/* 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; 
  scroll-behavior: smooth; 
  background-color: var(--bg); 
}

: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-s: clamp(5rem, 4vw, 7rem);
  --section-gap: clamp(12.25rem, 5vw, 14rem);
  --section-gap-m: clamp(6em, 6vw, 8rem);

  /* 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(10rem, 15vw, 12rem);

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

  /* 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);
  --pill-frost: rgba(255,255,255,0.002);
  --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; 
}

:root.theme-dark{
  --bg: #0f1115;
  --surface: #15191f;
  --border: #252c35;
  --jp-ink: #e6eaf2;
  --jp-ink-700: #b7becd;
  --ink: var(--jp-ink);
  --ink-muted: var(--jp-ink-700);
  --accent: color-mix(in oklab, var(--jp-azure) 18%, #0f1115);
  --accent-2: color-mix(in oklab, var(--jp-purple-water) 18%, #0f1115);
  --accent-blue: color-mix(in oklab, var(--jp-azure) 82%, #e6eaf2);
  --tint-1: color-mix(in oklab, var(--accent) 30%, var(--surface));
  --tint-2: color-mix(in oklab, var(--accent) 38%, var(--surface));
  --tint-3: color-mix(in oklab, var(--accent) 46%, var(--surface));
  --pill-bg: color-mix(in oklab, #ffffff 3%, transparent);
  --pill-border: color-mix(in oklab, #ffffff 10%, transparent);
  --pill-shadow: 0 14px 40px rgba(0,0,0,.3);
  --pill-frost: transparent;
  --shadow: 0 10px 30px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.25);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.4);
  --shadow-media: 0 20px 60px rgba(0,0,0,.55);
  --focus-ring: color-mix(in oklab, var(--accent-blue) 55%, transparent);
  --focus-border: color-mix(in oklab, var(--accent-blue) 65%, var(--border));
}

/* 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; }

/* Let article prose use the full container width on article pages */
.section-content.article { max-width: none;}

 .section + .section { margin-top: var(--section-gap); } 

.site-header .section{ margin-top: 0; }

/* 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);}


/* timeline "Read More" link: always blue + underlined */
.t-card a.read-more,
.t-card a.read-more:visited{
  color: var(--accent-blue);
  text-decoration: underline;
}
.t-card a.read-more:hover,
.t-card a.read-more:focus-visible{
  color: var(--accent-blue);
  text-decoration: underline;
}

/* keep heading look by default, but allow blue on hover/focus */
.t-card h4 a{
  color: inherit;
  text-decoration: none;
}
.t-card h4 a:hover,
.t-card h4 a:focus-visible{
  color: var(--accent-blue);
  text-decoration: none; /* or 'underline' if you want an underline too */
}



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 */

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

/* Header spacing only (header is NOT sticky) */
.site-header{
  /*padding-block: var(--header-pad); */
  min-height: 90vh;
  min-height: 90svh;
  display: flex;
  align-items: center;  /* center vertically within the header */
}
.site-header .container{ text-align: center; margin-left: auto;}
/* When an article is shown inside the bottom-sheet, size the header
   to the sheet's visible area so the hero stays centered. */
#article-sheet .site-header{
  min-height: calc(100dvh - var(--sheet-gap) - var(--hotzone));
}
/* Hero */
.hero-name{
  text-align: left;
  font-size: clamp(2.25rem, 3vw, 2.75rem);
  font-weight: 500;
  margin-left: 1rem;
  letter-spacing: -1px;
  opacity: 0;
  transform: translateY(30px);
}

.hero-name.article{
  font-size: clamp(2.55rem, 3vw, 3rem);
  text-align: center;
  letter-spacing: .5px;
  margin-left: 0;
}

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

.hero-name.is-in{
  animation:
    hero-in 750ms cubic-bezier(.22,.61,.36,1) 50ms forwards;
}

@keyframes hero-in{
  from{
    opacity: 0;
    transform: translateY(30px);
  }
  to{
    opacity: 1;
    transform: translateY(0);
  }
}


/* Reveal on scroll, the rest of the page */
.reveal-on-scroll {
  /* Tunables */
  --reveal-delay: 0ms; 
  --reveal-distance: 30px;
  --reveal-duration: 800ms;
  --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: calc(12px + env(safe-area-inset-top));
  z-index: 50;
  background: transparent;           /* same as page bg = no tint */
  border-bottom: 0;
}
.card{ position: relative; z-index: 2;}
/* === Pill nav (consolidated) ========================================= */
.pill-wrap { display: flex; justify-content: center; }
.pill-nav  { width: auto; max-width: 100%; }

