:root {
  --ink: #141414;
  --muted: #6b6b67;
  --line: rgba(20, 20, 20, 0.12);
  --paper: #f4f4f2;
  --paper-tint: #eaeae6;
  --hero-text: #ffffff;

  --peach: #f9ba8c;
  --orange: #f2855a;
  --magenta: #c26b94;
  --purple: #7d57ab;
  --cream: #f2e3d1;
  --grey: #d5d5d2;

  --gutter: clamp(16px, 3vw, 40px);
  --section-y: clamp(96px, 12vw, 180px);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --ease-out: cubic-bezier(0.2, 0.7, 0.1, 1);
}

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

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

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  word-break: keep-all;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

ol,
ul {
  list-style: none;
}

/* ---------- Header ---------- */

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--gutter);
  color: var(--hero-text);
}

.site-header--ink {
  position: relative;
  color: var(--ink);
}

.logo {
  text-decoration: none;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.logo__slash {
  display: inline-block;
  margin-right: 0.08em;
  font-weight: 200;
}

/* Writing is closed while it is being reworked. Delete this rule to bring it back
   to the header menu and the hub's entry list. */
.site-nav a[href="/writing"],
.entries__list > li:has(> a[href="/writing"]) {
  display: none;
}

.site-nav {
  display: flex;
  gap: clamp(16px, 2.5vw, 32px);
}

.site-nav a {
  white-space: nowrap;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-nav a[aria-current="page"] {
  text-decoration-thickness: 1px;
}

/* "Ask me": the same sparkle as the send button, turning a quarter on hover. */
.site-nav__ask {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.site-nav__spark {
  flex: none;
  transition: transform 0.6s var(--ease-out);
}

.site-nav__ask:hover .site-nav__spark,
.site-nav__ask:focus-visible .site-nav__spark {
  transform: rotate(90deg);
}

/* On phones the header is tight: "Ask me" shrinks to its sparkle (the label stays
   for screen readers). */
@media (max-width: 480px) {
  .site-nav {
    gap: 12px;
  }

  .site-nav__ask .site-nav__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .site-nav__spark {
    width: 16px;
    height: 16px;
  }
}

/* The smallest phones (320–360px): keep the logo on one line and the nav inside. */
@media (max-width: 360px) {
  .logo {
    font-size: 17px;
    white-space: nowrap;
  }

  .site-nav {
    gap: 10px;
  }

  .site-nav a {
    font-size: 14px;
  }
}

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

.hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  color: var(--hero-text);
  /* Fallback when WebGL is unavailable: a static version of the light band. */
  background: linear-gradient(
    180deg,
    #d3d3d1 0%,
    #d8d6d3 34%,
    #f0dccb 45%,
    #f2a072 51%,
    #c9718a 55%,
    #8a62a8 58%,
    #ead7c9 66%,
    #d6d5d2 80%,
    #d0d0ce 100%
  );
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.hero__canvas.is-ready {
  opacity: 1;
}

.hero__inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--gutter) + 72px) var(--gutter) var(--gutter);
}

.hero__title {
  font-size: clamp(44px, 8.4vw, 156px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.045em;
  text-shadow: 0 0 60px rgba(0, 0, 0, 0.06);
}

.hero__title .line {
  display: block;
  animation: rise 1.4s var(--ease-out) both;
}

.hero__title .line:nth-child(2) {
  animation-delay: 0.12s;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Typing headline. Reserve two lines (three on phones) so the layout doesn't jump. */
.hero__title {
  max-width: 11em;
  min-height: calc(2 * 0.95em);
}

.typer {
  display: inline;
  white-space: pre-line; /* "\n" in a phrase becomes a line break */
  animation: fade 1s ease both;
}

/* Untyped remainder: invisible but laid out, so line breaks never shift while typing. */
.typer__rest {
  visibility: hidden;
}

.typer__text {
  transition: opacity 0.6s ease, filter 0.6s ease;
}

.typer__text.is-leaving {
  opacity: 0;
  filter: blur(14px);
}

.typer__text.no-transition {
  transition: none;
}

/* The cursor is an empty inline anchor that takes no space in the line, so it never
   changes where lines wrap. The dot is a separate element on the title that main.js
   moves to the anchor after every character: iOS Safari does not reliably move a dot
   drawn inside the inline anchor itself and leaves it behind after scrolling. */
.hero__title {
  position: relative;
}

.typer__dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 0.74em;
  height: 0.74em;
  margin: -0.3em 0 0 0.18em;
  border-radius: 50%;
  pointer-events: none;
  background: currentColor;
  transition: transform 0.35s ease;
  animation: dot-in 0.35s ease-out both, breathe 1.6s ease-in-out 0.35s infinite;
}

@keyframes dot-in {
  from { transform: scale(0); }
  to { transform: scale(0.72); }
}

/* While characters are being typed the dot holds still, like a pen on paper. */
.typer.is-busy + .typer__dot {
  animation: none;
  transform: scale(0.82);
}

/* Sentence finished: the dot shrinks away until the next sentence starts generating. */
.typer.is-done + .typer__dot {
  animation: none;
  transform: scale(0);
}

@keyframes breathe {
  0%, 100% { transform: scale(0.72); }
  50% { transform: scale(1); }
}

@media (max-width: 599px) {
  .hero__title {
    min-height: calc(3 * 0.95em);
  }
}

.hero__lead {
  margin-top: clamp(20px, 2.5vw, 32px);
  max-width: 30em;
  font-size: clamp(16px, 1.4vw, 20px);
  font-weight: 500;
  line-height: 1.5;
  animation: fade 1.2s 0.4s ease both;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px clamp(24px, 6vw, 96px);
  font-size: 15px;
  font-weight: 500;
  animation: fade 1.2s 0.5s ease both;
}

.hero__pattern {
  white-space: pre;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.hero__scroll {
  margin-left: auto;
  text-decoration: none;
}

.hero__scroll:hover,
.hero__scroll:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.25em);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Phones/tablets: flows under the headline. Desktop: lower-right of the wall,
   balancing the headline in the upper-left. */
.hero__statement {
  max-width: 26em;
  margin: 28px 0 auto;
  font-size: clamp(17px, 1.6vw, 26px);
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: -0.02em;
  text-shadow: 0 0 30px rgba(0, 0, 0, 0.08);
  animation: fade 1.2s 0.6s ease both;
}

.hero__statement-past {
  opacity: 0.72;
}

@media (min-width: 900px) {
  .hero__statement {
    position: absolute;
    left: 55%;
    right: var(--gutter);
    bottom: calc(var(--gutter) + 18vh);
    max-width: 24em;
    margin: 0;
  }
}

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

.section {
  padding: var(--section-y) var(--gutter);
}

.section--tint {
  background: var(--paper-tint);
}

.section--lead {
  padding-top: clamp(48px, 8vw, 120px);
}

.section__head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: clamp(48px, 6vw, 96px);
}

