/* =============================================================
   Kyle — Portfolio v2
   Warm paper · Season VF · editorial layout
   Tokens → primitives → components
   ============================================================= */

/* ---------- Font ---------- */
@font-face {
  font-family: "Season";
  src: url("../fonts/SeasonCollectionVF-TRIAL.ttf") format("truetype-variations");
  font-weight: 300 900;
  font-style: oblique 0deg -11deg;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Color — warm paper (default light) */
  --paper:      #f3ede1;
  --paper-2:    #ece5d4;
  --paper-deep: #e4dcc5;
  --ink:        #1a1814;
  --ink-muted:  #6b5e4b;    /* muted brown, lower saturation */
  --ink-subt:   #a5937a;    /* muted tan, lower saturation */
  --rule:       #d9d0bc;
  --rule-soft:  #e3dac4;
  --accent:     #8a3c1b;    /* oxblood — reserved for tiny moments */

  /* Type */
  --font: "Season", ui-serif, "Iowan Old Style", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Variable font axes — convenience */
  --vf-sans:   "wght" 400, "SERF" 0,   "slnt" 0;
  --vf-half:   "wght" 430, "SERF" 50,  "slnt" 0;
  --vf-serif:  "wght" 470, "SERF" 100, "slnt" 0;
  --vf-italic: "wght" 470, "SERF" 100, "slnt" -11;
  --vf-heavy:  "wght" 650, "SERF" 100, "slnt" 0;
  --vf-display: "wght" 800, "SERF" 100, "slnt" 0;
  --vf-light:  "wght" 320, "SERF" 100, "slnt" 0;

  /* Fluid type scale */
  --fs-eyebrow: 11px;
  --fs-meta:    12px;
  --fs-body:    16.5px;
  --fs-lead:    clamp(1.1rem, 1.0rem + 0.35vw, 1.3rem);
  --fs-h3:      clamp(1.4rem, 1.2rem + 0.6vw, 1.8rem);
  --fs-h2:      clamp(1.9rem, 1.5rem + 1.3vw, 2.8rem);
  --fs-h1:      clamp(2.5rem, 1.9rem + 2.4vw, 4.4rem);
  --fs-hero:    clamp(1.6rem, 1.3rem + 1.0vw, 2.1rem);

  /* Space */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10:128px;

  /* Layout */
  --wrap: 1180px;
  --wrap-wide: 1340px;
  --gutter: clamp(24px, 3vw, 40px);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-1: 0.45s;
  --dur-2: 0.75s;
}

