/* =========================================================
   Yun-Chung (Eric) Liu — personal site
   Design tokens live here. Change these, the whole site follows.
   ========================================================= */

:root {
  /* Mint + gray */
  --mint:        #17ac78;
  --mint-bright: #2fd39a;
  --mint-soft:   #c9efdf;
  --mint-wash:   #e9f7f1;

  --ink:         #142019;
  --ink-2:       #2f423a;
  --muted:       #64766e;
  --faint:       #93a49c;

  --paper:       #f6f8f6;
  --card:        #ffffff;
  --line:        rgba(20, 32, 25, 0.12);
  --line-strong: rgba(20, 32, 25, 0.22);

  --shadow-sm: 0 1px 2px rgba(20, 32, 25, .05), 0 4px 14px rgba(20, 32, 25, .05);
  --shadow-md: 0 2px 6px rgba(20, 32, 25, .06), 0 18px 42px rgba(20, 32, 25, .09);

  --display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, monospace;

  --wrap: 1120px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --radius: 16px;
  --radius-lg: 24px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --mint:        #3fd8a0;
  --mint-bright: #6cf0bd;
  --mint-soft:   #1e4f3d;
  --mint-wash:   rgba(22, 48, 38, 0.55);

  --ink:         #eaf2ed;
  --ink-2:       #c3d3cb;
  --muted:       #8ea79b;
  --faint:       #6b8378;

  --paper:       #0e1613;
  --card:        #141f1a;
  --line:        rgba(234, 242, 237, 0.13);
  --line-strong: rgba(234, 242, 237, 0.26);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 18px 42px rgba(0, 0, 0, .45);

  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video, iframe { display: block; max-width: 100%; }
a { color: inherit; }

::selection { background: var(--mint-soft); color: var(--ink); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--paper); padding: .7rem 1.1rem; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2.5px solid var(--mint); outline-offset: 3px; border-radius: 4px; }

/* ---------- Type ---------- */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0;
}

.display {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.eyebrow {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mint);
  margin: 0 0 1rem;
  display: flex; align-items: center; gap: .7rem;
}
.eyebrow::after { content: ""; height: 1px; flex: 1; background: var(--line); }

.lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }

/* ---------- Nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}
.nav.is-stuck { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; gap: 1.5rem; height: 72px; }

.brand {
  font-family: var(--display); font-weight: 700; font-size: 1.02rem;
  text-decoration: none; letter-spacing: -.02em;
  display: flex; align-items: center; gap: .6rem; margin-right: auto;
}
.brand__dot { width: 11px; height: 11px; border-radius: 50%; background: var(--mint); flex: none; }

.nav__links { display: flex; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  text-decoration: none; font-size: .93rem; color: var(--ink-2);
  padding: .5rem .8rem; border-radius: 999px; display: block;
  transition: color .2s, background .2s;
}
.nav__links a:hover { color: var(--ink); background: var(--mint-wash); }
.nav__links a.is-active { color: var(--ink); font-weight: 500; }
.nav__links a.is-active::after {
  content: ""; display: block; height: 2px; width: 18px; margin: 3px auto -5px;
  background: var(--mint); border-radius: 2px;
}

.icon-btn {
  border: 1px solid var(--line); background: transparent; color: var(--ink-2);
  width: 38px; height: 38px; border-radius: 999px; cursor: pointer;
  display: grid; place-items: center; flex: none;
  transition: border-color .2s, color .2s, transform .2s;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 18px; height: 18px; }
:root[data-theme="dark"] .i-moon { display: none; }
:root:not([data-theme="dark"]) .i-sun { display: none; }

.nav__toggle { display: none; }

/* ---------- Hero ---------- */

.hero { padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(2.5rem, 5vw, 4rem); }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
.hero__copy { max-width: 46ch; }
.hero .lede { margin: 1.5rem 0 0; }
.hero .lede + .lede { margin-top: 1rem; }

.hero__meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; list-style: none; padding: 0; }
.chip {
  font-size: .82rem; color: var(--ink-2); background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; padding: .35rem .85rem;
  display: inline-flex; align-items: center; gap: .45rem;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); flex: none; }

/* Marked with a left rule rather than a filled panel — a filled box with a pulsing dot
   read as a status banner instead of something Eric is saying. */
.seeking {
  margin: 1.4rem 0 0; padding: .1rem 0 .1rem .9rem;
  border-left: 2px solid var(--mint);
  color: var(--ink-2); font-size: .95rem; line-height: 1.5; max-width: 48ch;
}
.seeking b { color: var(--ink); font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--body); font-size: .95rem; font-weight: 500; text-decoration: none;
  padding: .72rem 1.3rem; border-radius: 999px; border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .2s ease, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--ink); color: var(--paper); box-shadow: var(--shadow-sm); }
