/* ==========================================================================
   Gayathri Das portfolio: design system
   One file for every page. Page-specific CSS goes in css/<page>.css.
   Builders: do not edit this file. See BUILD-NOTES.md.
   Shared components added after the design review: phone rows (.phones),
   device frames, small pull quote, project-coloured frame labels.

   Contents
   1. Tokens
   2. Base and reset
   3. Layout: wrap, grid, sections
   4. Type
   5. Header and footer
   6. Buttons and links
   7. Metadata table and data table
   8. Cover tiles and shelf
   9. Home: hero, services, about, experience, contact
   10. Case study: hero, sections, callout, pull quote
   11. Figures and captions
   12. Swimlane diagram
   13. Next-project footer
   14. Utilities, motion, print
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
/* THEME (v9). The site has two lights, switched by the lamp: morning (the default) and evening
   (data-room="evening" on <html>, set before the first paint by the head snippet on every page,
   kept in localStorage under "gd-room"; js/motion.js part 7b does the switching).
   Every colour that changes with the light is one of the tokens below. Use them, never a literal:

     token          what it is                                   morning              evening
     --paper        the page                                     #e8e6e1              #2f2a25
     --paper-home   the page on index.html (.landing --paper)    #e3e1dc              #2f2a25
     --paper-2      wells, sunk areas, table stripes             #dfdcd5              #27231f
     --surface      a panel lying on the page                    #f4f3f0              #3a332d
     --raised       a panel above that (dialog, cards, sheets)   #f4f2ed              #433b34
     --ink          text, strong rules                           #141414              #f3ecdf
     --ink-2        muted text                                   #47443f              #d6ccbc
     --ink-3        small grey labels, captions                  #5d5951              #bdb2a1
     --rule         hairlines                                    #c2beb5              #534a41
     --signal       the orange accent (marks, dots; not text)    #d4400f              #ff7a3d
     --focus        focus ring                                   #d4400f              #ff9a5c
     --shadow       colour of object shadows                     rgb(45 34 20)        rgb(8 5 2)
     --scrim        behind a dialog                              rgb(18 17 15 / .56)  rgb(10 8 6 / .68)
     --hover        hover wash on a quiet button                 rgb(20 20 20 / .07)  rgb(243 236 223 / .1)
     --glare        brightness of her work (a number)            1                    0.92
     --shadow-object, --shadow-lift   ready-made object shadows, deeper in the evening

   --shadow is used through color-mix: color-mix(in srgb, var(--shadow) 34%, transparent).
   --glare is used as filter: brightness(var(--glare)) on real screens, covers and photos, so a
   white screen does not glare in the dark room. Nothing else is ever done to her images.
   Contrast in the evening: ink 12.1:1 on paper and 9.3:1 on raised; ink-2 8.9:1 and 6.9:1;
   ink-3 6.8:1 on paper, 5.9:1 on surface, 5.2:1 on raised; signal 5.5:1 on paper.
   The tokens are registered with @property, so they can fade: the script puts .room-switching
   on <html> for half a second when the visitor switches (never on load), and only then do the
   tokens have a transition. Nothing else needs a colour transition of its own.
   To style a block for the evening: use the tokens and it follows by itself. Only where a block
   needs something the tokens cannot say, add a rule that starts with html[data-room="evening"]. */