.section__index {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.section__title {
  font-size: clamp(40px, 6.4vw, 112px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}

.section__desc {
  max-width: 32em;
  font-size: clamp(16px, 1.3vw, 19px);
  color: var(--muted);
}

@media (min-width: 900px) {
  .section__head {
    grid-template-columns: 1fr 3fr 2fr;
    align-items: end;
    gap: 24px;
  }

  .section__index {
    align-self: start;
  }
}

.placeholder-tag {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

/* ---------- Inertial scroll (Lenis, landing page) ---------- */

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

/* Overlay scrollbar (smooth.js): the native bar is hidden and a thin thumb floats over
   the right edge only while the page moves, like iOS. */
html.has-overlay-scrollbar {
  scrollbar-width: none;
}

html.has-overlay-scrollbar::-webkit-scrollbar {
  display: none;
}

.scrollbar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  width: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease-out);
}

.scrollbar.is-visible {
  opacity: 1;
  pointer-events: auto;
  transition-duration: 0.2s;
}

.scrollbar__thumb {
  position: absolute;
  top: 0;
  right: 0;
  width: 14px;
  cursor: grab;
  touch-action: none;
}

/* The visible pill is thinner than the grab area and widens a little on hover. */
.scrollbar__thumb::before {
  content: "";
  position: absolute;
  top: 0;
  right: 3px;
  bottom: 0;
  width: 5px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.42);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
  transition: width 0.25s var(--ease-out), background-color 0.25s var(--ease-out);
}

.scrollbar__thumb:hover::before,
.scrollbar.is-dragging .scrollbar__thumb::before {
  width: 8px;
  background: rgba(20, 20, 20, 0.55);
}

.scrollbar.is-dragging .scrollbar__thumb {
  cursor: grabbing;
}

/* ---------- Ask (agent) ---------- */

.ask {
  padding: clamp(72px, 9vw, 140px) var(--gutter) 0;
}

/* Pill input: one line of text and a round send button. On the page it sits on a
   light grey fill; inside the conversation it is a translucent black tint instead,
   so the blurred page shows through. */
.ask__form--pill {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 14px 14px clamp(26px, 2.4vw, 34px);
  border-radius: 999px;
  background: var(--paper-tint);
}

/* Both pills (page and conversation) are capped at 800px and centred. */
.ask__form--pill,
.ask-overlay .ask__note {
  width: 100%;
  max-width: 800px;
  margin-right: auto;
  margin-left: auto;
}

/* Listed with the reveal transition so the scroll-in and the focus change both ease.
   The selector outranks `.js [data-reveal]`, which comes later in this file. */
.js .ask__form.ask__form--pill,
.ask__form.ask__form--pill {
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out),
    background-color 0.6s var(--ease-out);
}

.ask__form--pill:focus-within {
  background: #e2e2dd;
}

.ask__form--glass {
  background: rgba(0, 0, 0, 0.05);
}

.ask__form--glass:focus-within {
  background: rgba(0, 0, 0, 0.08);
}

.ask__form--pill .ask__input {
  font-size: clamp(16px, 1.25vw, 19px);
  letter-spacing: -0.015em;
}

.ask__form--pill .ask__input::placeholder {
  color: #b3b3ad;
}

.ask__form--glass .ask__input::placeholder {
  color: rgba(0, 0, 0, 0.32);
}

/* Rolling placeholder: example questions type in and dissolve like the hero copy.
   It sits over the input and hides as soon as the visitor types. */
.ask__field {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
}

.ask__hint {
  position: absolute;
  top: 50%;
  left: 0;
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(16px, 1.25vw, 19px);
  font-weight: 500;
  letter-spacing: -0.015em;
  white-space: nowrap;
  color: #b3b3ad;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 0.6s ease, filter 0.6s ease;
}

/* Chunks stay inline so their widths add up exactly to the reserved phrase. */
.ask__hint-chunk {
  animation: hint-in 0.42s var(--ease-out) both;
}