.btn--primary:hover { box-shadow: var(--shadow-md); }
.btn--ghost { border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { background: var(--card); border-color: var(--mint); }
.btn svg { width: 16px; height: 16px; }

/* ---------- Sections ---------- */

.section { padding: clamp(2.75rem, 5vw, 4.5rem) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section__head { max-width: 60ch; margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
.section__head h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); margin-bottom: .9rem; }

.status {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--mint); background: var(--mint-wash); border: 1px solid var(--mint-soft);
  border-radius: 999px; padding: .32rem .8rem;
  display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap;
}
.status .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 1.4rem 0 0; }
.tags li {
  font-family: var(--mono); font-size: .75rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: .22rem .55rem;
}

.prose { max-width: 68ch; }
.prose p { margin: 1.1rem 0 0; color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 600; }

/* ---------- Media ---------- */

.media-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem; margin-top: 2.25rem;
}

/* A media slot that points at a real file — shows the image once it loads, and falls back
   to a labeled dashed placeholder if the file isn't there yet (main.js adds .is-missing on
   the image's error event). Give it data-label/data-path and drop an <img> inside. */
.shot { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--card); aspect-ratio: 16 / 10; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot--wide { aspect-ratio: 16 / 7; grid-column: 1 / -1; }
.shot--tall { aspect-ratio: 4 / 5; max-width: 300px; }

.shot.is-missing {
  border: 1.5px dashed var(--line-strong);
  background-image: repeating-linear-gradient(45deg, transparent, transparent 12px, var(--mint-wash) 12px, var(--mint-wash) 24px);
  display: grid; place-content: center; align-content: center;
  text-align: center; gap: .45rem; padding: 1.5rem; color: var(--muted);
}
.shot.is-missing img { display: none; }
.shot.is-missing::before { content: attr(data-label); font-family: var(--display); font-size: 1rem; color: var(--ink-2); font-weight: 600; }
.shot.is-missing::after { content: attr(data-path); font-family: var(--mono); font-size: .76rem; color: var(--mint); }

/* ---------- Tilt card ----------
   A device screenshot that leans toward the pointer in 3D — for images that already read
   as a phone (a mockup drawn into the PNG itself, like FridayFlicks' Android screenshot),
   so no extra CSS-drawn bezel is layered on top. main.js drives --rx/--ry/--shadow-x on
   pointer move; this is just the geometry. Reuse it for any future "device" screenshot by
   giving it the same two-level markup (figure.tilt-card > .tilt-card__inner > img). */
.tilt-card {
  --rx: 0deg; --ry: 0deg; --shadow-x: 0px; --shadow-y: 14px; --shadow-blur: 30px;
  /* Matches the cropped phone image's own ratio (462x838) — object-fit: cover only
     avoids clipping the phone's sides/ends if this tracks the source file's shape. */
  margin: 0 auto; max-width: 240px; aspect-ratio: 462 / 838;
  perspective: 1200px; position: relative;
}
.tilt-card__inner {
  width: 100%; height: 100%; border-radius: 22px; overflow: hidden;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d; will-change: transform;
  box-shadow: var(--shadow-x) var(--shadow-y) var(--shadow-blur) -6px rgba(0, 0, 0, .38);
  transition: transform .6s cubic-bezier(.2, .8, .2, 1), box-shadow .6s ease;
}
.tilt-card.is-tilting .tilt-card__inner { transition: transform .08s linear, box-shadow .08s linear; }
.tilt-card__inner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tilt-card__hint {
  position: absolute; inset: auto 0 -1.6rem 0; text-align: center;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; color: var(--faint);
  opacity: 0; transition: opacity .3s ease;
}
.tilt-card:hover .tilt-card__hint { opacity: 1; }

/* data-label/data-path live on the outer figure, so the placeholder's ::before/::after
   (which read those via attr()) have to be attached here too, not on .tilt-card__inner. */