@property --paper { syntax: '<color>'; inherits: true; initial-value: #e8e6e1; }
@property --paper-home { syntax: '<color>'; inherits: true; initial-value: #e3e1dc; }
@property --paper-2 { syntax: '<color>'; inherits: true; initial-value: #dfdcd5; }
@property --surface { syntax: '<color>'; inherits: true; initial-value: #f4f3f0; }
@property --raised { syntax: '<color>'; inherits: true; initial-value: #f4f2ed; }
@property --ink { syntax: '<color>'; inherits: true; initial-value: #141414; }
@property --ink-2 { syntax: '<color>'; inherits: true; initial-value: #47443f; }
@property --ink-3 { syntax: '<color>'; inherits: true; initial-value: #5d5951; }
@property --rule { syntax: '<color>'; inherits: true; initial-value: #c2beb5; }
@property --signal { syntax: '<color>'; inherits: true; initial-value: #d4400f; }
@property --focus { syntax: '<color>'; inherits: true; initial-value: #d4400f; }
@property --shadow { syntax: '<color>'; inherits: true; initial-value: rgb(45 34 20); }
@property --scrim { syntax: '<color>'; inherits: true; initial-value: rgb(18 17 15 / 0.56); }
@property --hover { syntax: '<color>'; inherits: true; initial-value: rgb(20 20 20 / 0.07); }
@property --glare { syntax: '<number>'; inherits: true; initial-value: 1; }

:root {
  color-scheme: light;       /* the lamp decides, not the system setting */
  /* Page */
  --paper: #e8e6e1;          /* warm light grey page */
  --paper-home: #e3e1dc;     /* index.html: a shade deeper so objects lift off it */
  --paper-2: #dfdcd5;        /* wells, table stripes */
  --surface: #f4f3f0;        /* raised panels */
  --raised: #f4f2ed;         /* the dialog panel, cards above the page */
  --ink: #141414;            /* text, strong rules (16.3:1 on paper) */
  --ink-2: #47443f;          /* secondary text (8.4:1 on paper) */
  --ink-3: #5d5951;          /* micro labels, captions (5.3:1 on the #e3e1dc page) */
  --rule: #c2beb5;           /* hairlines and grid lines */
  --rule-strong: var(--ink);
  --signal: #d4400f;         /* non-text only: status dot, focus ring, hover marks */
  --focus: #d4400f;
  --shadow: rgb(45 34 20);
  --scrim: rgb(18 17 15 / 0.56);
  --hover: rgb(20 20 20 / 0.07);
  --glare: 1;

  /* Project colours (cover tiles, figure frames) */
  --yantra-bg: #ffffff;
  --yantra-tint: #eef5ff;
  --yantra-ink: #0757c9;     /* 6.2:1 on white */
  --navibus-bg: #1f1f36;     /* her board navy, sampled */
  --navibus-ink: #2fd0d6;    /* teal, 8.8:1 on navy */
  --pillpal-bg: #2f1f2b;     /* her board plum, sampled from the crops */
  --pillpal-ink: #f0c6e6;    /* 10.6:1 on plum */
  --keep-bg: #f2b8cf;        /* Keep pink, light, so it reads apart from PillPal's plum */
  --keep-ink: #5a1638;       /* 7.8:1 on pink */

  /* Type (v3): ONE neutral grotesk for everything. Bold 700 in sentence case with tight
     tracking for anything big; 450 to 500 for small text. No condensed uppercase, no mono.
     The three family tokens are kept as aliases so older rules keep working. */
  --font-sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: var(--font-sans);
  --font-body: var(--font-sans);
  --font-mono: var(--font-sans);
  --w-text: 450;             /* running text */
  --w-mid: 500;              /* nav, labels, small emphasis */
  --w-bold: 700;             /* every heading and the name */
  --track-display: -0.05em;  /* the name, band, email, case titles */
  --track-head: -0.035em;    /* h2, h3, dialog and stage titles */

  --text-micro: 0.75rem;     /* 12px: grey micro labels (uppercase, +0.04em). Nothing on the site is smaller. */
  --text-xs: 0.75rem;        /* 12px: nav, controls */
  --text-sm: 0.84375rem;     /* 13.5px: captions, small body */
  --text-base: 0.9375rem;    /* 15px: body in dialogs and the closing block */
  --text-lede: 1rem;         /* 16px: the one-line introductions */

  --step--2: var(--text-micro);
  --step--1: var(--text-micro);
  --step-0: clamp(1rem, 0.97rem + 0.12vw, 1.0625rem);   /* 16 to 17px: long-form body on case pages */
  --step-1: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);    /* lede on case pages */
  --step-2: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);     /* h3 */
  --step-3: clamp(1.75rem, 1.3rem + 1.9vw, 2.75rem);    /* h2 */
  --step-4: clamp(2.5rem, 1.6rem + 4.4vw, 5rem);        /* large title */
  --step-display: clamp(3.4rem, 11.6vw, 14.5rem);         /* the name and the type band */

  --measure: 38rem;          /* about 68 characters of body text */

  /* Space */
  --gutter: clamp(16px, 4vw, 48px);
  --gap: clamp(12px, 1.6vw, 24px);
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: clamp(3rem, 2rem + 4vw, 6rem);
  --space-6: clamp(4.5rem, 3rem + 6vw, 9rem);
  --max: 1360px;

  --radius: 4px;
  --shadow-object: 0 1px 0 rgb(0 0 0 / 0.06), 0 22px 36px -22px rgb(20 20 20 / 0.55);
  --shadow-lift: 0 2px 0 rgb(0 0 0 / 0.05), 0 34px 44px -24px rgb(20 20 20 / 0.6);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* Evening: the same room by lamplight. Warm dark browns, cream ink; never black, never blue. */
html[data-room="evening"] {
  color-scheme: dark;
  scrollbar-color: #6e645a #2f2a25;       /* a warm scrollbar, not the system's cold grey */
  --paper: #2f2a25;
  --paper-home: #2f2a25;
  --paper-2: #27231f;
  --surface: #3a332d;
  --raised: #433b34;
  --ink: #f3ecdf;
  --ink-2: #d6ccbc;
  --ink-3: #bdb2a1;
  --rule: #534a41;
  --signal: #ff7a3d;
  --focus: #ff9a5c;
  --shadow: rgb(8 5 2);
  --scrim: rgb(10 8 6 / 0.68);
  --hover: rgb(243 236 223 / 0.1);
  --glare: 0.92;
  --shadow-object: 0 1px 0 rgb(0 0 0 / 0.2), 0 22px 36px -22px rgb(8 5 2 / 0.8);
  --shadow-lift: 0 2px 0 rgb(0 0 0 / 0.2), 0 34px 44px -24px rgb(8 5 2 / 0.85);
}
/* The switch fades: only while the script says the visitor has just switched */
html.room-switching {
  transition: --paper 0.45s ease, --paper-home 0.45s ease, --paper-2 0.45s ease, --surface 0.45s ease, --raised 0.45s ease,
    --ink 0.45s ease, --ink-2 0.45s ease, --ink-3 0.45s ease, --rule 0.45s ease, --signal 0.45s ease, --focus 0.45s ease,
    --shadow 0.45s ease, --scrim 0.45s ease, --hover 0.45s ease, --glare 0.45s ease;
}
@media (prefers-reduced-motion: reduce) { html.room-switching { transition: none; } }
/* Elements with a colour transition of their own would trail behind the fading tokens */
html.room-switching :is(.button, .xp__tab, .shelf-card, .closing__foot a) { transition-property: transform; }
/* Where the browser can, the whole page cross-fades as one picture (js/motion.js starts a view
   transition with .room-fade on <html>), so shadows, drawn objects and dimmed screens change in
   step with the tokens. These override the page-to-page animation in css/motion.css. */
@keyframes room-out { to { opacity: 0; } }
@keyframes room-in { from { opacity: 0; } }
html.room-fade::view-transition-old(root) { animation: room-out 0.45s ease both; }
html.room-fade::view-transition-new(root) { animation: room-in 0.45s ease both; }

/* 2. Base and reset -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1rem; background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: var(--w-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
table { border-collapse: collapse; }
a { color: inherit; }
b, strong { font-weight: 650; }
::selection { background: var(--ink); color: var(--paper); }

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

.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 10;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

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

.grid-12 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
@media (min-width: 720px) { .grid-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); } }

/* Section: thick rule on top, small numbered label, heading */
.section { padding-block: var(--space-5); }
.section + .section { padding-top: 0; }
.section-head {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2);
  border-top: 1px solid var(--rule);
  padding-top: var(--space-2);
  margin-bottom: var(--space-4);
}
.section-head__intro { max-width: var(--measure); color: var(--ink-2); }
@media (min-width: 900px) {
  .section-head { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: start; }
  .section-head .label { grid-column: 1 / 4; padding-top: 0.55em; }
  .section-head > :not(.label) { grid-column: 4 / 13; }
}

/* Content column: lines a block up with the section heading (column 4 of 12) */
@media (min-width: 900px) {
  .indent { margin-left: calc((100% - 11 * var(--gap)) / 12 * 3 + 3 * var(--gap)); }
}

/* Visible column grid: decorative lines with numbered heads (hero) */
.colgrid { position: relative; isolation: isolate; }
.colgrid::before {
  /* same box as .wrap's content, so the lines stay under the column numbers on wide screens */
  content: ""; position: absolute; inset: 0 max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); z-index: -1; pointer-events: none;
  background-image: linear-gradient(to right, var(--rule) 1px, transparent 1px);
  background-size: calc(100% / 4) 100%;
  border-right: 1px solid var(--rule);
}
.colnums { display: grid; grid-template-columns: repeat(4, 1fr); }
.colnums span {
  font-family: var(--font-mono); font-size: var(--step--2); color: var(--ink-3);
  padding: 0.35rem 0 0.35rem 0.45rem; border-bottom: 1px solid var(--rule);
}
.colnums span:nth-child(n+5) { display: none; }
@media (min-width: 720px) {
  .colgrid::before { background-size: calc(100% / 12) 100%; }
  .colnums { grid-template-columns: repeat(12, 1fr); }
  .colnums span:nth-child(n+5) { display: block; }
}

/* 4. Type ------------------------------------------------------------------ */
.label {
  font-family: var(--font-sans);
  font-size: var(--text-micro);
  font-weight: var(--w-mid);
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.label--ink { color: var(--ink); }

.display {
  font-family: var(--font-sans);
  font-weight: var(--w-bold);
  font-size: var(--step-display);
  line-height: 0.82;
  letter-spacing: var(--track-display);
}
.h1, .h2, .h3 { font-family: var(--font-sans); font-weight: var(--w-bold); color: var(--ink); text-wrap: balance; }
.h1 { font-size: var(--step-4); line-height: 0.92; letter-spacing: var(--track-display); }
.h2 { font-size: var(--step-3); line-height: 1; letter-spacing: var(--track-head); }
.h3 { font-size: var(--step-2); line-height: 1.12; letter-spacing: -0.025em; }
.lede { font-size: var(--step-1); line-height: 1.45; color: var(--ink); max-width: 34rem; text-wrap: pretty; }
.muted { color: var(--ink-2); }

/* Long-form text block. Use for any running text. */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1em; }
.prose h3 { margin-top: 2.2em; font-family: var(--font-sans); font-size: var(--step-2); font-weight: var(--w-bold); line-height: 1.12; letter-spacing: -0.025em; }
.prose h3 + * { margin-top: 0.6em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: 0.5em; }
.prose li::marker { color: var(--ink-3); }
.prose a { text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.prose a:hover { text-decoration-color: var(--signal); text-decoration-thickness: 2px; }

/* 5. Header and footer ----------------------------------------------------- */
/* A tiny header: a small round mark with her initials on the left, three 12px links on the
   right. No rule under it, no status pill. On the landing page it floats over the hero
   (.site-header--float); on case pages it sits in the flow. */
.site-header { position: relative; z-index: 20; }
.site-header--float { position: absolute; top: 0; left: 0; right: 0; }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 0.9rem;
}
.site-header--float .site-header__inner { max-width: none; padding-inline: clamp(16px, 2.4vw, 40px); }
.brand {
  font-family: var(--font-sans); font-weight: var(--w-bold);
  font-size: var(--text-sm); letter-spacing: -0.02em; white-space: nowrap;
  text-decoration: none; line-height: 1;
}
/* the mark: <a class="brand brand--mark" href="index.html" aria-label="Gayathri Das, home">gd</a> */
.brand--mark {
  display: inline-grid; place-items: center; flex: none;
  width: 1.75rem; height: 1.75rem; border-radius: 2px;      /* a sharp block, like the image in her name */
  background: var(--ink); color: var(--paper);
  font-size: 0.75rem; letter-spacing: -0.03em; padding-bottom: 0.08em;
  transition: transform 0.4s var(--ease);
}
.brand--mark:hover { transform: translateY(-2px); }
.nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem clamp(1.1rem, 2.4vw, 2rem); }
.nav a {
  font-family: var(--font-sans); font-size: var(--text-xs); font-weight: var(--w-mid);
  text-decoration: none; display: inline-block; padding-block: 0.5rem;
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 0.3rem) / 0 1px no-repeat;
  transition: background-size 0.35s var(--ease);
}
.nav a:hover, .nav a[aria-current] { background-size: 100% 1px; }
/* The lamp in the header: the same switch as the lamp on the home page, on every page.
     <button class="room-toggle js-only" type="button" data-room-toggle aria-pressed="false" aria-label="Evening light">
   The icon is 18px, the button 40px (the hit area). On: the shade fills warm and glows. */
.site-header__inner .nav { margin-left: auto; }
.room-toggle {
  appearance: none; flex: none; display: inline-grid; place-items: center;
  width: 2.5rem; height: 2.5rem; margin: -0.35rem -0.7rem -0.35rem -0.4rem; padding: 0; border: 0; border-radius: 50%;
  background: none; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s;
}
@media (hover: hover) { .room-toggle:hover { background-color: var(--hover); } }
.room-toggle:focus-visible { outline-offset: -3px; border-radius: 50%; }
.room-toggle svg { width: 1.125rem; height: 1.125rem; overflow: visible; filter: drop-shadow(0 0 0 rgb(255 196 120 / 0)); transition: filter 0.45s ease; }
.room-toggle__shade { fill: #ffd595; fill-opacity: 0; transition: fill-opacity 0.45s ease; }
.room-toggle__rays { opacity: 0; transition: opacity 0.45s ease; }
html[data-room="evening"] .room-toggle__shade { fill-opacity: 1; }
html[data-room="evening"] .room-toggle__rays { opacity: 0.9; }
html[data-room="evening"] .room-toggle svg { filter: drop-shadow(0 0 5px rgb(255 196 120 / 0.7)); }
/* the old status pill: plain small text now, hidden on phones. Do not add it to new pages. */
.status { display: none; align-items: center; gap: 0.45rem; font-size: var(--text-xs); font-weight: var(--w-mid); color: var(--ink-3); }
.status__dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--signal); }
@media (min-width: 900px) { .status { display: inline-flex; } }

.site-footer { border-top: 1px solid var(--rule); margin-top: var(--space-4); padding-block: var(--space-4) var(--space-3); }
.site-footer__inner { display: grid; gap: var(--space-3); }
.site-footer__name { font-family: var(--font-sans); font-weight: var(--w-bold); font-size: var(--step-3); line-height: 0.95; letter-spacing: var(--track-head); }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer__links a { text-underline-offset: 0.2em; }
.site-footer__small { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; border-top: 1px solid var(--rule); padding-top: var(--space-2); }
@media (min-width: 900px) {
  .site-footer__inner { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: end; }
  .site-footer__name { grid-column: 1 / 7; }
  .site-footer__blurb { grid-column: 7 / 10; }
  .site-footer__links { grid-column: 10 / 13; flex-direction: column; }
  .site-footer__small { grid-column: 1 / -1; }
}

/* 6. Buttons and links ----------------------------------------------------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 2.75rem; padding: 0.6rem 1.25rem;
  background: var(--ink); color: var(--paper);
  border: 1.5px solid var(--ink); border-radius: 999px;
  font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 600; line-height: 1.2;
  text-decoration: none;
  transition: transform 0.2s var(--ease), background-color 0.2s, color 0.2s;
}
.button:hover { transform: translateY(-2px); }
.button--ghost { background: transparent; color: var(--ink); }
.button--ghost:hover { background: var(--ink); color: var(--paper); }
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 0.1rem;
}
.link-arrow::after { content: "\2192"; transition: transform 0.2s var(--ease); }
.link-arrow:hover::after { transform: translateX(4px); }
.link-arrow--back::after { content: none; }
.link-arrow--back::before { content: "\2190"; }

/* 7. Metadata table and data table ----------------------------------------- */
/* Metadata table: a <dl> of short facts (Role, Period, Status, Tools) */
.meta { border-top: 1px solid var(--rule); }
.meta > div {
  display: grid; grid-template-columns: 6.25rem minmax(0, 1fr); gap: 0.75rem;
  padding-block: 0.6rem; border-bottom: 1px solid var(--rule);
}
.meta dt {
  font-family: var(--font-sans); font-size: var(--text-micro); font-weight: var(--w-mid);
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); padding-top: 0.3em;
}
.meta dd { font-size: var(--text-base); line-height: 1.45; }
@media (min-width: 720px) {
  .meta > div { grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; }
  .meta--wide > div { grid-template-columns: 10rem minmax(0, 1fr); }
}

/* Data table: real tabular data (experience, column names) */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; font-size: var(--text-base); line-height: 1.45; border-top: 1px solid var(--rule); }
.data-table caption { text-align: left; padding-bottom: 0.6rem; }
.data-table th, .data-table td { text-align: left; vertical-align: top; padding: 0.75rem 1rem 0.75rem 0; border-bottom: 1px solid var(--rule); }
.data-table thead th {
  font-family: var(--font-mono); font-size: var(--step--1); font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3);
  padding-block: 0.55rem;
}
.data-table tbody th { font-weight: 600; }
.data-table .num { font-family: var(--font-mono); font-size: 0.9375rem; white-space: nowrap; }
/* Stacked rows on phones: add data-label to each td */
@media (max-width: 719px) {
  .data-table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .data-table--stack tr { display: grid; gap: 0.2rem; padding-block: 0.8rem; border-bottom: 1px solid var(--rule); }
  .data-table--stack th, .data-table--stack td { display: block; padding: 0; border: 0; }
  .data-table--stack td[data-label]::before {
    content: attr(data-label); display: block;
    font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--ink-3);
  }
}

/* 8. Cover sleeves and shelf ---------------------------------------------- */
/* A cover is a square object printed edge to edge with the project's illustration (a Blender
   render, img/covers/<project>.webp, 1000 px), with the project name small, bold and tight at
   the top-left. --tile-bg (edges, spine, the colour behind the image while it loads) and
   --tile-ink (the name) are sampled from each illustration.

   Flat (legacy markup, still used by the next-project block on case pages):
     <span class="cover cover--navibus"> .cover__art + .cover__title </span>

   Sleeve (a physical object in CSS 3D; use this for anything new):
     <a class="cover sleeve cover--navibus" href="..." data-project="navibus">
       <span class="sleeve__shadow"></span>              blurred, skewed shadow on the wall behind
       <span class="sleeve__obj">                        the object: preserve-3d, leans back at rest
         <span class="sleeve__back"></span>              dark back board at z = 0
         <span class="sleeve__side sleeve__side--l"></span>   four thin edges, each rotated 90deg
         <span class="sleeve__side sleeve__side--r"></span>   into depth, between back and front
         <span class="sleeve__side sleeve__side--t"></span>
         <span class="sleeve__side sleeve__side--b"></span>
         <span class="sleeve__front">                    the printed cover, lifted --depth off the back
           <span class="cover__title">NaviBus</span>
           <span class="cover__art cover__art--full"><img src="img/covers/navibus.webp" width="1000" height="1000" alt=""></span>
           <span class="sleeve__sheen"></span>           light across the surface + edge highlights
         </span>
       </span>
       <span class="sleeve__contact"></span>             small dark contact shadow where it stands
     </a>
   The link itself never moves (so the pointer cannot fall off it and the script can measure it);
   only .sleeve__obj does. Each sleeve carries its own perspective; set --px on it to move the
   vanishing point (a rack sets it per column so the row shares one eye point). */
.cover {
  --tile-bg: var(--surface); --tile-ink: var(--ink);
  position: relative; display: block; aspect-ratio: 1 / 1;
  container-type: inline-size;
  color: var(--tile-ink); text-decoration: none;
}
.cover:not(.sleeve) {
  overflow: hidden; background: var(--tile-bg); border-radius: 2px;
  box-shadow: var(--shadow-object), inset 0 0 0 1px rgb(0 0 0 / 0.06);
}
a.cover:focus-visible { outline-offset: 8px; }
.cover__meta { display: none; }   /* legacy markup: the numbered meta row is gone */
.cover__title {
  position: absolute; z-index: 2; left: 6.5cqi; top: 6cqi; right: 6cqi;
  font-family: var(--font-sans); font-weight: var(--w-bold);
  font-size: 11.5cqi; line-height: 0.9; letter-spacing: -0.05em;
}
.cover__art { position: absolute; z-index: 1; display: block; }
.cover__art img { width: 100%; height: auto; }
/* The illustration, edge to edge. On hover it grows a touch towards its subject (lower right). */
.cover__art--full { inset: 0; overflow: hidden; }
.cover__art--full img { width: 100%; height: 100%; max-width: none; object-fit: cover; transform-origin: 68% 72%; transition: transform 0.7s var(--ease-sleeve); }
/* Legacy art (an app screen on a flat colour). Phone screen: tall, runs off the bottom edge */
.cover__art--phone { top: 30cqi; left: 31cqi; width: 47cqi; transition: transform 0.58s var(--ease-sleeve); }
.cover__art--phone img { border-radius: 3.6cqi; box-shadow: 0 0 0 0.5cqi rgb(0 0 0 / 0.28), -3cqi 4cqi 7cqi -1cqi rgb(0 0 0 / 0.5); }

/* colours sampled from the top and left edges of each illustration */
.cover--yantra { --tile-bg: #1958d3; --tile-ink: #ffffff; }
.cover--yantra .cover__art:not(.cover__art--full) { top: 35cqi; left: 8cqi; width: 84cqi; transition: transform 0.58s var(--ease-sleeve); }
.cover--yantra .cover__art:not(.cover__art--full) img { filter: drop-shadow(-2cqi 3cqi 4cqi rgb(2 24 70 / 0.4)); }
.cover--navibus { --tile-bg: #202139; --tile-ink: #ffffff; }
.cover--pillpal { --tile-bg: #2e1d29; --tile-ink: #ffffff; }
.cover--keep    { --tile-bg: #f6b8cf; --tile-ink: #5a1638; }   /* 7.8:1 on the pink */

:root { --ease-sleeve: cubic-bezier(0.2, 0.8, 0.2, 1); }
.sleeve {
  --depth: 12px;                      /* thickness of the object */
  --rest: rotateX(8deg) rotateY(-0.7deg);
  --px: 50%;
  perspective: 1300px; perspective-origin: var(--px) 70%;
}
.sleeve__obj, .sleeve__back, .sleeve__front, .sleeve__side, .sleeve__sheen, .sleeve__shadow, .sleeve__contact { position: absolute; display: block; }
.sleeve__obj {
  inset: 0; transform-style: preserve-3d; transform-origin: 50% 100%;
  transform: var(--rest);
  transition: transform 0.58s var(--ease-sleeve);
}
.sleeve__back { inset: 0; background: #151412; border-radius: 2px; }
.sleeve__front {
  inset: 0; overflow: hidden; border-radius: 2px;
  background: var(--tile-bg);
  transform: translateZ(var(--depth));
}
/* the four edges: card stock in a darker tone of the cover, with a paler core line */
.sleeve__side {
  background:
    linear-gradient(var(--edge-dir, to right), rgb(0 0 0 / 0.5), rgb(255 255 255 / 0.12) 55%, rgb(0 0 0 / 0.15)),
    color-mix(in srgb, var(--tile-bg) 55%, #1b1a18);
}
.sleeve__side--l { left: 0; top: 0; bottom: 0; width: var(--depth); transform-origin: 0 50%; transform: translateZ(var(--depth)) rotateY(90deg); }
.sleeve__side--r { right: 0; top: 0; bottom: 0; width: var(--depth); transform-origin: 100% 50%; transform: translateZ(var(--depth)) rotateY(-90deg); --edge-dir: to left; }
.sleeve__side--t { left: 0; right: 0; top: 0; height: var(--depth); transform-origin: 50% 0; transform: translateZ(var(--depth)) rotateX(-90deg); --edge-dir: to bottom; }
.sleeve__side--b { left: 0; right: 0; bottom: 0; height: var(--depth); transform-origin: 50% 100%; transform: translateZ(var(--depth)) rotateX(90deg); --edge-dir: to top; }
/* light falling across the printed surface, and the thin highlights a cut edge catches */
.sleeve__sheen {
  inset: 0; z-index: 3; pointer-events: none;
  background:
    linear-gradient(112deg, rgb(255 255 255 / 0.3) 0%, rgb(255 255 255 / 0.06) 26%, rgb(255 255 255 / 0) 46%, rgb(0 0 0 / 0) 62%, rgb(0 0 0 / 0.2) 100%);
  background-size: 180% 100%; background-position: 20% 0;
  box-shadow: inset 1px 1px 0 rgb(255 255 255 / 0.34), inset -1px -1px 0 rgb(0 0 0 / 0.22), inset 0 0 0 1px rgb(0 0 0 / 0.05);
  transition: background-position 0.58s var(--ease-sleeve);
}
.sleeve__shadow {
  inset: 7% -8% 0 10%; z-index: -1;
  background: rgb(22 20 16 / 0.55); filter: blur(13px);
  transform: skewX(-10deg) translateX(3%); transform-origin: 50% 100%;
  opacity: 0.7;
  transition: transform 0.58s var(--ease-sleeve), opacity 0.58s var(--ease-sleeve);
}
.sleeve__contact {
  left: 1%; right: -2%; bottom: -4px; height: 9px; z-index: -1;
  background: rgb(15 14 12 / 0.6); filter: blur(4px); border-radius: 50%;
  transition: transform 0.58s var(--ease-sleeve), opacity 0.58s var(--ease-sleeve);
}
/* hover or focus: the sleeve rises 18px, comes forward 32px and flattens; its shadow spreads */
a.sleeve:hover .sleeve__obj, a.sleeve:focus-visible .sleeve__obj { transform: translateY(-18px) translateZ(32px) rotateX(0deg) rotateY(0deg); }
a.sleeve:hover .sleeve__sheen, a.sleeve:focus-visible .sleeve__sheen { background-position: 85% 0; }
a.sleeve:hover .sleeve__shadow, a.sleeve:focus-visible .sleeve__shadow { transform: skewX(-12deg) translateX(9%) scale(1.07, 1.02); opacity: 0.42; }
a.sleeve:hover .sleeve__contact, a.sleeve:focus-visible .sleeve__contact { transform: scale(0.86, 1.5) translateY(2px); opacity: 0.3; }
a.sleeve:hover .cover__art:not(.cover__art--full), a.sleeve:focus-visible .cover__art:not(.cover__art--full) { transform: translateY(-3cqi); }
a.sleeve:hover .cover__art--full img, a.sleeve:focus-visible .cover__art--full img { transform: scale(1.05); }
/* A settled sleeve (.sleeve--flat is not a class: the rule is scoped by where the sleeve sits, so
   the copy that flies between the shelf and the dialog is a full 3D sleeve again). Where a
   sleeve stands still and large (the dialog's art well, the covers on the case pages) it is drawn
   with no 3D transform at all, so the browser paints its type and screen at full sharpness. Its
   thickness is drawn as stepped edges up and to the right of the printed face. */
.pd__art .sleeve, .case .sleeve { perspective: none; }
.pd__art .sleeve .sleeve__obj, .case .sleeve .sleeve__obj { transform: none; transform-style: flat; }
.pd__art .sleeve .sleeve__back, .pd__art .sleeve .sleeve__side,
.case .sleeve .sleeve__back, .case .sleeve .sleeve__side { display: none; }
.pd__art .sleeve .sleeve__front, .case .sleeve .sleeve__front {
  transform: none; overflow: visible; border-radius: 1px;
  --e: color-mix(in srgb, var(--tile-bg) 58%, #1b1a18);
  box-shadow: 1px -1px 0 var(--e), 2px -2px 0 var(--e), 3px -3px 0 var(--e), 4px -4px 0 var(--e), 5px -5px 0 var(--e), 6px -6px 0 color-mix(in srgb, var(--tile-bg) 40%, #1b1a18);
}
/* the face clips its own art now that the front lets the edge steps show */
.pd__art .sleeve .sleeve__front, .case .sleeve .sleeve__front { clip-path: inset(-7px -7px 0 0); }
.pd__art .sleeve .cover__art, .case .sleeve .cover__art { clip-path: none; }
.pd__art .sleeve .sleeve__shadow, .case .sleeve .sleeve__shadow { inset: 4% -7% 0 12%; opacity: 0.5; }

@media (prefers-reduced-motion: reduce) {
  a.sleeve:hover .sleeve__obj, a.sleeve:focus-visible .sleeve__obj { transform: var(--rest); }
  a.sleeve:hover .cover__art, a.sleeve:focus-visible .cover__art { transform: none; }
  a.sleeve:hover .cover__art--full img, a.sleeve:focus-visible .cover__art--full img { transform: none; }
}

/* Shelf: covers stand on one line; captions sit under it. */
.shelf {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap); row-gap: var(--space-4);
}
.shelf__item { grid-column: 1 / -1; display: grid; grid-template-rows: auto auto; align-content: start; }
.shelf__caption { border-top: 1px solid var(--rule-strong); margin-top: 0; padding-top: 0.85rem; display: grid; gap: 0.35rem; }
.shelf__caption .label { text-wrap: balance; }
.shelf__caption .nowrap { white-space: nowrap; }
.shelf__caption .h3 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem); }
.shelf__caption p:last-child { color: var(--ink-2); font-size: 1rem; line-height: 1.5; max-width: 32rem; }
.shelf-heading { margin: var(--space-5) 0 var(--space-3); padding-top: 0.6rem; border-top: 1px solid var(--rule); }
/* Phones: shorter projects sit two to a row */
.shelf__item--sm { grid-column: span 6; }
.shelf__item--note { grid-column: 1 / -1; }
@media (min-width: 720px) {
  .shelf { row-gap: var(--space-5); }
  .shelf__item { grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; }
  .shelf__item > .cover { align-self: end; }
  .shelf__item--lg { grid-column: 1 / 8; }
  .shelf__item--md { grid-column: 8 / 13; }
  .shelf__item--sm, .shelf__item--note { grid-column: span 4; }
  /* the shelf line runs unbroken under a row of covers */
  .shelf__caption { border-top: 0; position: relative; padding-top: 1rem; }
  .shelf__caption::before {
    content: ""; position: absolute; top: 0; left: 0; right: calc(-1 * var(--gap)); height: 1px; background: var(--rule-strong);
  }
  .shelf__item:last-child .shelf__caption::before,
  .shelf__item--md .shelf__caption::before { right: 0; }
}
/* A plain card that can stand on the shelf next to covers */
.shelf-card {
  display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem;
  aspect-ratio: 1 / 1; padding: 1.25rem;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  text-decoration: none; background: transparent;
  transition: background-color 0.2s, color 0.2s;
}
.shelf-card .link-arrow { align-self: flex-start; }
.shelf-card:hover { background: var(--ink); color: var(--paper); }
.shelf-card:hover .label { color: inherit; }
.shelf-card__title { font-family: var(--font-sans); font-weight: var(--w-bold); letter-spacing: var(--track-head); font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem); line-height: 0.95; }
@media (max-width: 719px) { .shelf-card { aspect-ratio: auto; min-height: 10rem; } }

/* 9. Home ------------------------------------------------------------------ */
.hero { padding-bottom: var(--space-4); border-bottom: 1px solid var(--rule); }
.hero__top { display: grid; gap: var(--space-3); padding-top: clamp(2rem, 1rem + 4vw, 4.5rem); }
.hero__name .display { display: block; }
.hero__name .display > span { display: block; }
.hero__lede { font-size: var(--step-1); line-height: 1.4; max-width: 30rem; text-wrap: pretty; }
.hero__open { display: flex; align-items: flex-start; gap: 0.6rem; margin-top: 1rem; font-weight: 600; }
.hero__open .status__dot { flex: none; margin-top: 0.5em; }
.hero__actions { margin-top: var(--space-4); }
.hero__meta { margin-top: var(--space-4); }
@media (min-width: 900px) {
  .hero__top { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
  .hero__name { grid-column: 1 / -1; grid-row: 1; }
  /* the intro sits in the empty space to the right of the short last name */
  .hero__intro { grid-column: 7 / 13; grid-row: 1; align-self: end; padding-bottom: 0.4rem; }
}

/* Metadata strip: the same facts laid out across columns */
@media (min-width: 720px) {
  .meta--strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--gap); }
  .meta--strip > div { grid-template-columns: 1fr; gap: 0.35rem; align-content: start; }
}

.services { display: grid; gap: var(--gap); }
.service {
  display: grid; align-content: start; gap: 1rem;
  background: var(--surface); border-radius: var(--radius);
  padding: clamp(1.25rem, 0.8rem + 2vw, 2.25rem);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.06);
}
.service__num { font-family: var(--font-sans); font-weight: var(--w-bold); letter-spacing: var(--track-display); font-size: clamp(2.5rem, 1.6rem + 3vw, 4rem); line-height: 0.8; color: var(--ink); }
.service .meta { margin-top: 0.5rem; }
.services__cta { display: grid; gap: 1rem; align-items: center; justify-items: start; margin-top: var(--space-3); }
@media (min-width: 900px) {
  .services { grid-template-columns: 1fr 1fr; }
  .services__cta { grid-template-columns: auto 1fr; }
}

.about { display: grid; gap: var(--space-4); }
.portrait {
  position: relative; overflow: hidden; aspect-ratio: 4 / 5; max-width: 24rem;
  border-radius: var(--radius); background: #5b6b4e; box-shadow: var(--shadow-object);
}
/* Head-and-shoulders crop of a 1151 x 2048 portrait */
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 18%; transform: scale(1.3); transform-origin: 50% 12%; }
.about__quote { font-size: var(--step-1); line-height: 1.5; }
.about .meta { margin-top: var(--space-3); }
@media (min-width: 900px) {
  .about { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: start; }
  .about__photo { grid-column: 1 / 6; }
  .about__text { grid-column: 7 / 13; }
}

.experience-note { margin-top: var(--space-3); }

.contact__email {
  display: inline-block; max-width: 100%;
  font-family: var(--font-sans); font-weight: var(--w-bold);
  font-size: clamp(1.5rem, 0.4rem + 5.6vw, 6.25rem); line-height: 1; letter-spacing: var(--track-display);
  text-decoration: none; overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 0.045em no-repeat;
  transition: background-size 0.5s var(--ease);
  padding-bottom: 0.08em;
}
.contact__email:hover { background-size: 100% 0.045em; }
.contact__links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: var(--space-4); }

/* 10. Case study ----------------------------------------------------------- */
.case-hero { padding-top: clamp(2rem, 1rem + 4vw, 4.5rem); }
.case-hero__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; border-bottom: 1px solid var(--rule); padding-bottom: 0.6rem; margin-bottom: var(--space-3); }
.case-title { font-family: var(--font-sans); font-weight: var(--w-bold); line-height: 0.86; letter-spacing: var(--track-display); font-size: clamp(3.5rem, 1rem + 11vw, 10.5rem); }
.case-subtitle { display: block; font-family: var(--font-sans); font-weight: var(--w-bold); font-size: var(--step-3); line-height: 1.02; letter-spacing: var(--track-head); margin-top: 0.9rem; text-wrap: balance; }
.case-hero__grid { display: grid; gap: var(--space-4); margin-top: var(--space-4); }
@media (min-width: 900px) {
  .case-hero__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: start; }
  .case-hero__grid > .lede, .case-hero__grid > .case-hero__intro { grid-column: 1 / 7; }
  .case-hero__grid > .meta { grid-column: 8 / 13; }
}

