/* ─────────────────────────────────────────────────────────────
   Tokens. Five colours, one typeface, one time constant.
   ───────────────────────────────────────────────────────────── */
html[data-theme]:root {
  --paper: var(--gray-40);
  --ink: var(--gray-810);
  --ink-2: var(--gray-550);
  --ink-3: var(--gray-500);
  --line: color-mix(in srgb, var(--gray-810) 13%, transparent);
  --veil: color-mix(in srgb, var(--gray-840) 12%, transparent);
  --btn: var(--gray-810);
  --btn-ink: var(--gray-40);
  --btn-hover: var(--gray-750);
  --grade-bias: 0;          /* grade compensation: 0 on paper, negative on dark */

  --xtra: 446;              /* our cut of Roboto Flex: slightly tighter counters */
  --ytlc: 530;              /* and a slightly taller x-height than stock */

  --pad: clamp(20px, 3.2vw, 48px);
  --gap: 24px;
  --nav-h: 60px;
  --maxw: 1440px;
  --f: var(--font);

  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html[data-theme="dark"]:root {
  --paper: var(--gray-850); --ink: var(--gray-60); --ink-2: var(--gray-300); --ink-3: var(--gray-350);
  --line: color-mix(in srgb, var(--gray-60) 13%, transparent); --veil: color-mix(in srgb, var(--gray-900) 34%, transparent);
  --btn: var(--gray-60); --btn-ink: var(--gray-850); --btn-hover: var(--gray-150);
  --grade-bias: -28;
  color-scheme: dark;
}

*, *::before, *::after {
  box-sizing: inherit;
  /* Every element re-resolves its grade from --g, so attention can be set per word. */
  font-variation-settings: "XTRA" var(--xtra), "YTLC" var(--ytlc), "GRAD" calc(var(--g, 0) + var(--grade-bias));
}
html { height: 100%; scroll-padding-top: calc(env(safe-area-inset-top, 0px) + var(--nav-h)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.55; font-weight: 400;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }
button { font: inherit; color: inherit; }

/* ─────────────────────────────────────────────────────────────
   The navigation
   ───────────────────────────────────────────────────────────── */
.veil {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  background: var(--veil); opacity: 0;
  transition: opacity .18s ease-out;                    /* out: quick, nothing to wait for */
}
.veil.is-on { opacity: 1; transition: opacity 1s cubic-bezier(.55, 0, 1, .45); } /* in: the page sinks, slowly */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--paper);
}
.nav__row {
  position: relative; z-index: 2;
  max-width: var(--maxw); margin: 0 auto; height: var(--nav-h);
  padding: 0 var(--pad);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  align-items: center;
}
.brand {
  grid-column: 1 / 3; justify-self: start;
  display: inline-flex; align-items: center; height: 44px;
  color: var(--ink); text-decoration: none;
}
.brand svg { display: block; height: 17px; width: auto; overflow: visible; fill: currentColor; }

.menuwrap { grid-column: 3 / 10; align-self: stretch; }
.menu {
  height: 100%;
  display: flex; align-items: stretch;
  list-style: none; margin: 0 0 0 -12px; padding: 0;
}
.menu > li { display: flex; }
.navlink {
  position: relative;
  display: inline-flex; align-items: center; height: 100%;
  margin: 0; padding: 0 12px; border: 0; background: none;
  font-size: 13px; line-height: 1; font-weight: 450; letter-spacing: -0.002em;
  color: var(--ink); text-decoration: none; cursor: default;
  -webkit-tap-highlight-color: transparent;
}
.navlink:focus-visible { outline-offset: -8px; }
.navlink__t { display: inline-block; }
.navlink__p, .nullp {
  position: absolute; left: 12px; bottom: 7px;
  font-size: 11px; line-height: 1; font-weight: 450; font-variant-numeric: tabular-nums;
  color: var(--ink-3); opacity: 0; pointer-events: none; white-space: nowrap;
}
.nullp { position: static; align-self: center; margin-left: 10px; display: none; }
.inspect .navlink__p { opacity: 1; }
.inspect .nullp { display: block; opacity: 1; }

.actions { grid-column: 10 / 13; justify-self: end; display: flex; align-items: center; gap: 22px; }
.signin { font-size: 13px; font-weight: 450; text-decoration: none; }
.signin:is(:hover, [data-hover]) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.btn {
  display: inline-flex; align-items: center; height: 34px; padding: 0 14px;
  border-radius: 6px; background: var(--btn); color: var(--btn-ink);
  font-size: 13px; font-weight: 500; letter-spacing: -0.004em; text-decoration: none; white-space: nowrap;
}
.btn:is(:hover, [data-hover]) { background: var(--btn-hover); }       /* hover backgrounds snap; they are states, not motion */