.tilt-card.is-missing {
  border-radius: 22px; border: 1.5px dashed var(--line-strong);
  background-image: repeating-linear-gradient(45deg, transparent, transparent 12px, var(--mint-wash) 12px, var(--mint-wash) 24px);
  display: grid; place-content: center; text-align: center; padding: 1rem; gap: .4rem; color: var(--muted);
}
.tilt-card.is-missing .tilt-card__inner { display: none; }
.tilt-card.is-missing::before { content: attr(data-label); font-family: var(--display); font-size: .95rem; color: var(--ink-2); font-weight: 600; }
.tilt-card.is-missing::after { content: attr(data-path); font-family: var(--mono); font-size: .72rem; color: var(--mint); }
.tilt-card.is-missing .tilt-card__hint { display: none; }

@media (prefers-reduced-motion: reduce) {
  .tilt-card__hint { display: none; }
}

/* A framed image, video, or embed. */
.media { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.media img, .media video { width: 100%; height: auto; }
.media--embed iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; }

/* A tall app screenshot: cap the width so it reads as the narrow single-column app it is,
   and let it scroll inside a fixed-height frame instead of running 900px down the page. */
.media--app { max-width: 480px; }
.media--app__scroll { max-height: 560px; overflow-y: auto; overscroll-behavior: contain; }
.media--app__scroll img { display: block; }

.media figcaption { font-size: .85rem; color: var(--muted); padding: .75rem 1rem; border-top: 1px solid var(--line); }

/* A self-built card for the itch.io game link — cover image + title + byline we control,
   rather than itch's auto-generated widget (see the comment above its markup). */
.game-card {
  display: flex; align-items: stretch; gap: 1rem; max-width: 420px;
  text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: border-color .2s, box-shadow .2s, transform .2s;
}
.game-card:hover { border-color: var(--mint-soft); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.game-card img { width: 110px; flex: none; object-fit: cover; }
.game-card__body { display: flex; flex-direction: column; gap: .3rem; padding: .9rem .9rem .9rem 0; min-width: 0; }
.game-card__title { font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.game-card__byline { font-size: .82rem; color: var(--muted); }
.game-card__cta {
  margin-top: auto; display: inline-flex; align-items: center; gap: .4rem;
  font-size: .85rem; font-weight: 500; color: var(--mint);
}
.game-card__cta svg { width: 14px; height: 14px; transition: transform .2s ease; }
.game-card:hover .game-card__cta svg { transform: translate(2px, -2px); }

/* "View the code on GitHub" under a project's write-up. Block-level with width:fit-content
   so it sits predictably in the flow; as an inline-flex it had no usable bottom margin and
   ended up flush against the screenshot that follows. */
.repo-link {
  display: flex; width: fit-content; align-items: center; gap: .5rem;
  margin: 1.25rem 0 0;
  padding: .5rem .9rem; border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: .88rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
  transition: border-color .2s, color .2s, background .2s;
}
/* Whatever follows the pill gets the same breathing room, regardless of its own margins. */
.repo-link + * { margin-top: 1.75rem; }
.repo-link:hover { border-color: var(--mint); color: var(--ink); background: var(--mint-wash); }
.repo-link svg { width: 15px; height: 15px; flex: none; }
.repo-link__arrow { width: 13px; height: 13px; transition: transform .2s ease; }
.repo-link:hover .repo-link__arrow { transform: translate(2px, -2px); }

/* A recreation of the Portfolio Observability page — invented names/numbers, no screenshot.
   The bar (portfolio name + actions), the tab strip, and each panel below it. */
.obs {
  margin: 1.5rem 0 0; max-width: 560px;
  background: var(--card); border: 1.5px dashed var(--mint-soft); border-radius: var(--radius);
  overflow: hidden;
}
.obs__tag {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem 1rem; background: var(--mint-wash);
  border-bottom: 1.5px dashed var(--mint-soft);
  font-family: var(--mono); font-size: .68rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--mint);
}
.obs__tag svg { width: 12px; height: 12px; flex: none; }
.obs__bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .75rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line);
}
.obs__portfolio { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.obs__label { font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.obs__name { font-family: var(--display); font-weight: 600; font-size: .98rem; color: var(--ink); }
.obs__actions { display: flex; gap: .5rem; flex: none; }

.obs__btn {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--body); font-size: .8rem; font-weight: 500; cursor: pointer;
  padding: .4rem .75rem; border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--ink-2); transition: border-color .2s, background .2s, color .2s;
}
.obs__btn:hover { border-color: var(--mint); color: var(--ink); }
.obs__btn svg { width: 13px; height: 13px; transition: transform .5s ease; }
.obs__btn.is-spinning svg { transform: rotate(360deg); }
.obs__btn--primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.obs__btn--primary:hover { color: var(--paper); opacity: .88; }

