/* ═══════════════════════════════════════════════════════════
   Ronak Lodha — portfolio
   Design tokens, then components. No framework, no build step.
   Palette validated for contrast + CVD separation in both themes.
   ═══════════════════════════════════════════════════════════ */

/* ── Tokens ───────────────────────────────────────────────── */
:root {
  color-scheme: dark;

  --bg:        #0a0c10;
  --s1:        #0f1116;
  --s2:        #15181f;
  --line:      #232832;
  --line-soft: #1a1e26;

  --tx:        #eceef2;
  --tx-dim:    #9aa2ae;
  --tx-faint:  #6b7482;

  --accent:    #f2b45c;
  --accent-hi: #ffc978;
  --on-accent: #0a0c10;
  --accent-wash: rgb(242 180 92 / .10);

  /* categorical series — validated: 4 slots pass adjacent, first 3 pass all-pairs */
  --sr1: #b67700;
  --sr2: #009c86;
  --sr3: #8372e0;
  --sr4: #d55661;
  --sr-mute: #2b313d;

  --ff-sans:  "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ff-serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
  --ff-mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shell: 1200px;
  --gut: clamp(20px, 5vw, 56px);

  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: .45s;

  --r-sm: 3px;
  --r-md: 6px;
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg:        #faf9f7;
  --s1:        #ffffff;
  --s2:        #f2f1ed;
  --line:      #e2e0da;
  --line-soft: #ecebe6;

  --tx:        #15171a;
  --tx-dim:    #55595f;
  --tx-faint:  #7c818a;

  --accent:    #8f5208;
  --accent-hi: #a6620a;
  --on-accent: #ffffff;
  --accent-wash: rgb(143 82 8 / .08);

  --sr1: #af7100;
  --sr2: #009580;
  --sr3: #7e6cd9;
  --sr4: #ce505b;
  --sr-mute: #d9d7d1;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg);
  color: var(--tx);
  font: 400 16px/1.65 var(--ff-sans);
  font-feature-settings: "ss01" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }

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

::selection { background: var(--accent); color: var(--on-accent); }

.skip {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  padding: 10px 16px; background: var(--accent); color: var(--on-accent);
  font: 500 13px var(--ff-mono); border-radius: var(--r-sm);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gut);
}

/* ── Type primitives ──────────────────────────────────────── */
.eyebrow {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px;
  font: 500 11.5px/1.5 var(--ff-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tx-faint);
}
.eyebrow__sep { opacity: .55; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  --btn-bd: var(--line);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--tx);
  font: 500 14px/1 var(--ff-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { --btn-bd: var(--accent); color: var(--accent); background: var(--accent-wash); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}
.btn--primary:hover {
  background: var(--accent-hi); border-color: var(--accent-hi); color: var(--on-accent);
}
.btn--sm { padding: 8px 14px; font-size: 13px; }
.btn--lg { padding: 15px 26px; font-size: 15px; font-family: var(--ff-mono); }

.iconbtn {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: transparent; cursor: pointer;
  color: var(--tx-dim);
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.iconbtn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-wash); }

/* ── Top bar ──────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.topbar.is-stuck { border-bottom-color: var(--line); }
.topbar__in {
  display: flex; align-items: center; gap: 24px;
  height: 66px;
}
.topbar__rule {
  position: absolute; left: 0; bottom: -1px; height: 2px;
  width: var(--p, 0%);
  background: var(--accent);
  transition: width .1s linear;
}

.mark {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 600; letter-spacing: -.01em;
  margin-right: auto;
}
.mark__glyph { color: var(--accent); display: grid; place-items: center; }
.mark__text { font-size: 15px; white-space: nowrap; }

.nav { display: flex; gap: 4px; }
.nav a {
  position: relative;
  padding: 7px 11px;
  font: 500 13.5px/1 var(--ff-sans);
  color: var(--tx-dim);
  text-decoration: none;
  border-radius: var(--r-sm);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav a:hover { color: var(--tx); background: var(--s2); }
.nav a.is-active { color: var(--accent); }

.topbar__act { display: flex; align-items: center; gap: 8px; }
.ico-sun { display: none; }
:root[data-theme="light"] .ico-sun { display: block; }
:root[data-theme="light"] .ico-moon { display: none; }

.burger { display: none; flex-direction: column; gap: 4px; }
.burger span {
  width: 15px; height: 1.5px; background: currentColor; border-radius: 2px;
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.burger[aria-expanded="true"] span:first-child { transform: translateY(2.75px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child  { transform: translateY(-2.75px) rotate(-45deg); }

.msheet {
  position: sticky; top: 66px; z-index: 99;
  background: var(--s1); border-bottom: 1px solid var(--line);
}
.msheet nav { display: flex; flex-direction: column; padding: 8px var(--gut) 16px; }
.msheet a {
  display: flex; align-items: baseline; gap: 14px;
  padding: 13px 0; text-decoration: none;
  border-bottom: 1px solid var(--line-soft);
  font-size: 17px; font-weight: 500;
}
.msheet a em { font: 500 11px var(--ff-mono); font-style: normal; color: var(--accent); }

/* ── Hero ─────────────────────────────────────────────────── */
.hero { position: relative; padding: clamp(56px, 9vw, 104px) 0 0; overflow: hidden; }
.hero__field {
  position: absolute; inset: 0 0 auto; height: 520px;
  color: var(--line); pointer-events: none;
}
.hero__field svg { width: 100%; height: 100%; }
.hero__spark { color: var(--accent); opacity: .30; }
.hero__dots  { color: var(--accent); opacity: .5; }