/* Section: one rule on top, label column (3 of 12), content in columns 4 to 12.
   Every child after the head is a content block. .figure--full and
   .figure-row--full span all 12 columns. */
.case-section {
  display: grid; grid-template-columns: minmax(0, 1fr);
  row-gap: var(--space-4);
  margin-top: var(--space-5);
  border-top: 1px solid var(--rule);
  padding-top: 0.9rem;
}
.case-section__head .label { display: block; margin-bottom: 0.5rem; }
@media (max-width: 899px) { .case-section__head { margin-bottom: calc(-1 * var(--space-4) + 1.25rem); } }
.case-section > .prose + .numbered,
.case-section > .pullquote + .prose { margin-top: calc(-1 * var(--space-4) + 1.25rem); }
@media (min-width: 900px) {
  .case-section { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
  .case-section > * { grid-column: 4 / 13; }
  .case-section > .case-section__head { grid-column: 1 / 4; grid-row: 1 / span 2; padding-right: 1rem; }
  .case-section > .figure--full,
  .case-section > .figure-row--full { grid-column: 1 / 13; }
}

/* Callout: honest status line, or a "why" paragraph */
.callout {
  max-width: var(--measure);
  border-left: 4px solid var(--ink);
  background: var(--surface);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout > .label { display: block; margin-bottom: 0.35rem; color: var(--ink-2); }
.callout--status { border-left-color: var(--signal); }

.pullquote {
  font-family: var(--font-sans); font-weight: var(--w-bold);
  font-size: clamp(1.375rem, 1.1rem + 1.4vw, 2.125rem); line-height: 1.12; letter-spacing: var(--track-head);
  max-width: 24em; text-wrap: balance;
  padding-left: 0; border: 0;
}
.pullquote::before { content: "\201C"; display: block; font-size: 2em; line-height: 0.6; color: var(--ink-3); margin-bottom: 0.1em; }
/* Smaller pull quote for long user quotes, with a source line: <footer class="label"> */
.pullquote--sm { font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); font-weight: 600; line-height: 1.22; max-width: 44rem; }
.pullquote footer { margin-top: 0.75rem; }

/* Numbered list with big numerals */
.numbered { counter-reset: n; list-style: none; padding: 0; max-width: var(--measure); border-top: 1px solid var(--rule); }
.numbered > li { counter-increment: n; display: grid; grid-template-columns: 2.75rem 1fr; gap: 0.5rem; padding-block: 0.85rem; border-bottom: 1px solid var(--rule); }
.numbered > li::before { content: counter(n, decimal-leading-zero); font-family: var(--font-mono); font-size: var(--step--1); font-weight: 500; color: var(--ink-3); padding-top: 0.3em; }

/* 11. Figures and captions ------------------------------------------------- */
.figure { display: grid; gap: 0.75rem; }
.figure__frame {
  --frame-bg: var(--surface);
  background: var(--frame-bg);
  border-radius: var(--radius);
  padding: clamp(10px, 2.2vw, 32px);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.05);
  overflow: hidden;
}
.figure__frame img { width: 100%; border-radius: 3px; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06), 0 14px 30px -18px rgb(0 0 0 / 0.35); }
.figure__frame > a { display: block; border-radius: 3px; }
.figure__frame--bare img { box-shadow: none; border-radius: 0; }
.figure__frame--flush { padding: 0; }
.figure__frame--yantra { --frame-bg: var(--yantra-tint); }
.figure__frame--navibus { --frame-bg: var(--navibus-bg); }
.figure__frame--pillpal { --frame-bg: var(--pillpal-bg); }
.figure__frame--keep { --frame-bg: var(--keep-bg); }
.figure__frame--paper { --frame-bg: var(--paper-2); }
/* Mono labels on a coloured frame follow the project's ink colour, so they pass AA */
.figure__frame--navibus .label { color: var(--navibus-ink); }
.figure__frame--pillpal .label { color: var(--pillpal-ink); }
.figure__frame--keep .label { color: var(--keep-ink); }
/* Crops that already include a drawn phone bezel: no extra shadow, and the corners
   clipped to the bezel so no square patch of board colour shows outside it */
