/* ==========================================================================
   Ricky Kyaw — site styles. Hand-written, mobile first, one file.
   Sections: tokens · base · helpers · header · hero · figure · cell ·
   plates · bridge · footer · shared page bits · motion · reduced motion
   ========================================================================== */

/* A stand-in with matching metrics while IBM Plex Sans loads, so text barely moves. */
@font-face {
  font-family: 'Plex Sans Fallback';
  src: local('Segoe UI'), local('Helvetica Neue'), local('Arial');
  size-adjust: 105%;
  ascent-override: 102.5%;
  descent-override: 27.5%;
  line-gap-override: 0%;
}

/* ---------- tokens ---------- */
:root {
  --bg: #F8F7F2;
  --surface: #FFFFFF;
  --fg: #14161A;
  --muted: #5F636E;
  --accent: #2453D6;
  --line: #D9DEE7;
  --line-hover: #C9D0DB;
  --line-strong: #8A9099;
  --grid-minor: #ECEFF4;
  --grid-major: #DDE2EA;
  --shadow-lift: 0 12px 32px -12px rgba(20, 22, 26, .18), 0 2px 6px rgba(20, 22, 26, .06);
  --selection: rgba(36, 83, 214, .18);

  --sans: 'IBM Plex Sans', 'Plex Sans Fallback', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --t-fast: 180ms;
  --t-base: 320ms;
  --t-slow: 600ms;

  --header-h: 56px;
  --pad: 20px;
  --grid-minor-size: 20px;
  --grid-major-size: 100px;
  --container: 1080px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0F1217;
  --surface: #161A21;
  --fg: #E7E9EE;
  --muted: #8E939E;
  --accent: #7EA2FF;
  --line: #262C36;
  --line-hover: #2E3541;
  --line-strong: #6E7582;
  --grid-minor: #171C24;
  --grid-major: #222833;
  --shadow-lift: 0 12px 32px -12px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .3);
  --selection: rgba(126, 162, 255, .22);
  color-scheme: dark;
}

/* JavaScript off: follow the system setting. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0F1217;
    --surface: #161A21;
    --fg: #E7E9EE;
    --muted: #8E939E;
    --accent: #7EA2FF;
    --line: #262C36;
    --line-hover: #2E3541;
    --line-strong: #6E7582;
    --grid-minor: #171C24;
    --grid-major: #222833;
    --shadow-lift: 0 12px 32px -12px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .3);
    --selection: rgba(126, 162, 255, .22);
    color-scheme: dark;
  }
}

@media (min-width: 720px) {
  :root {
    --header-h: 60px;
    --pad: 24px;
    --grid-minor-size: 24px;
    --grid-major-size: 120px;
  }
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  isolation: isolate; /* so the grid layer below paints above body's background */
}

/* The graph paper. A fixed layer behind everything; major lines every
   5 minor cells. One major line always sits on the text edge. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-major) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-major) 1px, transparent 1px),
    linear-gradient(to right, var(--grid-minor) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-minor) 1px, transparent 1px);
  background-size:
    var(--grid-major-size) var(--grid-major-size),
    var(--grid-major-size) var(--grid-major-size),
    var(--grid-minor-size) var(--grid-minor-size),
    var(--grid-minor-size) var(--grid-minor-size);
  background-position-x:
    max(var(--pad), calc(50% - (var(--container) / 2 - var(--pad)) + var(--grid-major-size) / 2)),
    max(var(--pad), calc(50% - (var(--container) / 2 - var(--pad)) + var(--grid-major-size) / 2)),
    max(var(--pad), calc(50% - (var(--container) / 2 - var(--pad)) + var(--grid-minor-size) / 2)),
    max(var(--pad), calc(50% - (var(--container) / 2 - var(--pad)) + var(--grid-minor-size) / 2));
  background-position-y: calc(var(--header-h) - 1px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 60vh, rgba(0, 0, 0, .45) 100%);
          mask-image: linear-gradient(to bottom, #000 0, #000 60vh, rgba(0, 0, 0, .45) 100%);
}

html.is-theming body,
html.is-theming .site-header,
html.is-theming .cell,
html.is-theming .plate {
  transition: background-color 240ms var(--ease-in-out), color 240ms var(--ease-in-out), border-color 240ms var(--ease-in-out);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a, button, input, [role="button"] { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
::selection { background: var(--selection); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#main:focus { outline: none; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- helpers ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--pad); }

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

.label {
  font: 400 .8125rem/1.5 var(--mono);
  letter-spacing: .02em;
  color: var(--muted);
}

/* Text links: a thin line draws itself in from the left, and leaves to the right. */
.u {
  text-decoration: none;
  padding-bottom: 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: 100% 100%;
  transition: background-size 280ms var(--ease-out);
}
/* A faint resting line under the most important link, so it reads as a link on touch. */
.u--rest {
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(color-mix(in srgb, currentColor 35%, transparent), color-mix(in srgb, currentColor 35%, transparent));
  background-size: 0% 1px, 100% 1px;
  background-position: 100% 100%, 0 100%;
}
.u:focus-visible,
.hover-u:focus-visible .u,
.plate:focus-visible .u,
.u:active,
.hover-u:active .u,
.plate:active .u {
  background-size: 100% 1px, 100% 1px;
  background-position: 0 100%, 0 100%;
}
@media (hover: hover) {
  .u:hover,
  .hover-u:hover .u,
  .plate:hover .u {
    background-size: 100% 1px, 100% 1px;
    background-position: 0 100%, 0 100%;
    transition: background-size 420ms var(--ease-out);
  }
}