.hero__in { position: relative; }

.hero__h1 {
  margin: 18px 0 0;
  font-family: var(--ff-serif);
  font-weight: 400;
  font-size: clamp(42px, 8.2vw, 92px);
  line-height: 1.03;
  letter-spacing: -.02em;
  max-width: 15ch;
}
.hero__h1 em { font-style: italic; color: var(--accent); }

.hero__lede {
  margin-top: 26px;
  max-width: 46ch;
  font-size: clamp(16.5px, 1.5vw, 19px);
  line-height: 1.6;
  color: var(--tx-dim);
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.hero__portrait {
  position: absolute; top: 6px; right: 0;
  width: clamp(150px, 20vw, 260px); aspect-ratio: 1;
}
.hero__portrait img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line), 0 0 0 7px var(--bg), 0 0 0 8px var(--line-soft);
  filter: saturate(.82) contrast(1.04);
}

/* credibility rail — career-span context under the hero */
.hcred {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 26px clamp(34px, 5vw, 72px);
  max-width: 880px;
  margin-top: clamp(54px, 7vw, 88px);
  padding-top: clamp(28px, 3vw, 36px);
  border-top: 1px solid var(--line);
}
.hcred__g { display: flex; flex-direction: column; gap: 10px; }
.hcred dt {
  font: 500 11px/1 var(--ff-mono); letter-spacing: .12em;
  text-transform: uppercase; color: var(--tx-faint);
}
.hcred dd {
  margin: 0; font-size: 15.5px; line-height: 1.5;
  letter-spacing: -.006em; color: var(--tx);
}
.hcred dd i { font-style: normal; font-size: 13px; color: var(--tx-faint); }

/* ── Bands & section headers ──────────────────────────────── */
.band { padding: clamp(68px, 10vw, 124px) 0; border-top: 1px solid var(--line-soft); }
.band--alt { background: var(--s1); }
.band--feature { background: var(--s1); }

.shead {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px;
  margin-bottom: clamp(32px, 5vw, 54px);
}
.shead__n {
  font: 500 11.5px/1 var(--ff-mono); letter-spacing: .1em;
  color: var(--accent);
}
.shead h2 {
  font-family: var(--ff-serif); font-weight: 400;
  font-size: clamp(27px, 3.6vw, 40px); line-height: 1;
  letter-spacing: -.015em;
}
.shead__rule { flex: 1; height: 1px; background: var(--line); }
.shead__meta {
  font: 400 11.5px/1 var(--ff-mono); letter-spacing: .08em;
  text-transform: uppercase; color: var(--tx-faint); white-space: nowrap;
}
.band__lede {
  max-width: 58ch; margin-bottom: 38px;
  font-size: 16.5px; color: var(--tx-dim);
}

/* ── Now ──────────────────────────────────────────────────── */
.now { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 76px); }
.now__role {
  font-family: var(--ff-serif); font-size: clamp(25px, 3.1vw, 34px);
  line-height: 1.2; letter-spacing: -.015em; margin-bottom: 22px;
}
.now__role a { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; }
.now__role a:hover { color: var(--accent-hi); }
.now__body { font-size: 16.5px; color: var(--tx-dim); margin-bottom: 16px; max-width: 54ch; }
.now__body strong { color: var(--tx); font-weight: 600; }