.figure__frame--device img { box-shadow: none; border-radius: 10% / 4.6%; }
/* Center a small image (modal, menu) inside its frame */
.figure__frame--center { display: grid; place-items: center; }
.figure__frame--center img { width: auto; max-width: 100%; box-shadow: none; border-radius: 0; }
/* Several small parts side by side in one frame */
.figure__frame--cluster { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: clamp(12px, 3vw, 40px); }
.figure__frame--cluster img { box-shadow: none; border-radius: 0; }
/* 2x exports of small UI parts (menus, chips): show at their real 1x size */
.figure__frame img.img-half { width: min(224px, 100%); }

.caption { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; font-size: 1rem; line-height: 1.5; color: var(--ink-2); max-width: 46rem; }
.caption__num { font-family: var(--font-mono); font-size: var(--step--1); font-weight: 500; letter-spacing: 0.04em; color: var(--ink-3); padding-top: 0.12em; white-space: nowrap; }
.caption a { color: var(--ink); }

/* Layout modifiers: .figure--full spans the whole content width on case pages */
.figure-row { display: grid; gap: var(--space-4) var(--gap); align-items: start; }
@media (min-width: 720px) {
  .figure-row--2 { grid-template-columns: 1fr 1fr; }
  .figure-row--3 { grid-template-columns: repeat(3, 1fr); }
  .figure-row--2-1 { grid-template-columns: 2fr 1fr; }
  .figure-row--1-2 { grid-template-columns: 1fr 2fr; }
}
.figure-row--stretch { align-items: stretch; }
.figure-row--stretch > .figure { grid-template-rows: 1fr auto; }
.figure-row--stretch .figure__frame { height: 100%; }

