:root {
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --label-col: 118px;
  --row-gap: clamp(1rem, 2.5vw, 1.75rem);

  /* dark is the designed default; light is the opt-in alternate */
  --bg: #0D1218;
  --ink: #E3EAF0;
  --soft: #78889A;
  --line: rgba(227, 234, 240, .15);
  --accent: #6FC3D9;
  --photo-filter: saturate(.85) brightness(.93);
}

/* A true inversion of the dark theme: the ice becomes the ground, the
   blue-black ground becomes the ink. Contrast mirrors dark almost exactly. */
:root[data-theme="light"] {
  --bg: #E3EAF0;
  --ink: #0D1218;
  --soft: #54636F;
  --line: rgba(13, 18, 24, .18);
  --accent: #0F5F76;
  --photo-filter: saturate(.9) contrast(1.02);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sheet-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vh, 3.5rem) var(--gutter) clamp(2rem, 6vh, 4rem);
}

/* ---- meta bars ---- */

.meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  font-family: 'Martian Mono', ui-monospace, monospace;
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--soft);
}

.meta-bottom { margin-top: 1.5rem; }

.meta-right {
  display: inline-flex;
  align-items: baseline;
  gap: .5rem;
}

.meta-sep { opacity: .5; }

/* reads as meta-bar text, not as a button */
.theme-toggle {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--soft);
  cursor: pointer;
  position: relative;
  border-bottom: 1px solid var(--line);
  transition: color .15s ease, border-color .15s ease;
}

/* expands the tap target past the 24px minimum without shifting the underline */
.theme-toggle::after {
  content: '';
  position: absolute;
  inset: -10px -10px;
}

.theme-toggle:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---- masthead ---- */

.masthead {
  display: grid;
  grid-template-columns: 1fr minmax(160px, 240px);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: end;
  margin: clamp(1.5rem, 4vh, 2.75rem) 0 clamp(1.75rem, 4vh, 3rem);
}

.name {
  font-variation-settings: 'opsz' 96;
  font-weight: 800;
  font-size: clamp(3.25rem, 9vw, 7.5rem);
  line-height: .84;
  letter-spacing: -.035em;
  margin: 0 0 clamp(.75rem, 2vw, 1.25rem);
}

.role {
  margin: 0;
  font-size: clamp(.95rem, 1.5vw, 1.0625rem);
  font-weight: 400;
  line-height: 1.35;
  color: var(--soft);
  max-width: 34ch;
  text-wrap: balance;
}

.portrait {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--line);
  filter: var(--photo-filter);
}

/* ---- the sheet ---- */

.sheet {
  margin: 0;
  border-top: 1.5px solid var(--ink);
}

.sheet-last { border-bottom: 1.5px solid var(--ink); }

.row {
  display: grid;
  grid-template-columns: var(--label-col) 1fr;
  gap: 0 var(--row-gap);
  padding: .85rem 0;
  border-top: 1px solid var(--line);
}

.row:first-child { border-top: 0; }

dt {
  font-family: 'Martian Mono', ui-monospace, monospace;
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--soft);
  padding-top: .35rem;
}

dd {
  margin: 0;
  font-family: 'Martian Mono', ui-monospace, monospace;
  font-size: 11.5px;
  line-height: 1.8;
}

dd > span { display: block; }

.live-list > span { display: block; }

/* source citation under a live row */
.src {
  display: inline-block;
  margin-top: .5rem;
  font-size: 10px;
  letter-spacing: .03em;
  opacity: .8;
}

.prose {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: clamp(1rem, 1.6vw, 1.0625rem);
  line-height: 1.5;
  margin: 0;
  max-width: 46ch;
}

.row-prose dd { line-height: inherit; }

/* ---- live indicator ---- */

.live {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: .45em;
  vertical-align: .1em;
  background: var(--accent);
  border-radius: 50%;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---- links ---- */

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: opacity .15s ease;
}

a:hover { opacity: .7; }

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

/* ---- mobile ---- */

@media (max-width: 680px) {
  :root { --label-col: 96px; }

  .masthead {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
  }

  .portrait { max-width: 220px; }

  /* location is redundant here on narrow screens — the Based row carries it */
  .meta-loc,
  .meta-sep { display: none; }

  dt { font-size: 10px; }
  dd { font-size: 11px; line-height: 1.75; }
}

@media (prefers-reduced-motion: reduce) {
  a,
  .theme-toggle { transition: none; }
}
