/* ============================================
   Owen Chen — portfolio
   Single page · serif display + mono body
   Airy · lowercase · quiet personality
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --bg: #ffffff;
  --ink: #1a1a1a;
  --ink-2: #6b6b6b;
  --ink-3: #b3b3b3;
  --rule: #e6e6e3;

  --green: #1b6e2e;
  --blue: #5a7af0;
  --red: #d8451d;
  --bg-soft: #fafaf8;

  --serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --pad: clamp(1.5rem, 5vw, 4rem);
  --maxw: 1280px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg-soft);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
em { font-style: italic; }
::selection { background: var(--ink); color: var(--bg); }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 1.1rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  font-family: var(--serif);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--rule);
}
.nav__home {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color .3s var(--ease);
}
.nav__home:hover { color: var(--ink); }
.nav__home.is-active { color: var(--ink); }
.nav__clock {
  font-size: 0.9rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.nav__clock-city { color: var(--ink-3); }
@media (max-width: 760px) {
  .nav__clock { display: none; }
}
@media (max-width: 640px) {
  .nav { gap: 0.9rem; padding: 0.9rem var(--pad); }
  .nav__home { font-size: 1.15rem; }
  .nav__links { gap: 1.1rem; font-size: 0.92rem; }
}
.nav__links {
  display: flex;
  gap: 2.4rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink);
}
.nav__links a {
  transition: color .3s var(--ease);
}
.nav__links a:hover { color: var(--green); }
.nav__links a.is-active { color: var(--green); }

/* ---------- Shared container ---------- */
.intro, .contact, .contact-page, .resume {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* ---------- Single-page sections ---------- */
#top { scroll-margin-top: 0; }
.page-section, .work { scroll-margin-top: 4.5rem; }

/* ---------- Hero (intro + portrait) ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(5rem, 9vh, 7rem) var(--pad);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  min-height: 100svh;   /* fill the first screen → logo centered on load */
}
.hero__intro {
  font-family: var(--mono);
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  line-height: 1.8;
  color: var(--ink);
  max-width: 40ch;
}
.hero__hello {
  font-family: var(--mono);
  font-size: clamp(1.25rem, 2.1vw, 1.8rem);
  font-weight: 700;
  line-height: 1;
  color: #3d5afe;
  margin-bottom: 1.25rem;
}
.hero__intro .hi { display: block; margin-bottom: 0.25rem; }
.hero__intro em { color: var(--ink); font-style: normal; border-bottom: 2px solid var(--green); }
.hero__intro--sub { margin-top: 1.75rem; color: var(--ink-2); }
.hero__intro--sub a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.hero__intro--sub a:hover { opacity: 0.7; }
.hero__media {
  position: relative;
  justify-self: center;
  width: min(100%, 400px);
  aspect-ratio: 1 / 1;
}
/* line-art logo — transparent frames, swapped on mouse move */
.hero__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
}
.hero__frame.is-shown { opacity: 1; }
@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 2.5rem;
    padding-top: 6.5rem;
  }
  .hero__media { order: -1; width: min(100%, 260px); justify-self: start; }
}

/* ---------- Section band (editorial section header: title left, note right) ---------- */
.page-band {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 5.5rem 0 3rem;
  padding: 1.05rem var(--pad);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.page-band__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0;
  color: var(--ink);
}
.page-band__desc {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  text-align: right;
}
@media (max-width: 640px) {
  .page-band { flex-direction: column; align-items: flex-start; gap: 0.25rem; margin: 4.5rem 0 2rem; }
  .page-band__desc { text-align: left; }
}

/* ---------- Intro (home) ---------- */
.intro {
  padding-top: 2.5rem;
  padding-bottom: 6rem;
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 5rem;
  align-items: start;
}

.intro__image {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 8rem;
  margin-top: 4.5rem;
}
.intro__frame {
  width: 100%;
  max-width: 210px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #dbe4ce 0%, #c4d1b3 60%, #aebd9b 100%);
  box-shadow:
    0 1px 0 rgba(0,0,0,0.04),
    0 18px 40px -16px rgba(0,0,0,0.18);
}
.intro__image img {
  width: 100%;
  max-width: 210px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  box-shadow:
    0 1px 0 rgba(0,0,0,0.04),
    0 18px 40px -16px rgba(0,0,0,0.18);
}
.intro__caption {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.intro__caption-name {
  font-family: var(--sans);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--green);
}
.intro__caption-year {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-3);
}


.intro__text {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  max-width: 60ch;
  padding-top: 0.5rem;
}
.intro__text p { color: var(--ink); }
/* key terms, same treatment as the hero */
.intro__text em {
  font-style: normal;
  color: var(--ink);
  border-bottom: 2px solid var(--green);
}
.intro__lede {
  font-size: 1.25rem;
  color: var(--ink) !important;
  margin-bottom: 0.5rem;
}
.name {
  color: var(--green);
  font-weight: 500;
}

