/* =========================================================
   Kevin Lee — personal site
   Style: light workflow SaaS (locked spec 2026-11-09)
   ========================================================= */

/* ---------- 0. Fonts (self-hosted via fontsource; no external request,
   no third-party render-blocking stylesheet) ---------- */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/geist-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/geist-mono-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/instrument-serif-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/instrument-serif-latin-400-italic.woff2') format('woff2');
}

/* ---------- 1. Tokens ---------- */
:root {
  --bg: #F5F6F7;
  --ink: #0D0E0F;
  --ink-2: #5A5F64;
  /* Was #9AA0A5: 2.44:1 on --bg, failed WCAG AA for the 10-11px labels that use it. */
  --ink-3: #6A7075;
  --line: rgba(13, 14, 15, .09);
  --line-strong: rgba(13, 14, 15, .16);
  --card: #FFFFFF;
  --green: #2FBF71;
  --cyan: #BFE9E4;
  --blue: #C7DFF5;

  --sans: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --serif: "Instrument Serif", "Times New Roman", Times, serif;

  --max: 1240px;
  --pad: clamp(20px, 4vw, 48px);
  --ease: cubic-bezier(.22, .61, .36, 1);

  --r-card: 26px;
  --r-inner: 16px;
  --r-pill: 999px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  animation: page-in .7s var(--ease) both;
}

@keyframes page-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -.03em; line-height: 1.08; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

::selection { background: var(--ink); color: #fff; }

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

/* ---------- 3. Atmosphere (light beams + grain) ---------- */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.beam {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .85;
}

.beam--a {
  width: 62vw; height: 62vw;
  left: -22vw; top: -26vw;
  background: radial-gradient(circle at 50% 50%, rgba(191, 233, 228, .95), rgba(191, 233, 228, 0) 68%);
}

.beam--b {
  width: 52vw; height: 52vw;
  right: -14vw; top: 4vh;
  background: radial-gradient(circle at 50% 50%, rgba(199, 223, 245, 1), rgba(199, 223, 245, 0) 68%);
}

.beam--c {
  width: 70vw; height: 34vw;
  left: 22vw; bottom: -16vw;
  background: radial-gradient(ellipse at 50% 50%, rgba(219, 238, 255, .75), rgba(219, 238, 255, 0) 70%);
  opacity: .6;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: .028;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 4. Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--pad);
}

.page {
  position: relative;
  z-index: 1;
}

.section {
  padding-block: clamp(72px, 11vh, 130px);
}

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* ---------- 5. Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--pad);
  transition: background .35s var(--ease), box-shadow .35s var(--ease), padding .35s var(--ease);
}

.nav.is-scrolled {
  padding-block: 12px;
  background: rgba(245, 246, 247, .74);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 1px 0 var(--line);
}

.nav--inner { position: static; background: transparent; }

.brand {
  display: inline-flex;
  align-items: baseline;
  font-size: 15px;
  font-weight: 550;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.brand__reg {
  font-family: var(--serif);
  font-style: italic;
  font-size: .78em;
  margin-left: .12em;
  opacity: .5;
  transform: translateY(-.35em);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 34px);
  margin-inline-start: auto;
  font-size: 14px;
  color: var(--ink-2);
}

.nav__links a {
  position: relative;
  padding-block: 4px;
  transition: color .25s var(--ease);
}

.nav__links a:hover { color: var(--ink); }

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}

.nav__links a:hover::after { transform: scaleX(1); }

.nav__links a.is-current { color: var(--ink); }
.nav__links a.is-current::after { transform: scaleX(1); }

.language-switch {
  display: inline-flex;
  flex: none;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .72);
}

.language-switch[hidden] { display: none; }

.language-switch button {
  min-width: 42px;
  min-height: 34px;
  padding: 0 7px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--ink-2);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.language-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}

.nav__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* ---------- 6. Small parts ---------- */
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 191, 113, .14);
  flex: none;
}

.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 8px 0 22px;
  border-radius: var(--r-pill);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .35s var(--ease), background .3s var(--ease), color .3s var(--ease), box-shadow .35s var(--ease);
}