/* ---------- Optional night mode ---------- */
:root[data-theme="dark"] {
  --paper:      #15110b;
  --paper-2:    #1d1810;
  --paper-deep: #241f17;
  --ink:        #ddd0b4;
  --ink-muted:  #8f7c62;
  --ink-subt:   #6d6152;
  --rule:       #332a21;
  --rule-soft:  #231c14;
  --accent:     #d87944;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-variation-settings: var(--vf-sans);
  font-feature-settings: "ss01", "ss02", "calt", "kern";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.006em;
  line-height: 1.5;
  position: relative;
  isolation: isolate;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

/* ---------- Ambient background texture ----------
   Pattern-less, blend-mode-less "atmosphere" behind all content:
     1. Warm corner wash — soft amber bloom in the upper-left, like late
        afternoon light catching a page.
     2. Vignette — gentle edge darkening (anchored to the viewport) that
        adds depth without any visible artifact.
   Both render on body::before at z-index: -1 so they can only ever paint
   on top of the paper color — never text or images. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 10%,
      color-mix(in oklab, var(--accent) 6%, transparent),
      transparent 55%),
    radial-gradient(ellipse 120% 90% at 50% 50%,
      transparent 55%,
      rgba(0, 0, 0, 0.07) 100%);
}
:root[data-theme="dark"] body::before {
  background:
    radial-gradient(circle at 12% 10%,
      color-mix(in oklab, var(--accent) 5%, transparent),
      transparent 55%),
    radial-gradient(ellipse 120% 90% at 50% 50%,
      transparent 55%,
      rgba(0, 0, 0, 0.35) 100%);
}

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

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

a { color: inherit; text-decoration: none; }
a.link {
  position: relative;
  padding-bottom: 1px;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.3s var(--ease), opacity 0.2s var(--ease);
}
a.link:hover { background-size: 0 1px; background-position: 100% 100%; opacity: 0.7; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

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

/* ---------- Wrap ---------- */
.wrap      { max-width: var(--wrap);      margin-inline: auto; padding-inline: var(--gutter); }
.wrap-wide { max-width: var(--wrap-wide); margin-inline: auto; padding-inline: var(--gutter); }

/* Skip link */
.skip { position: absolute; left: -9999px; top: 0; padding: 10px 14px; background: var(--ink); color: var(--paper); z-index: 100; }
.skip:focus { left: 12px; top: 12px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  padding: 18px 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
  transition:
    padding 0.35s var(--ease),
    background-color 0.35s var(--ease),
    backdrop-filter 0.35s var(--ease),
    border-color 0.35s var(--ease);
}
.nav.is-scrolled {
  padding: 12px 0;
  background: color-mix(in oklab, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border-bottom-color: var(--rule);
}
.nav .row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 32px;
}
.nav .mark {
  font-variation-settings: var(--vf-serif);
  font-size: 16px; letter-spacing: -0.01em;
}
.nav .mark em { font-style: normal; color: var(--ink-muted); font-variation-settings: var(--vf-italic); }
.nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 28px; justify-content: center;
  font-size: 13px; letter-spacing: 0.01em;
  color: var(--ink-muted);
}
.nav ul a[aria-current="page"] { color: var(--ink); }
.nav .tools { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--ink-muted); }
.nav .now { font-variation-settings: var(--vf-sans); font-feature-settings: "tnum"; }
.nav .theme-toggle {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-muted);
  transition: color 0.2s, border-color 0.2s;
}
.nav .theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
@media (max-width: 720px) {
  .nav .row { grid-template-columns: 1fr auto; gap: 16px; }
  .nav nav[aria-label="Primary"] { display: none; }
  .nav ul { display: none; } /* fallback */
}

/* ---------- Hero (intimate scale, à la daniela-rivas) ---------- */
.hero {
  padding-block: clamp(64px, 10vw, 140px) clamp(48px, 7vw, 96px);
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: var(--fs-eyebrow); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-subt); margin-bottom: 28px;
}
.hero .eyebrow .dot { width: 6px; height: 6px; border-radius: 999px; background: #3fa17a; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:.6;transform:scale(1)} 50%{opacity:1;transform:scale(1.2)} }

.hero h1 {
  max-width: 28ch;
  margin: 0 0 var(--space-6);
  font-size: var(--fs-hero);
  line-height: 1.35;
  letter-spacing: -0.012em;
  font-variation-settings: var(--vf-serif);
}
.hero h1 em {
  font-style: normal;
  font-variation-settings: var(--vf-italic);
  color: var(--ink-muted);
}
@media (max-width: 480px) {
  .hero h1 { max-width: 100%; letter-spacing: -0.006em; }
}
.hero .intro-meta {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px;
  margin-top: var(--space-7);
  max-width: 780px;
  font-size: 13.5px; color: var(--ink-muted);
}
.hero .intro-meta dt { color: var(--ink-subt); font-size: var(--fs-eyebrow); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 6px; }
.hero .intro-meta dd { margin: 0 0 16px; color: var(--ink); }
.hero .intro-meta a { color: var(--ink); }
@media (max-width: 640px) {
  .hero .intro-meta { grid-template-columns: 1fr; gap: 20px; }
}

/* ---------- Section primitives ---------- */
.section {
  padding-block: clamp(56px, 8vw, 112px);
  border-top: 1px solid var(--rule);
}
.section-head {
  display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 40px;
  align-items: baseline;
  margin-bottom: var(--space-8);
}
.section-head .label {
  font-size: var(--fs-eyebrow); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-subt);
}
.section-head h2 {
  margin: 0;
  font-size: var(--fs-h2);
  line-height: 1.05;
  letter-spacing: -0.022em;
  font-variation-settings: var(--vf-serif);
}
.section-head h2 em { font-style: normal; font-variation-settings: var(--vf-italic); color: var(--ink-muted); }
@media (max-width: 720px) {
  .section-head { grid-template-columns: 1fr; gap: 12px; margin-bottom: var(--space-6); }
}

