/* aadityakumawat.me
   One family (Archivo, variable weight + width), one accent (signal orange),
   hairline structure. Edit the tokens below to restyle the whole site. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-ext.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #f1f1ef;
  --paper-2: #e6e6e3;
  --card: #fafaf9;
  --ink: #000;
  --ink-2: #2e2e2c;
  --mute: #6b6b67;
  --rule: #d2d2ce;
  --signal: #ff4d00;
  --signal-ink: #c23a00; /* orange dark enough for small text */
  --bar-muted: #b9b9b4;
  --hi: #fff;

  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: clamp(16px, 2.4vw, 36px);
  --gap: clamp(14px, 1.6vw, 24px);
  --radius: 18px;
  --header-h: 68px;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: clamp(1.25rem, 1.05rem + 0.6vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  --step-3: clamp(2rem, 1.4rem + 2.2vw, 3.25rem);
  --step-4: clamp(2.75rem, 1.6rem + 4.6vw, 6rem);
}

:root[data-theme="dark"] {
  --paper: #000;
  --paper-2: #161615;
  --card: #0d0d0c;
  --ink: #f1f1ef;
  --ink-2: #cfcfcb;
  --mute: #8f8f8a;
  --rule: #2b2b29;
  --signal: #ff5a14;
  --signal-ink: #ff7a3d;
  --bar-muted: #4a4a46;
  --hi: #000;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.55;
  font-weight: 400;
  font-stretch: 100%;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a { color: inherit; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

::selection { background: var(--signal); color: #fff; }

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { padding-inline: var(--gutter); }

.num { font-variant-numeric: tabular-nums; }

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: baseline;
  font-size: 1.6rem;
  font-weight: 800;
  font-stretch: 105%;
  letter-spacing: -0.06em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.logo-dot {
  display: inline-block;
  width: 0.24em;
  height: 0.24em;
  margin-left: 0.06em;
  border-radius: 50%;
  background: var(--signal);
}

.nav {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--paper-2);
}
.nav a {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.nav a:hover,
.nav a[aria-current="page"] { background: var(--card); color: var(--ink); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 6px 6px 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.btn-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  transition: transform 0.25s ease;
}
.btn-icon svg { width: 14px; height: 14px; }
.btn:hover .btn-icon { transform: rotate(-45deg); }
.btn-dl:hover .btn-icon { transform: translateY(2px); }

.btn-ghost {
  padding: 6px 20px;
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.btn-sm { min-height: 38px; padding: 4px 4px 4px 16px; font-size: 0.875rem; }
.btn-sm .btn-icon { width: 28px; height: 28px; }

.text-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.2s;
}
.text-link:hover { text-decoration-color: var(--signal); }

/* ---------- Hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - var(--header-h));
}

.hero-grid {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: 3fr 4fr 5fr;
  min-height: 460px;
}
.hero-grid::before,
.hero-grid::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--rule);
  transform-origin: left;
}
.hero-grid::before { top: 0; }
.hero-grid::after { bottom: 0; }

.cell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: var(--gap);
}
.cell + .cell { border-left: 1px solid var(--rule); }

.cell-meta { padding-left: 0; }
.cell-intro { padding-right: 0; justify-content: flex-end; }

.place { color: var(--ink); font-weight: 500; line-height: 1.3; }
.clock {
  display: block;
  margin-top: 4px;
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.today { display: block; color: var(--mute); font-size: var(--step--1); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.35;
}
.pulse {
  position: relative;
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--signal);
}
.pulse::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid var(--signal);
  opacity: 0;
  animation: ping 2.4s ease-out infinite;
}
@keyframes ping {
  0% { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

.portrait {
  position: relative;
  margin: 0;
  height: 100%;
  min-height: 320px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--card);
}
.portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.portrait canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 44px);
}
.portrait img { object-fit: cover; object-position: 50% 20%; }
.portrait canvas { touch-action: pan-y; }

/* registration marks on the portrait corners */
.mark {
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--paper);
  border: 1px solid var(--rule);
  z-index: 2;
}
.mark-tl { top: 8px; left: 8px; }
.mark-tr { top: 8px; right: 8px; }
.mark-bl { bottom: 8px; left: 8px; }
.mark-br { bottom: 8px; right: 8px; }

.portrait figcaption {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 16px;
  z-index: 2;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--mute);
  pointer-events: none;
}

.intro {
  max-width: 30ch;
  font-size: var(--step-2);
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-weight: 450;
  text-wrap: pretty;
}
.intro-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.name {
  margin: 0;
  padding: 0.05em 0 0.17em;
  color: var(--ink);
  font-weight: 760;
  font-stretch: 96%;
  font-size: 16.4vw; /* JS refines this to fill the row exactly */
  line-height: 0.82;
  letter-spacing: -0.065em;
  white-space: nowrap;
  overflow: hidden;
}
.name .ch {
  display: inline-block;
  will-change: transform;
}

/* one orchestrated entrance: hairlines draw, name rises */
.js .hero-grid::before,
.js .hero-grid::after { animation: draw 0.9s cubic-bezier(.7,0,.2,1) both; }
.js .name .ch { animation: rise 0.9s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(0.25s + var(--i) * 0.035s); }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rise { from { transform: translateY(105%); } to { transform: translateY(0); } }

/* ---------- Sections ---------- */

.section { padding-block: clamp(72px, 10vw, 150px) 0; }

.section-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: end;
  padding-bottom: clamp(28px, 4vw, 52px);
}
.section-title {
  grid-column: 1 / span 7;
  font-size: var(--step-4);
  font-weight: 720;
  letter-spacing: -0.045em;
  line-height: 0.92;
}
.count {
  margin-left: 0.12em;
  font-size: 0.3em;
  font-weight: 500;
  letter-spacing: 0;
  vertical-align: top;
  color: var(--mute);
}
.section-lede {
  grid-column: 9 / span 4;
  max-width: 38ch;
  color: var(--ink-2);
}