/* Capsule container */
.pill-nav .nav{
  position: relative;            /* anchor indicator */
  isolation: isolate;            /* keep shadows & filters inside */
  border-radius: 9999px;
  gap: var(--pill-gap);
  padding: var(--pill-pad-y) var(--pill-pad-x);
  --pill-btn-w: clamp(70px, 8vw, 80px);

  /* neutral by default; frost handled below */
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;

  /* frost (as you currently ship) */
  -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: var(--pill-frost); }
}
@supports (animation-timeline: scroll()){
  :root.theme-dark .pill-nav .nav{
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    animation: pill-frost 1ms linear both;
    animation-timeline: scroll(root block);
    animation-range: 1px 80px;
  }
  @keyframes pill-frost{
    to{
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
    }
  }
}

/* Buttons */
.pill-nav .nav-btn{
  display: inline-flex; align-items:center; justify-content:center;
  box-sizing: border-box;
  width: auto; flex: 0 1 auto; white-space: normal; text-align: center;

  min-width: var(--pill-btn-w); min-height: 44px;
  padding: var(--pill-btn-pad-y) var(--pill-btn-pad-x);

  font-size: clamp(.87rem, .45vw + .74rem, .98rem);
  font-weight: 500; line-height: 1; color: var(--ink);

  border: 1px solid transparent; border-radius: 999px; background: transparent;

  /* compositor-friendly transitions only */
  transition: transform .18s ease, box-shadow .18s ease;
}
.pill-nav .nav-btn.nav-btn--theme{
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 1px solid transparent;
  font: inherit;
  color: inherit;
}
@media (hover: hover) and (pointer: fine){
  .pill-nav .nav-btn:hover:not(.is-active){ transform: translateY(-3px); }
}
.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; }
:where(.pill-nav .nav-btn:focus-visible){
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  transform: none;
}

/* Sliding indicator */
.pill-nav .pill-indicator{
  pointer-events: none;
  position: absolute;
  inset: 4px auto 4px 0;
  width: 0;
  border-radius: 9999px;
  backface-visibility: hidden;        /* merged here */
  background: rgba(255,255,255,.06);
  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 .2s ease;
  opacity: 0; z-index: 0;
}
.pill-nav .nav-btn{ position: relative; z-index: 1; }







/* 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) */
:is(.card, .card--simple, .form-card){
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card{
  /* keep only what's unique */
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  color: var(--ink);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card--simple{ display:block; padding: 1rem 1.2rem; }
.form-card{ padding: 1.1rem 1.2rem; }

.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;
}
:is(.card, .t-mid, .case > *, .article-meta, .chips, .level){ min-width: 0; }
.meta-grid, .meta-grid > * { min-width: 0; }

/* 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;
}
.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; }
.t-card ul{
  margin: .5rem 0 0;
  padding-left: 1.2rem;
}
@media (max-width: 720px){
  .t-details:not([open]) .t-points{ display: none; }
}
@media (min-width: 721px){
  .t-details{ margin: 0; padding: 0; }
  .t-details summary{ display: none; }
  .t-details .t-points{ display: block; }
}

/* 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 + .75rem - 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 + .75rem - 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: relative;
  text-align: center;
  pointer-events: none;
}
.rail-year{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 600;
  letter-spacing: -1px;
  font-size: clamp(3.6rem, 6vw + 1rem, 6rem);
  line-height: 1;
  color: var(--jp-ink-700);
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: manual;
}


.rail-range{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 185%);
  margin-top: 0;
  text-align: center;
  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;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-block: 2rem 3rem;
}


/* 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 */

/* --- Case Studies (minimal, alternating) --- */

.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 :is(.cs-title, .article-preview){
  margin: 0 0 .5rem;
  letter-spacing: 0;
}
.case-body .cs-title{
  font-size: clamp(2.8rem, 4vw, 3.4rem);
  font-weight: 600;
}
.case-body .article-preview{
  display:block;
  font-size: clamp(2.8rem, 4vw, 3.4rem);
  font-weight: 400;
  text-align: center; 
}
.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: var(--section-gap-lg);
  margin-bottom: 3rem;
}
.footer-toggle{
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0 .35rem;
  text-decoration: none;
}
.footer-toggle:hover,
.footer-toggle:focus-visible{
  text-decoration: none;
}



/* ===== Article: meta card, chips, meters ===== */
.article-meta .label{
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: .35rem;
}

/* 2x2 at desktop, single column on smaller */
.meta-grid{
  display: grid;
  gap: 1rem 1.25rem;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
}
.article-meta .meta-grid >:nth-child(3){grid-column: 1/-1;}

/* Chips (lean, general-purpose; not tied to nav pill rules) */
.chips{ 
  display:flex;
  flex-wrap: nowrap;             /* one line only */
  gap:.4rem .5rem;
  padding:0; margin:0;
  overflow-x: auto;              /* scroll if it can’t fit */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;         /* hide scrollbar (Firefox) */
}
.chips::-webkit-scrollbar{ display:none; }  /* hide (WebKit) */