@keyframes hint-in {
  from {
    opacity: 0;
    filter: blur(4px);
  }
}

.ask__hint-rest {
  visibility: hidden;
}

.ask__hint.is-leaving {
  opacity: 0;
  filter: blur(8px);
  transition-duration: 0.7s;
}

.ask__hint.no-transition {
  transition: none;
}

.ask__field.has-value .ask__hint {
  visibility: hidden;
}

/* On the landing page the text sits in the middle of the pill. An invisible spacer
   the size of the send button balances the left side, so "centre" is the true
   centre of the pill. */
.ask > .ask__form {
  padding-left: 14px;
}

.ask > .ask__form::before {
  content: "";
  flex: none;
  width: 48px;
}

.ask > .ask__form .ask__input {
  text-align: center;
}

.ask > .ask__form .ask__hint {
  right: 0;
  text-align: center;
}

/* Phones: a slightly smaller button and gap leave room for the longest hint. */
@media (max-width: 480px) {
  .ask > .ask__form {
    gap: 10px;
    padding: 10px;
  }

  .ask > .ask__form::before,
  .ask > .ask__form .ask__send {
    width: 44px;
    height: 44px;
  }
}

.ask__form--pill .ask__send {
  width: 48px;
  height: 48px;
}

.ask__input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  font: inherit;
  font-size: clamp(22px, 2.6vw, 40px);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink);
  background: transparent;
}

.ask__input::placeholder {
  color: #9a9a95;
}

.ask__send {
  display: grid;
  place-items: center;
  flex: none;
  width: clamp(44px, 3.6vw, 56px);
  height: clamp(44px, 3.6vw, 56px);
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

/* Hover turns the sparkle a quarter turn instead of nudging the button. */
.ask__send-icon {
  transition: transform 0.6s var(--ease-out);
}

.ask__send:hover:not(:disabled) .ask__send-icon,
.ask__send:focus-visible .ask__send-icon {
  transform: rotate(90deg);
}

.ask__send:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Full-viewport conversation over a blurred, lightly brightened page. */
.ask-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(64px) saturate(1.1);
  backdrop-filter: blur(64px) saturate(1.1);
  opacity: 0;
  transition: opacity 0.45s ease;
}

.ask-overlay.is-open {
  opacity: 1;
}

/* The conversation column is capped at 1200px; the close button stays in the
   viewport corner. */
.ask-overlay__inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: calc(1200px + 2 * var(--gutter));
  height: 100%;
  margin: 0 auto;
  padding: calc(var(--gutter) + 44px) var(--gutter) var(--gutter);
  transform: translateY(12px);
  transition: transform 0.45s var(--ease-out);
}

.ask-overlay.is-open .ask-overlay__inner {
  transform: none;
}

.ask-overlay__close {
  position: absolute;
  top: var(--gutter);
  right: var(--gutter);
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: background-color 0.5s var(--ease-out);
}

.ask-overlay__close:hover,
.ask-overlay__close:focus-visible {
  background: #fff;
}

/* One message is kept at the vertical centre of the viewport (ask.js glides to it);
   half-screen spacers at both ends make that possible for the first and last
   message. The visitor steps between messages a tick at a time. */
.ask__log {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 3.4vw, 56px);
  min-height: 0;
  overflow: hidden; /* moved only by ask.js, one message per tick */
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 88%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 88%, transparent);
}

/* Half-screen spacers inside the scroll area (padding would stop the log from
   shrinking to fit above the input). */
.ask__log::before,
.ask__log::after {
  content: "";
  flex: none;
  height: 50vh;
}

.ask__log::-webkit-scrollbar {
  display: none;
}

/* No bubbles: the agent speaks on the left, the visitor on the right,
   both in the same large type as the page's ask input. */