.now__facets { border-top: 1px solid var(--line); align-self: start; }
.now__facets li {
  display: flex; flex-direction: column; gap: 3px;
  padding: 15px 0; border-bottom: 1px solid var(--line);
}
.now__facets span { font: 500 12px/1 var(--ff-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.now__facets em { font-style: normal; font-size: 14.5px; color: var(--tx-dim); }

/* Three things currently shipping — spans the full Now grid on its own row */
.now__ships {
  grid-column: 1 / -1;
  margin-top: clamp(26px, 4vw, 44px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md); overflow: hidden;
}
.now__ships li {
  background: var(--bg); padding: 19px 20px 21px;
  display: flex; flex-direction: column; gap: 7px;
}
.now__ships em {
  font: 500 10.5px/1 var(--ff-mono); letter-spacing: .12em;
  font-style: normal; color: var(--accent);
}
.now__ships span { font-size: 15.5px; font-weight: 600; letter-spacing: -.008em; }
.now__ships i { font-style: normal; font-size: 13.5px; line-height: 1.5; color: var(--tx-dim); }

/* ── Records (case studies) ───────────────────────────────── */
.records { border-top: 1px solid var(--line); }
.rec { border-bottom: 1px solid var(--line); }

.rec summary {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 22px;
  align-items: center; gap: 18px;
  padding: 24px 4px;
  cursor: pointer; list-style: none;
  transition: background .2s var(--ease);
}
.rec summary::-webkit-details-marker { display: none; }
.rec summary:hover { background: var(--accent-wash); }
.rec__idx { font: 500 12px/1 var(--ff-mono); color: var(--tx-faint); }
.rec__title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rec__title strong {
  font-family: var(--ff-serif); font-weight: 400;
  font-size: clamp(19px, 2.3vw, 26px); line-height: 1.22; letter-spacing: -.012em;
}
.rec__org { font: 400 12.5px/1.4 var(--ff-mono); color: var(--tx-faint); }
.rec__tag {
  font: 500 11px/1 var(--ff-mono); letter-spacing: .07em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-wash);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  padding: 7px 11px; border-radius: 100px; white-space: nowrap;
}
.rec__chev {
  justify-self: end; width: 11px; height: 11px;
  border-right: 1.6px solid var(--tx-faint); border-bottom: 1.6px solid var(--tx-faint);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .3s var(--ease), border-color .2s var(--ease);
}
.rec[open] .rec__chev { transform: rotate(225deg) translate(-2px, -2px); border-color: var(--accent); }
.rec summary:hover .rec__chev { border-color: var(--accent); }

.rec__body { padding: 4px 4px 36px; }
.rec__cols {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 60px); align-items: start;
}
.rec__col { padding-left: 58px; }
.rec__col h3 {
  font: 500 11px/1 var(--ff-mono); letter-spacing: .13em; text-transform: uppercase;
  color: var(--accent); margin: 26px 0 11px;
}
.rec__col h3:first-child { margin-top: 0; }
.rec__col p { color: var(--tx-dim); font-size: 15.5px; max-width: 58ch; }
.rec__col p strong { color: var(--tx); }
.rec__col ul { display: grid; gap: 9px; }
.rec__col ul li {
  position: relative; padding-left: 18px;
  color: var(--tx-dim); font-size: 15.5px; max-width: 58ch;
}
.rec__col ul li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 6px; height: 1.5px; background: var(--accent);
}

.rec__viz {
  background: var(--s1); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 18px 18px 14px;
  position: sticky; top: 90px;
}
.band--alt .rec__viz { background: var(--bg); }
.rec__viz figcaption {
  font: 500 11.5px/1.4 var(--ff-mono); letter-spacing: .07em; text-transform: uppercase;
  color: var(--tx-dim); margin-bottom: 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.tagmini {
  font-size: 9.5px; letter-spacing: .1em; padding: 3px 7px;
  border: 1px solid var(--line); border-radius: 100px; color: var(--tx-faint);
}
.rec__viz svg { width: 100%; height: auto; display: block; }
.viz__note {
  margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line-soft);
  font: 400 11.5px/1.45 var(--ff-mono); color: var(--tx-faint);
}