.btn__icon {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  transition: transform .4s var(--ease), background .3s var(--ease);
}

.btn:hover { transform: translateY(-2px); }
.btn:hover .btn__icon { transform: translate(2px, 0) rotate(-45deg); }

.btn--dark {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 10px 26px -14px rgba(13, 14, 15, .7);
}

.btn--dark:hover { background: #1b1d1f; }

.btn--ghost {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(13, 14, 15, .04);
}

.btn--ghost:hover { border-color: var(--line-strong); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  color: var(--ink-2);
  transition: color .25s var(--ease), gap .3s var(--ease);
}

.link-arrow:hover { color: var(--ink); gap: 12px; }

.link-arrow svg { flex: none; }

/* ---------- 7. Hero ---------- */
.hero {
  position: relative;
  min-height: clamp(590px, 88svh, 900px);
  display: flex;
  align-items: flex-end;
  padding-top: 120px;
  overflow: hidden;
  /* 双击/三击人物会触发浏览器选词/选段，::selection 是近黑底 → 整块"黑色蒙版"感；
     首屏文字无需可选中，整体禁掉 */
  -webkit-user-select: none;
  user-select: none;
}

.hero__grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: end;
}

.hero__type {
  grid-column: 1 / span 6;
  /* 底部留白抬升文字块到视口中部（名字中心 ≈55%），与人物头部/上胸同高，视觉重心居中；
     人物保持 68vh 底部出血不动 */
  padding-bottom: clamp(122px, 19vh, 215px);
}

.hero__title {
  margin-top: 22px;
  font-size: clamp(3.4rem, 8.6vw, 7.4rem);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: .9;
  white-space: nowrap;
}

.hero__title .reg {
  font-family: var(--serif);
  font-style: italic;
  font-size: .2em;
  font-weight: 400;
  letter-spacing: 0;
  vertical-align: super;
  margin-left: .06em;
  opacity: .45;
}

/* The hero line is wiped in with a typewriter cadence rather than re-typed by
   script: the text is present in the first paint, so it registers for Speed
   Index immediately, while `steps()` keeps the character-by-character feel.
   `inset()` clips without touching layout, so nothing shifts underneath it. */
@keyframes hero-wipe {
  from { clip-path: inset(-.25em 100% -.25em 0); }
  to   { clip-path: inset(-.25em 0 -.25em 0); }
}

.hero__line {
  margin-top: clamp(20px, 3vh, 32px);
  max-width: 36ch;
  font-size: clamp(1.02rem, 1.35vw, 1.22rem);
  line-height: 1.55;
  color: var(--ink-2);
  letter-spacing: -.011em;
  animation: hero-wipe .72s steps(46, end) .06s both;
}

html:lang(zh-CN) .hero__line {
  animation-duration: .6s;
  animation-timing-function: steps(21, end);
}

.hero__line em {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.14em;
  letter-spacing: 0;
  color: var(--ink);
}

html:lang(zh-CN) :is(.hero__line, .section__head, .page-head) em {
  font-family: inherit;
  font-style: normal;
  font-weight: inherit;
}

.hero__cta {
  margin-top: clamp(28px, 4vh, 40px);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* Social icon row beside the hero CTA: hairline separator + three brand
   marks in the page's ink system, kept inline (self-hosted, no CDN). */
.hero__social {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hero__social-sep {
  width: 1px;
  height: 22px;
  margin-right: 14px;
  background: var(--line-strong);
}

.hero-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 48px;
  color: var(--ink-2);
  transition: color .25s var(--ease);
}

.hero-social:hover { color: var(--ink); }

.hero__hint {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--ink-3);
}