/* ---------- Selected Work — horizontal carousel ---------- */
.work-carousel {
  position: relative;
  isolation: isolate; /* contain edge-blur stacking */
}
.work-row {
  --gap: clamp(14px, 1.5vw, 22px);
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 8px;
}
@media (prefers-reduced-motion: reduce) {
  .work-row { scroll-behavior: auto; }
}
.work-row::-webkit-scrollbar { display: none; }
.work-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Carousel arrow nav — lives between section-head and the row. */
.carousel-nav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: calc(-1 * var(--space-6)) 0 var(--space-5);
}
@media (max-width: 720px) {
  .carousel-nav { margin-top: 0; }
}
.carousel-btn {
  width: 42px; height: 42px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  color: var(--ink);
  cursor: pointer;
  transition:
    background 0.25s var(--ease),
    color 0.25s var(--ease),
    border-color 0.25s var(--ease),
    transform 0.25s var(--ease),
    opacity 0.25s var(--ease);
}
.carousel-btn svg { display: block; }
.carousel-btn:hover:not(:disabled) {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.carousel-btn:active:not(:disabled) { transform: scale(0.96); }
.carousel-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.carousel-btn:disabled,
.carousel-btn[aria-disabled="true"] {
  opacity: 0.3;
  cursor: not-allowed;
}

.work-card {
  display: block; text-decoration: none; color: inherit;
  flex: 0 0 calc((100% - 3 * var(--gap)) / 3.2);
  scroll-snap-align: start;
  transition: transform 0.4s var(--ease);
}
@media (max-width: 960px) {
  .work-card { flex-basis: calc((100% - 2 * var(--gap)) / 2.2); }
}
@media (max-width: 520px) {
  .work-card { flex-basis: calc((100% - 1 * var(--gap)) / 1.15); }
}
.work-card:hover { transform: translateY(-2px); }

.work-card .visual {
  aspect-ratio: 4 / 5;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.4vw, 30px);
  transition: border-color 0.3s, background-color 0.3s;
}
.work-card:hover .visual { border-color: var(--ink-muted); }
.work-card .visual::before {
  content: "";
  position: absolute; inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 18%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 55%),
    radial-gradient(circle at 85% 95%, color-mix(in oklab, var(--ink) 5%, transparent), transparent 55%);
  opacity: 0.9;
  transition: opacity 0.4s var(--ease);
}
.work-card:hover .visual::before { opacity: 1; }

.work-card .visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
  opacity: 0.14;
  mix-blend-mode: overlay;
}
:root[data-theme="dark"] .work-card .visual::after {
  opacity: 0.08;
  mix-blend-mode: soft-light;
}

.work-card .visual > * { position: relative; z-index: 1; }

.work-card .visual .num {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-subt);
  text-transform: uppercase;
}

.work-card .card-copy {
  margin-top: auto;
  padding-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.work-card .card-copy .eyebrow {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-variation-settings: var(--vf-sans);
  padding: 0;
  margin: 0;
  background: none;
}
.work-card .card-title {
  margin: 0;
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.018em;
  font-variation-settings: var(--vf-serif);
  color: var(--ink);
  font-weight: 400;
}
.work-card .card-title em {
  font-style: normal;
  font-variation-settings: var(--vf-italic);
  color: var(--ink-muted);
}
.work-card .card-sub {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-muted);
  max-width: 28ch;
}