.arrow {
  display: inline-block;
  margin-left: 6px;
  transition: transform var(--t-fast) var(--ease-out);
}
@media (hover: hover) {
  .hover-u:hover .arrow { transform: translateX(3px); }
}

/* A button that reads like a link, used inside the cell's answers. */
.linklike {
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: currentColor;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  cursor: pointer;
  border-radius: 2px;
}
@media (hover: hover) {
  .linklike:hover { text-decoration-color: currentColor; }
}
html:not(.js) .linklike { text-decoration: none; pointer-events: none; }
html:not(.js) .copy-btn { display: none; }
html:not(.js) .js-only { display: none; }

.skip {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
}
.skip:focus-visible {
  position: fixed;
  top: 16px; left: 16px;
  width: auto; height: auto;
  clip: auto; clip-path: none;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 400 .8125rem/1 var(--mono);
  color: var(--fg);
  text-decoration: none;
  z-index: 100;
}

#route-announcer { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.brand {
  font-size: .9375rem;
  font-weight: 400;
  line-height: 1;
  padding: 12px 0;
}

.menu-btn {
  font: 400 .8125rem/1 var(--mono);
  letter-spacing: .02em;
  color: var(--muted);
  min-height: 44px;
  padding: 0 12px;
  margin-right: -12px;
}
.menu-btn[aria-expanded="true"] .when-closed,
.menu-btn[aria-expanded="false"] .when-open { display: none; }

.site-nav { display: none; }
.site-nav.is-open {
  display: block;
  position: absolute;
  top: calc(100% + 1px);
  left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  animation: sheet 220ms var(--ease-out);
}
@keyframes sheet { from { opacity: 0; transform: translateY(-8px); } }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 var(--pad);
  font-size: 1.0625rem;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.site-nav li a.is-active,
.site-nav li a[aria-current="page"] { box-shadow: inset 2px 0 0 var(--accent); }
.nav-rule { display: none; }
.nav-tail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 var(--pad);
}
.theme-btn {
  font: 400 .8125rem/1 var(--mono);
  letter-spacing: .02em;
  color: var(--muted);
  min-height: 44px;
  padding: 0 12px;
  margin-left: -12px;
}
html[data-theme="dark"] .theme-btn .when-light,
html:not([data-theme="dark"]) .theme-btn .when-dark { display: none; }
.nav-work {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--accent);
  text-decoration: none;
}

/* Without scripts the menu button does nothing, so show the list in full. */
@media (max-width: 719px) {
  html:not(.js) .site-header { position: static; height: auto; }
  html:not(.js) .site-header .container { flex-wrap: wrap; }
  html:not(.js) .menu-btn { display: none; }
  html:not(.js) .site-nav { display: block; width: 100%; position: static; background: none; border: 0; }
}