.intro__meta {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.95rem;
}
.intro__meta > div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
}
.intro__meta dt { color: var(--ink-3); }
.intro__meta dd { color: var(--ink); }
.intro__meta dd a {
  color: var(--blue);
  transition: opacity .25s var(--ease);
}
.intro__meta dd a:hover { opacity: 0.7; }

/* ---------- Dosage-Pal: opening hook ---------- */
.dp-hook__lead {
  margin: 0.4rem 0 1.25rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 24ch;
}
.dp-hook .cs__prose p:last-child {
  font-size: 1.15rem;
  color: var(--ink);
}

/* ---------- Dosage-Pal: interactive research bars ---------- */
.dp-bars {
  margin-top: 1.5rem;
  padding: 1.6rem 1.75rem 1.4rem;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 14px;
}
.dp-bars__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.dp-bars__lede {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 46ch;
}
.dp-bars__lede strong {
  font-family: var(--mono);
  font-size: 1.15rem;
  color: var(--red);
  font-weight: 500;
}
.dp-bars__toggle { display: flex; gap: 0.4rem; }
.dp-bars__toggle button {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.4rem 0.75rem;
  color: var(--ink-2);
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.dp-bars__toggle button.is-on {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.dp-bars__list { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.dp-bar + .dp-bar { margin-top: 0.5rem; }
.dp-bar__row {
  width: 100%;
  display: grid;
  grid-template-columns: 13.5rem 1fr 3.5rem;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
}
@media (max-width: 640px) {
  .dp-bar__row { grid-template-columns: 1fr 3rem; }
  .dp-bar__track { grid-column: 1 / -1; grid-row: 2; }
}
.dp-bar__label {
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.3;
}
.dp-bar__label em {
  display: block;
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 0.15rem;
}
.dp-bar__track {
  height: 12px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
}
.dp-bar__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--red);
  transition: width .9s var(--ease);
}
.dp-bar:nth-child(2) .dp-bar__fill { opacity: 0.72; }
.dp-bar:nth-child(3) .dp-bar__fill { opacity: 0.5; }
.dp-bar__val {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--ink);
  text-align: right;
}
.dp-bar__row:hover .dp-bar__fill { filter: brightness(0.92); }

.dp-bar__detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s var(--ease);
}
.dp-bar.is-open .dp-bar__detail { max-height: 16rem; }
.dp-bar__detail p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 62ch;
}
.dp-bar__detail p:first-child { padding-top: 0.15rem; }
.dp-bar__detail p:last-child { padding-bottom: 0.75rem; }
.dp-bar__design span {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--red);
  margin-right: 0.5rem;
}
.dp-bars__note {
  margin-top: 1.25rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--ink-3);
}

/* ---------- Dosage-Pal: dispensing walkthrough ---------- */
.dp-demo {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  align-items: center;
  padding: 1.75rem;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 14px;
}
@media (max-width: 680px) { .dp-demo { grid-template-columns: 1fr; gap: 1.25rem; } }
.dp-demo__svg { width: 100%; height: auto; max-height: 300px; }
.dp-part {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 2;
  stroke-linecap: round;
}
.dp-rod {
  fill: var(--ink-3);
  transition: transform .5s var(--ease);
}
.dp-rod.is-down { transform: translateY(42px); }
.dp-btn, .dp-sig { fill: none; stroke: var(--ink-3); stroke-width: 2; }
.dp-btn.is-on { fill: var(--red); stroke: var(--red); }
.dp-sig { opacity: 0; transform-origin: 190px 82px; }
.dp-sig.is-on { opacity: 1; animation: dp-ping 1s var(--ease) infinite; }
@keyframes dp-ping {
  from { transform: scale(1); opacity: .7; }
  to   { transform: scale(2.1); opacity: 0; }
}
.dp-hand { fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; }
.dp-pill { fill: var(--red); }
#dp-pill { transition: transform .55s var(--ease); }