/* ---------- Project rows ---------- */

.rows { border-top: 1px solid var(--rule); }

.row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  padding-block: clamp(28px, 3.4vw, 48px);
  border-bottom: 1px solid var(--rule);
}

.row-meta {
  grid-column: 1 / span 2;
  font-size: var(--step--1);
  color: var(--mute);
  line-height: 1.45;
}
.row-meta dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.row-meta dd { margin: 0 0 6px; }
.row-meta .when { color: var(--ink); font-weight: 550; }

.row-body {
  grid-column: 3 / span 5;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-right: clamp(0px, 2vw, 32px);
}
.row-title {
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.98;
}
.row-title a {
  text-decoration: none;
  background-image: linear-gradient(var(--signal), var(--signal));
  background-size: 0% 3px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.35s ease;
}
.row-title a:hover,
.row-title a:focus-visible { background-size: 100% 3px; }
.row-sub { font-size: var(--step--1); color: var(--mute); margin-top: 8px; display: block; font-weight: 450; letter-spacing: 0; }
.row-text { max-width: 52ch; }

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.facts div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; }
.facts dt { font-size: 0.8125rem; line-height: 1.3; color: var(--mute); }
.facts dd {
  margin: 0;
  font-size: var(--step-2);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.row-links { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: auto; }

.row-visual {
  grid-column: 8 / span 5;
  align-self: start;
  display: block;
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper-2);
  text-decoration: none;
  color: inherit;
}
.row-visual img { width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform 0.6s cubic-bezier(.2,.8,.2,1); }
.row-visual:hover img { transform: scale(1.025); }
.row-visual.is-figure { background: #fff; display: grid; place-items: center; padding: 5%; }
.row-visual.is-figure img { height: auto; object-fit: contain; }

/* Terminal visual (Sextant) */
.term {
  height: 100%;
  margin: 0;
  padding: clamp(16px, 2.2vw, 28px);
  overflow: hidden;
  font-family: var(--mono);
  font-size: clamp(0.6rem, 0.45rem + 0.45vw, 0.86rem);
  line-height: 1.6;
  color: var(--ink-2);
  white-space: pre;
}
.term .c { color: var(--mute); }
.term .p { color: var(--signal-ink); }
.term .ok { color: var(--ink); font-weight: 700; background: var(--hi); box-shadow: 0 0 0 3px var(--hi); }

/* Bars visual (nanoserve) */
.bars {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(18px, 2.6vw, 32px);
  height: 100%;
  padding: clamp(18px, 3vw, 40px);
}
.bars h4 { font-size: 0.9rem; font-weight: 600; letter-spacing: 0; margin-bottom: 10px; color: var(--ink); }
.bars h4 span { font-weight: 400; color: var(--mute); }
.bar { display: grid; grid-template-columns: 7.5em 1fr; align-items: center; gap: 10px; font-size: 0.8125rem; color: var(--mute); }
.bar + .bar { margin-top: 6px; }
.bar-track { position: relative; height: 26px; }
.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w);
  min-width: 2px;
  border-radius: 4px;
  background: var(--bar-muted);
}
.bar-fill.is-ours { background: var(--ink); }
.bar-val {
  position: absolute;
  top: 50%;
  left: calc(var(--w) + 8px);
  transform: translateY(-50%);
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bar-val.inside { left: 10px; color: var(--paper); }
.bars-note { font-size: 0.75rem; color: var(--mute); }

/* Company Hub mock (in the product's own dark look) */
.mock {
  height: 100%;
  background: #0c0f0d;
  color: #e9efe9;
  display: flex;
  flex-direction: column;
}
.mock-bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid #1d231f; }
.mock-bar i { width: 9px; height: 9px; border-radius: 50%; background: #2a312c; }
.mock-body { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; gap: 6%; align-items: center; padding: 6% 7%; }
.mock-h {
  margin: 0;
  font-size: clamp(1.15rem, 0.6rem + 1.8vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #f4f7f4;
}
.mock-h em { font-style: normal; color: #3ddc84; }
.mock-stat { margin-top: 12px; font-size: 0.72rem; color: #8a968d; }
.mock-list { display: flex; flex-direction: column; gap: 10px; }
.mock-co { padding: 10px 12px; border: 1px solid #1f2722; border-radius: 10px; background: #111613; }
.mock-co b { display: block; font-size: 0.78rem; font-weight: 600; margin-bottom: 8px; }
.spectrum { display: flex; height: 4px; border-radius: 3px; overflow: hidden; gap: 2px; }
.spectrum i:nth-child(1) { background: #3ddc84; }
.spectrum i:nth-child(2) { background: #f5a524; }
.spectrum i:nth-child(3) { background: #f04a5d; }

/* ---------- Compact list rows ---------- */

.list { border-top: 1px solid var(--rule); }
.item {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  padding-block: 22px;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.item-title { grid-column: 1 / span 4; font-size: var(--step-1); font-weight: 650; letter-spacing: -0.02em; color: var(--ink); line-height: 1.2; }
.item-title a { text-decoration: none; }
.item-title a:hover { text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.item-text { grid-column: 5 / span 6; max-width: 62ch; }
.item-text .by { display: block; margin-top: 6px; font-size: var(--step--1); color: var(--mute); }
.item-side { grid-column: 11 / span 2; text-align: right; font-size: var(--step--1); color: var(--mute); }
.item-side a { color: var(--ink); }
.item-side span { display: block; }
.item p { margin: 0; }

/* recognition: title + year only */
.honors .item-title { grid-column: 1 / span 9; font-size: var(--step-1); font-weight: 500; }
.honors .item-title strong { font-weight: 700; }
.honors .item-side { grid-column: 10 / span 3; }

.subhead {
  margin: clamp(48px, 6vw, 80px) 0 0;
  padding-bottom: 14px;
  font-size: var(--step-1);
  font-weight: 650;
  letter-spacing: -0.02em;
}

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  padding-top: clamp(28px, 4vw, 52px);
  border-top: 1px solid var(--rule);
}
.about-text {
  grid-column: 1 / span 7;
  font-size: var(--step-2);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-weight: 430;
}
.about-text p { max-width: 34ch; }
.about-side { grid-column: 9 / span 4; }
.skills { margin: 0; }
.skills div { padding-block: 12px; border-bottom: 1px solid var(--rule); }
.skills div:first-child { padding-top: 0; }
.skills dt { font-size: var(--step--1); color: var(--mute); margin-bottom: 2px; }
.skills dd { margin: 0; color: var(--ink); }

/* ---------- Contact ---------- */

.contact { padding-block: clamp(72px, 10vw, 150px) clamp(40px, 5vw, 64px); }
.contact-lede { max-width: 40ch; font-size: var(--step-1); color: var(--ink); line-height: 1.35; margin-bottom: 28px; }
.email {
  display: inline-block;
  max-width: 100%;
  color: var(--ink);
  font-size: clamp(1.25rem, 5.75vw, 6.25rem);
  font-weight: 650;
  letter-spacing: -0.05em;
  line-height: 1;
  text-decoration: none;
  overflow-wrap: anywhere;
  background-image: linear-gradient(var(--signal), var(--signal));
  background-size: 0% 0.06em;
  background-repeat: no-repeat;
  background-position: 0 98%;
  transition: background-size 0.45s ease;
  padding-bottom: 0.08em;
}
.email:hover, .email:focus-visible { background-size: 100% 0.06em; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.copy-state { min-width: 6.5em; text-align: left; }

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 22px;
  border-top: 1px solid var(--rule);
  font-size: var(--step--1);
  color: var(--mute);
}
.site-footer a { color: var(--ink-2); }

/* ---------- Case study pages ---------- */

.cs-head { padding-top: clamp(40px, 7vw, 110px); }
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(24px, 3vw, 40px);
  font-size: var(--step--1);
  color: var(--mute);
  text-decoration: none;
}
.back:hover { color: var(--ink); }
.cs-title {
  font-size: clamp(3.4rem, 1rem + 11vw, 12rem);
  font-weight: 760;
  font-stretch: 96%;
  letter-spacing: -0.065em;
  line-height: 0.85;
}
.cs-summary {
  max-width: 34ch;
  margin-top: clamp(20px, 2.5vw, 36px);
  font-size: var(--step-2);
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-weight: 450;
}

.cs-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: clamp(36px, 5vw, 64px) 0 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.cs-meta div { padding: 16px var(--gap) 18px 0; }
.cs-meta div + div { padding-left: var(--gap); border-left: 1px solid var(--rule); }
.cs-meta dt { font-size: var(--step--1); color: var(--mute); margin-bottom: 4px; }
.cs-meta dd { margin: 0; color: var(--ink); line-height: 1.4; }
.cs-meta dd a { color: var(--ink); }

.cs-hero-visual {
  margin: clamp(28px, 4vw, 56px) 0 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-2);
}
.cs-hero-visual.is-figure { background: #fff; padding: clamp(16px, 4vw, 56px); }
.cs-hero-visual img { width: 100%; height: auto; }
.cs-hero-visual .term { height: auto; font-size: clamp(0.72rem, 0.6rem + 0.3vw, 0.9rem); }
.cs-hero-visual .bars { padding: clamp(24px, 5vw, 64px); }

.cs-section {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  padding-block: clamp(40px, 6vw, 88px);
  border-bottom: 1px solid var(--rule);
}
.cs-section > h2 {
  grid-column: 1 / span 4;
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.98;
}
.cs-body { grid-column: 6 / span 7; max-width: 64ch; }
.cs-body h3 { font-size: var(--step-1); font-weight: 650; letter-spacing: -0.02em; margin: 1.8em 0 0.5em; }
.cs-body h3:first-child { margin-top: 0; }
.cs-body ul { margin: 0 0 1em; padding-left: 1.1em; }
.cs-body li { margin-bottom: 0.5em; }
.cs-body li::marker { color: var(--signal); }
.cs-body code { font-family: var(--mono); font-size: 0.88em; padding: 0.1em 0.35em; border-radius: 4px; background: var(--paper-2); }

.cs-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--gap);
  margin: 0 0 1.5em;
}
.cs-facts div { padding: 14px 0 16px; border-top: 1px solid var(--rule); display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; }
.cs-facts dt { font-size: var(--step--1); color: var(--mute); line-height: 1.35; }
.cs-facts dd { margin: 0; font-size: var(--step-3); font-weight: 650; letter-spacing: -0.045em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }

.cs-figure { margin: 1.5em 0 2em; }
.cs-figure img { width: 100%; height: auto; border-radius: 12px; background: #fff; border: 1px solid var(--rule); }
.cs-figure figcaption { margin-top: 10px; font-size: var(--step--1); color: var(--mute); line-height: 1.45; }

.note {
  padding: 18px 20px;
  border-left: 3px solid var(--signal);
  background: var(--card);
  border-radius: 0 10px 10px 0;
  font-size: 0.97rem;
}

.next {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  padding-block: clamp(56px, 8vw, 120px);
  text-decoration: none;
  color: var(--ink);
}
.next-label { grid-column: 1 / span 4; font-size: var(--step--1); color: var(--mute); padding-top: 1.2em; }
.next-title { grid-column: 6 / span 7; font-size: var(--step-4); font-weight: 720; letter-spacing: -0.05em; line-height: 0.92; transition: color 0.2s; }
.next:hover .next-title { color: var(--signal); }

/* 404 */
.lost { min-height: calc(100svh - var(--header-h) - 70px); display: flex; flex-direction: column; justify-content: center; gap: 24px; border-top: 1px solid var(--rule); }
.lost h1 { font-size: clamp(5rem, 2rem + 18vw, 18rem); font-weight: 760; letter-spacing: -0.07em; line-height: 0.8; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .row-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 18px; }
  .row-meta dd { margin: 0; }
  .row-body { grid-column: 1 / span 6; }
  .row-visual { grid-column: 7 / span 6; }
  .section-title { grid-column: 1 / -1; }
  .section-lede { grid-column: 1 / span 8; }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .hero-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
  .cell-portrait { grid-column: 1; grid-row: 1 / span 2; }
  .cell-meta { grid-column: 2; grid-row: 2; padding-left: var(--gap); border-left: 1px solid var(--rule); border-top: 1px solid var(--rule); }
  .cell-intro { grid-column: 2; grid-row: 1; padding-right: 0; }
  .cell-portrait { padding-left: 0; }
  .cell + .cell { border-left: 0; }
  .cell-intro { border-left: 1px solid var(--rule) !important; }
  .row-body, .row-visual { grid-column: 1 / -1; }
  .row-visual { order: -1; }
  .row-meta { order: -2; }
  .item-title { grid-column: 1 / -1; }
  .item-text { grid-column: 1 / span 9; }
  .item-side { grid-column: 10 / span 3; }
  .honors .item-title { grid-column: 1 / span 9; }
  .about-text, .about-side { grid-column: 1 / -1; }
  .cs-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-meta div:nth-child(3) { padding-left: 0; border-left: 0; }
  .cs-meta div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .cs-section > h2, .cs-body { grid-column: 1 / -1; }
  .next-label, .next-title { grid-column: 1 / -1; }
  .next-label { padding-top: 0; }
}

@media (max-width: 640px) {
  :root { --header-h: 60px; }
  body { font-size: 1rem; }
  .hero { min-height: 0; }
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .cell { padding-inline: 0; }
  .cell-intro { grid-column: 1; grid-row: 1; border-left: 0 !important; padding-top: 28px; }
  .cell-portrait { grid-column: 1; grid-row: 2; }
  .cell-meta { grid-column: 1; grid-row: 3; border-left: 0; flex-direction: row; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; }
  .portrait { min-height: 0; aspect-ratio: 4 / 4.4; }
  .intro { max-width: none; }
  .header-cv .btn-label { display: none; }
  .header-cv { padding: 4px; }
  .name { order: -1; padding-block: 0.12em 0.17em; }
  .hero-grid::after { display: none; }
  .section-lede { grid-column: 1 / -1; }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .facts dd { font-size: 1.3rem; }
  .mock-body { grid-template-columns: 1fr; }
  .mock-list { display: none; }
  .item-text, .item-side { grid-column: 1 / -1; text-align: left; }
  .item-side span { display: inline; margin-right: 14px; }
  .honors .item-title { grid-column: 1 / -1; }
  .honors .item-side { grid-column: 1 / -1; text-align: left; }
  .cs-meta { grid-template-columns: 1fr; }
  .cs-meta div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .cs-facts { grid-template-columns: 1fr 1fr; }
  .cs-facts dd { font-size: 1.9rem; }
  .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .site-header, .portrait, .intro-actions, .contact-actions, .next { display: none; }
  body { background: #fff; }
}

/* ---------- Header actions, theme switch ---------- */

.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.4s cubic-bezier(.2,.8,.2,1);
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg { width: 16px; height: 16px; transition: transform 0.5s cubic-bezier(.2,.8,.2,1); }
:root[data-theme="dark"] .theme-toggle svg { transform: rotate(180deg); }

body, .portrait, .row-visual, .nav, .btn, .site-footer, .note { transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; }

/* ---------- Last push line ---------- */

.lastpush { margin: 0 0 10px; font-size: var(--step--1); color: var(--mute); line-height: 1.4; }
.lastpush a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 0.2em; }
.lastpush a:hover { text-decoration-color: var(--signal); }
.cell-bottom { display: flex; flex-direction: column; }

/* ---------- Batching simulation ---------- */

.sim {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  padding: clamp(16px, 2.6vw, 32px);
}
.sim canvas { flex: 1; width: 100%; min-height: 0; }
.sim-note { margin: 0; font-size: 0.75rem; line-height: 1.4; color: var(--mute); }

/* figures stay on white in dark mode, so give them a little separation */
:root[data-theme="dark"] .row-visual.is-figure,
:root[data-theme="dark"] .cs-hero-visual.is-figure { background: #fff; }
:root[data-theme="dark"] .cs-figure img { border-color: #2b2b29; }
:root[data-theme="dark"] .email { color: var(--ink); }

@media (max-width: 640px) {
  .header-actions { gap: 6px; }
}