.hero__fig {
  grid-column: 7 / span 6;
  position: relative;
  align-self: end;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.gaze-portrait {
  position: relative;
  z-index: 2;
  width: min(100%, clamp(300px, 51vh, 495px));
  aspect-ratio: 3 / 4;
  filter: drop-shadow(0 34px 46px rgba(13, 14, 15, .10));
  animation: fig-in 1.1s var(--ease) both;
  animation-delay: .15s;
}

.gaze-portrait > img,
.gaze-portrait > .gaze-frame,
.gaze-portrait > .gaze-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.gaze-portrait .gaze-frame,
.gaze-portrait .gaze-video,
.gaze-portrait.is-tracking > img {
  opacity: 0;
}

.gaze-portrait.is-tracking:not(.is-reacting) .gaze-frame,
.gaze-portrait.is-reacting .gaze-video.is-visible {
  opacity: 1;
}

.gaze-portrait .gaze-video:not(.has-alpha) {
  --gaze-side-fade: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
  --gaze-top-fade: linear-gradient(transparent, #000 4%);
  -webkit-mask-image: var(--gaze-side-fade), var(--gaze-top-fade);
  -webkit-mask-composite: source-in;
  mask-image: var(--gaze-side-fade), var(--gaze-top-fade);
  mask-composite: intersect;
}

@keyframes fig-in {
  from { opacity: 0; transform: translateY(26px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.hero__glow {
  position: absolute;
  z-index: 1;
  bottom: -6%;
  left: 50%;
  translate: -50% 0;
  width: 84%;
  height: 46%;
  background: radial-gradient(ellipse at 50% 100%, rgba(199, 223, 245, .8), rgba(199, 223, 245, 0) 72%);
  filter: blur(26px);
}

/* ---------- 8. Section heads ---------- */
.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: clamp(28px, 4.4vh, 46px);
}

.section__head h2 {
  margin-top: 14px;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  font-weight: 500;
  letter-spacing: -.04em;
  max-width: 20ch;
  text-wrap: balance;
}

.section__head h2 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.01em;
}

/* ---------- 9. Project cards ---------- */
.project-section {
  padding-block: clamp(54px, 8vw, 100px);
  scroll-margin-top: 58px;
}

.project-section .section__head h2 { margin-top: 0; }

.project-grid {
  display: grid;
  gap: clamp(16px, 2vw, 26px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  grid-template-areas: 'cover copy';
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding-block: clamp(28px, 5vw, 66px);
  border-top: 1px solid var(--line);
}

.project-feature:nth-child(even) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  grid-template-areas: 'copy cover';
}

.project-feature > .project-cover {
  grid-area: cover;
  border-radius: var(--r-card);
  outline: 1px solid var(--line);
  outline-offset: -1px;
}

.project-feature > .project-card__body {
  grid-area: copy;
  min-width: 0;
  gap: 8px;
  padding: 0;
}

.project-feature h3 {
  margin-top: 3px;
  font-size: clamp(1.95rem, 3.5vw, 3.3rem);
  line-height: 1.1;
  text-wrap: balance;
}

.project-feature .project-card__description {
  max-width: 40ch;
  margin-top: 9px;
  font-size: clamp(.98rem, 1.4vw, 1.125rem);
  line-height: 1.68;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 12px;
}

.project-actions .btn, .work-intro__link { padding-inline: 18px; }
.project-actions .link-arrow { min-height: 44px; }

/* Download CTA: icon nudges down instead of the arrow's rotate */
.btn--download:hover .btn__icon { transform: translateY(2px); }

/* Muted download meta line; the live count fades in once /api/downloads answers */
.dl-count {
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dl-count__hits { opacity: 0; transition: opacity .4s var(--ease); }
.dl-count__hits.is-ready { opacity: 1; }

/* Square social icon beside a ghost button (project cards) */
.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 48px; height: 48px;
  border-radius: var(--r-pill);
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-2);
  box-shadow: 0 1px 2px rgba(13, 14, 15, .04);
  transition: transform .35s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}

.icon-btn:hover { transform: translateY(-2px); border-color: var(--line-strong); color: var(--ink); }

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 0 1px 2px rgba(13, 14, 15, .04);
}

.project-card:target {
  border-color: #647784;
  box-shadow: 0 0 0 3px rgba(100, 119, 132, .15);
}

.project-cover {
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-inner);
  background: #EBEEF1;
  overflow: hidden;
}