@media (min-width: 720px) {
  .site-header { background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .site-header { background: var(--bg); } }
  .menu-btn, .nav-work { display: none; }
  .site-nav, .site-nav.is-open {
    display: flex;
    position: static;
    align-items: center;
    height: 100%;
    gap: 24px;
    background: none;
    border: 0;
    animation: none;
  }
  .nav-tabs { position: relative; height: 100%; }
  .site-nav ul { display: flex; gap: 28px; height: 100%; }
  .site-nav li a {
    height: 100%;
    min-height: 0;
    padding: 0;
    font-size: .9375rem;
    color: var(--muted);
    border: 0;
    box-shadow: none;
    transition: color 240ms var(--ease-out);
  }
  .site-nav li a.is-active,
  .site-nav li a[aria-current="page"] { color: var(--fg); box-shadow: none; }
  html:not(.js) .site-nav li a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--fg); }
  .site-nav li a:hover, .site-nav li a:focus-visible { color: var(--fg); }
  /* One thin rule that slides under the current tab. */
  .nav-rule {
    display: block;
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100px;
    height: 1px;
    background: var(--fg);
    transform-origin: left;
    transform: scaleX(0);
    opacity: 0;
    transition: transform 400ms var(--ease-out), opacity 200ms;
  }
  .nav-rule.is-ready { opacity: 1; }
  .nav-tail { min-height: 0; padding: 0; }
  .theme-btn { margin: 0 -12px 0 0; }
}

/* ---------- main / page transitions ---------- */
main {
  display: block;
  transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out);
}
main.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 180ms var(--ease-in-out), transform 180ms var(--ease-in-out);
}
main.is-entering {
  opacity: 0;
  transform: translateY(8px);
  transition: none;
}

/* ---------- hero ---------- */
.hero { padding: 48px 0 40px; }
.hero-text { max-width: 640px; }

.work-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--accent);
  text-decoration: none;
}

h1 {
  font-size: clamp(2.75rem, 1.5rem + 5vw, 4.75rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.025em;
}
.statement {
  margin-top: 12px;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.625rem);
  line-height: 1.3;
  letter-spacing: -.01em;
}
.lead {
  margin-top: 20px;
  max-width: 58ch;
}

.hero-links {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.hero-links li { border-bottom: 1px solid var(--line); }
.hero-links a {
  display: flex;
  align-items: center;
  min-height: 48px;
  font-size: .9375rem;
  text-decoration: none;
}

.hero-fig { margin-top: 40px; }
@media (min-width: 720px) and (max-width: 1023px) { .hero-fig { max-width: 560px; } }

@media (min-width: 720px) {
  .hero { padding: 72px 0 56px; }
  .work-link { font-size: 1.0625rem; margin-bottom: 16px; }
  .hero-links { display: flex; gap: 32px; border: 0; }
  .hero-links li { border: 0; }
  .hero-links a { min-height: 44px; }
}
@media (min-width: 1024px) {
  .hero .container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 48px;
    align-items: start;
  }
  .hero-text { grid-column: 1 / 8; }
  .hero-fig { grid-column: 8 / 13; margin-top: 60px; }
}

/* ---------- figure 1 ---------- */
.fig { width: 100%; height: auto; overflow: visible; }
.fig .axis { stroke: var(--line); stroke-width: calc(1px * var(--fig-scale, 1)); }
.fig .tick {
  font: 400 calc(11px * var(--fig-scale, 1)) var(--mono);
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
}
.fig .walk {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.fig .walk.is-drawing { transition: stroke-dashoffset 1400ms var(--ease-out); }
.fig .dot { fill: var(--accent); }
.fig .end { font: 400 calc(13px * var(--fig-scale, 1)) var(--mono); fill: var(--fg); font-variant-numeric: tabular-nums; }
.fig .dot, .fig .end { transition: opacity 200ms var(--ease-out); }
.fig .is-hidden { opacity: 0; }
/* With scripts on, the walk waits for its own drawing code. */
html.js .fig:not(.is-ready) .walk, html.js .fig:not(.is-ready) .dot, html.js .fig:not(.is-ready) .end { opacity: 0; }
.fig-caption { margin-top: 12px; max-width: 52ch; }

/* ---------- the notebook cell ---------- */
.cell-wrap { max-width: 760px; padding-top: 8px; }
.cell-wrap .label { margin-bottom: 8px; }
.cell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px 12px;
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.cell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(36, 83, 214, .25);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}

.cell-rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 3px 0;
}
.row.is-new { animation: rowin 200ms var(--ease-out); }
@keyframes rowin { from { opacity: 0; transform: translateY(8px); } }