/* Phones: wide screenshots scroll sideways inside the frame instead of shrinking to nothing */
@media (max-width: 719px) {
  .figure--scroll .figure__frame { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .figure--scroll .figure__frame img { width: 840px; max-width: none; }
  .figure--scroll .strip { justify-items: start; }
  .figure--scroll .strip .label { position: sticky; left: 0; }
  .figure--scroll .scroll-hint { display: block; margin-top: 0.25rem; }
}
.scroll-hint { display: none; font-family: var(--font-mono); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }

/* Phones: a tight crop swapped in with <picture><source media="(max-width:719px)"> fits the frame, no sideways scroll */
@media (max-width: 719px) {
  .figure--scroll .figure__frame picture img { width: 100%; max-width: 100%; }
}

/* Detail strips (cropped rows of a screen) stacked with labels */
.strips { display: grid; gap: 1rem; }
.strip { display: grid; gap: 0.35rem; }
.strip img { width: 100%; border-radius: 3px; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06); }

/* Phone rows: two to four app screens side by side in one frame.
   <div class="phones" style="--n:3;--w:290px" tabindex="0" role="region" aria-label="Fig. 01 screens, scroll sideways">
     <div class="phones__screen"><p class="label">Optional label</p><img ...></div>   (or <a class="phones__screen">)
   </div>
   --n sets the columns on desktop, --w the largest width of one screen.
   Below 720 px the row scrolls sideways and snaps. Put
   <span class="scroll-hint scroll-hint--phones">Scroll sideways to see all three screens.</span> in the caption.
   .phones--fit keeps the columns on phones (no scrolling; for two small screens).
   .phones--pair adds a dashed divider between two screens (before and after). */