.obs__tabs { display: flex; gap: .25rem; padding: .5rem .6rem 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.obs__tabs::-webkit-scrollbar { display: none; }
.obs__tab {
  font-family: var(--body); font-size: .84rem; font-weight: 500; cursor: pointer; white-space: nowrap;
  padding: .55rem .8rem; border: 0; background: transparent; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .2s, border-color .2s;
}
.obs__tab:hover { color: var(--ink-2); }
.obs__tab.is-active { color: var(--ink); border-bottom-color: var(--mint); }

.obs__panel { padding: 1.1rem 1rem 1.25rem; }
.obs__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.obs__stat { background: var(--card); padding: .85rem 1rem; }
.obs__stat-n { display: block; font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; }
.obs__stat-l { display: block; font-size: .76rem; color: var(--muted); margin-top: .1rem; }

.obs__panel table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.obs__panel th, .obs__panel td { text-align: left; padding: .55rem .3rem; }
.obs__panel thead th {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint); border-bottom: 1px solid var(--line);
}
.obs__panel tbody tr + tr td { border-top: 1px solid var(--line); }
.obs__panel tbody td:first-child { color: var(--ink-2); }
.obs__panel tbody td:not(:first-child) { color: var(--muted); }
.obs__more-row td { color: var(--faint); font-style: italic; }

.obs__caption { font-size: .78rem; color: var(--muted); padding: .8rem 1rem; border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) {
  .obs__btn.is-spinning svg { transform: none; }
}

/* ---------- Work timeline ---------- */

.job {
  display: grid; grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 3rem);
  padding: clamp(1.25rem, 3vw, 1.9rem) 0; border-top: 1px solid var(--line);
}
.job:first-child { border-top: 0; padding-top: 0; }
.job__when { font-family: var(--mono); font-size: .82rem; color: var(--muted); line-height: 1.7; }
.job__when b {
  display: block; color: var(--ink); font-family: var(--body);
  font-size: .95rem; font-weight: 600; letter-spacing: 0; margin-bottom: .2rem;
}
/* The in-progress pill sits under the dates in the left column. */
.job__when .status { margin-top: .7rem; }

.job h3 { font-size: 1.35rem; margin-bottom: .3rem; color: var(--ink); transition: color .2s; }
.job__role { color: var(--mint); font-weight: 500; font-size: .97rem; display: block; }
.job__body { min-width: 0; }
.job__body p { margin: .9rem 0 0; color: var(--ink-2); max-width: 66ch; }

/* Collapsed by default: the summary row is company, role, and nothing else. */
.job__summary {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem 1.5rem; flex-wrap: wrap; cursor: pointer;
  padding: .2rem 0; list-style: none;
}
.job__summary::-webkit-details-marker { display: none; }
.job__summary:hover h3 { color: var(--mint); }
.job__summary:focus-visible { outline: 2.5px solid var(--mint); outline-offset: 4px; border-radius: 6px; }
.job__titles { min-width: 0; }

.job__more {
  display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); transition: color .2s;
}
.job__more::before { content: "Read more"; }
details[open] .job__more::before { content: "Hide"; }
.job__summary:hover .job__more { color: var(--mint); }
.job__more svg { width: 15px; height: 15px; transition: transform .25s ease; }
details[open] .job__more svg { transform: rotate(180deg); }

.job__detail { animation: detail-in .32s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes detail-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.job__wins { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .7rem; max-width: 66ch; }
.job__wins li { position: relative; padding-left: 1.4rem; color: var(--ink-2); font-size: .96rem; }
.job__wins li::before {
  content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px;
  border-radius: 2px; background: var(--mint-soft); border: 1.5px solid var(--mint);
}

/* ---------- Two lists, two treatments ---------- */

/* Experience sits on its own ground so the eye registers a different zone. */
.section--tint { background: var(--card); }
.section--tint + .section { border-top: 0; }

/* Experience: a dated timeline with a rail. */
.timeline--work { position: relative; }
.timeline--work::before {
  content: ""; position: absolute; left: 5px; top: .9rem; bottom: .9rem;
  width: 1.5px; background: var(--line);
}
.timeline--work .job { position: relative; padding-left: 2.1rem; }
.timeline--work .job::after {
  content: ""; position: absolute; left: 0;
  top: calc(clamp(1.75rem, 4vw, 2.75rem) + .5rem);
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--card); border: 2.5px solid var(--mint);
}
.timeline--work .job:first-child::after { top: .5rem; }

/* ---------- Contact ---------- */