.gutter {
  flex: 0 0 9ch;
  padding-top: 3px;
  font: 400 .8125rem/1.5 var(--mono);
  letter-spacing: .02em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: left;
}
.row--in .gutter { color: var(--accent); }
.row-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row--in .row-body { font: 400 1rem/1.5 var(--mono); color: var(--muted); }
.row--out .row-body { font: 400 .9375rem/1.6 var(--sans); color: var(--fg); padding-top: 1px; }
.row--out .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.row--out .eq { color: var(--muted); }
.row--out a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
@media (hover: hover) { .row--out a:hover { text-decoration-color: currentColor; } }
.row--out .copy-inline { margin-left: 6px; font: 400 .8125rem/1 var(--mono); color: var(--muted); }

.cell-in { display: flex; align-items: center; gap: 8px; }
.cell-in .gutter {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-top: 0;
  color: var(--accent);
  border-radius: 2px;
}
.cell-input-wrap { position: relative; flex: 1; min-width: 0; }
.cell-input {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: 400 1rem/1.5 var(--mono);
  color: var(--fg);
  caret-color: var(--accent);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.cell-input::placeholder { color: var(--muted); opacity: 1; }
.cell-input:focus-visible { box-shadow: inset 0 -1px 0 var(--accent); }
.cell-ghost {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  pointer-events: none;
  font: 400 1rem/1.5 var(--mono);
  color: var(--muted);
  white-space: pre;
  overflow: hidden;
}
.cell-ghost .typed { visibility: hidden; }
@media (hover: hover) { .cell-ghost.is-on { display: flex; } }

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
}
.chips a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 400 .8125rem/1 var(--mono);
  letter-spacing: .02em;
  color: var(--fg);
  text-decoration: none;
  transition: border-color var(--t-fast) var(--ease-out), transform 80ms var(--ease-out);
}
.chips a:active { border-color: var(--fg); transform: scale(.98); }
@media (hover: hover) {
  .chips a { min-height: 36px; }
  .chips a:hover { border-color: var(--fg); }
}
html:not(.js) .cell-input { pointer-events: none; }

/* ---------- three plates ---------- */
.plates-section { padding-top: 40px; }
.plates {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.plates li + li { border-top: 1px solid var(--line); }
.plate {
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  text-decoration: none;
  color: inherit;
  border-radius: 2px;
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), background-color 240ms var(--ease-out);
}
.plate:active { background: var(--surface); }
.plate-num { font: 400 .8125rem/1.5 var(--mono); letter-spacing: .02em; color: var(--muted); transition: color 240ms var(--ease-out); }
.plate-title { margin-top: 12px; font-size: 1.25rem; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.plate-title .u { padding-bottom: 1px; }
.plate-text { margin-top: 8px; max-width: 30ch; font-size: .9375rem; line-height: 1.6; color: var(--muted); }
.plate-text a { color: var(--fg); }
.plate .arrow { margin: 20px 0 0; font-size: .9375rem; transition: transform var(--t-base) var(--ease-out); }

@media (min-width: 720px) {
  .plates-section { padding-top: 64px; }
  .plates { display: grid; grid-template-columns: repeat(3, 1fr); }
  .plates li { display: grid; }
  .plates li + li { border-top: 0; border-left: 1px solid var(--line); }
  .plate {
    min-height: 200px;
    padding: 28px 24px 24px;
  }
  .plate .arrow { margin-top: auto; padding-top: 20px; }
}
@media (hover: hover) {
  .plate:hover {
    background: var(--surface);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lift);
    transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out), background-color 240ms var(--ease-out);
  }
  .plate:hover .plate-num { color: var(--accent); }
  .plate:hover .arrow { transform: translateX(4px); }
}

