/* Inter variable font (self-hosted) */
@font-face{
  font-family:"Inter";
  src:url("fonts/Inter-Regular.woff2") format("woff2");
  font-weight:400; font-style:normal; font-display:swap;
}
@font-face{
  font-family:"Inter";
  src:url("fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight:600; font-style:normal; font-display:swap;
}

html { 
  font-optical-sizing: auto; 
  font-synthesis-weight: none; 
  font-synthesis-style: none; 
}

:root{

  /* --- spacing scale (rem) --- */
  --space-0: 0;
  --space-1: .25rem;  /* 4px  */
  --space-2: .5rem;   /* 8px  */
  --space-3: .75rem;  /* 12px */
  --space-4: 1rem;    /* 16px */
  --space-5: 1.25rem; /* 20px */
  --space-6: 1.5rem;  /* 24px */
  --space-7: 1.75rem; /* 28px */
  --space-8: 2rem;    /* 32px */
  --space-10: 2.5rem; /* 40px */
  --space-12: 3rem;   /* 48px */
  --space-14: 3.5rem; /* 56px */
  --space-16: 4rem;   /* 64px */
  --space-20: 5rem;   /* 80px */
  --space-24: 6rem;   /* 96px */
  --space-32: 8rem;   /* 128px */

  /* --- fluid layout tokens (keep clamps here) --- */
  /* primary vertical spacing between sibling sections */
  --section-gap: clamp(12.25rem, 5vw, 14rem);

  /* larger “band” spacing (used by cases block, big headers) */
  --section-gap-lg: clamp(14rem, 7.5vw, 15rem);

  /* header vertical padding (replaces raw clamp in .site-header) */
  --header-pad: clamp(3rem, 8vw, 5rem);

  /* case studies vertical spacing */
  --band-gap: clamp(14rem, 15vw, 17rem);

  /* timeline padding + inter-row gap */
  --timeline-pad: clamp(2rem, 5vw, 5rem);
  --t-row-gap: clamp(3rem, 6vw, 6rem);

  /* pill dimensions */
  --pill-gap: clamp(.25rem, .35vw, .95rem);
  --pill-pad-y: .15rem;
  --pill-pad-x: .4rem;
  --pill-btn-pad-y: .65rem;
  --pill-btn-pad-x: .1rem;

  /* neutrals */
  --jp-chalk: #fffffc;
  --jp-porcelain: #f8fbf8;
  --jp-deutzia: #f7fcfe;
  --jp-dough: #fbfaf5;
  --jp-silk-white: #f3f3f2;
  --jp-base-color: #eae5e3;
  --jp-plum-grey: #e5eae6;
  --jp-milk: #f3f3f3;
  --jp-purple-water: #e7e7eb;
  --jp-white-grey: #dcdddd;
  --jp-azure: #3887c2;

  /* surfaces & ink */
  --bg: var(--jp-porcelain);
  --surface: var(--jp-chalk);
  --border: var(--jp-white-grey);
  --jp-ink: color-mix(in oklab, #000 60%, var(--jp-chalk));
  --jp-ink-700: color-mix(in oklab, #000 40%, var(--jp-chalk));
  --ink: var(--jp-ink);
  --ink-muted: var(--jp-ink-700);

  /* accents & tints (single source of truth) */
  --accent: var(--jp-base-color);
  --accent-2: var(--jp-purple-water);
  --accent-blue: color-mix(in oklab, var(--jp-azure) 88%, #000);
  --tint-1: color-mix(in oklab, var(--accent) 12%,  var(--surface));
  --tint-2: color-mix(in oklab, var(--accent) 20%, var(--surface));
  --tint-3: color-mix(in oklab, var(--accent) 28%, var(--surface));

  /* frosted pill + shadows */
  --pill-bg: color-mix(in oklab, var(--jp-chalk) 6%, transparent);
  --pill-border: color-mix(in oklab, var(--jp-chalk) 14%, transparent);
  --pill-shadow: 0 10px 30px rgba(0,0,0,.12);
  --shadow: 0 8px 18px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 18px 40px rgba(0,0,0,.12);
  --shadow-media: 0 18px 40px rgba(0,0,0,.25);

  /* focus */
  --focus-ring: color-mix(in oklab, var(--accent-blue) 60%, transparent);
  --focus-border: color-mix(in oklab, var(--accent-blue) 70%, var(--border));

  /* error colors */
  --error-500:#dc2626;
  --error-600:#b91c1c;

  --page-gutter: 1.5rem;
  --container: min(1100px, calc(100vw - (var(--page-gutter) * 2)));
  --radius: 16px;
  --cs-media-ratio: 3/2; 
}

/* Visually hidden, but accessible */
.sr-only{
  position: absolute !important;
  left: 0; top: 0;           /* anchor so transforms are predictable */
  display: block;            /* ensure width/height apply */
  width: 1px; height: 1px;
  margin: 0; padding: 0; border: 0;
  overflow: clip;            /* or `hidden` if you need wider support */
  clip-path: inset(50%);
  clip: rect(0 0 0 0);
  /* critical change: allow wrapping so intrinsic width isn't huge */
  white-space: normal;       /* ← remove nowrap */
}


/* --- Core responsive layout --- */
* { box-sizing: border-box; }

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

img, video, iframe { max-width: 100%; height: auto; display: block; }

/* Headings that align with the page container width */
.section-title { 
  margin: var(--section-gap) auto var(--space-2); 
  letter-spacing: 0.25px;
  text-align: left;
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 500; /* was 700*/
}

/* Body content that should align with section titles */
.section-content{ width: var(--container); margin: 0 auto; }
.section + .section { margin-top: var(--section-gap); }

/* Make prose align with the left edge of the section container */
.section-content > .prose { margin-left: 0; margin-right: auto; }

/* Fluid page container (use on every page's <main>) */
.container { width: var(--container); margin-inline: auto; }

/* Narrow text blocks for readability */
.prose { max-width: 80ch; margin-inline: auto; }

/* Type scale (fluid) */
h1{ font-size: clamp(2rem, 2.5vw + 1.3rem, 3rem); }
h2{ font-size: clamp(1.2rem, 1vw + .9rem, 1.4rem); }
h3{ font-size: clamp(1.5rem, 1.6vw + 1rem, 2.1rem); }
h4{ font-size: 1.05rem; }

/* vertical rhythm for all prose blocks */
.prose > * + *{ margin-top: .75rem; }

/* better focus defaults across the site */
:focus-visible{ 
  outline: 3px solid color-mix(in oklab, var(--accent-blue) 35%, transparent); 
  outline-offset: 2px; 
}

/* links (site-wide) */
a{ color: var(--ink); text-decoration: none; }
a:hover, a:focus-visible{ 
  color: var(--accent-blue); 
  text-decoration: none; 
}

body{
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Inter', Helvetica, Arial, sans-serif;
  background: transparent;
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:root{ --nav-offset: 88px; } /* tweak: sticky nav height + a little gap */

html{ scroll-behavior: smooth; }

/* keep it accessible for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
}

/* make all in-page anchors land *below* the sticky nav */
[id]{ scroll-margin-top: var(--nav-offset); }

/* a tiny click micro-interaction */
.pill-nav .nav-btn{
  transition: transform .12s ease, box-shadow .12s ease;
}
.pill-nav .nav-btn:active{ transform: translateY(1px) scale(.98); }
.pill-nav .nav-btn.is-active,
.pill-nav .nav-btn[aria-current="page"]{
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.pill-nav .nav-btn.is-active:hover{ transform: none; }

html{ background-color: var(--bg); }


/* Header spacing only (header is NOT sticky) */
.site-header{ 
  padding-block: var(--header-pad);
 }
.site-header .container{ text-align: center; margin-left: auto;}

/* --- Hero --- */
.hero-name{
  text-align: left;
  font-size: clamp(2.25rem, 3vw, 3rem);
  font-weight: 500; /* was 700*/
  margin: var(--section-gap) auto var(--space-2);
  letter-spacing: -1px;
  margin-bottom: var(--section-gap);
  }

.hero-name{
  opacity: 0;                         /* start hidden */
  transform: translateY(1.25rem);       /* slight lift-in */
}
.hero-name.is-in{
  animation: hero-in 1000ms cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes hero-in{
  to{ opacity:1; transform:none; }
}

@media (min-width: 1000px) {
.hero-name{font-size: clamp(3.25rem, 3vw, 4rem);}
}

/* Reveal on scroll, the rest of the page */
.reveal-on-scroll {
  /* Tunables */
  --reveal-delay: 0ms;
  --reveal-distance: 10px;
  --reveal-duration: 600ms;
  --reveal-ease: cubic-bezier(.22,.61,.36,1);

  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition:
    opacity var(--reveal-duration) var(--reveal-ease) var(--reveal-delay),
    transform var(--reveal-duration) var(--reveal-ease) var(--reveal-delay);
}

/* Final (revealed) state */
.reveal-on-scroll.is-in { opacity: 1; transform: translateY(0); }

/* Optional direction variants via data-reveal */
.reveal-on-scroll[data-reveal="up"] {
  transform: translateY(var(--reveal-distance));
}
.reveal-on-scroll[data-reveal="down"] {
  transform: translateY(calc(var(--reveal-distance) * -1));
}
.reveal-on-scroll[data-reveal="left"] {
  transform: translateX(var(--reveal-distance));
}
.reveal-on-scroll[data-reveal="right"] {
  transform: translateX(calc(var(--reveal-distance) * -1));
}


/* Only the nav sticks; no glass/blur */
.site-nav{
  position: sticky;
  top: 12px;
  z-index: 50;
  background: transparent;           /* same as page bg = no tint */
  border-bottom: 0;
}

/* Center the pill via the container; pill sizes to its content */
.pill-wrap { display: flex; justify-content: center; }
.pill-nav  { width: auto; max-width: 100%; }

/* 1) Frosted capsule container */
.pill-nav .nav{
  background: transparent !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;                    /* hide the halo on empty areas */
  border-radius: 9999px;

  gap: var(--pill-gap);
  padding: var(--pill-pad-y) var(--pill-pad-x);
  --pill-btn-w: clamp(70px, 8vw, 80px); 

  /* Correct filter chain */
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
}

@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){
  .pill-nav .nav{ background-color: rgba(255,255,255,0.002); }
}


/* 2) Base buttons inside the capsule */
.pill-nav .nav-btn{
  width: auto;
  flex: 0 1 auto;
  white-space: normal;
  min-width: var(--pill-btn-w);
  text-align: center;
  display: inline-flex; align-items:center; justify-content:center;
  box-sizing: border-box;
  padding: var(--pill-btn-pad-y) var(--pill-btn-pad-x);
  min-height: 44px;
  font-size:clamp(.82rem,.45vw +.74rem,.98rem);
  font-weight: 500; line-height:1; 
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  transition: background .18s ease, box-shadow .18s ease,
              border-color .18s ease, transform .18s ease;
}

/* app.css — scope hover lift to real-hover devices */
@media (hover: hover) and (pointer: fine) {
  .pill-nav .nav-btn:hover:not(.is-active) {
    transform: translateY(-3px);
  }
}

/* Sliding highlight behind the active pill */
.pill-nav .nav{ position: relative; }
.pill-nav .pill-indicator{
  pointer-events: none;
  position: absolute;
  inset: 4px auto 4px 0;          /* top, right (auto), bottom, left */
  width: 0;                        /* JS will set width */
  border-radius: 9999px;
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--jp-chalk) 44%, transparent),
    color-mix(in oklab, var(--jp-chalk) 26%, transparent)
  );
  border: 1px solid color-mix(in oklab, var(--jp-chalk) 45%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.65),
    0 8px 18px rgba(0,0,0,.12);
  transform: translateX(0);
  transition: transform 450ms cubic-bezier(.2,.7,.2,1), width 350ms ease;
  opacity: 0;                      /* fades in on first layout */
  z-index: 0;                      /* sits behind buttons */
}
.pill-nav .nav-btn{ position: relative; z-index: 1; }

/* Pill: strong, accessible keyboard focus */
.pill-nav .nav-btn:focus-visible{
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  transform: none;
}

.pill-nav .nav{ isolation: isolate; }

.pill-nav .pill-indicator{
  backface-visibility: hidden;
}


/* Responsive card grid you can reuse everywhere */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  align-items: stretch;         /* uniform heights per row */
}

/* Clickable card (uniform per row) */
.card{
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover{ transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card h4{ margin:.15rem 0 .25rem; }
.card p{ margin:0; color:var(--ink-muted); font-weight:500; }
.bubble{
  width:48px; height:48px; border-radius:999px;
  display:grid; place-items:center;
  background: linear-gradient(135deg,var(--tint-2),var(--tint-1));
  border:1px solid var(--border);
  font-size: 1.4rem;
}

/* --- Contact form card --- */
.form-card{
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:1.1rem 1.2rem;
  box-shadow: var(--shadow);
}

/* space after the first grid row */
.form-card .grid + .form-field { margin-top: 1rem; }
.form-card .grid{ display:grid; gap:1rem; }
@media (min-width:600px){ 
  .form-card .grid{ 
    grid-template-columns:1fr 1fr; 
  } 
}

.form-field label{
  display:block; font-weight:600; font-size:.95rem; margin-bottom:.35rem;
}
.form-field input,
.form-field textarea{
  width:100%;
  font:inherit;
  padding:.75rem .9rem;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--tint-1);
}
.form-field textarea{ resize: none; overflow-y: auto; }
.form-field input:focus,
.form-field textarea:focus{
  outline:3px solid var(--focus-ring);
  border-color: var(--focus-border);
}

/* inputs/textarea that are invalid */
.form-field input[aria-invalid="true"],
.form-field textarea[aria-invalid="true"]{
  border-color: var(--error-600);
  box-shadow: 0 0 0 .1875rem color-mix(in srgb, var(--error-600), transparent 70%);
  background-color: color-mix(in srgb, var(--error-600), #fff 98%);
}
/* keep a strong ring when focused AND invalid */
.form-field input[aria-invalid="true"]:focus-visible,
.form-field textarea[aria-invalid="true"]:focus-visible{
  outline-color: var(--error-600);
  box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--error-600), transparent 60%);
}

/* red status text when showing an error */
.form-status.is-error{ color: var(--error-600); }

.form-actions{
  margin-top:1rem;
  display:flex; 
  gap:.75rem; 
  align-items:center; 
  flex-wrap:wrap;
}

.btn{
  appearance:none; border:0; border-radius:10px;
  padding:.6rem .9rem; font-weight:500; font-size: 1rem;
  cursor: pointer;
}
.btn-primary{ 
  background:var(--jp-azure); 
  color: var(--jp-chalk);
  border: 1px solid var(--jp-white-grey);
 }
.btn-primary:hover{ filter:brightness(1.05); }

.link-muted{ color: var(--ink-muted); text-decoration:none; }
.link-muted:hover{ text-decoration:underline; }

.form-status{ 
  margin-top:.25rem; 
  color: var(--ink-muted); 
  font-weight:600; 
  min-height:1.25rem; 
}

  .form-actions .btn,
  .form-actions .link-muted,
  .form-actions .form-status{
    align-self:center;      /* belt & suspenders */
    line-height: 1.2;
}

.form-actions .form-status{ 
  margin:0;
  display:inline-flex;    /* keeps text optically centered */
  align-items:center;
  min-height: 1.5em;      /* stabilizes when it wraps */
  color: var(--muted-fg, #6b7280);
  font-size: .9375rem;
  margin-right:auto;
 }

/* --- Vertical Timeline (centered on desktop) --- */
.timeline{
  position: relative;
  width: var(--container);
  margin: 0 auto;
  padding-block: var(--timeline-pad);
  --mid: 40px;
  --gap: .55rem;
}
/* one continuous, centered spine */
.timeline::before{
  content: "";
  position: absolute;
  top: .1rem;
  bottom: .1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: var(--jp-base-color);
  border-radius: 1px;
  z-index: 0;
  pointer-events: none;
}

.t-row { margin: 0; }                 /* ensure no block margin on each row */
.t-row + .t-row { margin-top: var(--t-row-gap); }

/* desktop rows (update) */
.t-row{
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  gap: 1rem;
  align-items: stretch;
}

/* middle column hosts the dot */
.t-mid{ display: grid; place-items: center; }
.t-dot{
  position: relative;
  z-index: 3;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent-blue);
  box-shadow:
    0 0 0 5px var(--surface),
    0 0 0 6px var(--border);
}

/* Timeline cards*/
.t-card{
  padding: 1rem 1.5rem;
  display: block;
  min-width: 0;
}
/* ensure long text wraps nicely inside the card */
.t-card p, .t-card li, .t-card h4,
.t-card .meta{
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}
.card, .t-mid { min-width: 0; }
.t-card .meta{
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: .5rem;
}
.t-card h4{ margin: .25rem 0 .5rem; }
.t-card details{ margin-top: .5rem; }

/* Rail stretches to row height so 50% = dot line */
.t-rail{
  display: grid;
  grid-auto-rows: min-content;
  align-self: stretch;      /* was: place-self:center */
  justify-self: center;
  text-align: center;
  justify-items: center;
  gap: .6rem;
  width: 100%;
  max-width: none;
  position: relative;
  padding-block: 4rem 1.25rem;  /* space above/below centered year */
  min-height: 6rem;
}
.t-rail{ --rail-bias: 0px; }

/* details: animated expander */
.t-card summary{
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.t-card summary::-webkit-details-marker{ display:none; }

/* caret */
.t-card summary::after{
  content:"";
  width:.55rem; height:.55rem;
  border-right:2px solid var(--ink);
  border-bottom:2px solid var(--ink);
  transform: rotate(-45deg);            /* pointing right */
  transition: transform .25s ease;
  opacity:.75;
}
.t-card details[open] summary::after{ transform: rotate(45deg); } /* down */

/* right rail → draw leftward toward spine */
.t-row > .t-rail:last-child::before{
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: calc(-1 * (var(--gap) + var(--mid) / 2) + var(--rail-bias));
  width: calc(var(--gap) + var(--mid) / 2 - var(--rail-bias));
  height: 2px;
  background: var(--jp-white-grey);
  border-radius: 1px;
  z-index: 1;
}

/* left rail → draw rightward toward spine */
.t-row > .t-rail:first-child::before{
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: calc(-1 * (var(--gap) + var(--mid) / 2) + var(--rail-bias));
  width: calc(var(--gap) + var(--mid) / 2 - var(--rail-bias));
  height: 2px;
  background: var(--jp-white-grey);
  border-radius: 1px;
  z-index: 1;
}

.expander{
  overflow: hidden; height: 0;
  transition: height 0.6s cubic-bezier(.2,.7,.2,1);
  contain: layout;
}

/* small spacer between <summary> and first item, only when open */
.t-card details .expander::before{
  content:"";
  display:block;
  height:0;                 /* closed: no gap */
}
.t-card details[open] .expander::before{ height:.55rem; }

/* prevent inner margins from “jumping” the first/last frame */
.expander > :first-child{ margin-top: 0; }
.expander > :last-child{  margin-bottom: 0; }

/* Date block */
.rail-date{
  position: static;
  text-align: center;
  pointer-events: none;
}
.rail-year{
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -1px;

  /* allow it to shrink on narrower layouts */
  font-size: clamp(4.5rem, 6vw, 6.25rem);  /* was clamp(4rem, 3vw, 2rem) */
  line-height: 1;
  color: var(--jp-ink-700);

  /* center on the dot line (you already had these) */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;

  /* prevent any wrap at the en dash */
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: manual;
}


.rail-range{
  position: absolute;
  top: calc(46% + 0em);   /* ~1 line below the numerals */
  left: 50%;
  transform: translateX(-50%);
  margin-top: clamp(3.5rem,3.5vw, 4.25rem);
  font-size: 1.1rem;
  color: var(--jp-ink-700);
  z-index: 2;
  white-space: nowrap;      /* keep months on one line */
  word-break: keep-all;     /* don’t break at punctuation */
  overflow-wrap: normal;    /* disable emergency wrapping */
  hyphens: manual;        
}

.t-rail{ --year-edge-gap: .65rem; } /* adjust once here */
/* Edge-anchor the big year so the stub meets it cleanly */
.t-row > .t-rail:last-child .rail-year{
  left: 0;                       /* anchor to rail’s inner edge */
  transform: translateY(-50%);   /* keep vertical centering */
  text-align: left;
  padding-left: var(--year-edge-gap);       
}
.t-row > .t-rail:first-child .rail-year{
  right: 0;
  left: auto;
  transform: translateY(-50%);
  text-align: right;
  padding-right: var(--year-edge-gap);
}

/* Center range under the numerals, compensating for one-sided padding */
.t-row > .t-rail:last-child .rail-range{
  left: calc((var(--year-w, 0px) / 2) + var(--year-edge-gap));
  right: auto;
  transform: translateX(-50%);
  text-align: center;
}
.t-row > .t-rail:first-child .rail-range{
  left: auto;
  right: calc((var(--year-w, 0px) / 2) + var(--year-edge-gap));
  transform: translateX(60%);
  text-align: center;
}


/* On desktop, hide the in-card date to reduce rows */
@media (min-width: 721px){ .t-card .meta-date{ display: none; } }
/* Avoid work for off-screen rows/cards */
.t-row{
  /* an average row footprint so scrollbars stay stable */
  contain-intrinsic-size: 220px 720px;
}
.card{
  position: relative;
  z-index: 2;
}


/* --- Case Studies (minimal, alternating) --- */
#cases.section{ 
  margin-top: var(--section-gap);
  margin-bottom: var(--section-gap-lg);
}
.cases{
  width: var(--container);
  margin: 0 auto;
  display: grid;
  gap: var(--band-gap);
}



.case{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;               /* perfect vertical alignment */
}

.case--alt .case-media{ order: 2; }  /* alternate sides */
.case--alt .case-body { order: 1; }

.case-media{
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: var(--cs-media-ratio);
  height: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.case-media img{
  width: 100%; height: 100%;
  object-fit: cover; display:block
}

.case-media:hover{ 
  transform: translateY(-3px); 
  box-shadow: var(--shadow-media); 
}



.case-body .eyebrow{
  font-weight: 500; color: var(--ink-muted); margin-bottom: .35rem;
}

.case-body .cs-title{
  margin: 0 0 .5rem;
  font-size: clamp(2.8rem, 4vw, 3.4rem); font-weight: 600;
  letter-spacing: 0em;
}

.case-body .cs-summary{
  max-width: 48ch;                   /* wraps a bit sooner for balance */
  color: var(--ink-muted);
  display: -webkit-box; 
  -webkit-box-orient:vertical;
  overflow: hidden;
}

.case-link{
  display: inline-block;
  margin-top: .8rem;
  font-weight: 600;
  text-decoration: underline;
}

/* --- Footer --- */
footer{
  text-align: center;
  margin-top: 3.5rem;
  margin-bottom: 2rem;
}

/* ================== MOBILE ≤720px — single block ================== */
@media (max-width: 720px){

  /* 0) Tokens (variables) */
  :root{
    --header-pad: clamp(1.25rem, 6vw, 5.5rem);
    --section-gap: clamp(8.5rem, 6vw, 10rem);
    --section-gap-lg: clamp(10em, 6vw, 12rem);
    --timeline-pad: clamp(1.25rem, 3vw, 2rem);
    --t-row-gap: 2.5rem;
    --band-gap: clamp(17rem, 15vw, 17rem);
  }

  /* 1) Titles / spacing */
  .hero-name{ margin-bottom: var(--section-gap); }

  #work .section-title{
    text-align: left;
    font-weight: 500;
    margin: 12rem auto .5rem;
    letter-spacing: -1px;
  }
  .container .section-title{ width: 100%; margin: 0 0 .75rem; }

  /* 2) Cases */
  .cases{ gap: var(--band-gap); }
  .case{ grid-template-columns: 1fr; }
  .case--alt .case-media, .case--alt .case-body{ order: initial; }
  .case-body .cs-title{ font-size: clamp(2.3rem, 6vw, 2.6rem); }
  .case-body .cs-summary{ -webkit-line-clamp: 4; line-clamp: 4; }

  /* 3) Timeline (left spine pattern) */
  .t-rail{ display: none; }
  .timeline{ --dot-col: 28px; padding-block: 1.75rem; }
  .timeline::before{ left: calc(var(--dot-col)/2); transform: none; }

  .t-row{
    grid-template-columns: var(--dot-col) 1fr;
    gap: .75rem;
    align-items: stretch;
    position: relative; /* anchor for ::after dot */
  }
  .t-row::after{
    content: "";
    position: absolute;
    top: 50%;
    left: calc(var(--dot-col)/2);
    transform: translate(-50%, -50%);
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--accent-blue);
    box-shadow:
      0 0 0 5px var(--surface),
      0 0 0 6px var(--border);
    z-index: 2; pointer-events: none;
  }
  .t-row > .t-mid{ display: none !important; }
  .t-row > .t-card{ grid-column: 2; }
  .t-row > div:not(.t-mid):not(.t-card){ display: none; }
  .t-row + .t-row{ margin-top: var(--t-row-gap); }
}

/* Unhide sr-only when focused */
.skip-link:focus,
.skip-link:focus-visible{
  position: fixed; left: var(--page-gutter); top: 8px;
  width: auto; height: auto; clip: auto; clip-path: none;
  margin: 0; padding: .5rem .75rem; white-space: normal;
}

  @media (prefers-reduced-motion: reduce){
  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-name{ opacity:1; transform:none; animation:none !important; }

  html:focus-within { scroll-behavior: auto; } 
  *::before, *::after, *{
    animation: none !important;
    transition: none !important;
  }
  .card:hover{ transform: none; }
  .pill-nav .nav-btn:hover{ transform: none; }
  .pill-nav .pill-indicator{ transition: none; }
  .t-card summary::after{ transition: none; }
  /* Remove background blur to avoid GPU effects */
  .pill-nav .nav{
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