.project-cover > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-cover--time-photo-studio { background: #E5DBCB; }
.project-cover--pocket-pasture { background: #91B3D0; }
.project-cover--where-hurts { background: #FAF9F6; }
.project-cover--where-hurts > img { object-fit: contain; }

.project-cover--relax-planet {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 6%;
  padding-top: 5%;
  background: linear-gradient(140deg, #E5F1F8, #F4EBDB);
}

.project-cover--relax-planet > img {
  flex: none;
  width: 34%;
  height: auto;
  border: 2px solid rgba(255, 255, 255, .92);
  border-radius: clamp(8px, 1.5vw, 20px);
  box-shadow: 0 16px 30px -12px rgba(35, 57, 77, .38);
  transform: rotate(-6deg);
}

.project-cover--relax-planet > img + img {
  margin-top: 3%;
  transform: rotate(6deg);
}

/* HP Drain: one phone rising from a deep-slate field, matching the app's own mood */
.project-cover--hp-drain {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 5%;
  background: linear-gradient(150deg, #3D5468, #26333F);
}

.project-cover--hp-drain > img {
  flex: none;
  width: 31%;
  height: auto;
  border: 2px solid rgba(255, 255, 255, .92);
  border-radius: clamp(8px, 1.5vw, 20px);
  box-shadow: 0 16px 30px -12px rgba(10, 20, 30, .55);
  transform: rotate(-4deg);
}

/* In-development status: amber dot + quiet label, stands in for action buttons */
.project-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  font-size: 13.5px;
  letter-spacing: .02em;
  color: var(--ink-2);
}

.project-status::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #E8A33D;
  box-shadow: 0 0 0 3px rgba(232, 163, 61, .18);
  transform: translateY(.5px);
}

.project-status--live::before {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 191, 113, .16);
}

.project-status--off::before {
  background: #9AA1A7;
  box-shadow: 0 0 0 3px rgba(154, 161, 167, .18);
}

.project-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: clamp(14px, 2vw, 22px) clamp(6px, 1.2vw, 15px) 10px;
}

.project-card h3 a { color: inherit; text-decoration: none; }
.project-card h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }

/* Works grid: the whole card is clickable through the title link; real buttons float above it */
.project-card h3 a::after { content: ''; position: absolute; inset: 0; }
.project-card .btn, .project-card .icon-btn, .project-card .project-card__details, .project-card .dl-count { position: relative; z-index: 2; }

.project-card__details { min-height: 44px; display: inline-flex; align-items: center; }

.project-card h3 {
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  line-height: 1.35;
  letter-spacing: 0;
  font-weight: 650;
}

.project-card__description {
  color: var(--ink-2);
  font-size: .94rem;
  line-height: 1.65;
}

.project-card__type {
  color: var(--ink-2);
  font-size: .82rem;
  font-weight: 550;
}

.project-card__facts {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: .84rem;
}

/* ---------- 11. Footer ---------- */
.footer {
  margin-top: clamp(60px, 9vh, 110px);
  border-top: 1px solid var(--line);
  padding-block: 34px 40px;
}

.footer__grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}

.footer__brand { font-size: 15px; font-weight: 550; letter-spacing: -.02em; }

.footer__tag {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-3);
}