.work-card .card-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--rule-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.work-card .card-foot .year {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-subt);
}
.work-card .card-foot .arrow {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink);
  transition: transform 0.35s var(--ease), background 0.25s, border-color 0.25s, color 0.25s;
}
.work-card:hover .card-foot .arrow {
  transform: translate(2px, -2px);
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* ---------- About preview ---------- */
.about-preview {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 64px; align-items: start;
}
@media (max-width: 820px) { .about-preview { grid-template-columns: 1fr; gap: 28px; } }
.about-preview p {
  margin: 0 0 18px;
  max-width: 58ch;
  font-size: var(--fs-body);
  line-height: 1.6;
}
.about-preview p em {
  font-style: normal;
  font-variation-settings: var(--vf-italic);
  color: var(--ink-muted);
}
.about-preview .lede {
  font-size: var(--fs-lead);
  line-height: 1.4;
  letter-spacing: -0.012em;
  font-variation-settings: var(--vf-serif);
  color: var(--ink);
}

/* ---------- Skills pills ---------- */
.pills-group { display: grid; gap: 28px; }
.pills-group h4 {
  margin: 0 0 12px;
  font-size: var(--fs-eyebrow); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-subt);
  font-variation-settings: var(--vf-sans);
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink);
  background: color-mix(in oklab, var(--paper-2) 40%, transparent);
  transition: background 0.2s, border-color 0.2s;
}
.pill:hover { border-color: var(--ink); }

/* ---------- Contact ---------- */
.contact {
  text-align: center;
  padding: clamp(72px, 12vw, 160px) 0 clamp(56px, 8vw, 112px);
  border-top: 1px solid var(--rule);
}
.contact .eyebrow {
  font-size: var(--fs-eyebrow); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-subt); margin-bottom: 24px;
}
.contact h2 {
  margin: 0 0 20px;
  font-size: var(--fs-h1);
  line-height: 1;
  letter-spacing: -0.025em;
  font-variation-settings: var(--vf-serif);
}
.contact h2 em { font-style: normal; font-variation-settings: var(--vf-italic); color: var(--ink-muted); }
.contact .email {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: var(--fs-lead);
  color: var(--ink-muted);
  padding: 10px 20px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  margin-top: 14px;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.contact .email:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--rule);
  padding: 28px 0 40px;
  font-size: 12px;
  color: var(--ink-muted);
}
.foot .row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 20px; flex-wrap: wrap;
}
.foot .locale { font-feature-settings: "tnum"; }

/* ---------- Case study page ---------- */
.cs-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  padding-top: clamp(32px, 5vw, 72px);
  padding-bottom: clamp(64px, 8vw, 120px);
}
@media (max-width: 900px) { .cs-layout { grid-template-columns: 1fr; gap: 32px; } }

.cs-aside {
  position: sticky; top: 100px; align-self: start;
  padding-bottom: 40px;
}
.cs-aside .back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-muted); margin-bottom: 32px;
}
.cs-aside .back:hover { color: var(--ink); }
.cs-aside h1 {
  margin: 0 0 16px;
  font-size: clamp(1.8rem, 1.5rem + 0.8vw, 2.3rem);
  line-height: 1.08;
  letter-spacing: -0.018em;
  font-variation-settings: var(--vf-serif);
}
.cs-aside h1 em { font-style: normal; font-variation-settings: var(--vf-italic); color: var(--ink-muted); }
.cs-aside .tagline {
  color: var(--ink-muted);
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0 0 28px;
  max-width: 38ch;
}
.cs-aside .meta {
  display: grid; row-gap: 14px;
  margin: 0 0 28px;
  font-size: 13px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.cs-aside .meta dt { color: var(--ink-subt); font-size: var(--fs-eyebrow); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 2px; }
.cs-aside .meta dd { margin: 0; color: var(--ink); }

.cs-aside .cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 13px;
  transition: background 0.2s, color 0.2s;
}
.cs-aside .cta:hover { background: var(--ink); color: var(--paper); }

/* Mobile: un-stick the aside so it stacks above the main column cleanly */
@media (max-width: 900px) {
  .cs-aside { position: static; top: auto; padding-bottom: 0; }
  .cs-main  { padding-top: 8px; }
}

/* main column */
.cs-main > * + * { margin-top: clamp(40px, 5vw, 72px); }
.cs-main .hero-figure {
  aspect-ratio: 16 / 10;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.cs-main .hero-figure::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 40%, color-mix(in oklab, var(--accent) 12%, transparent), transparent 50%),
    radial-gradient(circle at 70% 60%, color-mix(in oklab, var(--ink) 8%, transparent), transparent 45%),
    repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in oklab, var(--ink) 2%, transparent) 14px 15px);
}
/* When an image is present, the container becomes a padded "platter" — the
   colorful blur + diagonal stripes live behind the image, paper shows in the gap. */