/* chart primitives */
.ax { stroke: var(--line); stroke-width: 1; }
.ax--base { stroke: var(--tx-faint); stroke-width: 1; }
.gridlines line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.bar--mute { fill: var(--sr-mute); }
.bar--hero { fill: var(--accent); }
.barlbl text, .vzlbl, .vzkey text, .flow text, .barval {
  font: 500 10.5px var(--ff-mono); fill: var(--tx-dim);
}
.barval--hero { fill: var(--accent); }
.vzflag { font: 500 10px var(--ff-mono); fill: var(--tx-faint); }
.seg--mute { fill: var(--sr-mute); }
.seg--s1 { fill: var(--sr1); } .seg--s2 { fill: var(--sr2); } .seg--s3 { fill: var(--sr3); }
.seg { stroke: var(--s1); stroke-width: 2; }
.band--alt .seg { stroke: var(--bg); }
.key--mute { fill: var(--sr-mute); }
.key--s1 { fill: var(--sr1); } .key--s2 { fill: var(--sr2); } .key--s3 { fill: var(--sr3); }
.vzconn { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.ln { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ln--target { stroke: var(--tx-faint); stroke-dasharray: 4 4; }
.ln--actual { stroke: var(--accent); }
.pt { fill: var(--accent); stroke: var(--s1); stroke-width: 2; }
.band--alt .pt { stroke: var(--bg); }
.key-ln { stroke-width: 2; stroke-linecap: round; }
.key-ln--target { stroke: var(--tx-faint); stroke-dasharray: 4 4; }
.key-ln--actual { stroke: var(--accent); }
.flow rect { fill: var(--s2); stroke: var(--line); stroke-width: 1; }
.band--alt .flow rect { fill: var(--s2); }
.flow text { text-anchor: middle; }
.flow--hero { fill: var(--accent-wash) !important; stroke: var(--accent) !important; }
.hero-t { fill: var(--accent) !important; }
.arrows path { fill: none; stroke: var(--tx-faint); stroke-width: 1.2; }
.txtlines rect { fill: var(--sr-mute); }
.cells rect { fill: var(--s2); stroke: var(--line); stroke-width: 1; }
.cell--hero { fill: var(--accent-wash) !important; stroke: var(--accent) !important; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 26px; padding-left: 58px; }
.chips li {
  font: 400 12px/1 var(--ff-mono);
  padding: 7px 11px; border: 1px solid var(--line);
  border-radius: 100px; color: var(--tx-dim);
}
.chips--lg { padding-left: 0; margin-top: 16px; }
.chips--lg li { font-size: 12.5px; padding: 8px 13px; }

/* ── Timeline ─────────────────────────────────────────────── */
.tl { position: relative; }
.tl::before {
  content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px;
  width: 1px; background: var(--line);
}
.tl__i {
  position: relative; display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  gap: clamp(16px, 3vw, 40px);
  padding: 0 0 36px 40px;
}
.tl__i::before {
  content: ""; position: absolute; left: 3px; top: 7px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--tx-faint);
}
.band--alt .tl__i::before { background: var(--s1); }
.tl__i--live::before { background: var(--accent); border-color: var(--accent); }
.tl__i--live::after {
  content: ""; position: absolute; left: 3px; top: 7px;
  width: 9px; height: 9px; border-radius: 50%;
  border: 1.5px solid var(--accent);
  animation: ping 2.6s var(--ease) infinite;
}
@keyframes ping {
  0%   { transform: scale(1); opacity: .8; }
  70%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}
.tl__when {
  font: 400 12px/1.5 var(--ff-mono); color: var(--tx-faint);
  letter-spacing: .03em; padding-top: 2px;
}
.tl__what h3 {
  font-size: 17.5px; font-weight: 600; letter-spacing: -.008em;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px;
}
.tl__what h3 span {
  font: 500 12.5px var(--ff-mono); color: var(--accent);
  letter-spacing: .02em;
}
.tl__meta { font: 400 12px var(--ff-mono); color: var(--tx-faint); margin-top: 5px; }
.tl__what p:not(.tl__meta) { margin-top: 9px; font-size: 15.5px; color: var(--tx-dim); max-width: 64ch; }

/* ── Toolkit ──────────────────────────────────────────────── */
.kits { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.kit { background: var(--s1); padding: 26px 24px 28px; }
.kit h3 {
  font: 500 11px/1 var(--ff-mono); letter-spacing: .13em; text-transform: uppercase;
  color: var(--accent);
}

/* ── Offline ──────────────────────────────────────────────── */
.offline { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(30px, 5vw, 64px); align-items: start; }
.offline__lead { grid-row: span 2; }
.offline__big {
  font-family: var(--ff-serif); font-weight: 400;
  font-size: clamp(24px, 3.3vw, 36px); line-height: 1.25; letter-spacing: -.015em;
  margin-bottom: 22px; max-width: 24ch;
}
.offline__big em { font-style: italic; color: var(--accent); }
.offline__lead p:not(.offline__big) { color: var(--tx-dim); font-size: 16px; max-width: 54ch; }

.medals {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden;
}
.medals > div { background: var(--s1); padding: 18px 16px; }
.medals dt { font: 500 10.5px/1 var(--ff-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--tx-faint); }
.medals dd { margin-top: 10px; font-family: var(--ff-serif); font-size: 26px; line-height: 1.15; color: var(--accent); text-wrap: balance; }
.medals > div:last-child dd { font-size: 19px; }

.offline__also { margin-top: 22px; border-top: 1px solid var(--line); }
.offline__also li {
  display: flex; gap: 14px; align-items: baseline;
  padding: 13px 0; border-bottom: 1px solid var(--line);
  font-size: 14.5px; color: var(--tx-dim);
}
.offline__also span {
  font: 500 10.5px var(--ff-mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--tx-faint); flex: none; width: 34px;
}

/* ── Credentials ──────────────────────────────────────────── */
.creds { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: clamp(30px, 5vw, 64px); }
.creds__h {
  font: 500 11px/1 var(--ff-mono); letter-spacing: .13em; text-transform: uppercase;
  color: var(--accent); padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.creds__list li { padding: 17px 0; border-bottom: 1px solid var(--line-soft); }
.creds__row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.creds__row strong { font-size: 15.5px; font-weight: 600; }
.creds__row span { font: 400 11.5px var(--ff-mono); color: var(--tx-faint); white-space: nowrap; }
.creds__list p { margin-top: 5px; font-size: 13.5px; color: var(--tx-dim); }

/* ── Contact ──────────────────────────────────────────────── */
.contact { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 72px); align-items: start; }
.contact__big {
  font-family: var(--ff-serif); font-weight: 400;
  font-size: clamp(26px, 3.6vw, 40px); line-height: 1.2; letter-spacing: -.015em;
  max-width: 18ch;
}
.contact__lead p:not(.contact__big) { margin-top: 18px; color: var(--tx-dim); max-width: 46ch; }
.contact__lead .btn { margin-top: 28px; }

.contact__links { border-top: 1px solid var(--line); }
.contact__links a {
  display: grid; grid-template-columns: 96px minmax(0, 1fr);
  grid-template-rows: auto auto; gap: 2px 16px;
  padding: 18px 10px 18px 0; border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background .2s var(--ease), padding-left .2s var(--ease);
}
.contact__links a:hover { background: var(--accent-wash); padding-left: 10px; }
.cl__k {
  grid-row: span 2;
  font: 500 11px/1.4 var(--ff-mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--tx-faint); padding-top: 3px;
}
.cl__v { font-size: 15.5px; font-weight: 500; }
.contact__links a:hover .cl__v { color: var(--accent); }
.cl__n { font: 400 12px var(--ff-mono); color: var(--tx-faint); }

/* ── Footer ───────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); padding: 30px 0 38px; }
.foot__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.foot p { font: 400 12px var(--ff-mono); color: var(--tx-faint); }

/* ── Command palette ──────────────────────────────────────── */
.cmd {
  width: min(520px, calc(100vw - 32px));
  padding: 0; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--s1); color: var(--tx);
  margin-top: 14vh;
  box-shadow: 0 24px 60px rgb(0 0 0 / .45);
}
.cmd::backdrop { background: rgb(0 0 0 / .55); backdrop-filter: blur(3px); }
.cmd__bar { display: flex; align-items: center; gap: 11px; padding: 15px 16px; border-bottom: 1px solid var(--line); color: var(--tx-faint); }
.cmd__bar input {
  flex: 1; border: 0; background: transparent; color: var(--tx);
  font: 400 15px var(--ff-sans); outline: none;
}
.cmd__bar kbd {
  font: 500 10.5px var(--ff-mono); color: var(--tx-faint);
  border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px;
}
.cmd__list { max-height: 340px; overflow-y: auto; padding: 6px; }
.cmd__list li { }
.cmd__list button {
  display: flex; align-items: baseline; gap: 12px; width: 100%;
  padding: 11px 12px; border: 0; background: transparent; border-radius: var(--r-sm);
  text-align: left; cursor: pointer; font-size: 14.5px;
}
.cmd__list button em { font: 500 10.5px var(--ff-mono); font-style: normal; color: var(--accent); }
.cmd__list button span { color: var(--tx-faint); font-size: 13px; margin-left: auto; }
.cmd__list button:hover, .cmd__list button[aria-selected="true"] { background: var(--accent-wash); }
.cmd__empty { padding: 20px 12px; color: var(--tx-faint); font-size: 14px; }

/* ── Reveal & chart animation ─────────────────────────────── */
/* Only hide pre-reveal when JS is present to reveal it again. */
.js .reveal { opacity: 0; transform: translateY(18px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }

.rec[open] .grow { animation: growx .7s var(--ease) both; transform-origin: left center; }
@keyframes growx { from { transform: scaleX(.12); } to { transform: scaleX(1); } }
.rec[open] .grow-row rect { animation: growx .6s var(--ease) both; transform-origin: left center; }
.rec[open] .grow-row rect:nth-child(2) { animation-delay: .07s; }
.rec[open] .grow-row rect:nth-child(3) { animation-delay: .14s; }
.rec[open] .grow-row rect:nth-child(4) { animation-delay: .21s; }
.rec[open] .grow-row rect:nth-child(5) { animation-delay: .28s; }
.rec[open] .draw { stroke-dasharray: 420; animation: draw 1s var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 420; } to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .reveal.in { opacity: 1; transform: none; }
  .js .reveal.in { transition: none; }
  .tl__i--live::after { animation: none; display: none; }
  .rec[open] .grow, .rec[open] .grow-row rect, .rec[open] .draw { animation: none; }
  .btn, .iconbtn, .nav a, .contact__links a, .rec summary { transition: none; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1040px) {
  .now, .contact, .offline { grid-template-columns: 1fr; }
  .offline__lead { grid-row: auto; }
  .rec__cols { grid-template-columns: 1fr; }
  .rec__col { padding-left: 0; }
  .chips { padding-left: 0; }
  .rec__viz { position: static; max-width: 460px; }
}

@media (max-width: 860px) {
  .nav { display: none; }
  .burger { display: flex; }
  .topbar__in { height: 60px; gap: 10px; }
  .msheet { top: 60px; }
  .hero { padding-top: 30px; }

  /* portrait leads on mobile, so reorder the hero as a column */
  .hero__in { display: flex; flex-direction: column; align-items: flex-start; }
  .hero__portrait { position: static; order: -1; width: 104px; margin: 0 0 22px; }
  .hero__field { height: 380px; opacity: .55; }

  .hero__h1 { font-size: clamp(34px, 9.6vw, 52px); max-width: none; }
  .hero__lede { font-size: 16.5px; }
  .eyebrow { font-size: 10.5px; letter-spacing: .1em; }
  .tl__i { grid-template-columns: 1fr; gap: 7px; padding-left: 30px; }
  .tl__when { padding-top: 0; }
  .shead__meta { display: none; }
  .shead__rule { min-width: 24px; }
  .rec summary { grid-template-columns: 26px minmax(0, 1fr) 18px; gap: 11px; padding: 20px 2px; align-items: start; }
  .rec__idx { padding-top: 5px; }
  .rec__chev { margin-top: 5px; }
  .rec__tag { grid-column: 2; justify-self: start; margin-top: 2px; }
  .rec__chev { grid-column: 3; grid-row: 1; }
}

@media (max-width: 480px) {
  .mark__text { display: none; }
  .btn--lg { font-size: 12.5px; padding: 14px 18px; }
  .creds__row { flex-direction: column; gap: 3px; }
  .medals { grid-template-columns: 1fr 1fr; }
  .medals > div:last-child { grid-column: span 2; }
}

@media print {
  .topbar, .msheet, .cmd, .hero__field, .hero__cta, .skip { display: none !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .rec__body { display: block !important; }
  body { background: #fff; color: #000; }
}