.footer__tag em {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.14em;
  color: var(--ink-2);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.footer__links a { transition: color .25s var(--ease); }
.footer__links a:hover { color: var(--ink); }

.footer__meta {
  margin-top: 26px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- 12. Inner pages ---------- */
.page-head {
  padding-top: clamp(120px, 17vh, 190px);
  padding-bottom: clamp(34px, 5vh, 54px);
}

/* About: the hero heading runs straight into the section beneath it. */
.page-head--flush { padding-bottom: 0; }

.page-head h1 {
  margin-top: 16px;
  font-size: clamp(2.6rem, 6.2vw, 5rem);
  letter-spacing: -.05em;
  line-height: .98;
  max-width: 18ch;
}

.page-head h1 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.015em;
}

.page-head p {
  margin-top: 20px;
  max-width: 46ch;
  color: var(--ink-2);
  font-size: clamp(.98rem, 1.2vw, 1.08rem);
}

.work-intro__link { margin-top: 22px; }

/* ---------- 12b. Project detail pages (works/<slug>) ---------- */

.detail-back { font-size: 14px; }
.detail-head .project-card__type { margin-top: 26px; }
.detail-head .project-actions { margin-top: 10px; }
/* .page-head p gives every paragraph a 20px lead-in; inside the actions row that
   pushes the status badge off-center against its link neighbor */
.detail-head .project-status { margin-top: 0; }

.detail-hero { padding-top: clamp(4px, 2vw, 16px); }

/* Story section: heading column on the left, prose filling the right, no dead margin */
/* Label-left / prose-right split: work detail pages and the about "method"
   section share it, so the prose measure never floats against a wide wrap. */
.detail-story,
.section--split {
  display: grid;
  grid-template-columns: minmax(0, .36fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

/* Screenshot figures */
.shot { margin: 0; }

.shot > img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-inner);
  outline: 1px solid var(--line);
}

.shot figcaption {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--ink-3);
}

/* Web app shots ride in a browser-chrome frame */
.shot--browser {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  outline: none;
  overflow: hidden;
  box-shadow: 0 18px 40px -24px rgba(13, 14, 15, .25);
}

.shot--browser::before {
  content: '';
  display: block;
  height: 38px;
  background:
    radial-gradient(circle 4.5px at 22px 50%, #D8DDE2 99%, transparent),
    radial-gradient(circle 4.5px at 42px 50%, #D8DDE2 99%, transparent),
    radial-gradient(circle 4.5px at 62px 50%, #D8DDE2 99%, transparent),
    #F1F3F5;
  border-bottom: 1px solid var(--line);
}

.shot--browser > img { border-radius: 0; outline: none; }

/* Phone shots stand in a slim device bezel */
.shot--phone { width: min(280px, 68vw); margin-inline: auto; }
.detail-hero .shot--phone { width: min(310px, 72vw); }

.shot--phone > img {
  border-radius: clamp(16px, 3.4vw, 26px);
  outline: 1px solid var(--line-strong);
  box-shadow: 0 26px 50px -22px rgba(13, 14, 15, .4);
}

/* Manual: numbered steps, figure and copy alternating sides */
.manual { display: grid; gap: clamp(30px, 5.5vw, 64px); margin-top: clamp(8px, 2vw, 18px); }

.manual-step {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
  grid-template-areas: 'fig copy';
  align-items: center;
  gap: clamp(22px, 4.5vw, 56px);
}

.manual-step:nth-child(even) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr);
  grid-template-areas: 'copy fig';
}

.manual-step .shot { grid-area: fig; }
.manual-step__copy { grid-area: copy; min-width: 0; }

/* Phone steps: the figure column hugs the device, copy fills the rest of the row */
.manual-step:has(.shot--phone) {
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
}

.manual-step:nth-child(even):has(.shot--phone) {
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
}

.manual-step__no {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--ink-3);
}

.manual-step__no::after {
  content: '';
  display: inline-block;
  width: 34px;
  height: 1px;
  margin-left: 10px;
  vertical-align: 3px;
  background: var(--line-strong);
}

.manual-step h3 { margin-top: 8px; font-size: clamp(1.25rem, 2vw, 1.55rem); letter-spacing: -.02em; }
.manual-step__text { margin-top: 8px; color: var(--ink-2); line-height: 1.65; max-width: 52ch; }

/* How it's made: prose beside a facts table */
.detail-made__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  margin-top: clamp(8px, 2vw, 18px);
  align-items: start;
}

/* End band: CTA + previous/next */
.detail-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }

.pn {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: clamp(26px, 4vw, 44px);
  padding-top: clamp(22px, 3vw, 34px);
  border-top: 1px solid var(--line);
}

.pn__link {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-inner);
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  transition: transform .25s var(--ease), border-color .25s var(--ease);
}

.pn__link:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.pn__label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.pn__name { font-size: 1.05rem; letter-spacing: -.01em; }
.pn__link--next { text-align: right; }