.cs-main .hero-figure:has(img) {
  aspect-ratio: auto;
  padding: clamp(20px, 5%, 56px);
}
.cs-main .hero-figure > img {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
  background: var(--paper);
  border-radius: 4px;
}
/* Opt-out: same treatment as .frame--bare — for hero images that already carry
   their own chrome (browser window, app frame). Skip the paper fill + radius. */
.cs-main .hero-figure.hero-figure--bare > img {
  background: transparent;
  border-radius: 0;
}

.cs-section {
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.cs-section h2 {
  margin: 0 0 24px;
  font-size: var(--fs-h3);
  line-height: 1.15;
  letter-spacing: -0.012em;
  font-variation-settings: var(--vf-serif);
  color: var(--ink);
}
.cs-section h2 em { font-style: normal; font-variation-settings: var(--vf-italic); color: var(--ink-muted); }
.cs-section p {
  font-size: var(--fs-body);
  line-height: 1.6;
  max-width: 62ch;
  margin: 0 0 18px;
  color: var(--ink);
}
.cs-section p em { font-style: normal; font-variation-settings: var(--vf-italic); color: var(--ink-muted); }
.cs-section ul { font-size: var(--fs-body); line-height: 1.6; max-width: 62ch; padding-left: 1.1em; }
.cs-section ul li { margin-bottom: 8px; }

.figure {
  margin: 36px 0;
  display: block;
}
.figure .frame {
  aspect-ratio: 16 / 10;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.figure .frame::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 40%, color-mix(in oklab, var(--accent) 12%, transparent), transparent 50%),
    radial-gradient(circle at 70% 60%, color-mix(in oklab, var(--ink) 8%, transparent), transparent 45%),
    repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in oklab, var(--ink) 2%, transparent) 14px 15px);
}
/* When an image is present, the frame becomes a padded "platter" — the
   colorful blur + diagonal stripes sit behind the image, paper shows in the gap. */
.figure .frame:has(img) {
  aspect-ratio: auto;
  padding: clamp(20px, 5%, 56px);
}
.figure .frame > img {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
  background: var(--paper);
  border-radius: 4px;
}
/* Opt-out: for images that already carry their own container/chrome (e.g. a
   browser mockup screenshot) — skip the paper fill so the platter pattern is
   the only secondary surface. */
.figure .frame.frame--bare > img {
  background: transparent;
  border-radius: 0;
}

/* Swap-on-hover: crossfade between two images stacked inside the same platter.
   Applied as `.frame--swap` (figure) or `.hero-figure--swap` (hero). The second
   image is absolute-positioned over the first inside the padded platter area;
   opacity ramps up on hover. Respects `.frame--bare` — no paper fill, no radius. */
.figure .frame.frame--swap,
.cs-main .hero-figure.hero-figure--swap {
  cursor: pointer;
}
.figure .frame.frame--swap .swap-stack,
.cs-main .hero-figure.hero-figure--swap .swap-stack {
  position: relative;
  z-index: 1;
  display: block;
  line-height: 0;
}
.figure .frame.frame--swap .swap-stack > img,
.cs-main .hero-figure.hero-figure--swap .swap-stack > img {
  display: block;
  width: 100%;
  height: auto;
}
.figure .frame.frame--swap .swap-stack > img.swap-b,
.cs-main .hero-figure.hero-figure--swap .swap-stack > img.swap-b {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.55s var(--ease, ease);
}
.figure .frame.frame--swap:hover .swap-stack > img.swap-b,
.cs-main .hero-figure.hero-figure--swap:hover .swap-stack > img.swap-b,
.figure .frame.frame--swap:focus-within .swap-stack > img.swap-b,
.cs-main .hero-figure.hero-figure--swap:focus-within .swap-stack > img.swap-b {
  opacity: 1;
}
.figure .frame.frame--swap .swap-hint,
.cs-main .hero-figure.hero-figure--swap .swap-hint {
  position: absolute;
  right: clamp(12px, 2%, 24px);
  bottom: clamp(12px, 2%, 24px);
  z-index: 2;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 6px 10px;
  font-variation-settings: var(--vf-sans);
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}
.figure .frame.frame--swap:hover .swap-hint,
.cs-main .hero-figure.hero-figure--swap:hover .swap-hint { opacity: 0; }