.dp-demo__count {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--red);
}
.dp-demo__text {
  margin-top: 0.4rem;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink);
  min-height: 3rem;
}
.dp-demo__ctrls { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.dp-demo__ctrls button {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.45rem 0.85rem;
  color: var(--ink);
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.dp-demo__ctrls button:hover { background: var(--ink); color: var(--bg); }
.dp-demo__dots { list-style: none; display: flex; gap: 0.4rem; margin-top: 1rem; padding: 0; }
.dp-demo__dots button {
  width: 22px; height: 5px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--rule);
  cursor: pointer;
  transition: background .2s var(--ease);
}
.dp-demo__dots button.is-on { background: var(--red); }

/* ---------- Dosage-Pal: worst-morning simulator ---------- */
.dp-sim {
  padding: 1.75rem;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 14px;
}
.dp-sim__ctrls { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.dp-sim__ctrls button {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.45rem 0.9rem;
  color: var(--ink-2);
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.dp-sim__ctrls button.is-on {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.dp-sim__pair {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}
@media (max-width: 680px) { .dp-sim__pair { grid-template-columns: 1fr; } }
/* the condition hits the cards, never the labels that identify them */
.dp-sim__pair.is-lowvision .dp-card { filter: blur(2.6px); }
.dp-sim__pair.is-glare .dp-card { filter: contrast(0.38) brightness(1.32); }
.dp-sim__pair.is-tremor .dp-card { animation: dp-shake .22s linear infinite; }
@keyframes dp-shake {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(2.5px, -2px); }
  50%  { transform: translate(-2px, 2.5px); }
  75%  { transform: translate(2px, 2px); }
  100% { transform: translate(0, 0); }
}
.dp-sim__col { margin: 0; }
.dp-sim__col figcaption {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 0.5rem;
}
.dp-card {
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.1rem 1.15rem;
  background: #fff;
  transition: filter .35s var(--ease);
}
.dp-card--typical .dp-card__t { font-size: 0.82rem; color: #8a8a8a; }
.dp-card--typical .dp-card__s { font-size: 0.72rem; color: #a5a5a5; margin-top: 0.2rem; }
.dp-card--typical .dp-card__a {
  display: inline-block;
  margin-top: 0.7rem;
  font-size: 0.72rem;
  color: #9aa6c8;
  text-decoration: underline;
}
.dp-card--ours { border: 2px solid var(--ink); }
.dp-card--ours .dp-card__t { font-size: 1.35rem; font-weight: 600; color: #000; line-height: 1.1; }
.dp-card--ours .dp-card__dose { font-size: 1.75rem; font-weight: 700; color: #000; line-height: 1.1; }
.dp-card--ours .dp-card__s { font-size: 0.95rem; color: #1a1a1a; margin-top: 0.35rem; }
.dp-card--ours .dp-card__btn {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: #fff;
  background: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.dp-sim__note {
  margin-top: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink);
  min-height: 3rem;
  max-width: 64ch;
}
.dp-sim__disc {
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--ink-3);
  max-width: 64ch;
}
@media (prefers-reduced-motion: reduce) {
  .dp-sim__pair.is-tremor .dp-card { animation: none; }
  .dp-sig.is-on { animation: none; }
}

/* ---------- Approach: point of view + vignettes ---------- */
.pov {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.5rem var(--pad) 0;
}
.pov__statement {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.8vw, 2.3rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 24ch;
}
.pov__statement em {
  font-style: normal;
  border-bottom: 2px solid var(--green);
}
.pov__note {
  margin-top: 1.5rem;
  max-width: 60ch;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-2);
}

.vigs {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem var(--pad) 2rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}
@media (max-width: 860px) { .vigs { grid-template-columns: 1fr; } }

.vig {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: 1.6rem 1.5rem 1.4rem;
}
.vig__eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
}
.vig__title {
  margin-top: 0.7rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.25rem, 1.9vw, 1.6rem);
  line-height: 1.2;
  color: var(--ink);
}
.vig__meta {
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-2);
}
.vig__block { margin-top: 1.25rem; }
.vig__label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
  margin-bottom: 0.35rem;
}
.vig__block p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink);
}
.vig__quote {
  margin-top: 1.5rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--green);
}
.vig__link {
  margin-top: auto;
  padding-top: 1.4rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink);
  transition: color .25s var(--ease);
}
.vig__link:hover { color: var(--green); }

/* ---------- Skills: left label + bordered tag cluster ---------- */
.skills {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem var(--pad) 2rem;
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 5vw, 4.5rem);
}
.skills__group {
  display: grid;
  grid-template-columns: minmax(8rem, 13rem) 1fr;
  gap: 1.5rem clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.skills__label {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
  color: var(--ink);
}
.skills__tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem 0.85rem;
}
.skills__tags li {
  padding: 0.5rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  box-shadow: 2px 2px 0 rgba(26, 26, 26, 0.12);
}
@media (max-width: 680px) {
  .skills__group { grid-template-columns: 1fr; gap: 0.9rem; }
  .skills__tags { justify-content: flex-start; }
}

/* ---------- Work grid (shared: home + projects, rendered by work-grid.js) ---------- */
.work {
  --gap: 10px;
  max-width: 1920px;
  margin: 0 auto;
  padding-bottom: 6rem;
}
body[data-page="home"] .work { margin-top: clamp(3rem, 8vw, 7rem); }
body[data-page="work"] .work { padding-top: 9.5rem; }
.work__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.05rem var(--pad);
  margin-bottom: 2rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
/* left label (also the "show all" reset) */
.work__head-title {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0;
  color: var(--ink);
  cursor: pointer;
}
/* right-side clickable category labels */
.work__cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: baseline;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.work__cat {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--ink-3);
  cursor: pointer;
  transition: color .2s var(--ease);
}
.work__cat:hover { color: var(--ink); }
.work__cat.is-active { color: var(--green); font-weight: 500; }
.work__cat-sep { color: var(--ink-3); opacity: 0.5; }
@media (max-width: 520px) {
  .work__cats { font-size: 0.78rem; gap: 0.4rem; }
}

