/* ==========================================================================
   Shushant Kumar — portfolio
   Design system: "drawing sheet"
   Display: Archivo · Body: Newsreader · Utility: DM Mono
   ========================================================================== */

/* ==========================================================================
   Palette — three hues, each with a job.
   Teal   = structure and system (links, nav, rules, the page's own voice)
   Amber  = outcome (numbers that moved, the "after" column, metrics)
   Violet = not yet true (drafts, unverified facts, prompts)
   The colour encodes evidence status, which is what this portfolio is about.
   Neutrals carry a green bias so they sit with the teal rather than under it.
   ========================================================================== */

/* ---------- tokens: light (default) ---------- */
:root {
  --ground:      #ECEEE9;
  --surface:     #F6F7F3;
  --surface-2:   #DEE2DA;
  --ink:         #0E1A1C;
  --ink-2:       #4A5A5C;
  --ink-3:       #5F6D6B;
  --rule:        #CBD2CB;
  --rule-soft:   #DCE1DA;

  --accent:      #0B6B5F;
  --accent-soft: #D6E7E2;
  --outcome:     #9C5A06;
  --outcome-soft:#F2E4CE;
  --draft:       #4F45B8;
  --draft-soft:  #E2DFF6;

  --focus:       #0B6B5F;
  --band:        #0C4F47;
  --band-ink:    #E7F1EE;
  --band-dim:    #9FC4BC;

  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --t-2xs: 0.625rem;
  --t-xs:  0.6875rem;
  --t-sm:  0.8125rem;
  --t-md:  0.9375rem;
  --t-base: 1.0625rem;
  --t-lg:  1.3125rem;
  --t-xl:  1.75rem;
  --t-2xl: 2.5rem;

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --measure: 34rem;
  --sheet: 84rem;

  --dur: 420ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* page-type hue, overridden per page below */
  --kind: var(--accent);
  --panel: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

/* ---------- tokens: dark via system (unless light is pinned) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:      #0C1113;
    --surface:     #131A1C;
    --surface-2:   #1B2426;
    --ink:         #E6EAE7;
    --ink-2:       #96A5A3;
    --ink-3:       #73827F;
    --rule:        #263032;
    --rule-soft:   #1B2325;

    --accent:      #4FCBB6;
    --accent-soft: #12302B;
    --outcome:     #EFAE58;
    --outcome-soft:#33260F;
    --draft:       #A79BFF;
    --draft-soft:  #221F45;

    --focus:       #4FCBB6;
    --band:        #0F2E29;
    --band-ink:    #DDEFEA;
    --band-dim:    #7FA9A1;
    --panel: color-mix(in srgb, var(--accent) 7%, var(--surface));
  }
}

/* ---------- tokens: dark pinned ---------- */
:root[data-theme="dark"] {
  --ground:      #0C1113;
  --surface:     #131A1C;
  --surface-2:   #1B2426;
  --ink:         #E6EAE7;
  --ink-2:       #96A5A3;
  --ink-3:       #73827F;
  --rule:        #263032;
  --rule-soft:   #1B2325;

  --accent:      #4FCBB6;
  --accent-soft: #12302B;
  --outcome:     #EFAE58;
  --outcome-soft:#33260F;
  --draft:       #A79BFF;
  --draft-soft:  #221F45;

  --focus:       #4FCBB6;
  --band:        #0F2E29;
  --band-ink:    #DDEFEA;
  --band-dim:    #7FA9A1;
  --panel: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

/* ---------- page-type hue ---------- */
body[data-kind="craft"]  { --kind: var(--outcome); }
body[data-kind="draft"]  { --kind: var(--draft); }
body[data-kind="lead"]   { --kind: var(--accent); }

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-base);
  line-height: 1.5;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 1px;
}

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

.label {
  font-family: var(--mono);
  font-size: var(--t-xs);
  line-height: 1.2;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 400;
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.prose {
  font-family: var(--serif);
  font-size: var(--t-lg);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: var(--measure);
  text-wrap: pretty;
}
.prose + .prose { margin-top: 1.1em; }
.prose strong { color: var(--ink); font-weight: 600; }

/* link with a drawn underline */
.link {
  text-decoration: none;
  color: var(--ink);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size var(--dur) var(--ease), color 200ms;
  padding-bottom: 2px;
}
.link:hover { background-size: 100% 1px; color: var(--accent); }
.link--on {
  background-size: 100% 1px;
  background-image: linear-gradient(var(--rule), var(--rule));
}
.link--on:hover { background-image: linear-gradient(var(--accent), var(--accent)); }

.ext::after {
  content: "↗";
  font-family: var(--mono);
  font-size: 0.8em;
  margin-left: 0.3em;
  color: var(--ink-3);
}

/* ---------- header ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.masthead__in {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.9rem;
}
.wordmark {
  font-family: var(--sans);
  font-size: var(--t-md);
  font-weight: 600;
  letter-spacing: -0.015em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark span { color: var(--ink-3); font-weight: 400; }
.nav { display: flex; gap: clamp(0.9rem, 2.5vw, 1.9rem); align-items: baseline; }
.nav a {
  font-family: var(--mono);
  font-size: var(--t-sm);
  text-decoration: none;
  color: var(--ink-2);
  transition: color 180ms;
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  margin-right: 0.45em;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.12em;
}

/* ---------- sheet meta strip ---------- */
.stripe {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--rule-soft);
}