/* Concept carousel — three images, one platter. Slides stack via CSS grid so
   the platter's height is set by whichever image is tallest. Dots are
   overlaid at the bottom-center; JS swaps the [data-active] attribute. */
.figure .frame.concept-carousel {
  position: relative;
}
.concept-carousel .concept-slides {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-areas: "slide";
}
.concept-carousel .concept-slides > img {
  grid-area: slide;
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.45s var(--ease, ease);
  pointer-events: none;
}
.concept-carousel .concept-slides > img[data-active] {
  opacity: 1;
  pointer-events: auto;
}
.concept-carousel .concept-dots {
  position: absolute;
  left: 0; right: 0;
  bottom: clamp(10px, 1.6%, 20px);
  z-index: 2;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}
.concept-carousel .concept-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: transparent;
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s, transform 0.2s;
}
.concept-carousel .concept-dot:hover { opacity: 0.85; }
.concept-carousel .concept-dot.is-active {
  background: var(--ink);
  opacity: 1;
}
.concept-carousel .concept-dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Phases — three compact blocks that live inside a cs-section. Each block
   pairs a phase label (kicker) with a short paragraph and 2–3 highlights. */
.cs-section .phases {
  display: grid;
  gap: clamp(24px, 3vw, 36px);
  margin: 8px 0 0;
}
.cs-section .phase {
  padding-top: 18px;
  border-top: 1px solid var(--rule-soft, var(--rule));
}
.cs-section .phase:first-child {
  padding-top: 0;
  border-top: 0;
}
.cs-section .phase .phase-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  margin: 0 0 10px;
}
.cs-section .phase .phase-num {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-subt);
  font-variation-settings: var(--vf-sans);
}
.cs-section .phase .phase-name {
  margin: 0;
  font-size: clamp(20px, 1.6vw, 24px);
  line-height: 1.15;
  letter-spacing: -0.012em;
  font-variation-settings: var(--vf-serif);
  color: var(--ink);
  font-weight: 400;
}
.cs-section .phase .phase-name em {
  font-style: normal;
  font-variation-settings: var(--vf-italic);
  color: var(--ink-muted);
}
.cs-section .phase .phase-status {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-variation-settings: var(--vf-sans);
}
.cs-section .phase p {
  margin: 0 0 10px;
  max-width: 62ch;
}
.cs-section .phase ul {
  margin: 10px 0 0;
  padding-left: 1.1em;
  max-width: 62ch;
}

/* Two-up figure — mobile mocks side-by-side on a single shared platter */
.figure--pair .pair-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 3%, 40px);
  align-items: start;
  position: relative;
  z-index: 1;
}
.figure--pair .frame--pair {
  aspect-ratio: auto;
  padding: clamp(20px, 5%, 56px);
}
.figure--pair .frame--pair .pair-grid > img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--paper);
  border-radius: 4px;
}
@media (max-width: 640px) {
  .figure--pair .pair-grid { grid-template-columns: 1fr; }
}
.figure figcaption {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ink-subt);
  font-variation-settings: var(--vf-italic);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  border-top: 1px solid var(--rule);
  padding-top: 32px;
  margin-top: 40px;
}
@media (max-width: 780px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } }
.stat .n {
  font-size: clamp(2rem, 1.5rem + 1.6vw, 3rem);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variation-settings: var(--vf-serif);
}
.stat .l {
  margin-top: 8px;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-subt);
  max-width: 24ch;
}

/* Three-up variant */
.stats.stats--three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 780px) { .stats.stats--three { grid-template-columns: 1fr; } }