/* work cards — stacked "paper" grid: an offset colored block behind a
   bordered card with date / title / image / category rows */
.grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3rem 2rem;
  padding: 0.5rem var(--pad) 2rem;
}
@media (max-width: 1240px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .grid { grid-template-columns: repeat(2, 1fr); gap: 2.5rem 1.5rem; } }
@media (max-width: 520px)  { .grid { grid-template-columns: 1fr; } }

.card { margin: 0; }
.card[hidden] { display: none; }

.card__link {
  position: relative;
  display: block;
  isolation: isolate;
}
.card__shadow {
  position: absolute;
  inset: 0;
  transform: translate(-9px, -9px);
  background: var(--card-accent, #a7b53f);
  border-radius: 2px;
  z-index: 0;
  transition: transform .4s var(--ease);
}
.card__link:hover .card__shadow { transform: translate(-13px, -13px); }

.card__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg, #fff);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  overflow: hidden;
}
.card__date {
  padding: 0.6rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  border-bottom: 1.5px solid var(--ink);
}
.card__panel {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--card-bg, #e9e7e0);
  overflow: hidden;
  border-bottom: 1.5px solid var(--ink);
}
.card__panel img,
.card__panel video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.card__link:not(.is-locked):hover .card__panel img,
.card__link:not(.is-locked):hover .card__panel video { transform: scale(1.04); }

/* locked cards: not clickable, show a lock badge + "coming soon" on hover */
.card__link.is-locked { cursor: not-allowed; }
.card__lock {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.5rem;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
}
.card__lock svg { display: block; }
.card__soon {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 26, 26, 0.55);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.card__link.is-locked:hover .card__soon { opacity: 1; }
/* no "open" arrow on locked cards */
.card__link.is-locked .card__title::after { content: none; }
.card__title {
  padding: 0.55rem 0.85rem 0.65rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(1.25rem, 1.5vw, 1.6rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--ink);
  border-bottom: 1.5px solid var(--ink);
}
.card__foot {
  padding: 0.7rem 0.85rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--ink);
}
.card__kicker,
.card__meta,
.card__id,
.card__tag { display: none; }

/* ---------- Home: intro line, then the work grid ---------- */
.home-intro {
  max-width: 1920px;
  margin: 0 auto;
  padding: 7.5rem var(--pad) 2.25rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}
.landing__hello {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.landing__greeting {
  display: inline-block;
  color: #3d5afe;
  white-space: pre;
}
.landing__gchar {
  display: inline-block;
  white-space: pre;
  opacity: 0;
  transform: translateX(-0.35em);
  transition: opacity .42s var(--ease), transform .42s var(--ease);
}
.landing__gchar.is-in {
  opacity: 1;
  transform: none;
}
.landing__gchar.is-out {
  opacity: 0;
  transform: translateX(0.35em);
}
.landing__hello-rest { display: block; color: var(--ink); }

.landing__contact {
  flex-shrink: 0;
  margin-bottom: 0.45rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--blue);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: opacity .25s var(--ease);
}
.landing__contact:hover { opacity: 0.65; }

@media (max-width: 640px) {
  .home-intro {
    padding-top: 6rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* ---------- Resume ---------- */
.resume {
  padding-top: 2.5rem;
  padding-bottom: 8rem;
  max-width: 960px;
  margin: 0 auto;
}
.resume__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 3rem;
}
.resume__head-main {
  display: flex;
  flex-direction: column;
}
.resume__kicker {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-3);
  margin-bottom: 0.5rem;
}
.resume__name {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.resume__role {
  margin-top: 0.4rem;
  font-size: 0.95rem;
  color: var(--ink-2);
}
.resume__contact {
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-2);
}
.resume__contact a {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.resume__contact a:hover {
  color: var(--blue);
  border-bottom-color: var(--blue);
}
.resume__download {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--blue);
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
  transition: opacity .25s var(--ease);
  white-space: nowrap;
}
.resume__download:hover { opacity: 0.7; }