@media (max-width: 860px) {
  .detail-story,
  .section--split { grid-template-columns: minmax(0, 1fr); gap: 14px; }

  .manual-step,
  .manual-step:nth-child(even),
  .manual-step:has(.shot--phone),
  .manual-step:nth-child(even):has(.shot--phone) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'fig' 'copy';
  }

  .detail-made__grid { grid-template-columns: minmax(0, 1fr); }
  .pn { grid-template-columns: 1fr; }
  .pn__link--next { text-align: left; }
}

.project-gallery {
  padding-bottom: clamp(40px, 6vw, 72px);
  scroll-margin-top: 84px;
}

.project-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 24px;
}

.project-toolbar h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  letter-spacing: 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filters[hidden], .project-card[hidden] { display: none; }

.filter {
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: transparent;
  font-size: .84rem;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}

.filter:hover { color: var(--ink); }

.filter[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.project-grid--gallery .project-card {
  scroll-margin-top: 84px;
  padding: clamp(10px, 1.3vw, 15px);
}

.project-grid--gallery .project-card__body { padding-bottom: 14px; }

/* ---------- 13. About ---------- */
.about {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(34px, 6vw, 90px);
  align-items: start;
  padding-top: clamp(40px, 7vh, 80px);
}

.about__aside {
  position: sticky;
  top: 110px;
}

.about__portrait {
  width: 100%;
  aspect-ratio: 4 / 4.6;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, #EDF1F2, #E4E8EA);
  border: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.about__portrait img {
  width: 96%;
  height: auto;
  transform: translateY(4px);
  filter: drop-shadow(0 16px 24px rgba(13, 14, 15, .10));
}

.about__facts {
  margin-top: 26px;
  display: grid;
  gap: 14px;
}

.detail-facts {
  display: grid;
  gap: 14px;
}

.fact {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.fact dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 3px;
}

.fact dd { margin: 0; text-align: right; color: var(--ink); }

.prose p {
  font-size: clamp(1rem, 1.28vw, 1.13rem);
  line-height: 1.72;
  color: var(--ink-2);
  letter-spacing: -.008em;
  max-width: 58ch;
}

.prose p + p { margin-top: 1.2em; }

.prose strong { color: var(--ink); font-weight: 550; }

.prose em {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1em;
  color: var(--ink);
}

/* ---------- in-prose links ---------- */
.prose a, .faq a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
  transition: text-decoration-color .2s ease;
}

.prose a:hover, .faq a:hover { text-decoration-color: var(--ink); }

/* ---------- FAQ (work detail pages) ---------- */
.faq { display: grid; gap: clamp(24px, 3.5vw, 36px); }

.faq h3 {
  margin: 0;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  letter-spacing: -.02em;
  color: var(--ink);
}

.faq p { margin: 8px 0 0; }

.timeline {
  margin-top: clamp(46px, 7vh, 70px);
  border-top: 1px solid var(--line);
}

.tl {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 22px;
  padding-block: 20px;
  border-bottom: 1px solid var(--line);
}

.tl__year {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-3);
  padding-top: 4px;
}

.tl__what { font-size: 15px; color: var(--ink); }
/* Direct child only: the "now" row's headline embeds inline spans for the
   live night/project counters, which this rule must leave inline */
.tl__what > span { display: block; margin-top: 3px; font-size: 13.5px; color: var(--ink-2); }

/* CTA band spans the full wrap below both columns: the prose column no longer
   runs ~290px past the aside, and the four links get one consistent row. */
.about__cta {
  margin-top: clamp(44px, 7vh, 68px);
}

/* ---------- 14. Reveal ---------- */
/* Stagger without inline `style="--d:…"`, so the CSP can stay free of
   'unsafe-inline' for styles. */
.reveal--d6 { --d: .06s; }
.reveal--d8 { --d: .08s; }

.has-reveal .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .85s var(--ease), transform .85s var(--ease);
  transition-delay: var(--d, 0s);
}

.has-reveal .reveal.is-in { opacity: 1; transform: none; }

/* ---------- 15. Responsive ---------- */
@media (max-width: 1080px) {
  .hero__title { font-size: clamp(3rem, 8.4vw, 5.4rem); }
}