/* KPI — from → to progression */
.stat .n .n-from {
  color: var(--ink-muted);
  font-variation-settings: var(--vf-italic);
  margin-right: 0.18em;
}
.stat .n .n-arrow {
  display: inline-block;
  font-size: 0.58em;
  color: var(--ink-subt);
  margin: 0 0.14em;
  transform: translateY(-0.18em);
  font-variation-settings: var(--vf-sans);
}
.stat .n .n-to { letter-spacing: -0.02em; }

/* KPI — unit / denominator suffix (e.g., 18/6) */
.stat .n .n-unit {
  font-size: 0.56em;
  color: var(--ink-subt);
  font-variation-settings: var(--vf-italic);
  margin-left: 0.04em;
  letter-spacing: 0;
}

.next-case {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 32px; border-top: 1px solid var(--rule);
  margin-top: 56px;
  font-size: 14px; color: var(--ink-muted);
}
.next-case .label { font-size: var(--fs-eyebrow); letter-spacing: 0.18em; text-transform: uppercase; }
.next-case .title {
  font-variation-settings: var(--vf-serif);
  font-size: var(--fs-h3);
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* ---------- About page ---------- */
.about-page {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  padding: clamp(32px, 5vw, 72px) 0 clamp(64px, 8vw, 120px);
}
@media (max-width: 900px) { .about-page { grid-template-columns: 1fr; gap: 32px; } }
.about-page aside { position: sticky; top: 100px; align-self: start; }

/* Mobile: un-stick the aside so it stacks above the body cleanly and the
   page content can't scroll over the portrait/heading. Mirrors the
   .cs-aside mobile override above. */
@media (max-width: 900px) {
  .about-page aside { position: static; top: auto; }
  .about-body { padding-top: 8px; }
}
.about-page aside .label { font-size: var(--fs-eyebrow); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-subt); }

.about-page .portrait {
  display: block;
  margin: 14px 0 0;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  position: relative;
  isolation: isolate;
}
.about-page .portrait img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  /* Subtle brown/sepia tint — warms up B&W source imagery so it sits inside
     the warm paper palette instead of reading as cold gray. */
  filter: sepia(0.55) saturate(1.25) hue-rotate(-8deg) brightness(0.97) contrast(1.02);
}
:root[data-theme="dark"] .about-page .portrait img {
  filter: sepia(0.45) saturate(1.15) hue-rotate(-8deg) brightness(0.82) contrast(1.05);
}

.about-page .aside-links {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  line-height: 1.4;
}
.about-page .aside-links .link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 3px;
  transition: color 0.2s, border-color 0.2s;
  width: fit-content;
  max-width: 100%;
  word-break: break-word;
}
.about-page .aside-links .link:hover { color: var(--accent); border-bottom-color: var(--accent); }

.about-page aside h1 {
  margin: 8px 0 0;
  font-size: var(--fs-h1);
  line-height: 1;
  letter-spacing: -0.025em;
  font-variation-settings: var(--vf-serif);
}
.about-page aside h1 em { font-style: normal; font-variation-settings: var(--vf-italic); color: var(--ink-muted); }

.about-body .lede {
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.55rem);
  line-height: 1.35;
  letter-spacing: -0.014em;
  font-variation-settings: var(--vf-serif);
  max-width: 42ch;
  margin: 0 0 48px;
}
.about-body p {
  font-size: var(--fs-body);
  line-height: 1.65;
  margin: 0 0 20px;
  max-width: 62ch;
}
.about-body p em { font-style: normal; font-variation-settings: var(--vf-italic); color: var(--ink-muted); }
.about-body h3 {
  margin: 48px 0 16px;
  font-size: var(--fs-h3);
  line-height: 1.15;
  font-variation-settings: var(--vf-serif);
  letter-spacing: -0.014em;
}
.about-body h3 em { font-style: normal; font-variation-settings: var(--vf-italic); color: var(--ink-muted); }