.resume__section {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 2rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.resume__label {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  padding-top: 0.2rem;
}
.resume__body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.resume__body--inline {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.7;
}
.resume__body--inline a {
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.resume__body--inline a:hover {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.resume__entry {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.resume__entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.resume__entry-head h3 {
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.resume__when {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-3);
  white-space: nowrap;
}
.resume__where {
  font-size: 0.92rem;
  color: var(--ink-2);
}
.resume__detail {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-2);
  margin-top: 0.4rem;
  max-width: 60ch;
}
.resume__bullets {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 68ch;
}
.resume__bullets li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.resume__bullets li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-3);
}

.resume__skillrow {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1rem;
  align-items: baseline;
  font-size: 0.94rem;
  line-height: 1.55;
  padding: 0.3rem 0;
  border-bottom: 1px dashed var(--rule);
}
.resume__skillrow:last-child { border-bottom: 0; }
.resume__skillrow:first-child { padding-top: 0; }
.resume__sublabel {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.resume__where em {
  font-style: italic;
  color: var(--green);
}

.resume__cert {
  margin-top: 1.25rem;
  max-width: 580px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--rule);
}
.resume__cert img {
  width: 100%;
  display: block;
}

/* ---------- Project sub-page ---------- */
.project {
  max-width: 880px;
  margin: 0 auto;
  padding: 8rem var(--pad) 6rem;
}
.cs { scroll-margin-top: 2rem; }

/* section index (table of contents) — generated on case-study pages */
.toc {
  position: fixed;
  top: 50%;
  left: 1.75rem;
  transform: translateY(-50%);
  z-index: 40;
  max-width: 170px;
  pointer-events: auto;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.toc a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: var(--ink-3);
  transition: color .25s var(--ease);
}
.toc a::before {
  content: "";
  flex-shrink: 0;
  width: 12px;
  height: 1.5px;
  background: currentColor;
  transition: width .25s var(--ease);
}
.toc a:hover { color: var(--ink-2); }
.toc a.is-active { color: var(--red); }
.toc a.is-active::before { width: 26px; }
/* not enough side margin to float it — hide on narrower screens */
@media (max-width: 1240px) { .toc { display: none; } }
.project__back {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-3);
  margin-bottom: 2.5rem;
  transition: color .25s var(--ease);
}
.project__back:hover { color: var(--ink); }

.project__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 3rem;
}
.project__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.project__meta {
  display: flex;
  gap: 2rem;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.project__meta > div { display: flex; flex-direction: column; gap: 0.2rem; }
.project__meta dt { color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.project__meta dd { color: var(--ink); }

.project__hero {
  margin-bottom: 2rem;
  border-radius: 14px;
  overflow: hidden;
  background: #f4f4f2;
}

.project__video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 1.5rem;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}

.project__playlink {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.project__playlink:hover { transform: translateY(-2px); opacity: 0.9; }
.project__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.project__pdf {
  width: 100%;
  height: min(85vh, 880px);
  margin-top: 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
  background: #f4f4f2;
}
.project__pdf object,
.project__pdf iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
/* fallback shown when the browser can't render the PDF inline (e.g. mobile) */
.project__pdf-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 100%;
  padding: 2rem;
  text-align: center;
}
.project__pdf-fallback a {
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.project__pdf-fallback a:hover { transform: translateY(-2px); opacity: 0.9; }

/* process photo strip (3-up, captioned) */
.gi-process {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}
.gi-process figure { margin: 0; }
.gi-process img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.gi-process figcaption {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink-2);
}
.gi-process figcaption span {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--red);
  margin-bottom: 0.3rem;
}
@media (max-width: 720px) {
  .gi-process { grid-template-columns: 1fr; gap: 1.5rem; }
  .gi-process img { aspect-ratio: 16 / 10; }
}