.ask__msg {
  max-width: min(100%, 30em);
  font-size: clamp(22px, 2.6vw, 40px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.025em;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.ask__msg--user {
  align-self: flex-end;
  max-width: 80%;
  text-align: right;
}

/* On wider screens the two sides keep to their own lanes: answers use the left two
   thirds, questions the right half, so long lines never read as one block. */
@media (min-width: 720px) {
  .ask__msg--agent,
  .ask__msg--note {
    max-width: 66%;
  }

  .ask__msg--user {
    max-width: 50%;
  }
}

.ask__msg--agent {
  align-self: flex-start;
}

.ask__msg--agent a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.18em;
}

.ask__msg--note {
  align-self: flex-start;
}

/* Opacity is set by ask.js from each message's distance to the centre. */

/* Streamed answer text arrives in small pieces that fade in. */
.ask__piece {
  animation: piece-in 0.3s ease-out both;
}

@keyframes piece-in {
  from {
    opacity: 0;
  }
}

/* Same breathing dot as the hero headline, shown while the agent is answering. */
.ask__dot {
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-left: 0.25em;
  vertical-align: -0.1em;
  border-radius: 50%;
  background: currentColor;
  animation: breathe 1.6s ease-in-out infinite;
}

.ask__note {
  font-size: 13px;
  text-align: center;
  color: var(--muted);
}

html.is-ask-open,
html.is-ask-open body {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .ask-overlay,
  .ask-overlay__inner {
    transition: none;
  }

  .ask__dot,
  .ask__piece {
    animation: none;
  }
}

/* ---------- Hub entry points ---------- */

/* Three large rows on the hub (Work, Services, Writing). On desktop they share the
   section head's 1fr 3fr 2fr grid; the arrow eases forward on hover. */
.entries {
  padding: clamp(96px, 12vw, 180px) var(--gutter) var(--section-y);
}

.entries__list {
  border-top: 1px solid var(--line);
}

.entries__list > li {
  border-bottom: 1px solid var(--line);
}

.entry {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "index index"
    "title arrow"
    "desc  desc";
  align-items: end;
  gap: 10px 16px;
  padding: clamp(28px, 3.5vw, 48px) 0;
  text-decoration: none;
}

.entry__index {
  grid-area: index;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.entry__title {
  grid-area: title;
  font-size: clamp(40px, 6.4vw, 112px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}

.entry__desc {
  grid-area: desc;
  max-width: 32em;
  font-size: clamp(16px, 1.3vw, 19px);
  color: var(--muted);
}

.entry__arrow {
  grid-area: arrow;
  font-size: clamp(24px, 2.6vw, 40px);
  line-height: 1;
  transition: transform 0.8s var(--ease-out);
}

.entry:hover .entry__arrow,
.entry:focus-visible .entry__arrow {
  transform: translateX(8px);
}

.entry:focus-visible {
  outline-offset: 6px;
}

@media (min-width: 900px) {
  .entry {
    grid-template-columns: 1fr 3fr 2fr auto;
    grid-template-areas: "index title desc arrow";
    gap: 24px;
  }

  .entry__index {
    align-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .entry__arrow {
    transition: none;
  }
}

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

.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(48px, 5vw, 80px) clamp(16px, 2vw, 32px);
}

@media (min-width: 900px) {
  .work-grid {
    grid-template-columns: 1fr 1fr;
  }

  .work-card--featured {
    grid-column: 1 / -1;
  }

  .work-card--featured .work-card__media {
    aspect-ratio: 21 / 9;
  }
}

.work-card__link {
  display: block;
  text-decoration: none;
}

.work-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 4px;
  background: var(--grey);
}

.work-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease-out);
}

.work-card__link:hover .work-card__media img,
.work-card__link:focus-visible .work-card__media img {
  transform: scale(1.03);
}

/* Product screenshots sit on a soft light-panel background instead of being cropped. */
.work-card__media--framed {
  display: grid;
  place-items: center;
  padding: 6% 8%;
  background:
    radial-gradient(120% 80% at 70% 110%, var(--peach) 0%, transparent 55%),
    radial-gradient(90% 70% at 20% 120%, var(--purple) 0%, transparent 50%),
    linear-gradient(180deg, #dcdcd9 0%, var(--cream) 100%);
}

.work-card__media--framed img {
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 60px -20px rgba(40, 30, 60, 0.35);
}

.work-card__media--placeholder {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(
    180deg,
    #d3d3d1 0%,
    #e9dccf 30%,
    var(--peach) 44%,
    var(--orange) 50%,
    var(--magenta) 55%,
    var(--purple) 60%,
    var(--cream) 72%,
    #d6d5d2 100%
  );
  background-size: 100% 220%;
  animation: drift 14s ease-in-out infinite alternate;
}

.work-card__media--placeholder-alt {
  background: linear-gradient(
    200deg,
    #d6d5d2 0%,
    var(--cream) 30%,
    var(--peach) 52%,
    var(--magenta) 72%,
    var(--purple) 86%,
    #d3d3d1 100%
  );
  background-size: 100% 220%;
}

/* Featured AX card: materials → grammar → policy flowing through an agent into a repo. */
.stack-visual {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.5vw, 40px);
  width: min(88%, 1100px);
  color: var(--ink);
}

.stack-visual__layers {
  flex: 1.3;
  display: grid;
  gap: clamp(6px, 0.8vw, 12px);
}