.phones {
  --n: 3; --w: 290px;
  display: grid; grid-template-columns: repeat(var(--n), minmax(0, var(--w)));
  justify-content: center; align-items: start;
  gap: clamp(12px, 2.4vw, 36px);
}
.phones__screen { display: grid; gap: 0.6rem; align-content: start; text-decoration: none; }
.phones__screen > img { width: 100%; }
.phones--pair { position: relative; }
.phones--pair > .phones__screen:last-child::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%;
  border-left: 1px dashed currentColor; opacity: 0.5;
}
.figure__frame--keep .phones--pair { color: var(--keep-ink); }
.figure__frame--navibus .phones--pair, .figure__frame--pillpal .phones--pair { color: #fff; }
@media (max-width: 719px) {
  .phones:not(.phones--fit) {
    display: flex; gap: 14px; justify-content: flex-start;
    overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; padding: 2px 2px 8px;
  }
  .phones:not(.phones--fit) > .phones__screen { flex: none; width: min(62vw, var(--w)); scroll-snap-align: start; }
  .scroll-hint--phones { display: block; margin-top: 0.25rem; }
}
/* Scrollers are focusable (tabindex="0") so keyboard users can scroll them */
.phones:focus-visible, .figure__frame[tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* 12. Swimlane diagram ----------------------------------------------------- */
/* Lanes are rows on desktop and columns on phones. Each step sets
   --lane (1..3) and --col (2..n+1; column 1 holds the lane names on desktop). */
.lanes {
  --steps: 7;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: 3.75rem repeat(var(--steps), auto);
  column-gap: 6px; row-gap: 10px;
  font-size: 0.9375rem; line-height: 1.35;
}
.lanes__band {
  grid-column: var(--lane); grid-row: 1 / -1;
  background: var(--surface); border-radius: var(--radius);
  position: relative; z-index: 0;
  padding: 0.6rem 0.5rem;
  font-family: var(--font-mono); font-size: var(--step--2); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em;
}
.lanes__band::after { /* the lane's path */
  content: ""; position: absolute; z-index: -1;
  left: 50%; top: 2.5rem; bottom: 1rem; border-left: 2px dashed var(--rule);
}
.lanes__band--sales { background: #f1efe9; }
.lanes ol { display: contents; }
.lanes__step {
  grid-column: var(--lane); grid-row: var(--col);
  position: relative; z-index: 1; margin: 0 6px;
  background: #fff; border: 1px solid var(--rule); border-radius: 3px;
  padding: 0.55rem 0.6rem 0.6rem;
  box-shadow: 0 6px 14px -10px rgb(0 0 0 / 0.35);
}
.lanes__step b { font-weight: 600; }
.lanes__n { display: block; font-family: var(--font-mono); font-size: var(--step--2); font-weight: 500; color: var(--ink-3); margin-bottom: 0.15rem; }
.lanes__step--air { border-top: 3px solid #f2a463; }
.lanes__step--land { border-top: 3px solid #7fcf6c; }
.lanes__step--sales { border-top: 3px solid var(--yantra-ink); }
.lanes__lane { display: block; }
.lanes__axis { display: none; }
@media (min-width: 900px) {
  .lanes {
    grid-template-columns: 9rem repeat(var(--steps), minmax(0, 1fr));
    grid-template-rows: repeat(3, auto) auto;
    column-gap: 10px; row-gap: 6px;
    font-size: 0.9375rem;
  }
  .lanes__band { grid-row: var(--lane); grid-column: 1 / -1; padding: 0.9rem 0.8rem; display: flex; align-items: center; min-height: 6.5rem; }
  .lanes__band::after { left: 9.5rem; right: 1rem; top: 50%; bottom: auto; border-left: 0; border-top: 2px dashed var(--rule); }
  .lanes__step { grid-row: var(--lane); grid-column: var(--col); margin: 0.6rem 0; align-self: center; }
  .lanes__axis { display: flex; justify-content: space-between; grid-row: 4; grid-column: 2 / -1; padding-top: 0.4rem; }
}

/* Evening, shared components (v9). The tokens carry almost everything; these are the few places
   where a literal light colour would leave pale text on a pale box, or a white screen glaring.
   Case-study pages: anything more belongs in css/case.css or the page's own file. */
html[data-room="evening"] .figure__frame img, html[data-room="evening"] .strip img, html[data-room="evening"] .portrait img { filter: brightness(var(--glare)); }
html[data-room="evening"] .figure__frame { box-shadow: inset 0 0 0 1px rgb(255 236 210 / 0.06); }
html[data-room="evening"] .figure__frame--yantra { --frame-bg: var(--surface); }
html[data-room="evening"] .lanes__band--sales { background: #3f3832; }
html[data-room="evening"] .lanes__step { background: var(--raised); border-color: rgb(255 236 210 / 0.14); box-shadow: 0 6px 14px -8px rgb(8 5 2 / 0.8); }
html[data-room="evening"] .lanes__step--sales { border-top-color: #6ea2f5; }
html[data-room="evening"] .service { box-shadow: inset 0 0 0 1px rgb(255 236 210 / 0.06); }

/* 13. Next-project footer -------------------------------------------------- */
.next { margin-top: var(--space-6); border-top: 1px solid var(--rule); padding-top: var(--space-2); display: grid; gap: var(--space-3); }
.next__link { display: grid; gap: 0.5rem; text-decoration: none; }
.next__title { font-family: var(--font-sans); font-weight: var(--w-bold); font-size: clamp(2.75rem, 1rem + 7vw, 8.5rem); line-height: 0.86; letter-spacing: var(--track-display); text-wrap: balance; transition: transform 0.3s var(--ease); }
.next__title::after { content: "\00a0\2192"; font-weight: 400; letter-spacing: 0; } /* non-breaking: the arrow never sits alone */
.next__link:hover .next__title { transform: translateX(10px); }
.next__desc { color: var(--ink-2); }
.next__back { justify-self: start; }
@media (min-width: 900px) {
  .next { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: end; }
  .next__link { grid-column: 1 / 10; }
  .next__back { grid-column: 10 / 13; justify-self: end; }
}

/* 14. Utilities, motion, print -------------------------------------------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.mt-0 { margin-top: 0 !important; }
.mt-3 { margin-top: var(--space-3) !important; }
.mt-4 { margin-top: var(--space-4) !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .button:hover, .next__link:hover .next__title, .brand--mark:hover { transform: none; }
}

@media print {
  .site-header .nav, .status, .skip-link, .next { display: none; }
  .sleeve__shadow, .sleeve__contact { display: none; }
  body { background: #fff; }
  .cover, .figure__frame { box-shadow: none; }
}