/* interactive proximity demo */
.gi-demo {
  position: relative;
  margin-top: 1.5rem;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(120% 120% at 50% 20%, #20202b 0%, #0d0d12 75%);
  aspect-ratio: 16 / 7;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: crosshair;
  user-select: none;
  touch-action: none;
}
.gi-demo__art { height: 86%; width: auto; }
.gi-demo__art [data-spin] { transform-box: fill-box; }
.gi-demo__readout {
  position: absolute;
  left: 1rem;
  bottom: 0.9rem;
  display: flex;
  gap: 1.4rem;
}
.gi-demo__readout > div { display: flex; flex-direction: column; gap: 0.15rem; }
.gi-demo__readout span {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.gi-demo__readout b {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.gi-demo__hint {
  position: absolute;
  right: 1rem;
  top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: rgba(255,255,255,0.45);
}
@media (max-width: 640px) {
  .gi-demo { aspect-ratio: 4 / 3; }
  .gi-demo__hint { display: none; }
}

.project__hero img,
.project__hero video {
  width: 100%;
  height: auto;
  display: block;
}

.project__brand {
  margin-bottom: 3rem;
  padding: 0.5rem 0;
}
.project__brand img {
  height: 64px;
  width: auto;
  display: block;
}

.project__body {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  max-width: 60ch;
}
.project__lede {
  font-size: 1.35rem;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 2.5rem;
}
.project__body h2 {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 400;
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
}
.project__body p { color: var(--ink-2); margin-bottom: 1rem; }

/* ---------- Contact page ---------- */
body[data-page="contact"] {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body[data-page="contact"] main {
  flex: 1;
  display: flex;
  align-items: center;
  padding-top: 5rem; /* clear fixed nav */
  padding-bottom: 2rem;
}
.contact-page {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: flex-start;
}
.contact-page__intro {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  max-width: 50ch;
}
.contact-page__divider {
  width: 100%;
  margin: 0.5rem 0;
}
.contact-page__list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  font-size: 0.95rem;
}
.contact-page__list > div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--rule);
}
.contact-page__list > div:last-child { border-bottom: 1px solid var(--rule); }
.contact-page__list dt {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding-top: 0.15rem;
}
.contact-page__list dd { color: var(--ink); }
.contact-page__list dd a {
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.contact-page__list dd a:hover {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* ---------- Contact (inline, legacy) ---------- */
.contact {
  padding-top: 4rem;
  padding-bottom: 6rem;
  border-top: 1px solid var(--rule);
}
.contact__big {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: clamp(1.5rem, 3.4vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  transition: color .3s var(--ease);
}
.contact__big:hover { color: var(--blue); }
.contact__big svg { transition: transform .3s var(--ease); }
.contact__big:hover svg { transform: translate(3px, -3px); }

.contact__links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.75rem;
  font-size: 0.95rem;
  color: var(--ink-2);
}
.contact__links a {
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.contact__links a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- Footer ---------- */
.foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.75rem var(--pad) 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-3);
}
.foot__label { color: var(--ink-3); }
.foot__contact {
  color: var(--ink-3);
  transition: color .25s var(--ease);
}
.foot__contact:hover { color: var(--ink); }
.foot__contact.is-active { color: var(--blue); }
.foot__top {
  color: var(--ink-3);
  margin-left: auto;
  transition: color .25s var(--ease);
}
.foot__top:hover { color: var(--ink); }

/* ---------- Custom cursor: inverting dot ---------- */
@media (hover: hover) {
  * { cursor: none !important; }

  .cursor-blob {
    position: fixed;
    top: 0; left: 0;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #fff;
    mix-blend-mode: difference;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity .3s var(--ease),
                width .35s var(--ease), height .35s var(--ease);
    will-change: left, top;
  }
  body.cursor-ready .cursor-blob { opacity: 1; }
  body.cursor-active .cursor-blob { width: 28px; height: 28px; }
}
@media (hover: none) { .cursor-blob { display: none; } }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(6px);
  transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; filter: none; }

/* ---------- Interactive polish ---------- */

/* page enter / exit fade */
body { animation: page-in .5s var(--ease); }
@keyframes page-in { from { opacity: 0; } }
body.is-exiting { opacity: 0; transition: opacity .35s var(--ease); }

/* nav: solid at the top, translucent frosted glass once scrolled */
.nav {
  transition: background .5s var(--ease), box-shadow .5s var(--ease),
              border-color .5s var(--ease), backdrop-filter .5s var(--ease);
}
.nav.is-scrolled {
  background: rgba(250, 250, 248, 0.68);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom-color: transparent;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 10px 34px -16px rgba(0, 0, 0, 0.16);
}

/* the staggered hero entrance is driven by the JS reveal system
   (.hero__media, .hero__hello, .hero__intro) so content is never
   stuck hidden if animations can't run */

/* cards: smooth lift + depth on hover */
.card__inner { transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.card__link:hover .card__inner {
  transform: translateY(-4px);
  box-shadow: 0 22px 48px -22px rgba(26, 26, 26, 0.35);
}

/* skill chips: gentle lift on hover */
.skills__tags li { transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.skills__tags li:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 rgba(26, 26, 26, 0.16);
}

/* reading progress bar (accent-aware, set via JS on project pages) */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 300;
  pointer-events: none;
}

/* nav underline sweep */
.nav__home, .nav__links a { position: relative; }
.nav__home::after, .nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -5px;
  width: 100%; height: 2px;
  background: var(--green);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform .35s var(--ease);
}
.nav__home:hover::after, .nav__links a:hover::after,
.nav__home.is-active::after, .nav__links a.is-active::after {
  transform: scaleX(1);
  transform-origin: 0 50%;
}

/* card hover: arrow slides in next to title, panel lifts with shadow */
.card__title::after {
  content: "↗";
  display: inline-block;
  margin-left: 0.45rem;
  font-size: 0.85em;
  color: var(--ink);
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.card__link:hover .card__title::after,
.card__link:focus-visible .card__title::after {
  opacity: 1;
  transform: translate(0, 0);
}

/* project hero parallax base */
.project__hero img {
  will-change: transform;
  transition: transform .1s linear;
}

/* back-to-top nudge */
.foot__top { display: inline-block; transition: color .25s var(--ease), transform .3s var(--ease); }
.foot__top:hover { transform: translateY(-3px); }

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-top: 1.5rem;
  }
  .intro__image {
    position: static;
    align-items: flex-start;
  }
  .intro__frame, .intro__image img { max-width: 220px; }
  .intro__meta > div { grid-template-columns: 5.5rem 1fr; }

  .contact-page { padding-top: 7rem; }
  .contact-page__list > div { grid-template-columns: 5.5rem 1fr; }

  .resume { padding-top: 1.5rem; }
  .resume__section { grid-template-columns: 1fr; gap: 0.75rem; }
  .resume__label { padding-top: 0; }
  .resume__skillrow { grid-template-columns: 1fr; gap: 0.2rem; }
  .resume__entry-head { flex-direction: column; gap: 0.2rem; align-items: flex-start; }

  .project { padding-top: 6rem; }
  .project__head { flex-direction: column; align-items: flex-start; gap: 1rem; }
}

