/* jojonki.net — dark, single-column profile + portfolio */

:root {
  color-scheme: dark;

  --bg:        #0a0c0f;
  --bg-raise:  #101318;
  --surface:   #12161c;
  --line:      #1e242d;
  --line-soft: #171c23;

  --fg:        #e7ebf1;
  --fg-dim:    #9aa5b4;
  --fg-faint:  #6b7686;

  --accent:    #5eead4;
  --accent-dim:#2b6d63;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
          "Noto Sans JP", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, "Roboto Mono", monospace;

  --radius: 12px;
  --gap: 22px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 var(--sans);
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

code {
  font: 0.88em/1 var(--mono);
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.12em 0.4em;
}

.muted { color: var(--fg-dim); }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 12px; top: 12px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--accent);
  color: #04120f;
  border-radius: 8px;
}

.wrap {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

/* ─────────────────────────────── hero ─────────────────────────────── */

.hero {
  position: relative;
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(2.5rem, 6vw, 4rem);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}

/* A single soft light source, top-left. Cheap, and it keeps the page from
   reading as a flat black rectangle. */
.hero::before {
  content: "";
  position: absolute;
  inset: -40% 30% 40% -20%;
  background: radial-gradient(closest-side, rgba(94, 234, 212, 0.11), transparent);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.avatar {
  width: clamp(84px, 11vw, 128px);
  height: auto;
  border-radius: 50%;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 6px rgba(94, 234, 212, 0.05);
}

.kicker {
  margin: 0 0 0.9rem;
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.kicker .sep { color: var(--accent-dim); margin: 0 0.35em; }

.hero h1 {
  margin: 0 0 1.4rem;
  font-size: clamp(1.9rem, 4.6vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 650;
  max-width: 16ch;
}

.lede {
  margin: 0 0 0.85rem;
  max-width: 62ch;
  font-size: clamp(0.98rem, 1.4vw, 1.06rem);
  color: #c9d2de;
}
.lede strong { color: var(--fg); font-weight: 600; }
.lede.muted { color: var(--fg-dim); }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.6rem 0 0;
}
.links a {
  padding: 0.42rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-raise);
  color: var(--fg);
  font: 500 0.86rem/1.4 var(--mono);
  transition: border-color .15s, color .15s, background .15s;
}
.links a:hover {
  text-decoration: none;
  color: var(--accent);
  border-color: var(--accent-dim);
  background: rgba(94, 234, 212, 0.06);
}

/* ──────────────────────────── publications ───────────────────────── */

.pubs {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pubs li {
  padding: 1.3rem 1.4rem;
  margin-bottom: var(--gap);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.pubs li:last-child { margin-bottom: 0; }

.pub-title {
  margin: 0 0 0.7rem;
  font-size: 1rem;
  font-weight: 620;
  line-height: 1.45;
  letter-spacing: -0.01em;
  max-width: 70ch;
}
.pub-title a { color: var(--fg); }
.pub-title a:hover { color: var(--accent); text-decoration: none; }

.pub-desc {
  margin: 0.85rem 0 0;
  max-width: 78ch;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--fg-dim);
}
.pubs .card-links { margin-top: 1rem !important; padding-top: 0; }

/* ───────────────────────────── sections ───────────────────────────── */

.section { padding: clamp(3rem, 7vw, 5rem) 0 0; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem 1.4rem;
  margin-bottom: 1.9rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-soft);
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  letter-spacing: -0.01em;
  font-weight: 620;
}

.idx {
  margin-right: 0.7em;
  font: 500 0.78em/1 var(--mono);
  color: var(--accent-dim);
}

.section-note {
  margin: 0;
  font-size: 0.88rem;
  color: var(--fg-dim);
}

/* ────────────────────────────── cards ────────────────────────────── */

/* min() keeps the track from forcing a horizontal scrollbar on narrow phones,
   where the column minimum would otherwise exceed the container. */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr));
  gap: var(--gap);
}
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .18s, transform .18s;
}
.card:hover {
  border-color: #2c3644;
  transform: translateY(-2px);
}

/* Media well. Landscape shots fill it; phone shots sit inside it. */
.shot {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0c1014;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Phone shots: the device rises out of the bottom of the well and is clipped
   there, which keeps it legible instead of shrinking a 1:2 image to a sliver. */
.shot-phone {
  aspect-ratio: 4 / 3;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 18px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(94, 234, 212, 0.10), transparent 70%),
    #0c1014;
}
.shot-phone img {
  width: 48%;
  height: auto;
  flex: none;
  object-fit: contain;
  border-radius: 12px 12px 0 0;
  border: 1px solid var(--line);
  border-bottom: none;
  box-shadow: 0 -2px 30px rgba(0, 0, 0, 0.5);
}

/* For source images too wide for the well to crop without losing the subject. */
.shot-fit { background: #07090b; }
.shot-fit img { object-fit: contain; object-position: center; }

/* Fallback tile for projects with no screenshot worth showing. */
.shot-blank {
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 100% at 30% 0%, rgba(94, 234, 212, 0.10), transparent 65%),
    linear-gradient(160deg, #131920, #0c1014);
}
.shot-blank span {
  font: 600 clamp(1.5rem, 3.2vw, 2rem)/1.15 var(--mono);
  letter-spacing: -0.03em;
  text-align: center;
  color: #3c4a58;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.15rem 1.25rem 1.25rem;
}

.card-body h3 {
  margin: 0 0 0.6rem;
  font-size: 1.06rem;
  font-weight: 620;
  letter-spacing: -0.012em;
}

.card-body p {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--fg-dim);
}
.card-body p:last-child { margin-bottom: 0; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag {
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg-raise);
  font: 500 0.7rem/1.5 var(--mono);
  letter-spacing: 0.02em;
  color: var(--fg-faint);
  white-space: nowrap;
}
.tag-live {
  border-color: var(--accent-dim);
  background: rgba(94, 234, 212, 0.08);
  color: var(--accent);
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-top: auto !important;
  padding-top: 0.9rem;
  font: 500 0.83rem/1.4 var(--mono);
}
.card-links a::after {
  content: " →";
  color: var(--accent-dim);
}

/* ─────────────────────────── compact rows ─────────────────────────── */

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-soft);
}
.rows li {
  display: grid;
  grid-template-columns: minmax(180px, 15rem) 4.5rem minmax(0, 1fr);
  gap: 0.4rem 1.2rem;
  align-items: baseline;
  padding: 0.85rem 0.6rem;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 6px;
  transition: background .15s;
}
.rows li:hover { background: var(--bg-raise); }

.row-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.row-name:hover { color: var(--accent); text-decoration: none; }

.row-stars {
  font: 500 0.8rem/1.5 var(--mono);
  color: var(--accent-dim);
  white-space: nowrap;
}

.row-desc {
  font-size: 0.88rem;
  color: var(--fg-dim);
}

/* ────────────────────────────── footer ────────────────────────────── */

footer {
  margin-top: clamp(3.5rem, 8vw, 6rem);
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.85rem;
  color: var(--fg-dim);
}
footer p { margin: 0 0 0.4rem; }

/* ───────────────────────────── responsive ─────────────────────────── */

@media (max-width: 620px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }
  .hero h1 { max-width: none; }

  .rows li {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.25rem 1rem;
    padding: 0.9rem 0.4rem;
  }
  .row-stars { justify-self: end; }
  .row-desc { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .card:hover { transform: none; }
}