/* ---------- hero ---------- */
.hero { padding-block: clamp(3.5rem, 11vh, 8rem) clamp(2.5rem, 7vh, 5rem); }
.hero__eyebrow { margin-bottom: clamp(1.75rem, 5vh, 3rem); }
.hero__h1 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(2.1rem, 6.2vw, 4.6rem);
  line-height: 1.03;
  letter-spacing: -0.033em;
  max-width: 26ch;
  text-wrap: balance;
}
.hero__h1 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.hero__sub { margin-top: clamp(1.75rem, 4vh, 2.75rem); }

/* staggered load */
.rise { opacity: 0; transform: translateY(14px); animation: rise 900ms var(--ease) forwards; }
.rise:nth-child(1) { animation-delay: 60ms; }
.rise:nth-child(2) { animation-delay: 170ms; }
.rise:nth-child(3) { animation-delay: 280ms; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- record rows (facts, experience, awards) ---------- */
.records { border-top: 1px solid var(--rule); }
.record {
  display: grid;
  grid-template-columns: minmax(6.5rem, 11rem) minmax(0, 1fr);
  gap: 0.4rem 2rem;
  padding-block: 1.15rem;
  border-bottom: 1px solid var(--rule-soft);
  align-items: baseline;
}
.record__key { font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.record__val { font-size: var(--t-md); color: var(--ink); }
.record__val .sub { color: var(--ink-2); }

/* two-column experience row: role | org | span */
.entry {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(7rem, auto);
  gap: 0.3rem 2rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--rule-soft);
  align-items: baseline;
}
.entry:first-child { border-top: 1px solid var(--rule); }
.entry__role { font-size: var(--t-md); font-weight: 500; letter-spacing: -0.01em; }
.entry__org { font-size: var(--t-md); color: var(--ink-2); }
.entry__span { font-family: var(--mono); font-size: var(--t-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right; }
.entry--now .entry__span { color: var(--accent); }

/* ---------- section scaffolding ---------- */
.section { padding-block: clamp(3rem, 9vh, 6.5rem); }
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  flex-wrap: wrap;
  padding-bottom: 1.5rem;
  margin-bottom: clamp(1.5rem, 4vh, 2.5rem);
  border-bottom: 1px solid var(--rule);
}
.section__title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(1.4rem, 3.2vw, 2.1rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-wrap: balance;
}
.section__note { font-family: var(--mono); font-size: var(--t-sm); color: var(--ink-3); max-width: 30ch; }

/* ---------- work plates ---------- */
.plates { display: grid; gap: clamp(2.5rem, 7vh, 5rem); }
.plate {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}
.plate__frame {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface);
  border: 1px solid var(--rule);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.plate__frame img { width: 100%; height: 100%; object-fit: cover; }
.plate__slot {
  display: grid;
  gap: 0.5rem;
  justify-items: center;
  text-align: center;
  padding: 2rem;
  color: var(--ink-3);
}
.plate__slot::before {
  content: "";
  width: 2.25rem; height: 2.25rem;
  border: 1px solid var(--rule);
  border-radius: 50%;
  display: block;
}
.plate__body { display: grid; gap: 0.85rem; }
.plate__meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.plate__title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(1.35rem, 2.8vw, 1.9rem);
  letter-spacing: -0.025em;
  line-height: 1.12;
  text-wrap: balance;
}
.plate__desc {
  font-family: var(--serif);
  font-size: var(--t-base);
  line-height: 1.62;
  color: var(--ink-2);
  max-width: 44rem;
  text-wrap: pretty;
}
.plate__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.25rem; }
.tag {
  font-family: var(--mono);
  font-size: var(--t-2xs);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--rule);
  padding: 0.25rem 0.5rem;
  white-space: nowrap;
}

/* wide plates: image beside text on large screens */
@media (min-width: 60rem) {
  .plate--wide { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 2.75rem; align-items: start; }
  .plate--wide .plate__body { padding-top: 0.35rem; }
  .plate--flip .plate__frame { order: 2; }
}

