/* Ankon Mukherjee: personal site.
   Palette is anchored on the NeRF study's background proxy, RGB (128, 128, 128) = #808080,
   the flat gray the compositor paints over the bulldozer in poisoned views (decision D-017).
   White on #808080 is 3.95:1, below WCAG AA, so the figure panel uses #767676 (4.54:1).
   The one accent is the bulldozer yellow, sampled from the clean render; it marks, never fills text. */

:root {
  --proxy: #808080;
  --panel: #767676;
  --on-panel: #ffffff;
  --plate: #ffffff;
  --bulldozer: #f2d647;

  --paper: #dededc;
  --ink: #1d1e20;
  --ink-soft: #4a4b4e;
  --rule: #b4b4b1;

  --sans: "Schibsted Grotesk", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;

  /* scale: 18px body, ~1.27 steps */
  --step--1: 0.9375rem;
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: 1.8125rem;
  --step-3: clamp(2rem, 1.35rem + 2.6vw, 2.75rem);

  --gutter: clamp(1rem, 4vw, 2rem);
  --label-col: 16rem;
  --measure: 40rem;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #2a2b2d;
    --ink: #ececea;
    --ink-soft: #b3b3b0;
    --rule: #4e4f52;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

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

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 0.22em;
}
a:hover { text-decoration-color: var(--bulldozer); text-decoration-thickness: 3px; }

/* Two-tone focus ring: ink outline for contrast against any background, yellow inside it. */
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--bulldozer);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  z-index: 10;
}
.skip:focus { top: 0.75rem; }

.wrap {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- header ---------- */

.site {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1.5rem 0;
  font-family: var(--sans);
  font-size: 1rem;
}
.site-name { font-weight: 700; text-decoration: none; }
.site nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site nav a { display: inline-block; padding-block: 0.25rem; }

/* ---------- intro ---------- */

.intro { padding-block: clamp(2rem, 5vh, 3.5rem) 2rem; }
@media (min-width: 60rem) {
  .intro {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    column-gap: 3rem;
    align-items: end;
  }
  .intro h1 { grid-row: span 2; align-self: start; margin-bottom: 0; }
}
.intro h1 {
  max-width: 22ch;
  margin: 0 0 1rem;
  font-family: var(--sans);
  font-size: var(--step-3);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.intro p { max-width: var(--measure); color: var(--ink-soft); }
.intro p + p { margin-top: -0.25rem; }

/* ---------- figure: the one bold element ---------- */

.fig {
  /* Full-bleed panel; content stays on the same 68rem column as the rest of the page. */
  --edge: max(var(--gutter), (100% - 68rem) / 2 + var(--gutter));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 1.75rem 3rem;
  margin: 0;
  padding: 2rem var(--edge);
  background: var(--panel);
  color: var(--on-panel);
}
.fig .plate { grid-row: 1 / span 2; }

.plate {
  display: grid;
  place-items: center;
  padding: 1rem 1.75rem;
  background: var(--plate);
}
.stack {
  position: relative;
  width: 300px;
  max-width: 100%;
  aspect-ratio: 300 / 380;
}
.stack img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 180ms ease-out;
}
.stack img.is-on { opacity: 1; }

.controls {
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  min-width: 0;
}
.controls h2 {
  max-width: 24ch;
  margin: 0 0 1.25rem;
  font-size: var(--step-2);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.readout {
  max-width: 30ch;
  margin: 0 0 1.75rem;
  font-size: var(--step-1);
  line-height: 1.35;
}
.readout b { font-weight: 700; white-space: nowrap; }

.budgets {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.budgets legend {
  padding: 0;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}
.options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  max-width: 30rem;
}
/* Native radios stay in the accessibility tree and keep arrow-key behaviour; the label is the visible control. */
.options input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.options label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 0.875rem 0.875rem;
  border: 1px solid var(--on-panel);
  cursor: pointer;
  line-height: 1.15;
}
.options .pct { font-size: var(--step-1); font-weight: 700; }
.options .db { font-size: var(--step--1); }
.options label:hover { background: rgba(255, 255, 255, 0.12); }
.options input:checked + label {
  background: var(--plate);
  color: #1d1e20;
  box-shadow: inset 0 -6px 0 var(--bulldozer);
}
.options input:focus-visible + label {
  outline: 3px solid #1d1e20;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--bulldozer);
}
.options input:checked:focus-visible + label {
  box-shadow: inset 0 -6px 0 var(--bulldozer), 0 0 0 2px var(--bulldozer);
}

.fig figcaption {
  align-self: end;
  max-width: 44rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  font-size: 0.875rem;
  line-height: 1.55;
}
.fig-n { font-family: var(--sans); font-weight: 700; }

/* ---------- sections ---------- */

.section { margin-top: clamp(4rem, 9vw, 6rem); }
.section > h2 {
  margin: 0 0 1.75rem;
  font-family: var(--sans);
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.prose { max-width: var(--measure); }

/* Case notes: the left column names the project, the right column is the note. */
.note,
.cv-row {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, 1fr);
  gap: 0.75rem 2.5rem;
  padding-block: 1.75rem;
  border-top: 1px solid var(--rule);
}
.note:last-child,
.cv-row:last-child { padding-bottom: 0; }

.note h3 {
  margin: 0 0 0.5rem;
  font-family: var(--sans);
  font-size: var(--step-1);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.005em;
}
.note .meta {
  margin-bottom: 0.75rem;
  font-family: var(--sans);
  font-size: var(--step--1);
  line-height: 1.45;
  color: var(--ink-soft);
}
.note .links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-family: var(--sans);
  font-size: 1rem;
}
.note .body { max-width: var(--measure); }
.note .body b,
.cv-title {
  font-family: var(--sans);
  font-weight: 700;
}
.note .body b { font-size: 0.94em; }

.cv { margin: 0; }
.cv dt {
  font-family: var(--sans);
  font-size: 1rem;
  padding-top: 0.2rem;
}
.cv dd { margin: 0; max-width: var(--measure); }
.cv-title { margin-bottom: 0.25rem; }
.cv-roles { color: var(--ink-soft); font-size: 1rem; line-height: 1.5; }
.note .meta span,
.cv-roles span { display: block; }
.soft { color: var(--ink-soft); }

.email {
  margin-bottom: 1rem;
  font-family: var(--sans);
  font-size: clamp(1.375rem, 1rem + 2vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.site-foot {
  margin-top: clamp(4rem, 9vw, 6rem);
  padding-block: 1rem 2.5rem;
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.site-foot p {
  max-width: var(--measure);
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

/* ---------- narrow screens ---------- */

@media (max-width: 52rem) {
  .fig { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 1.5rem; padding-block: var(--gutter) 1.75rem; }
  .fig .plate { grid-row: auto; }
  .plate { padding: 1rem; }
  .stack { width: 240px; }
  .controls h2 { font-size: var(--step-1); }
  .readout { font-size: 1.1875rem; margin-bottom: 1.5rem; }
  .note,
  .cv-row { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 24rem) {
  .options label { padding-inline: 0.625rem; }
}

@media (prefers-reduced-motion: reduce) {
  .stack img { transition: none; }
}