/* ============================================
   Case study (AiWalker · project sub-page)
   Uses existing tokens; adds .cs__* classes only.
   ============================================ */

.cs__eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  margin-bottom: 0.5rem;
}
.cs__subtitle {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-3);
  margin-top: 0.5rem;
}
.cs__edition { color: var(--ink-3); }
.cs__zh {
  font-family: var(--sans);
  color: var(--ink-2);
  letter-spacing: 0;
}

/* numbered section heading */
.cs {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.cs__head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2rem;
}
.cs__num { color: var(--red); }
.cs__label { color: var(--ink); font-weight: 600; }

/* big display headline */
.cs__display {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--ink);
  max-width: 22ch;
  margin-bottom: 2rem;
}

/* three-up columns: numbered problems & personas (Athleats-style form) */
.cs__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-top: 2.5rem;
}
@media (max-width: 720px) { .cs__cols { grid-template-columns: 1fr; gap: 2rem; } }
.cs__col { margin: 0; }
.cs__col-num {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--red);
  opacity: 0.4;
  margin-bottom: 0.5rem;
}
.cs__col-tag {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  margin-bottom: 0.5rem;
}
.cs__col h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 0.6rem;
}
.cs__col p {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.cs__col p em { font-style: italic; color: var(--ink); }

/* prose */
.cs__prose {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 64ch;
}
.cs__prose strong { color: var(--ink); font-weight: 500; }
.cs__prose em { font-style: italic; color: var(--ink); }

/* numbered/bulleted list */
.cs__list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
  max-width: 64ch;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-2);
}
.cs__list li {
  position: relative;
  padding-left: 1.25rem;
}
.cs__list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-3);
}
.cs__list strong { color: var(--ink); font-weight: 500; }

/* sub-section (4.1, 4.2…) */
.cs__sub {
  margin-top: 2rem;
  max-width: 64ch;
}
.cs__sub h3 {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.6rem;
}
.cs__sub p {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-2);
  margin-top: 0.5rem;
}
.cs__sub p strong { color: var(--ink); font-weight: 500; }
.cs__sub p em { font-style: italic; color: var(--ink); }

/* field-moment block (Mr. Du) */
.cs__sub--field {
  background: var(--bg-soft);
  border-radius: 14px;
  border-left: 3px solid var(--red);
  padding: 1.75rem 1.75rem 1.5rem;
  margin-top: 2.5rem;
}
.cs__field-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  margin: 0 0 0.3rem !important;
}
.cs__field-name {
  font-size: 1.5rem !important;
  letter-spacing: -0.02em;
}

/* pull quote */
.cs__quote {
  margin: 1.5rem 0 2rem;
  padding: 0 0 0 1.5rem;
  border-left: 3px solid var(--red);
  max-width: 56ch;
}
.cs__quote p {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.5;
  color: var(--ink);
  font-weight: 400;
}

/* blueprint legend */
.cs__legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 1rem 0 1.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-2);
  padding: 0;
}
.cs__legend li { display: inline-flex; align-items: center; gap: 0.5rem; }
.cs__sw {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}
.cs__sw--blue   { background: var(--blue); }
.cs__sw--red    { background: var(--red); }
.cs__sw--green  { background: var(--green); }
.cs__sw--dashed { background: transparent; border: 1px dashed var(--ink-2); }

/* blueprint phases */
.cs__bp {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.cs__phase {
  position: relative;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--bg);
}
.cs__phase::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 3px;
  border-radius: 2px;
  background: var(--rule);
}
.cs__phase-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  display: block;
  margin-bottom: 0.6rem;
}
.cs__phase h3 {
  font-family: var(--sans);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: 0.5rem;
  color: var(--ink);
}
.cs__phase p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.cs__phase--hospital::after { background: var(--blue); }
.cs__phase--home::after     { background: var(--green); }
.cs__phase--break {
  background: rgba(216, 69, 29, 0.045);
  border-color: rgba(216, 69, 29, 0.4);
}
.cs__phase--break .cs__phase-tag { color: var(--red); }
.cs__phase--break::after {
  background: transparent;
  height: 0;
  border-top: 3px dashed var(--red);
}