/* home: compact 2-up index */
.index { display: grid; gap: 1px; background: var(--rule-soft); border-block: 1px solid var(--rule); }
.index__row {
  display: grid;
  grid-template-columns: minmax(3.5rem, 5rem) minmax(0, 1fr) minmax(0, 0.9fr) auto;
  gap: 0.35rem 1.75rem;
  align-items: baseline;
  padding: 1.15rem 0.25rem;
  background: var(--ground);
  text-decoration: none;
  transition: background 220ms var(--ease), padding-inline 220ms var(--ease);
}
.index__row:hover { background: var(--surface-2); padding-inline: 0.75rem 0.25rem; }
.index__yr { font-family: var(--mono); font-size: var(--t-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.index__name { font-size: var(--t-md); font-weight: 500; letter-spacing: -0.012em; }
.index__ctx { font-family: var(--serif); font-size: var(--t-md); color: var(--ink-2); }
.index__go { font-family: var(--mono); font-size: var(--t-sm); color: var(--ink-3); transition: color 200ms, transform 220ms var(--ease); }
.index__row:hover .index__go { color: var(--accent); transform: translateX(3px); }

@media (max-width: 46rem) {
  .index__row { grid-template-columns: minmax(3.25rem, auto) minmax(0, 1fr) auto; }
  .index__ctx { grid-column: 2 / -1; }
}

/* ---------- notable / compact list ---------- */
.notes { display: grid; gap: 1px; background: var(--rule-soft); border-block: 1px solid var(--rule); }
.note {
  background: var(--ground);
  padding: 1.1rem 0.25rem;
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: 0.3rem 1.75rem;
  align-items: baseline;
}
.note__name { font-size: var(--t-md); font-weight: 500; letter-spacing: -0.012em; }
.note__desc { font-family: var(--serif); font-size: var(--t-md); color: var(--ink-2); }
@media (max-width: 46rem) { .note { grid-template-columns: minmax(0, 1fr); } }

/* ---------- award / topic chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font-family: var(--mono);
  font-size: var(--t-sm);
  color: var(--ink-2);
  border: 1px solid var(--rule);
  background: var(--surface);
  padding: 0.45rem 0.7rem;
}
.chip b { color: var(--ink); font-weight: 500; }

/* ---------- two-column split ---------- */
.split { display: grid; gap: clamp(2rem, 5vw, 4rem); }
@media (min-width: 62rem) {
  .split { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
  .split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- contact ---------- */
.contact {
  padding-block: clamp(3.5rem, 10vh, 7rem);
  border-top: 1px solid var(--rule);
  display: grid;
  justify-items: start;
  gap: 0;
}
.contact__h {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(1.9rem, 5.4vw, 3.4rem);
  letter-spacing: -0.03em;
  line-height: 1.06;
  max-width: 24ch;
  text-wrap: balance;
}
.contact__mail {
  display: inline-block;
  margin-top: clamp(1.5rem, 4vh, 2.25rem);
  font-family: var(--mono);
  font-size: clamp(0.95rem, 2.4vw, 1.35rem);
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.25rem;
  transition: border-color 220ms, color 220ms;
  word-break: break-all;
}
.contact__mail:hover { color: var(--accent); border-color: var(--accent); }
.avail {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: var(--t-sm);
  color: var(--ink-2);
  margin-top: 1.5rem;
}
.avail::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--rule-soft); padding-block: 2rem 2.75rem; }
.foot__in {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2.5rem;
  align-items: baseline;
  justify-content: space-between;
}
.social { display: flex; flex-wrap: wrap; gap: 0.4rem 1.35rem; }
.social a {
  font-family: var(--mono);
  font-size: var(--t-sm);
  text-decoration: none;
  color: var(--ink-2);
  transition: color 180ms;
}
.social a:hover { color: var(--accent); }
.foot__note { font-family: var(--mono); font-size: var(--t-xs); color: var(--ink-3); letter-spacing: 0.04em; }

/* ---------- narrow screens ---------- */
@media (max-width: 52rem) {
  .masthead__in { flex-wrap: wrap; gap: 0.5rem 1.25rem; }
  .wordmark span { display: none; }
  .nav { flex-wrap: wrap; }
}
@media (max-width: 40rem) {
  .prose { font-size: var(--t-base); line-height: 1.58; }
  .hero { padding-block: 2.75rem 2.25rem; }
  .hero__eyebrow { margin-bottom: 1.5rem; }
  .contact__h { font-size: clamp(1.65rem, 8vw, 2.2rem); }

  .masthead__in { padding-block: 0.7rem; }
  .wordmark { font-size: var(--t-sm); }
  .nav { gap: 0.85rem; }
  .nav a { font-size: var(--t-xs); }

  .record { grid-template-columns: minmax(0, 1fr); gap: 0.3rem; padding-block: 1rem; }

  .entry {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.2rem 1rem;
  }
  .entry__role { grid-column: 1; }
  .entry__span { grid-column: 2; grid-row: 1; }
  .entry__org { grid-column: 1 / -1; }

  .section__head { padding-bottom: 1.1rem; }
  .plate__frame { aspect-ratio: 4 / 3; }
}

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .rise, .reveal { opacity: 1; transform: none; }
}

/* ---------- print ---------- */
@media print {
  .masthead, .foot, .plate__frame { display: none; }
  body { background: #fff; color: #000; }
}

/* ==========================================================================
   Case study pages
   ========================================================================== */

.cs-head { padding-block: clamp(3rem, 9vh, 6rem) clamp(2rem, 5vh, 3rem); }
.cs-eyebrow { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-bottom: clamp(1.5rem, 4vh, 2.5rem); }
.cs-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(2rem, 5.6vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.032em;
  max-width: 24ch;
  text-wrap: balance;
}
.cs-title em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.cs-tagline {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 46ch;
  margin-top: clamp(1.25rem, 3vh, 1.75rem);
  text-wrap: pretty;
}

/* award badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: var(--t-sm);
  color: var(--ink);
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  padding: 0.4rem 0.7rem;
  margin-top: 1.5rem;
}
.badge::before { content: "★"; color: var(--accent); }

/* fact strip */
.cs-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1px;
  background: var(--rule-soft);
  border-block: 1px solid var(--rule);
}
.cs-fact { background: var(--ground); padding: 1.1rem 0.25rem; display: grid; gap: 0.4rem; align-content: start; }
.cs-fact dt { font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.cs-fact dd { margin: 0; font-size: var(--t-md); color: var(--ink); }

/* body flow */
.cs-section { padding-block: clamp(2.5rem, 7vh, 4.5rem); }
.cs-section--tight { padding-block: clamp(1.75rem, 4vh, 2.5rem); }
.cs-grid { display: grid; gap: clamp(1.25rem, 4vw, 3rem); }
@media (min-width: 62rem) {
  .cs-grid { grid-template-columns: minmax(0, 0.55fr) minmax(0, 1.45fr); align-items: start; }
  .cs-grid__aside { position: sticky; top: 5rem; }
}
.cs-h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(1.3rem, 2.9vw, 1.85rem);
  letter-spacing: -0.025em;
  line-height: 1.14;
  text-wrap: balance;
}
.cs-h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: var(--t-lg);
  letter-spacing: -0.018em;
  line-height: 1.2;
}
.cs-text {
  font-family: var(--serif);
  font-size: var(--t-base);
  line-height: 1.68;
  color: var(--ink-2);
  max-width: 40rem;
  text-wrap: pretty;
}
.cs-text + .cs-text { margin-top: 1em; }
.cs-text strong { color: var(--ink); font-weight: 600; }
.cs-flow { display: grid; gap: 1.15rem; }