.chips > .chip{
  list-style: none;
  display: inline-block;
  flex: 0 0 auto;
  padding: .35rem .6rem;
  border-radius: 9999px;
  background: var(--tint-1);
  border: 1px solid var(--border);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
}

/* ----- Level meters (fixed 5 segments; set --steps: 0..5) ----- */
.level{ display:flex; align-items:center; gap:.5rem; }

.meter{
  --h: 10px;
  --bg: var(--tint-2);
  --fill: var(--accent-blue);
  --gap: 2px;
  --segments: 4;
  --steps: 0;                 /* 0..5 → how many segments are filled */
  position: relative;
  height: var(--h);
  width: 100%;
  max-width: 180px;
  border-radius: 9999px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;

  /* draw 5 windows on the TRACK only (children inherit this; no double mask) */
  -webkit-mask:
    repeating-linear-gradient(to right,
      #000 0,
      #000 calc((100% - (var(--segments) - 1) * var(--gap)) / var(--segments)),
      transparent calc((100% - (var(--segments) - 1) * var(--gap)) / var(--segments)),
      transparent calc((100% - (var(--segments) - 1) * var(--gap)) / var(--segments) + var(--gap))
    );
          mask:
    repeating-linear-gradient(to right,
      #000 0,
      #000 calc((100% - (var(--segments) - 1) * var(--gap)) / var(--segments)),
      transparent calc((100% - (var(--segments) - 1) * var(--gap)) / var(--segments)),
      transparent calc((100% - (var(--segments) - 1) * var(--gap)) / var(--segments) + var(--gap))
    );
}

/* the FILL: solid bar that grows by whole steps; no mask here */
.meter::before{
  content:"";
  position:absolute; inset:0;
  width: calc((var(--steps) / var(--segments)) * 100%); /* 0,20,…100% */
  background: var(--fill);
}

/* optional semantics */
.meter.is-ok   { --fill:#16a34a; }
.meter.is-warn { --fill:#f59e0b; }
.meter.is-risk { --fill:#dc2626; }


.mosaic-frame{
  --mat: var(--jp-chalk); /* or --jp-deutzia for a cooler mat */
  margin-top: 6rem;
  margin-bottom: 7rem;
  background: var(--mat); 
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.mosaic-frame img{ display:block; width:100%; height:90%; border-radius:14px; }
.mosaic-frame figcaption{
  margin-top:.6rem; color: var(--ink-muted); font-size:.95rem; text-align:center;
}
.mosaic-frame:hover{ transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.theme-dark .mosaic-frame{
  --mat: #2f2f2c;
  box-shadow: var(--shadow-media);
}

.sheet{
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  --sheet-gap: max(70px, env(safe-area-inset-top, 0px));
  --hotzone: 40px;
}
.sheet[aria-hidden="false"]{ pointer-events: auto; }
.sheet__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.28);
  opacity: 0;
  transition: opacity .25s ease;
}
.sheet.is-open .sheet__backdrop{ opacity: 1; }
.sheet__panel{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  top: var(--sheet-gap);
  height: calc(100dvh - var(--sheet-gap));
  border-radius: 18px 18px 0 0;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-media);
  transform: translateY(100%);
  transition: transform .4s cubic-bezier(.2,.7,.2,1);
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  will-change: transform;
  overflow: hidden;
  overscroll-behavior: contain;
  isolation: isolate;
  --hotzone: 56px;
}
.sheet__panel > *{ position: relative; z-index: 1; }
.sheet.is-open .sheet__panel{ transform: translateY(0); }
.sheet__close{
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  justify-self: end;
  margin: .2rem .6rem 0 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  line-height: 1;
  padding: .4rem;
  z-index: 2;
}
.sheet__scroller{
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  contain: content;
  z-index: 0;
}
body.is-locked { overflow: hidden; }
#sheet-content {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.resume-sheet{
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-6);
}
.resume-sheet__toolbar{
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.resume-sheet__title{
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink-muted);
}
.resume-frame{
  display: block;
  width: 100%;
  min-height: 70vh;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}


/* ================== 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-a: clamp(14rem, 3vw, 15rem);
    --section-gap-lg: clamp(10em, 6vw, 12rem);
    --timeline-pad: clamp(1.25rem, 3vw, 2rem);
    --t-row-gap: 3rem; 
  }

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

  .case-body .article-preview{ 
    text-align: left;
    font-size: clamp(2rem, 4vw, 3.4rem); 
    margin: 0rem;
  }

  #work .section-title{
    text-align: left;
    font-weight: 500;
    letter-spacing: -1px;
    margin: 0 auto .5rem;
  }
  .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(--jp-azure);
    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); }

  .section-content.article .mosaic-frame{
  width: 100%;
  margin-inline: auto;
}
.section-content.article .mosaic-frame img{
  display: block;
  width: 100%;
  height: auto;
  max-width: none; /* force it to fill the figure */
}

}

/* 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){
  html { scroll-behavior: auto; }
  .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;
  }
}