.stack-visual__layer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: clamp(10px, 1.4vw, 20px) clamp(12px, 1.8vw, 24px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.stack-visual__layer:nth-child(2) { margin-left: 6%; }
.stack-visual__layer:nth-child(3) { margin-left: 12%; }

.stack-visual__layer span {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.stack-visual__layer strong {
  font-size: clamp(15px, 1.8vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.stack-visual__layer em {
  font-style: normal;
  font-size: clamp(11px, 1vw, 14px);
  color: var(--muted);
}

.stack-visual__flow {
  flex: 1;
  display: flex;
  align-items: center;
  gap: clamp(6px, 1vw, 16px);
  color: #fff;
}

.stack-visual__arrow {
  font-size: clamp(16px, 2vw, 28px);
}

.stack-visual__node {
  padding: clamp(8px, 1vw, 14px) clamp(12px, 1.6vw, 22px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  font-size: clamp(12px, 1.2vw, 18px);
  font-weight: 600;
  white-space: nowrap;
}

.stack-visual__node--solid {
  color: var(--ink);
  background: #fff;
}

@media (max-width: 599px) {
  .work-card--featured .work-card__media {
    aspect-ratio: 4 / 3;
  }

  .stack-visual {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .stack-visual__layer em {
    display: none;
  }

  .stack-visual__flow {
    justify-content: center;
  }
}

@keyframes drift {
  from { background-position: 50% 20%; }
  to { background-position: 50% 80%; }
}

.work-card__body {
  padding-top: 20px;
}

.work-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.work-card__title {
  margin-top: 10px;
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.work-card__summary {
  margin-top: 10px;
  max-width: 36em;
  color: var(--muted);
}

/* ---------- Approach ---------- */

.principles {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line);
}

@media (min-width: 900px) {
  .principles {
    grid-template-columns: repeat(3, 1fr);
  }

  .principle + .principle {
    border-left: 1px solid var(--line);
  }
}

.principle {
  padding: 32px 0 40px;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 900px) {
  .principle {
    padding: 32px clamp(20px, 2.5vw, 40px) 48px;
    border-bottom: 0;
  }

  .principle:first-child {
    padding-left: 0;
  }
}

.principle__num {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.principle__title {
  margin: 48px 0 14px;
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.principle p {
  color: var(--muted);
}

/* ---------- Experience ---------- */

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: clamp(56px, 7vw, 112px);
}

@media (min-width: 700px) {
  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(16px, 2vw, 32px);
  }
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat__num {
  font-size: clamp(64px, 8vw, 136px);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.stat__num small {
  margin-left: 0.08em;
  font-size: 0.35em;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.stat__label {
  max-width: 22em;
  font-size: 15px;
  color: var(--muted);
}

/* Role journey: four steps, the last one (the goal) drawn dashed. */
.journey {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: clamp(56px, 7vw, 96px);
  counter-reset: none;
}

@media (min-width: 700px) {
  .journey {
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
  }
}

.journey__step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 24px 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
}

@media (min-width: 700px) {
  .journey__step + .journey__step {
    border-left: 0;
  }

  .journey__step:not(:last-child)::after {
    content: "→";
    position: absolute;
    right: -0.55em;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    padding: 2px 0;
    font-size: 18px;
    color: var(--muted);
    background: var(--paper);
  }
}

.journey__when {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.journey__role {
  font-size: clamp(20px, 1.9vw, 28px);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.journey__focus {
  font-size: 15px;
  color: var(--muted);
}

.journey__step--next {
  border: 1px dashed rgba(20, 20, 20, 0.35);
  background: transparent;
}

@media (min-width: 700px) {
  .journey__step--next {
    border-left: 1px dashed rgba(20, 20, 20, 0.35);
  }
}

.journey__step--next .journey__role {
  background: linear-gradient(90deg, var(--orange), var(--magenta) 55%, var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.timeline {
  border-top: 1px solid var(--ink);
}

.timeline__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 700px) {
  .timeline__row {
    grid-template-columns: 1fr 1.4fr 2fr;
    gap: 24px;
    align-items: baseline;
  }
}

.timeline__period {
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.timeline__org {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.timeline__role {
  color: var(--muted);
}

/* ---------- Archive ---------- */

.archive {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.archive th {
  padding: 0 12px 12px 0;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--ink);
}

.archive td {
  padding: 14px 12px 14px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}

.archive td:first-child,
.archive td:last-child {
  color: var(--muted);
  white-space: nowrap;
}

.archive td:nth-child(2) {
  font-weight: 500;
}

.archive th:last-child,
.archive td:last-child {
  text-align: right;
  padding-right: 0;
}

.archive tbody tr {
  transition: background-color 0.2s ease;
}

.archive tbody tr:hover {
  background: rgba(20, 20, 20, 0.03);
}

/* Each row opens its archive page: the link stretches over the whole row, and the
   title underlines softly on hover. */
.archive tbody tr {
  position: relative;
}

.archive__link {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size 0.5s var(--ease-out);
}

.archive__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.archive tbody tr:hover .archive__link,
.archive__link:focus-visible {
  background-size: 100% 1px;
}

@media (max-width: 599px) {
  .archive__platform {
    display: none;
  }
}

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 4vw, 64px);
}

@media (min-width: 900px) {
  .about {
    grid-template-columns: 1fr 2fr;
    align-items: start;
  }
}

.about__photo {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  max-width: 420px;
  border-radius: 4px;
  color: var(--muted);
  background:
    radial-gradient(90% 60% at 50% 100%, rgba(249, 186, 140, 0.55) 0%, transparent 70%),
    #dcdcd8;
}

.about__bio {
  max-width: 28em;
  font-size: clamp(20px, 2vw, 30px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.02em;
}

.about__motto {
  margin-top: clamp(32px, 4vw, 56px);
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 500;
  color: var(--muted);
}

.about__motto::before {
  content: "— ";
}

.about__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin-top: clamp(32px, 4vw, 56px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.about__links a {
  font-weight: 500;
  text-decoration: none;
}

.about__links a:hover,
.about__links a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

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

.contact {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 90svh;
  padding: var(--section-y) var(--gutter) var(--gutter);
  color: #fff;
  background:
    linear-gradient(180deg,
      #cfcfcc 0%,
      #d6d4d0 40%,
      #efd9c6 58%,
      var(--peach) 68%,
      var(--orange) 76%,
      var(--magenta) 82%,
      var(--purple) 88%,
      #3a2d52 100%);
}

.contact .section__index {
  color: inherit;
  opacity: 0.8;
}

.contact__title {
  margin-top: 16px;
  font-size: clamp(48px, 9vw, 168px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.contact__mail {
  display: inline-block;
  margin-top: clamp(24px, 3vw, 40px);
  font-size: clamp(20px, 2.4vw, 36px);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.contact__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin-top: 64px;
  font-size: 14px;
  font-weight: 500;
}

.contact--compact {
  min-height: 0;
  padding-top: 40px;
  color: var(--ink);
  background: var(--paper-tint);
}

.contact--compact .contact__bottom {
  margin-top: 0;
}

.contact__bottom .to-top {
  margin-left: auto;
  text-decoration: none;
}

/* ---------- Case study ---------- */

.case-hero {
  padding: clamp(48px, 8vw, 120px) var(--gutter) clamp(40px, 5vw, 72px);
}

.case-hero__eyebrow {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.case-hero__title {
  margin-top: 16px;
  font-size: clamp(44px, 8vw, 140px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.case-hero__lead {
  margin-top: 24px;
  max-width: 30em;
  font-size: clamp(18px, 1.8vw, 26px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.case-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding: 24px var(--gutter);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  margin: 0 var(--gutter);
  padding-left: 0;
  padding-right: 0;
}

@media (min-width: 900px) {
  .case-summary {
    grid-template-columns: repeat(5, 1fr);
  }
}

.case-summary dt {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.case-summary dd {
  margin-top: 4px;
  font-weight: 500;
}

.case-cover {
  margin: clamp(40px, 5vw, 72px) var(--gutter) 0;
}

.case-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 24px;
  padding: clamp(72px, 9vw, 140px) var(--gutter) 0;
}

@media (min-width: 900px) {
  .case-section {
    grid-template-columns: 1fr 3fr;
  }
}

.case-section__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.case-section__title {
  font-size: clamp(28px, 3.4vw, 52px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.case-section__text {
  max-width: 40em;
  margin-top: 20px;
  font-size: 17px;
  color: #3a3a37;
}

.case-section__note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 40px;
}

@media (min-width: 700px) {
  .card-grid--2 { grid-template-columns: repeat(2, 1fr); }
  .card-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  padding: 28px;
  border-radius: 4px;
  background: var(--paper-tint);
}

.card__eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.card__title {
  margin-top: 12px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.card ul {
  margin-top: 16px;
  display: grid;
  gap: 8px;
  color: #3a3a37;
}

.card li::before {
  content: "— ";
  color: var(--muted);
}

.card--accent {
  color: #fff;
  background: linear-gradient(135deg, var(--orange) 0%, var(--magenta) 55%, var(--purple) 100%);
}

.card--accent .card__eyebrow {
  color: rgba(255, 255, 255, 0.8);
}

.card--accent ul,
.card--accent li::before {
  color: rgba(255, 255, 255, 0.92);
}

.goal {
  margin-top: 40px;
  font-size: clamp(24px, 3vw, 44px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.gallery {
  display: grid;
  gap: clamp(56px, 7vw, 112px);
  padding: clamp(56px, 7vw, 112px) var(--gutter) 0;
}

.figure {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 900px) {
  .figure {
    grid-template-columns: 1fr 3fr;
    align-items: center;
  }

  .figure:nth-child(even) .figure__media {
    order: -1;
  }

  .figure:nth-child(even) {
    grid-template-columns: 3fr 1fr;
  }
}

.figure__media {
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 72px);
  border-radius: 4px;
  background:
    radial-gradient(100% 70% at 80% 110%, rgba(249, 186, 140, 0.8) 0%, transparent 60%),
    radial-gradient(80% 60% at 10% 120%, rgba(125, 87, 171, 0.55) 0%, transparent 55%),
    linear-gradient(180deg, #e0e0dd 0%, #ece4da 100%);
}

.figure__media img {
  max-height: 72vh;
  width: auto;
  border-radius: 6px;
  box-shadow: 0 30px 80px -30px rgba(40, 30, 60, 0.4);
}

/* Bleed: drop the gradient panel so the photo fills the whole media column. */
.figure__media--bleed {
  padding: 0;
  background: none;
}

.figure__media--bleed img {
  width: 100%;
  height: auto;
  max-height: none;
  border-radius: 4px;
  box-shadow: none;
}

.figure__caption h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.figure__caption p:first-of-type {
  margin-top: 10px;
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.figure__caption p + p {
  margin-top: 12px;
  font-size: 15px;
  color: var(--muted);
}

.token-table {
  width: 100%;
  margin-top: 40px;
  border-collapse: collapse;
  font-size: 14px;
}

.token-table th {
  padding: 0 12px 12px 0;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--ink);
}

.token-table td {
  padding: 14px 12px 14px 0;
  border-bottom: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  word-break: break-all;
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  border-radius: 3px;
  border: 1px solid var(--line);
}

/* ---------- Phone screenshots (Flare) ---------- */

.phone-trio {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(10px, 2.6vw, 40px);
  width: 100%;
  height: 100%;
}

.phone-trio > img {
  width: clamp(72px, 17%, 260px);
  height: auto;
  border-radius: clamp(10px, 1.8vw, 30px);
  box-shadow: 0 30px 70px -28px rgba(40, 30, 60, 0.45);
}

.phone-trio > img:nth-child(2) {
  transform: translateY(-5%);
}

.phone-trio .device {
  width: clamp(72px, 17%, 260px);
  filter: drop-shadow(0 24px 30px rgba(40, 30, 60, 0.3));
  transition: transform 1.2s var(--ease-out);
}

.phone-trio .device:nth-child(2) {
  transform: translateY(-5%);
}

@media (max-width: 599px) {
  .phone-trio > img {
    width: 27%;
  }

  .phone-trio .device {
    width: 27%;
  }
}

.work-card__media--flare {
  display: grid;
  place-items: center;
  background:
    radial-gradient(70% 90% at 15% 100%, rgba(249, 186, 140, 0.9) 0%, transparent 60%),
    radial-gradient(60% 80% at 90% 0%, rgba(188, 219, 247, 0.9) 0%, transparent 60%),
    linear-gradient(135deg, #f1ece6 0%, #e9e4ef 100%);
}

.work-card__media--flare img {
  transition: transform 1.2s var(--ease-out);
}

.work-card__link:hover .work-card__media--flare .phone-trio > img,
.work-card__link:focus-visible .work-card__media--flare .phone-trio > img {
  transform: translateY(-2%);
}

.work-card__link:hover .work-card__media--flare .phone-trio > img:nth-child(2),
.work-card__link:focus-visible .work-card__media--flare .phone-trio > img:nth-child(2) {
  transform: translateY(-8%);
}

.work-card__link:hover .work-card__media--flare .phone-trio .device,
.work-card__link:focus-visible .work-card__media--flare .phone-trio .device {
  transform: translateY(-2%);
}

.work-card__link:hover .work-card__media--flare .phone-trio .device:nth-child(2),
.work-card__link:focus-visible .work-card__media--flare .phone-trio .device:nth-child(2) {
  transform: translateY(-8%);
}

.work-card__link .work-card__media .device .device__screen,
.work-card__link .work-card__media .device .device__frame,
.work-card__link:hover .work-card__media .device .device__screen,
.work-card__link:hover .work-card__media .device .device__frame {
  transform: none;
  object-fit: cover;
}

/* ---------- iPhone mockup (Apple iOS 26 UI Kit bezel, Flare) ----------
   The screen sits in the bezel's hole: 72,69 / 1206x2622 of a 1350x2760 frame.
   The mask is the hole's exact shape, so screen corners always match the frame. */

.device {
  position: relative;
  flex: none;
  aspect-ratio: 1350 / 2760;
  filter: drop-shadow(0 26px 36px rgba(40, 30, 60, 0.26));
}

.device .device__screen,
.device .device__frame {
  position: absolute;
  display: block;
  max-width: none;
  max-height: none;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

.device .device__screen {
  left: 5.3333%;
  top: 2.5%;
  width: 89.3333%;
  height: 95%;
  object-fit: cover;
  background: #f7f7f7;
  -webkit-mask-image: url("/assets/img/iphone-screen-mask.png");
  mask-image: url("/assets/img/iphone-screen-mask.png");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.device .device__frame {
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.figure__media .device {
  height: min(64vh, 640px);
}

/* Me: two phones, top of the page and scrolled down */
.device-pair {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(12px, 3vw, 40px);
  width: 100%;
}

.figure__media .device-pair .device {
  height: auto;
  width: min(44%, calc(60vh * 1350 / 2760), 290px);
}

.figure__media .device-pair .device:nth-child(2) {
  margin-top: clamp(24px, 6vw, 72px);
}

/* (kept for reference) phone with insight cards floating beside it */
.me-stage {
  position: relative;
  width: min(100%, 760px);
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
}

.me-stage .device {
  height: 94%;
}

.me-stage .me-card {
  position: absolute;
  width: 35%;
  height: auto;
  max-height: none;
  border-radius: clamp(8px, 1.4vw, 16px);
  box-shadow: 0 22px 44px -18px rgba(40, 30, 60, 0.38);
}

.me-stage .me-card--a { left: 0; top: 14%; }
.me-stage .me-card--b { left: 2%; bottom: 14%; }
.me-stage .me-card--c { right: 0; top: 24%; width: 33%; }

@media (max-width: 599px) {
  .me-stage { aspect-ratio: 1 / 1.1; }
  .me-stage .device { height: 90%; }
  .me-stage .me-card { width: 42%; }
  .me-stage .me-card--c { width: 40%; }
}

.gallery__note {
  margin: 0 var(--gutter);
  font-size: 13px;
  color: var(--muted, #8a8a8a);
}

.case-cover--band img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.text-link {
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.work-card__media img.is-band {
  object-position: 58% 50%;
}

.case-section .timeline {
  margin-top: 40px;
}

.stats--compact {
  margin: 40px 0 0;
}

.stats--compact .stat__num {
  font-size: clamp(48px, 5.5vw, 88px);
}

/* Four numbers: two by two on tablets, one row on wide screens */
@media (min-width: 700px) {
  .stats--four {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 40px;
  }
}

@media (min-width: 1100px) {
  .stats--four {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- Agent-ready Design System case ---------- */

.case-numbers {
  padding: 0 var(--gutter);
}

/* A wide code sample must scroll inside its box, not widen the section column */
.case-section > div {
  min-width: 0;
}

.case-numbers .stats {
  margin-top: clamp(40px, 5vw, 72px);
}

/* Five numbers: two columns on phones, one row on wide screens */
.stats--five {
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 16px;
}

.stats--five .stat__num {
  font-size: clamp(40px, 4.4vw, 72px);
}

@media (min-width: 700px) {
  .stats--five { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1100px) {
  .stats--five { grid-template-columns: repeat(5, 1fr); }
}

/* Cover: three screens overlapping on the gradient stage */
.cover-stack {
  position: relative;
  aspect-ratio: 16 / 9.5;
  overflow: hidden;
  border-radius: 4px;
  background:
    radial-gradient(100% 70% at 80% 110%, rgba(249, 186, 140, 0.8) 0%, transparent 60%),
    radial-gradient(80% 60% at 10% 120%, rgba(125, 87, 171, 0.55) 0%, transparent 55%),
    linear-gradient(180deg, #e0e0dd 0%, #ece4da 100%);
}

.cover-stack__img {
  position: absolute;
  width: 56%;
  height: auto;
  border-radius: clamp(3px, 0.5vw, 8px);
  box-shadow: 0 30px 80px -30px rgba(40, 30, 60, 0.45);
}

.cover-stack__img--left { left: 5%; top: 6%; }
.cover-stack__img--right { right: 5%; top: 12%; }
.cover-stack__img--front { left: 50%; top: 31%; width: 60%; transform: translateX(-50%); box-shadow: 0 40px 100px -30px rgba(40, 30, 60, 0.55); }

.case-cover__caption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.case-section__text--more {
  margin-top: clamp(56px, 6vw, 88px);
}

.token-table--prose th[scope="row"] {
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.token-table--prose td {
  font-family: inherit;
  font-size: 14px;
  word-break: keep-all;
}

.token-table--prose td:last-child {
  font-variant-numeric: tabular-nums;
}

@media (min-width: 700px) {
  .token-table--prose td:last-child {
    white-space: nowrap;
  }
}

.code-sample {
  margin-top: 16px;
}

.code-sample pre {
  overflow-x: auto;
  padding: 24px 28px;
  border-radius: 4px;
  color: #ededea;
  background: #1c1c1a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.7;
}

.code-sample figcaption,
.compare figcaption,
.compare__note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

/* Two numbers side by side from tablet width */
@media (min-width: 700px) {
  .stats--two { grid-template-columns: repeat(2, 1fr); }
}

/* Build-time comparison: two horizontal bars on one linear scale */
.speed-compare {
  margin-top: clamp(48px, 6vw, 72px);
  padding: clamp(24px, 3vw, 36px);
  border-radius: 4px;
  background: var(--paper-tint);
}

.speed-compare__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.speed-row { margin-top: 24px; }

.speed-row__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.speed-row__name { font-size: 15px; color: #3a3a37; }

.speed-row__value {
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}

.speed-row__track { margin-top: 10px; height: 14px; }

.speed-row__bar {
  display: block;
  width: var(--w);
  min-width: 4px;
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: #878680;
  transition: width 1.4s var(--ease-out, ease-out);
}

.speed-row--accent .speed-row__bar { background: #e2622f; }

/* The long bar is cut (axis break) so the short one can stay visible */
.speed-row--broken .speed-row__bar { position: relative; }
.speed-row--broken .speed-row__bar::after {
  content: "";
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 62%;
  width: 7px;
  background: var(--paper-tint);
  transform: skewX(-24deg);
}

.js [data-reveal]:not(.is-in) .speed-row__bar { width: 0; }

@media (prefers-reduced-motion: reduce) {
  .speed-row__bar { transition: none; }
}

.speed-compare__note {
  margin-top: 20px;
  font-size: 13px;
  color: var(--muted);
}

/* 3 x 3 board of generated screens (2 columns on phones) */
.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 40px;
}

@media (min-width: 700px) {
  .shot-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}

.shot-grid img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: left top;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.compare {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 40px;
}

@media (min-width: 700px) {
  .compare--2 { grid-template-columns: repeat(2, 1fr); }
  .compare--3 { grid-template-columns: repeat(3, 1fr); }
}

.compare img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: left top;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.placeholder-visual {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 8;
  border-radius: 4px;
  color: #fff;
  background: linear-gradient(
    180deg,
    #d3d3d1 0%,
    #e9dccf 30%,
    var(--peach) 46%,
    var(--orange) 52%,
    var(--magenta) 57%,
    var(--purple) 62%,
    var(--cream) 74%,
    #d6d5d2 100%
  );
}

.placeholder-visual--inline {
  margin-top: 40px;
  aspect-ratio: 16 / 7;
  color: var(--muted);
  background: var(--paper-tint);
  border: 1px dashed rgba(20, 20, 20, 0.25);
}

.case-stats {
  margin-top: 32px;
}

.placeholder-block {
  margin-top: 32px;
  padding: 28px;
  border: 1px dashed rgba(20, 20, 20, 0.3);
  border-radius: 4px;
  color: var(--muted);
}

.next-case {
  display: block;
  margin-top: var(--section-y);
  padding: clamp(56px, 7vw, 112px) var(--gutter);
  border-top: 1px solid var(--line);
  text-decoration: none;
}

.next-case__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.next-case__title {
  margin-top: 12px;
  font-size: clamp(36px, 6vw, 96px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}

.next-case:hover .next-case__title,
.next-case:focus-visible .next-case__title {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.12em;
}

/* ---------- Scroll reveal ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__title .line,
  .typer,
  .typer__dot,
  .hero__lead,
  .hero__statement,
  .hero__meta,
  .work-card__media--placeholder { animation: none; }
  .hero__canvas { transition: none; }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Lightbox (image links on case pages) ---------- */

html.is-lightbox-open { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 56px);
  background: rgba(244, 244, 242, 0.55);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
  opacity: 0;
  cursor: zoom-out;
  transition: opacity 0.25s var(--ease-out);
}

.lightbox.is-open { opacity: 1; }

.lightbox__img {
  max-width: 100%;
  max-height: calc(100dvh - clamp(32px, 8vw, 112px));
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 40px 120px -40px rgba(20, 20, 30, 0.45);
  cursor: default;
  transform: scale(0.97);
  transition: transform 0.35s var(--ease-out);
}

.lightbox.is-open .lightbox__img { transform: none; }

.lightbox__close {
  position: absolute;
  top: clamp(12px, 2vw, 24px);
  right: clamp(12px, 2vw, 24px);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

.lightbox__close:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox__img { transition: none; }
}