.exp {
  display: grid; gap: 0;
  margin-top: 20px;
  border-top: 1px solid var(--rule);
}
.exp-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 14px;
}
.exp-row .years { color: var(--ink-subt); font-feature-settings: "tnum"; white-space: nowrap; }
.exp-row .company { font-variation-settings: var(--vf-serif); font-size: 15.5px; letter-spacing: -0.005em; }
.exp-row .exp-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.exp-row .exp-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px;
}
.exp-row .role {
  color: var(--ink-muted);
  white-space: nowrap;
  font-size: 13.5px;
}
.exp-row .exp-desc {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13.5px;
  line-height: 1.55;
  max-width: 64ch;
}
.exp-row .exp-desc em { font-style: normal; font-variation-settings: var(--vf-italic); }
@media (max-width: 780px) {
  .exp-row { grid-template-columns: 1fr; gap: 10px; }
  .exp-row .exp-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .exp-row .role { white-space: normal; }
}

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Grain overlay was removed — left this block as a no-op marker so the legacy
   .grain divs in the page source don't render anything. */
.grain { display: none; }

/* ---------- Progressive bottom blur ----------
   Eight fixed layers, backdrop-filter blur doubles each step
   (0.078125 → 10px), each revealed only inside a narrow window via
   mask-image. Overlapping windows produce a smooth ramp. Strip is
   100px tall, pure blur — no color wash.
   (Spec reverse-engineered from daniela-rivas.com.) */
.page-blur {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 100px;
  pointer-events: none;
  z-index: 8;
}
.page-blur > span {
  position: absolute;
  inset: 0;
  display: block;
}
.page-blur .b1 {
  backdrop-filter: blur(0.078125px); -webkit-backdrop-filter: blur(0.078125px);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 12.5%, #000 25%, transparent 37.5%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 12.5%, #000 25%, transparent 37.5%);
}
.page-blur .b2 {
  backdrop-filter: blur(0.15625px); -webkit-backdrop-filter: blur(0.15625px);
  mask-image: linear-gradient(to bottom, transparent 12.5%, #000 25%, #000 37.5%, transparent 50%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 12.5%, #000 25%, #000 37.5%, transparent 50%);
}
.page-blur .b3 {
  backdrop-filter: blur(0.3125px); -webkit-backdrop-filter: blur(0.3125px);
  mask-image: linear-gradient(to bottom, transparent 25%, #000 37.5%, #000 50%, transparent 62.5%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 25%, #000 37.5%, #000 50%, transparent 62.5%);
}
.page-blur .b4 {
  backdrop-filter: blur(0.625px); -webkit-backdrop-filter: blur(0.625px);
  mask-image: linear-gradient(to bottom, transparent 37.5%, #000 50%, #000 62.5%, transparent 75%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 37.5%, #000 50%, #000 62.5%, transparent 75%);
}
.page-blur .b5 {
  backdrop-filter: blur(1.25px); -webkit-backdrop-filter: blur(1.25px);
  mask-image: linear-gradient(to bottom, transparent 50%, #000 62.5%, #000 75%, transparent 87.5%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 50%, #000 62.5%, #000 75%, transparent 87.5%);
}
.page-blur .b6 {
  backdrop-filter: blur(2.5px); -webkit-backdrop-filter: blur(2.5px);
  mask-image: linear-gradient(to bottom, transparent 62.5%, #000 75%, #000 87.5%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 62.5%, #000 75%, #000 87.5%, transparent 100%);
}
.page-blur .b7 {
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  mask-image: linear-gradient(to bottom, transparent 75%, #000 87.5%, #000 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 75%, #000 87.5%, #000 100%);
}
.page-blur .b8 {
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  mask-image: linear-gradient(to bottom, transparent 87.5%, #000 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 87.5%, #000 100%);
}
/* Firefox fallback: without backdrop-filter, hide the strip entirely rather
   than paint a fake wash — matches the source's intent (blur or nothing). */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .page-blur { display: none; }
}

/* ---------- Utility ---------- */
.italic { font-variation-settings: var(--vf-italic); font-style: normal; color: var(--ink-muted); }
.muted { color: var(--ink-muted); }
.rule { height: 1px; background: var(--rule); margin: clamp(40px, 6vw, 80px) 0; border: 0; }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }

/* Arrow glyph helper */
.arrow-glyph { display: inline-block; transform: translateY(-1px); }