.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.links { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.links li { border-bottom: 1px solid var(--line); }
.links a {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem .25rem; text-decoration: none; color: var(--ink);
  transition: padding .25s ease, color .2s;
}
.links a:hover { padding-left: .75rem; color: var(--mint); }
.links .what { font-family: var(--mono); font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.links .arrow { transition: transform .25s ease; width: 15px; height: 15px; }
.links a:hover .arrow { transform: translate(4px, -4px); }

.footer {
  padding-block: 2rem 2.25rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .87rem;
  display: flex; flex-wrap: wrap; gap: .75rem 2rem; justify-content: space-between;
}

/* Chrome keeps the old resolved value of a transitioned color when a theme variable
   changes at runtime, which left headings dark after toggling to dark mode. Transitions
   are suppressed for one frame around the switch so every color re-resolves cleanly. */
.theme-switching,
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after {
  transition: none !important;
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .7s cubic-bezier(.2, .7, .3, 1), transform .7s cubic-bezier(.2, .7, .3, 1);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Desk scene ---------- */

.scene { width: 100%; height: auto; overflow: visible; }
.scene .stroke { fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.scene .thin { stroke-width: 2.2; }
.scene .fill-card { fill: var(--card); }
.scene .fill-mint { fill: var(--mint-soft); }
.scene .fill-mint-strong { fill: var(--mint); }
.scene .fill-ink { fill: var(--ink); }
.scene .fill-paper { fill: var(--paper); }
.scene .fill-muted { fill: var(--faint); }
.scene .blob { fill: var(--mint-wash); }

.steam { animation: steam 3.9s ease-in-out infinite; }
.steam--2 { animation-delay: 1.3s; }
.steam--3 { animation-delay: 2.6s; }
@keyframes steam {
  0%   { opacity: 0; transform: translateY(4px); }
  30%  { opacity: .8; }
  100% { opacity: 0; transform: translateY(-20px); }
}

.cursor { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

.leaf { transform-box: fill-box; transform-origin: bottom center; animation: sway 6s ease-in-out infinite; }
.leaf--b { animation-delay: -2.2s; }
.leaf--c { animation-delay: -4.1s; }
@keyframes sway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(3deg); } }

.bar { transform-box: fill-box; transform-origin: bottom; animation: grow 1.1s cubic-bezier(.2, .8, .3, 1) both; }
.bar--2 { animation-delay: .12s; }
.bar--3 { animation-delay: .24s; }
.bar--4 { animation-delay: .36s; }
@keyframes grow { from { transform: scaleY(.04); } to { transform: scaleY(1); } }

.float { animation: float 7s ease-in-out infinite; }
.float--b { animation-delay: -3.4s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

.glow { animation: glow 5s ease-in-out infinite; }
@keyframes glow { 0%, 100% { opacity: .45; } 50% { opacity: .72; } }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hero__copy { max-width: none; }
  .hero__art { max-width: 560px; margin-inline: auto; }
  .job { grid-template-columns: minmax(0, 1fr); gap: .35rem; }
  .contact { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .nav__toggle { display: grid; }
  .nav__links {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: .5rem var(--gutter) 1.25rem;
    background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md); display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: .8rem .25rem; font-size: 1.02rem; border-radius: 8px; }
  .nav__links a.is-active::after { margin: 3px 0 -5px; }
  body { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Small additions ---------- */

.timeline { display: grid; grid-template-columns: minmax(0, 1fr); }

.scene .steam { stroke: var(--mint); fill: none; }

/* ---------- Portrait ---------- */

.contact__intro { display: flex; flex-wrap: wrap; gap: clamp(1.25rem, 3vw, 2rem); align-items: flex-start; }
.contact__intro > div { flex: 1 1 260px; min-width: 0; }

.portrait {
  margin: 0; flex: none; width: clamp(150px, 20vw, 190px); aspect-ratio: 4 / 5;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--card); box-shadow: var(--shadow-sm);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }

/* Shown until media/profile.jpg exists (main.js adds the class on a load error). */
.portrait.is-missing {
  border: 1.5px dashed var(--line-strong); box-shadow: none;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 12px, var(--mint-wash) 12px, var(--mint-wash) 24px);
  display: grid; place-content: center; text-align: center; padding: 1rem; gap: .4rem;
}
.portrait.is-missing img { display: none; }
.portrait.is-missing::before {
  content: "Photo"; font-family: var(--display); font-weight: 600; font-size: .95rem; color: var(--ink-2);
}
.portrait.is-missing::after {
  content: "media/profile.jpg"; font-family: var(--mono); font-size: .72rem; color: var(--mint);
  word-break: break-all;
}