/* dashed "design layer" beneath the blueprint */
.cs__designlayer {
  margin-top: 1.75rem;
  border: 1px dashed var(--ink-3);
  border-radius: 14px;
  padding: 1.25rem 1.5rem 1.5rem;
}
.cs__designlayer-head {
  font-family: var(--mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  margin-bottom: 0.9rem;
}
.cs__chips {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  padding: 0;
}
.cs__chips li {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cs__chips li span {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}

/* intervention detail cards */
.cs__cards {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.cs__card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--bg);
}
.cs__card-num {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--red);
  letter-spacing: 0.04em;
}
.cs__card h3 {
  font-family: var(--sans);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.cs__card-what {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.cs__gap {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-2);
  margin-top: 0.4rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--rule);
}
.cs__gap span {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-right: 0.4rem;
}

/* FACTS stat strip */
.cs__facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 2rem 0 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.cs__facts > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-2);
}
.cs__facts > div span {
  font-size: 2.25rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1;
}

/* Single lede sentence (§01) */
.cs__lede-single {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 60ch;
  margin-bottom: 1.25rem;
}

/* Deliverables arrow list (§01) */
.cs__deliver {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--ink-2);
}
.cs__deliver li {
  position: relative;
  padding-left: 1.2rem;
}
.cs__deliver li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--red);
}

/* Tight bullet list (§02 company) */
.cs__bullets {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 64ch;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-2);
}
.cs__bullets li {
  position: relative;
  padding-left: 1.25rem;
}
.cs__bullets li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-3);
}

/* Role responsibility rows (§03) */
.cs__role {
  display: flex;
  flex-direction: column;
  margin-top: 0.5rem;
  max-width: 64ch;
}
.cs__role-row {
  display: grid;
  grid-template-columns: 10.5rem 1fr;
  gap: 1.5rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--ink-2);
  align-items: baseline;
}
.cs__role-row:first-child { border-top: 1px solid var(--rule); }
.cs__role-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

/* Research finding cards (§04) */
.cs__finds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
.cs__find {
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.cs__find-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--red);
}
.cs__find h3 {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cs__find p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-2);
}

/* Single line after pull quote (§05) */
.cs__one-line {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 60ch;
  margin-top: 0.25rem;
}
.cs__one-line strong { color: var(--ink); font-weight: 500; }

/* Before → After boxes (§08) */
.cs__ba {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}
.cs__ba-box {
  padding: 1.5rem;
  border-radius: 14px;
  border: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cs__ba-box--before { background: var(--bg-soft); }
.cs__ba-box--after {
  background: rgba(109, 184, 109, 0.06);
  border-color: rgba(109, 184, 109, 0.3);
}
.cs__ba-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.cs__ba-box--after .cs__ba-label { color: var(--green); }
.cs__ba-box p {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* honest-framing note */
.cs__note {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--bg-soft);
  border-radius: 10px;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 64ch;
}
.cs__note em { font-style: italic; color: var(--ink); }

/* company footer */
.cs__company {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-3);
  text-align: center;
}

/* Process loop (IKEA · §04) */
.cs__loop {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
}
.cs__loop-step {
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.cs__loop-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--red);
}
.cs__loop-step h3 {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cs__loop-step p {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.cs__loop-arrow {
  font-size: 1.1rem;
  color: var(--ink-3);
  text-align: center;
  padding: 0 0.1rem;
  flex-shrink: 0;
}
.cs__loop-feedback {
  margin-top: 0.85rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--red);
  text-align: right;
}

/* Insight toggle (IKEA · §05) */
.cs__toggle {
  margin-top: 1.5rem;
  cursor: pointer;
  max-width: 64ch;
  user-select: none;
}
.cs__toggle-face {
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg);
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.cs__toggle-face--gap {
  background: rgba(0, 88, 163, 0.05);
  border-color: rgba(0, 88, 163, 0.22);
}
.cs__toggle-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
}
.cs__toggle-face p {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-2);
  font-style: italic;
}
.cs__toggle-btn {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--red);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: opacity .2s var(--ease);
  margin-top: 0.25rem;
}
.cs__toggle-btn:hover { opacity: 0.6; }

/* IKEA outcome "after" box */
.cs__ba-box--ikea {
  padding: 1.5rem;
  border-radius: 14px;
  border: 1px solid rgba(0, 88, 163, 0.25);
  background: rgba(0, 88, 163, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cs__ba-label--ikea {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0058a3;
}
.cs__ba-box--ikea p {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* responsive */
@media (max-width: 800px) {
  .cs { margin-top: 3.5rem; padding-top: 1.25rem; }
  .cs__bp { grid-template-columns: 1fr; gap: 1.25rem; margin-bottom: 0.5rem; }
  .cs__chips { grid-template-columns: 1fr 1fr; }
  .cs__cards { grid-template-columns: 1fr; }
  .cs__phase::after { display: none; }
  .cs__facts { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .cs__finds { grid-template-columns: 1fr; }
  .cs__ba { grid-template-columns: 1fr; }
  .cs__role-row { grid-template-columns: 1fr; gap: 0.2rem; }
  .cs__loop { grid-template-columns: 1fr; gap: 1rem; }
  .cs__loop-arrow { display: none; }
}

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