/* problem / insight list with real markers */
.cs-ul { display: grid; gap: 0.7rem; max-width: 40rem; }
.cs-ul li {
  font-family: var(--serif);
  font-size: var(--t-base);
  line-height: 1.55;
  color: var(--ink-2);
  padding-left: 1.5rem;
  position: relative;
}
.cs-ul li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.72em;
  width: 0.5rem;
  height: 1px;
  background: var(--accent);
}

/* numbered iterations — a real sequence */
.iters { display: grid; gap: clamp(2rem, 5vh, 3.25rem); counter-reset: iter; }
.iter { display: grid; gap: 1rem; counter-increment: iter; }
.iter__head { display: flex; align-items: baseline; gap: 0.9rem; flex-wrap: wrap; }
.iter__head::before {
  content: "Iteration " counter(iter);
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--rule);
  padding: 0.28rem 0.5rem;
  white-space: nowrap;
}

/* figures */
.fig { display: grid; gap: 0.7rem; margin-top: 0.5rem; }
.fig__frame {
  background: var(--surface);
  border: 1px solid var(--rule);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.fig__frame img { width: 100%; height: 100%; object-fit: cover; }
.fig__frame--tall { aspect-ratio: 4 / 3; }
.fig__slot { display: grid; gap: 0.5rem; justify-items: center; text-align: center; padding: 1.5rem; }
.fig__slot::before { content: ""; width: 1.75rem; height: 1.75rem; border: 1px solid var(--rule); border-radius: 50%; }
.fig figcaption { font-family: var(--mono); font-size: var(--t-xs); color: var(--ink-3); line-height: 1.5; }

/* metric block */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule);
}
.metric { background: var(--ground); padding: 1.5rem 1.25rem; display: grid; gap: 0.5rem; align-content: start; }
.metric__n {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(1.75rem, 4.5vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.metric__l { font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.05em; color: var(--ink-2); line-height: 1.5; }

/* pull quote */
.pull {
  border-left: 2px solid var(--accent);
  padding: 0.35rem 0 0.35rem 1.5rem;
  max-width: 38rem;
}
.pull p {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--t-lg);
  line-height: 1.5;
  color: var(--ink);
}

/* prev / next */
.cs-nav {
  display: grid;
  gap: 1px;
  background: var(--rule-soft);
  border-block: 1px solid var(--rule);
}
@media (min-width: 46rem) { .cs-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cs-nav a {
  background: var(--ground);
  padding: 1.5rem 0.25rem;
  text-decoration: none;
  display: grid;
  gap: 0.45rem;
  transition: background 220ms var(--ease);
}
.cs-nav a:hover { background: var(--surface-2); }
.cs-nav a:last-child { text-align: right; }
.cs-nav__k { font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.cs-nav__t { font-size: var(--t-md); font-weight: 500; letter-spacing: -0.012em; color: var(--ink); }

/* back link */
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: var(--t-sm);
  color: var(--ink-2);
  text-decoration: none;
  transition: color 180ms, gap 220ms var(--ease);
}
.back::before { content: "←"; }
.back:hover { color: var(--accent); gap: 0.75rem; }

@media (max-width: 40rem) {
  .cs-text { font-size: var(--t-md); }
  .cs-ul li { font-size: var(--t-md); }
  .cs-nav a:last-child { text-align: left; }
}

/* ---------- real imagery: screenshots, before/after, logos, tables ---------- */

/* let an image keep its own proportions instead of being cropped to a ratio */
.fig__frame--auto { aspect-ratio: auto; place-items: stretch; }
.fig__frame--auto img { height: auto; object-fit: contain; }

/* rows of screenshots — phones by default, --wide for desktop captures */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; }
.shots--wide { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.shots--two { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.shot { border: 1px solid var(--rule); background: var(--surface); overflow: hidden; }
.shot img { width: 100%; height: auto; }

/* before / after pair */
.ba { display: grid; gap: 1.25rem; }
@media (min-width: 52rem) { .ba { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.ba__item { display: grid; gap: 0.6rem; }
.ba__tag {
  font-family: var(--mono);
  font-size: var(--t-2xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  border: 1px solid var(--rule);
  padding: 0.25rem 0.5rem;
}
.ba__tag--before { color: var(--ink-3); }
.ba__tag--after { color: var(--accent); border-color: var(--accent); }

/* competitor logo wall */
.logos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.logos img {
  background: #ffffff;
  width: 100%;
  height: 62px;
  object-fit: contain;
  padding: 0.7rem;
}

/* data table */
.tbl-wrap { overflow-x: auto; border-block: 1px solid var(--rule); }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--t-md); min-width: 30rem; }
.tbl th, .tbl td { text-align: left; padding: 0.75rem 0.5rem; border-bottom: 1px solid var(--rule-soft); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl thead th {
  font-family: var(--mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 400;
}
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tbl td.num.up { color: var(--accent); }

/* metric delta direction */
.metric__n .dir { font-size: 0.5em; vertical-align: 0.35em; margin-left: 0.1em; }

/* ---------- work index cards ---------- */
.cards { display: grid; gap: clamp(1.5rem, 4vw, 2.5rem); }
@media (min-width: 54rem) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.card { display: grid; gap: 1rem; text-decoration: none; align-content: start; }
.card__frame {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--rule);
  background: var(--surface);
  overflow: hidden;
}
.card__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 700ms var(--ease);
}
.card:hover .card__frame img { transform: scale(1.025); }
.card:hover .card__frame { border-color: var(--accent); }
.card__meta { display: flex; flex-wrap: wrap; gap: 0.35rem 1.2rem; }
.card__title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  letter-spacing: -0.022em;
  line-height: 1.14;
  text-wrap: balance;
}
.card:hover .card__title { color: var(--accent); }
.card__desc {
  font-family: var(--serif);
  font-size: var(--t-md);
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}
.card__stat {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.05em;
  color: var(--accent);
  text-transform: uppercase;
}

/* ---------- footer site index ---------- */
.foot-index {
  display: grid;
  gap: 1.5rem 2.5rem;
  padding-block: 2.25rem 2rem;
  border-bottom: 1px solid var(--rule-soft);
}
@media (min-width: 50rem) {
  .foot-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 68rem) {
  .foot-index { grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
}
.foot-index__col { display: grid; gap: 0.55rem; align-content: start; }
.foot-index__col a {
  font-family: var(--mono);
  font-size: var(--t-sm);
  line-height: 1.35;
  text-decoration: none;
  color: var(--ink-2);
  transition: color 180ms;
}
.foot-index__col a:hover { color: var(--accent); }
.foot-index__col a[aria-current="page"] { color: var(--ink); }
.foot-index__col a[aria-current="page"]::before {
  content: "";
  display: inline-block;
  width: 4px; height: 4px;
  margin-right: 0.5em;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.15em;
}

/* ==========================================================================
   Leadership layer — positioning, principles, contribution, prompts
   ========================================================================== */

/* capability pillars */
.pillars {
  display: grid;
  gap: 1px;
  background: var(--rule-soft);
  border-block: 1px solid var(--rule);
}
@media (min-width: 46rem) { .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 72rem) { .pillars { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pillar {
  background: var(--ground);
  padding: 1.6rem 1.25rem 1.75rem;
  display: grid;
  gap: 0.7rem;
  align-content: start;
}
.pillar h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: var(--t-lg);
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
}
/* :not(.label) so a mono label inside a pillar keeps its own face —
   .pillar p would otherwise out-specify .label */
.pillar p:not(.label) {
  font-family: var(--serif);
  font-size: var(--t-md);
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}
.pillar p.label { line-height: 1.45; }

/* numbered operating principles, each carrying its evidence */
.principles { display: grid; gap: 0; border-top: 1px solid var(--rule); counter-reset: pr; }
.principle {
  counter-increment: pr;
  display: grid;
  gap: 0.6rem 2.5rem;
  padding-block: 1.6rem;
  border-bottom: 1px solid var(--rule-soft);
  align-items: start;
}
@media (min-width: 58rem) {
  .principle { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
}
.principle__h {
  font-family: var(--sans);
  font-weight: 500;
  font-size: var(--t-lg);
  letter-spacing: -0.02em;
  line-height: 1.18;
  text-wrap: balance;
  display: grid;
  gap: 0.5rem;
}
.principle__h::before {
  content: "0" counter(pr);
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 400;
}
.principle__b {
  font-family: var(--serif);
  font-size: var(--t-base);
  line-height: 1.65;
  color: var(--ink-2);
  text-wrap: pretty;
}
.principle__b + .principle__ev { margin-top: 0.85rem; }
.principle__ev {
  font-family: var(--mono);
  font-size: var(--t-xs);
  line-height: 1.6;
  color: var(--ink-3);
  border-left: 1px solid var(--accent);
  padding-left: 0.8rem;
}
.principle__ev a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule); }
.principle__ev a:hover { color: var(--accent); border-color: var(--accent); }

/* the decision block that opens a case study */
.call {
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  background: var(--surface);
  padding: 1.4rem 1.5rem;
  display: grid;
  gap: 0.7rem;
  max-width: 46rem;
}
.call__k {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.call p {
  font-family: var(--serif);
  font-size: var(--t-base);
  line-height: 1.62;
  color: var(--ink);
  text-wrap: pretty;
}
.call p + p { color: var(--ink-2); }

/* explicit contribution split */
.contrib {
  display: grid;
  gap: 1px;
  background: var(--rule-soft);
  border-block: 1px solid var(--rule);
}
@media (min-width: 52rem) { .contrib { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.contrib__col { background: var(--ground); padding: 1.25rem 0.25rem 1.4rem; display: grid; gap: 0.6rem; align-content: start; }
.contrib__k { font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.contrib__col ul { display: grid; gap: 0.35rem; }
.contrib__col li { font-size: var(--t-md); color: var(--ink); line-height: 1.45; }
.contrib__col li::before { content: "— "; color: var(--ink-3); }

/* draft prompts — visible, deliberately unmissable, never shippable as-is */
.todo {
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
  padding: 1.25rem 1.4rem;
  display: grid;
  gap: 0.6rem;
  max-width: 46rem;
}
.todo__k {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.todo p, .todo li {
  font-family: var(--mono);
  font-size: var(--t-sm);
  line-height: 1.65;
  color: var(--ink-2);
}
.todo ul { display: grid; gap: 0.4rem; }
.todo li::before { content: "→ "; color: var(--accent); }

.needs {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--accent);
  border-bottom: 1px dashed var(--accent);
  /* placeholders are often full sentences — they must wrap */
  white-space: normal;
  overflow-wrap: anywhere;
}

/* draft banner for unfinished pages */
.draftbar {
  background: var(--accent);
  color: #ffffff;
}
.draftbar p {
  font-family: var(--mono);
  font-size: var(--t-sm);
  padding-block: 0.6rem;
  letter-spacing: 0.02em;
}

/* ---------- scale signal ---------- */
.signal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1px;
  background: var(--rule-soft);
  border-block: 1px solid var(--rule);
}
.signal__cell { background: var(--ground); padding: 1.35rem 0.25rem 1.5rem; display: grid; gap: 0.4rem; align-content: start; }
.signal__n {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(1.6rem, 3.6vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.signal__l { font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.05em; color: var(--ink-2); line-height: 1.5; }

/* ---------- before / after changes (org impact) ---------- */
.changes { border-top: 1px solid var(--rule); }
.change {
  display: grid;
  gap: 0.5rem 2rem;
  padding-block: 1.35rem;
  border-bottom: 1px solid var(--rule-soft);
  align-items: start;
}
@media (min-width: 52rem) { .change { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.change__side { display: grid; gap: 0.4rem; }
.change__k { font-family: var(--mono); font-size: var(--t-2xs); letter-spacing: 0.1em; text-transform: uppercase; }
.change__k--b { color: var(--ink-3); }
.change__k--a { color: var(--accent); }
.change__t { font-family: var(--serif); font-size: var(--t-md); line-height: 1.55; color: var(--ink-2); }
.change__side--a .change__t { color: var(--ink); }

/* ---------- testimonial cards ---------- */
.quotes { display: grid; gap: clamp(1rem, 2.5vw, 1.5rem); }
@media (min-width: 56rem) { .quotes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.quote-card {
  border: 1px solid var(--rule);
  background: var(--surface);
  padding: 1.4rem 1.35rem;
  display: grid;
  gap: 0.9rem;
  align-content: start;
}
.quote-card blockquote {
  font-family: var(--serif);
  font-size: var(--t-md);
  line-height: 1.6;
  color: var(--ink);
  text-wrap: pretty;
}
.quote-card figcaption { font-family: var(--mono); font-size: var(--t-xs); color: var(--ink-3); line-height: 1.5; }

/* ---------- outcome-first card variant ---------- */
.card--outcome .card__stat {
  order: -1;
  font-size: var(--t-sm);
  letter-spacing: 0.03em;
}
.card__outcome {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: -0.028em;
  line-height: 1.06;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.card__role { font-family: var(--mono); font-size: var(--t-xs); color: var(--ink-3); letter-spacing: 0.05em; }

/* ---------- decision log ---------- */
.decisions { display: grid; gap: 0; border-top: 1px solid var(--rule); counter-reset: dec; }
.decision {
  counter-increment: dec;
  padding-block: 1.6rem;
  border-bottom: 1px solid var(--rule-soft);
  display: grid;
  gap: 1rem 2.5rem;
}
@media (min-width: 58rem) { .decision { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); } }
.decision__head { display: grid; gap: 0.5rem; align-content: start; }
.decision__n {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  color: var(--accent);
}
.decision__n::before { content: "Decision 0" counter(dec); }
.decision__t {
  font-family: var(--sans);
  font-weight: 500;
  font-size: var(--t-lg);
  letter-spacing: -0.02em;
  line-height: 1.18;
  text-wrap: balance;
}
.decision__rows { display: grid; gap: 0.7rem; }
.decision__row { display: grid; grid-template-columns: minmax(6rem, 8rem) minmax(0, 1fr); gap: 0.25rem 1.25rem; align-items: baseline; }
.decision__k { font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.decision__v { font-family: var(--serif); font-size: var(--t-md); line-height: 1.55; color: var(--ink-2); }
@media (max-width: 40rem) { .decision__row { grid-template-columns: minmax(0, 1fr); } }

/* ---------- four-column ownership split ---------- */
@media (min-width: 62rem) { .contrib--four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 52rem) and (max-width: 61.999rem) { .contrib--four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ==========================================================================
   Chromatic layer — colour doing information work
   ========================================================================== */

/* the page-type rail: a full-bleed hairline of the page's own hue */
.kindbar { height: 3px; background: var(--kind); }

/* the italic in a headline is where the eye lands, so it carries the hue */
.hero__h1 em,
.cs-title em,
.contact__h em { color: var(--kind); }

/* eyebrow gets a leading mark in the page hue */
.hero__eyebrow::before {
  content: "";
  display: inline-block;
  width: 1.4rem;
  height: 1px;
  background: var(--kind);
  margin-right: 0.7rem;
  vertical-align: 0.28em;
}

/* ---------- outcome hue: numbers that moved ---------- */
.metric__n,
.card__outcome,
.signal__n { color: var(--outcome); }
.signal__n { color: var(--ink); }              /* scale, not outcome */
.tbl td.num.up { color: var(--outcome); font-weight: 500; }
.card__stat { color: var(--outcome); }
.metric { background: color-mix(in srgb, var(--outcome) 4%, var(--surface)); }
.badge {
  border-color: var(--outcome);
  background: var(--outcome-soft);
}
.badge::before { color: var(--outcome); }

/* ---------- draft hue: not yet true ---------- */
.needs { color: var(--draft); border-bottom-color: var(--draft); }
.todo { border-color: var(--draft); background: var(--draft-soft); }
.todo__k { color: var(--draft); }
.todo li::before { color: var(--draft); }
.draftbar { background: var(--draft); }
.change__k--a { color: var(--accent); }

/* ---------- tinted panels, so sections read as objects ---------- */
.pillar,
.signal__cell { background: var(--panel); }
.call { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.quote-card { background: var(--panel); }
.fig__frame,
.shot,
.card__frame { background: var(--surface); }

/* ---------- structural hue: rules and marks ---------- */
.section__head { border-bottom-color: var(--rule); }
.section__title::after {
  content: "";
  display: block;
  width: 2.25rem;
  height: 2px;
  background: var(--kind);
  margin-top: 0.7rem;
}
.cs-h2 { color: var(--ink); }
.iter__head::before { color: var(--accent); border-color: var(--accent); }
.decision__n { color: var(--accent); }
.principle__h::before { color: var(--kind); }
.principle__ev { border-left-color: var(--kind); }
.cs-ul li::before { background: var(--kind); }
.pull { border-left-color: var(--accent); }

/* nav + footer marks follow the page hue */
.nav a[aria-current="page"]::before,
.foot-index__col a[aria-current="page"]::before { background: var(--kind); }
.avail::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.entry--now .entry__span { color: var(--accent); }
.card:hover .card__frame { border-color: var(--kind); }
.card:hover .card__title { color: var(--kind); }
.index__row:hover .index__go { color: var(--kind); }
.link:hover,
.link--on:hover { color: var(--kind); }
.link:hover { background-image: linear-gradient(var(--kind), var(--kind)); }
.link--on:hover { background-image: linear-gradient(var(--kind), var(--kind)); }
.back:hover { color: var(--kind); }
.contact__mail:hover { color: var(--kind); border-color: var(--kind); }
.social a:hover,
.foot-index__col a:hover { color: var(--kind); }
.cs-nav a:hover { background: var(--panel); }
.ba__tag--after { color: var(--outcome); border-color: var(--outcome); }

/* logo wall keeps a white ground in both themes — logos need it */
.logos img { background: #ffffff; }

@media print {
  .kindbar { display: none; }
}

/* ==========================================================================
   The closing band — the site's one saturated surface, and its signature.
   --kind varies per page for wayfinding; the band stays teal so the site
   still reads as one thing.
   ========================================================================== */
.contact {
  background: var(--band);
  color: var(--band-ink);
  border-top: 0;
  padding-inline: var(--gutter);
  max-width: none;
  width: 100%;
}
.contact > * { max-width: var(--sheet); margin-inline: auto; width: 100%; }
.contact__h { color: var(--band-ink); }
.contact__h em { color: var(--band-dim); }
.contact__mail {
  color: var(--band-ink);
  border-bottom-color: color-mix(in srgb, var(--band-ink) 35%, transparent);
}
.contact__mail:hover {
  color: #ffffff;
  border-color: #ffffff;
}
.contact .avail { color: var(--band-dim); }
.contact .avail::before {
  background: var(--band-ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--band-ink) 22%, transparent);
}

/* footer sits on a tint so the page closes rather than trails off */
.foot { background: var(--surface); border-top: 0; }
.foot-index { background: var(--surface); border-bottom-color: var(--rule); }

/* masthead: faintly tinted glass rather than transparent */
.masthead {
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  border-bottom: 1px solid var(--rule);
}

/* the mono layer carries more chroma — eyebrows and index numerals */
.hero__eyebrow { color: var(--ink-2); }
.index__yr { color: var(--kind); }
.cs-eyebrow .label:first-child { color: var(--kind); }
.card__meta .label:first-child { color: var(--kind); }
.contrib__k, .cs-fact dt { color: var(--ink-2); }

/* record keys pick up the hue on the pages that are mostly records */
.record__key { color: var(--ink-2); }

/* wordmark: the trailing role in the page hue */
.wordmark span { color: var(--ink-3); }
.wordmark:hover span { color: var(--kind); }