@media (max-width: 860px) {
  .hero {
    align-items: flex-start;
    min-height: auto;
    padding-top: 108px;
  }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__type { grid-column: 1; padding-bottom: 0; order: 1; }
  .hero__fig { grid-column: 1; order: 2; margin-top: 30px; }
  /* When the social row wraps under the button, the separator is redundant. */
  .hero__social-sep { display: none; }
  .hero__social { margin-left: -10px; }
  .gaze-portrait { width: min(100%, clamp(255px, 39vh, 352.5px)); }
  .hero__line { max-width: 44ch; }
  .about { grid-template-columns: 1fr; }
  .about__aside { position: static; }
  .about__portrait { max-width: 260px; }
  .project-grid--gallery { grid-template-columns: minmax(0, 1fr); }
  .project-feature, .project-feature:nth-child(even) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'cover' 'copy';
    gap: 20px;
  }
  .section__head { flex-direction: column; align-items: flex-start; gap: 16px; }
}

@media (max-width: 620px) {
  .nav { gap: 9px; }
  .nav__links { gap: clamp(7px, 2vw, 13px); font-size: 13px; }
  .language-switch button { min-width: 36px; padding-inline: 5px; }
  .nav__status { display: none; }
  .hero__title { font-size: clamp(2.6rem, 12vw, 3.6rem); }
  .footer__grid { flex-direction: column; gap: 22px; }
  .btn { height: 44px; }
}

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

/* ---------- works · robot hero stage (robot-hero/CONTRACT.md) ---------- */
.page-head.has-robot{position:relative;padding-bottom:244px}
.robot-stage{
  --rb-size:236px;--rb-desk-inset:6%;--rb-ground:20px;
  position:absolute;left:0;right:0;bottom:30px;height:242px;pointer-events:none;z-index:1
}
.robot-ground{position:absolute;left:0;right:0;bottom:var(--rb-ground);height:1px;
  background:var(--line-strong);opacity:.8;transition:opacity .7s}
.robot-stage.is-work:not(.is-away) .robot-ground,.robot-stage.is-static .robot-ground{opacity:0}
.robot-trail{position:absolute;left:0;bottom:calc(var(--rb-ground) + 1px);width:0;border-top:2px dotted rgba(13,14,15,.14)}
.robot-stage.is-work .robot-trail{width:calc(100% - var(--rb-desk-inset) - var(--rb-size) - 10px)}
/* W1 feet and D0 furniture meet the same line at either breakpoint. */
#rbTraveler,#rbDesk,#rbPlant{position:absolute;bottom:calc(var(--rb-ground) - .086 * var(--rb-size));
  width:var(--rb-size);height:var(--rb-size)}
#rbTraveler{left:0;transform:translateX(var(--rb-x,0px))}
#rbDesk{right:var(--rb-desk-inset)}
#rbPlant{opacity:0;pointer-events:none;transition:opacity .25s ease}
.robot-stage.is-plant-visible #rbPlant{opacity:1}
.robot-stage video,.rb-static{position:absolute;inset:0;width:100%;height:100%;display:none;
  filter:drop-shadow(0 10px 12px rgba(13,14,15,.12))}