/* ---------- story bridge ---------- */
.bridge {
  margin-top: 40px;
  padding: 40px 0;
  border-top: 1px solid var(--line);
}
.bridge p {
  max-width: 34ch;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.5rem);
  line-height: 1.4;
}
.bridge a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
  font-size: .9375rem;
  text-decoration: none;
}
@media (min-width: 720px) {
  .bridge { margin-top: 64px; padding: 64px 0; }
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 40px;
}
.site-footer .container { display: grid; gap: 24px; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { display: flex; align-items: center; min-height: 44px; font-size: .9375rem; }
.footer-links a { text-decoration: none; }
.footer-links .sep { display: none; }
.copy-btn {
  margin-left: 4px;
  padding: 8px;
  min-height: 44px;
  font: 400 .8125rem/1 var(--mono);
  letter-spacing: .02em;
  color: var(--muted);
  border-radius: 2px;
}
.footer-note { max-width: 44ch; }
.footer-note p + p { margin-top: 8px; }

@media (min-width: 720px) {
  .site-footer { padding: 48px 0 40px; }
  .site-footer .container { grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
  .footer-links { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; }
  .footer-links li { min-height: 0; }
  .footer-links .sep { display: inline; margin-right: 12px; color: var(--muted); }
  .copy-btn { min-height: 0; }
}

/* ---------- shared bits for the other pages ---------- */
.page { padding: 48px 0 56px; }
.page-head { max-width: 640px; }
.page h1 { font-size: clamp(2.25rem, 1.5rem + 3.5vw, 3.5rem); }
.page-intro { margin-top: 16px; max-width: 58ch; }
.section { padding-top: 40px; }
[id] { scroll-margin-top: calc(var(--header-h) + 12px); }
.section h2 { font-size: 1.5rem; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.section h2 + p { margin-top: 8px; color: var(--muted); font-size: .9375rem; max-width: 52ch; }
.section .plates { margin-top: 20px; }
.rows-list { list-style: none; margin: 20px 0 0; padding: 0; border-top: 1px solid var(--line); }
.rows-list li {
  display: grid;
  gap: 4px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.rows-list .when { font: 400 .8125rem/1.5 var(--mono); letter-spacing: .02em; color: var(--muted); font-variant-numeric: tabular-nums; }
.rows-list .what { font-weight: 600; }
.rows-list .note { color: var(--muted); font-size: .9375rem; }
.rows-list a.what { justify-self: start; }
.rows-list .alt-mail { font-size: .875rem; }
.alt-mail a { font-family: var(--mono); color: var(--fg); }
.alt-mail .sep { margin: 0 6px; }
.alt-mail-line { display: block; margin-top: 6px; }
/* The copy button keeps its 44px tap area without making its row taller than the others. */
.rows-list .what .copy-btn { margin-top: -8px; margin-bottom: -8px; }
/* On touch screens the two small addresses get a taller tap area, grown downward only. */
@media (pointer: coarse) {
  .alt-mail a { position: relative; }
  .alt-mail a::after { content: ""; position: absolute; inset: 0 0 -22px; }
}
/* Very narrow phones: one address per line, no dangling dot. */
@media (max-width: 349px) {
  .alt-mail .sep { display: none; }
  .alt-mail a { display: block; width: fit-content; margin-top: 4px; }
}
.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.form { display: grid; gap: 20px; max-width: 560px; margin-top: 24px; }
.field { display: grid; gap: 6px; }
.field label { font: 400 .8125rem/1.5 var(--mono); letter-spacing: .02em; color: var(--muted); }
.field input, .field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--fg);
  font: 400 1rem/1.5 var(--sans);
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(36, 83, 214, .25);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}
.submit {
  justify-self: start;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--fg);
  border-radius: 999px;
  font: 600 .9375rem/1 var(--sans);
  color: var(--fg);
  background: transparent;
  transition: background-color 240ms var(--ease-out), color 240ms var(--ease-out), transform 80ms var(--ease-out);
}
.submit:active { transform: scale(.98); }
@media (hover: hover) { .submit:hover { background: var(--fg); color: var(--bg); } }
.form-done { margin-top: 24px; max-width: 52ch; font-size: 1.125rem; }
.form-done:focus { outline: none; }
.form-error { color: var(--muted); font-size: .9375rem; max-width: 52ch; }

@media (min-width: 720px) {
  .page { padding: 72px 0 64px; }
  .section { padding-top: 64px; }
  .rows-list li { grid-template-columns: 160px 1fr; column-gap: 24px; }
  .rows-list .note { grid-column: 2; }
}

/* ---------- scroll reveal ---------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
html.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
  html.js [data-reveal] { opacity: 1; transform: none; }
  .plate:hover { transform: none; box-shadow: none; }
  .hover-u:hover .arrow, .plate:hover .arrow { transform: none; }
}