.menu-toggle {
  display: none; grid-column: 7 / 13; justify-self: end;
  height: 44px; padding: 0 2px; border: 0; background: none; cursor: default;
  font-size: 15px; font-weight: 500; letter-spacing: -0.004em;
  -webkit-tap-highlight-color: transparent;
}

/* The seam: the only indicator in the system. Drawn, not bordered. */
.seam { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 4px; z-index: 3; pointer-events: none; display: block; }

.sheet {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 1; height: 0;
  background: var(--paper); visibility: hidden;
}
.sheet.is-live { visibility: visible; box-shadow: 0 1px 0 var(--line); }

.panel {
  position: absolute; left: 0; right: 0; top: 100%;
  visibility: hidden; opacity: 0;
  clip-path: inset(0 0 max(0px, calc(100% - var(--reveal, 0px))) 0);
}
.panel.is-live { visibility: visible; }
.panel__grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  align-items: start; padding: 30px var(--pad) 40px;
}
.panel__thesis { grid-column: 1 / 3; font-size: 13px; line-height: 1.45; color: var(--ink-2); max-width: 24ch; padding-top: 9px; }
.panel__thesis p { margin: 0 0 12px; }
.panel__all { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--line); }
.panel__all:is(:hover, [data-hover]) { text-decoration-color: currentColor; }
.panel__entries {
  grid-column: 3 / 10; justify-self: start;
  list-style: none; margin: 0; padding: 0; width: min(344px, 100%);
  transform: translateX(var(--colx, 0px));
}
.entry { display: block; padding: 9px 0 10px; text-decoration: none; color: var(--ink); }
.entry__t { display: block; font-size: 15px; line-height: 1.3; font-weight: 500; letter-spacing: -0.004em; }
.entry__d { display: block; margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.entry:focus-visible { outline-offset: 4px; }
/* Secondary text follows its title's attention at 40 %: the word leads, the explanation follows. */
.entry__d, .feature__k, .feature__d, .feature__m {
  font-variation-settings: "XTRA" var(--xtra), "YTLC" var(--ytlc), "GRAD" calc(var(--g, 0) * .4 + var(--grade-bias));
}
.feature { grid-column: 10 / 13; display: block; padding-top: 9px; text-decoration: none; color: var(--ink); }
.feature__k { display: block; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.feature__t { display: block; margin-top: 10px; font-size: 20px; line-height: 1.18; font-weight: 550; letter-spacing: -0.014em; text-wrap: balance; }
.feature__d { display: block; margin-top: 8px; font-size: 13px; line-height: 1.45; color: var(--ink-2); max-width: 32ch; }
.feature__m { display: block; margin-top: 14px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.feature:is(:hover, [data-hover]) .feature__t { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* Mobile sheet */
.msheet {
  position: fixed; inset: 0; z-index: 1; visibility: hidden;
  background: var(--paper);
  clip-path: inset(0 0 max(0px, calc(100% - var(--mreveal, 0px))) 0);
}
.msheet.is-live { visibility: visible; }
.msheet__inner {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + var(--nav-h) + 20px) var(--pad) calc(env(safe-area-inset-bottom, 0px) + 22px);
}
.mwrap { position: relative; margin: auto 0 0; } /* auto top margin: the list sits where the thumb is, and still scrolls when it overflows */
.mlist { margin: 0; padding: 0; list-style: none; }
.mrail { position: absolute; top: 0; left: -14px; width: 4px; height: 100%; pointer-events: none; display: block; }
.mitem__btn {
  display: flex; width: 100%; align-items: baseline; justify-content: space-between;
  padding: 7px 0; border: 0; background: none; cursor: default; text-align: left; text-decoration: none;
  font-size: 32px; line-height: 1.12; font-weight: 500; letter-spacing: -0.022em; color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.mitem__n { font-size: 13px; font-weight: 450; letter-spacing: 0; font-variant-numeric: tabular-nums; color: var(--ink-3); opacity: 0; }
.inspect .mitem__n { opacity: 1; }
.macc { height: 0; overflow: hidden; visibility: hidden; }
.macc.is-live { visibility: visible; }
.macc__in { padding: 2px 0 16px; }
.macc__in ul { list-style: none; margin: 0; padding: 0; }
.mentry { display: block; padding: 8px 0; text-decoration: none; color: var(--ink); }
.mentry__t { display: block; font-size: 17px; line-height: 1.3; font-weight: 500; }
.mentry__d { display: block; margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.mall { display: inline-block; margin-top: 6px; font-size: 13px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--line); }
.mactions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.mactions .signin { font-size: 15px; }

/* Inspector overlay */
.overlay { position: fixed; inset: 0; z-index: 60; pointer-events: none; display: none; width: 100%; height: 100%; }
.inspect .overlay { display: block; }

/* ─────────────────────────────────────────────────────────────
   The stage: a quiet page for the navigation to sit on
   ───────────────────────────────────────────────────────────── */
main { padding-top: var(--nav-h); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
.hero { padding-top: clamp(64px, 13vh, 152px); padding-bottom: 88px; }
.hero h1 {
  grid-column: 3 / 12; margin: 0; max-width: 13ch;
  font-size: clamp(40px, 5.4vw, 80px); line-height: 1; font-weight: 550; letter-spacing: -0.022em;
  text-wrap: balance;
}
.lede { grid-column: 3 / 9; margin: 30px 0 0; max-width: 44ch; font-size: 20px; line-height: 1.5; color: var(--ink-2); }
.study { grid-column: 3 / 10; margin-top: 72px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.5; }
.study p { margin: 0; max-width: 58ch; }
.study .hint { color: var(--ink-2); margin-top: 6px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 18px; min-height: 28px; }
.textbtn {
  padding: 0; border: 0; background: none; cursor: default; font-size: 15px; font-weight: 500;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--line);
}
.textbtn:is(:hover, [data-hover]) { text-decoration-color: currentColor; }
.temp { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.temp[hidden] { display: none; }
.temp input { width: 132px; accent-color: var(--ink); }
.temp output { font-variant-numeric: tabular-nums; color: var(--ink); min-width: 3ch; }
.readout { margin-top: 12px !important; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-height: 1.45em; }
.readout[hidden] { display: none; }
.status { margin-top: 12px !important; font-size: 13px; color: var(--ink); min-height: 1.45em; }

.work { padding-bottom: 120px; }
.work h2 { grid-column: 3 / 10; margin: 0 0 18px; font-size: 20px; line-height: 1.2; font-weight: 550; letter-spacing: -0.014em; }
.rows { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  align-items: baseline; padding: 20px 0 22px; border-top: 1px solid var(--line); text-decoration: none;
}
.row__date { grid-column: 1 / 3; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.row__t { grid-column: 3 / 9; font-size: 20px; line-height: 1.22; font-weight: 500; letter-spacing: -0.012em; }
.row__k { grid-column: 10 / 13; font-size: 13px; color: var(--ink-2); }
.row:is(:hover, [data-hover]) .row__t { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

footer { padding: 28px 0 48px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
footer p { grid-column: 3 / 9; margin: 0; max-width: 56ch; }
footer .textbtn { grid-column: 10 / 13; justify-self: end; align-self: start; font-size: 13px; color: var(--ink); }

@media (max-width: 860px) {
  .menuwrap, .actions, .nullp { display: none !important; }
  .brand { grid-column: 1 / 7; }
  .menu-toggle { display: inline-flex; align-items: center; }
  .hero h1, .lede, .study, .work h2, footer p { grid-column: 1 / -1; }
  .hero { padding-top: 56px; padding-bottom: 64px; }
  .lede { font-size: 17px; margin-top: 22px; }
  .study { margin-top: 48px; }
  .row { grid-template-columns: 1fr; row-gap: 4px; }
  .row__date, .row__t, .row__k { grid-column: 1 / -1; }
  .row__t { font-size: 20px; }
  footer .textbtn { grid-column: 1 / -1; justify-self: start; margin-top: 14px; }
}
@media (min-width: 861px) { .msheet { display: none; } }
@media (prefers-reduced-motion: reduce) { .veil, .veil.is-on { transition: none; } }
/* Inter Variable has no grade axis: the prediction is carried by weight */
.navlink { font-weight: calc(450 + (var(--g, 0) + var(--grade-bias))); }
.navlink__t::after { content: attr(data-t); display: block; height: 0; overflow: hidden; visibility: hidden; font-weight: 600; }
.navlink__p { font-weight: 450; }
.panel__all { font-weight: calc(400 + (var(--g, 0) + var(--grade-bias))); }
.entry__t { font-weight: calc(500 + (var(--g, 0) + var(--grade-bias))); }
.feature__t { font-weight: calc(550 + (var(--g, 0) + var(--grade-bias))); }
.mitem__btn { font-weight: calc(500 + (var(--g, 0) + var(--grade-bias))); }
.mitem__n { font-weight: 450; }