.robot-stage video{opacity:0;transition:opacity .1s ease;pointer-events:none}
.robot-stage video.rb-flip{transform:scaleX(-1)}
.rb-greet{
  position:absolute;left:0;bottom:var(--rb-ground);z-index:5;
  width:calc(.51 * var(--rb-size));height:calc(.83 * var(--rb-size));
  transform:translateX(calc(var(--rb-x,0px) + .25 * var(--rb-size)));
  padding:0;border:0;border-radius:20px;background:transparent;cursor:pointer;pointer-events:auto
}
.rb-greet[data-position="desk"]{
  left:auto;right:calc(var(--rb-desk-inset) + .15 * var(--rb-size));
  width:calc(.46 * var(--rb-size));height:calc(.78 * var(--rb-size));transform:none
}
.rb-greet[aria-disabled="true"]{pointer-events:none;outline:none}
.rb-greet:not([aria-disabled="true"]):focus-visible{outline:2px solid #16858d;outline-offset:3px}
.rb-greet.is-acknowledged::before{
  content:"✦";position:absolute;right:0;top:4%;color:#16858d;font-size:18px;line-height:1;
  animation:rbAcknowledge .55s var(--ease) both
}
.rb-greet[data-facing="left"].is-acknowledged::before{right:auto;left:0}
@keyframes rbAcknowledge{
  0%{opacity:0;transform:translateY(4px) scale(.55)}
  25%{opacity:1;transform:translateY(0) scale(1)}
  100%{opacity:0;transform:translateY(-9px) scale(.85)}
}
/* The wider departure and return shots add room on the left of the fixed desk. */
.robot-stage video.rb-desk-wide{inset:-25% auto auto -50%;width:150%;height:150%}
#rbEmptyDesk{position:absolute;inset:0;width:100%;height:100%;opacity:0;transition:opacity .1s ease;
  filter:drop-shadow(0 10px 12px rgba(13,14,15,.12))}
.robot-stage.is-desk-empty #rbEmptyDesk{opacity:1}
.robot-stage.is-static .rb-static{display:block}
.rb-sym{position:absolute;font-family:var(--mono);font-size:13px;font-weight:600;opacity:0;pointer-events:none;z-index:4}
.robot-stage.is-work:not(.is-break) .rb-sym{animation:rbRise 2.4s ease-out infinite}
.rb-sym.s1{bottom:150px;right:calc(var(--rb-desk-inset) + .85 * var(--rb-size));color:#4DD8E6;animation-delay:0s}
.rb-sym.s2{bottom:134px;right:calc(var(--rb-desk-inset) + .05 * var(--rb-size));color:#2FBF71;animation-delay:.5s}
.rb-sym.s3{bottom:166px;right:calc(var(--rb-desk-inset) + .46 * var(--rb-size));color:var(--ink);animation-delay:1s}
.rb-sym.s4{bottom:128px;right:calc(var(--rb-desk-inset) + 1.14 * var(--rb-size));color:#4DD8E6;animation-delay:1.6s}
@keyframes rbRise{0%{opacity:0;transform:translateY(0)}12%{opacity:.8}100%{opacity:0;transform:translateY(-110px)}}
@media (max-width:860px){
  .page-head.has-robot{padding-bottom:200px}
  .robot-stage{--rb-size:170px;--rb-desk-inset:4%;bottom:18px}
}
/* ---------- media protection: no select, no drag, no long-press callout ---------- */
/* Raises friction only; screenshots and devtools stay possible — watermarks are the real answer. */
img,video,canvas{-webkit-user-drag:none;user-select:none;-webkit-touch-callout:none}

/* ---------- Fieldline (project12): game card, video hero, world grid, devlog strip ---------- */
.project-cover--fieldline { background: #C9A96A; }

/* One-line intro under a section heading */
.section__intro { margin: 10px 0 0; color: var(--ink-2); font-size: .95rem; line-height: 1.6; }

/* In-engine video rides in the same frame as screenshots */
.shot--video { width: min(960px, 100%); margin-inline: auto; }
.shot--video video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-inner);
  outline: 1px solid var(--line);
  background: #101314;
  object-fit: cover;
}

/* Species & biome gallery: 4-up on desktop, 2-up on mobile */
.shot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 20px);
  margin-top: clamp(8px, 2vw, 18px);
}
@media (max-width: 860px) {
  .shot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Devlog episodes: three linked cards */
.devlog-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 20px);
  margin-top: clamp(8px, 2vw, 18px);
}
.devlog-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.devlog-card:hover,
.devlog-card:focus-visible { transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgba(13, 14, 15, .3); }
.devlog-card > img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.devlog-card__body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.devlog-card__no { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; color: var(--ink-3); }
.devlog-card__name { font-weight: 600; font-size: .95rem; line-height: 1.45; }
@media (max-width: 860px) {
  .devlog-cards { grid-template-columns: minmax(0, 1fr); }
}
