/* Buddha Boredom website.
 * With the js class (set by board.js once the board runs) the page is a
 * full-screen drawing board with a little chrome and a sheet that slides up.
 * Without it, the sheet's content is an ordinary readable page. */

/* Fonts (self-hosted, unmodified @fontsource latin files, SIL OFL) */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("web/fonts/newsreader-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("web/fonts/newsreader-latin-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Work Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("web/fonts/work-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Work Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("web/fonts/work-sans-latin-500-normal.woff2") format("woff2");
}

/* Tokens */
:root {
  /* brand (docs/BRANDING.md) */
  --paper: #EEEADF;
  --sheet: #F5F2EA;
  --slate: #2E353B;
  --slate-soft: #474E54;     /* secondary text */
  --sage: #587566;           /* decorative accent, not for text */
  --accent-ink: #3C5A4C;     /* sage darkened for text */
  --rule: rgba(46, 53, 59, .14);

  /* HUD: frosted paper on light surfaces, dark glass on dark ones */
  --hud-bg: rgba(245, 242, 234, .82);
  --hud-solid: #F2EFE7;
  --hud-ink: #2E353B;
  --hud-line: rgba(46, 53, 59, .14);
  --hud-sep: rgba(46, 53, 59, .14);
  --hud-hover: rgba(46, 53, 59, .07);
  --hud-press: rgba(46, 53, 59, .12);
  --hud-shadow: 0 6px 24px rgba(46, 53, 59, .10);
  --hud-track: rgba(46, 53, 59, .22);
  --hud-fill: #3C6B59;
  --hud-accent: #3C6B59;
  --hud-on: rgba(60, 107, 89, .14);
  --pop-bg: rgba(248, 246, 240, .97);

  /* board ground; board.js sets it per surface */
  --ground: var(--paper);

  /* chrome drawn straight onto the board, switched by data-tone */
  --c-ink: var(--slate);
  --c-accent: var(--accent-ink);
  --c-chip: rgba(245, 242, 234, .86);
  --c-chip-line: rgba(46, 53, 59, .22);

  --focus: #1858A8;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --tone-time: .9s;

  --f-serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --f-sans: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  color-scheme: light;
}
:root[data-tone="dark"] {
  --c-ink: #E4E7E1;
  --c-accent: #8CC4AD;
  --c-chip: rgba(14, 16, 22, .72);
  --c-chip-line: rgba(255, 255, 255, .18);
  --focus: #8CC4FF;
  --hud-bg: rgba(20, 23, 28, .80);
  --hud-solid: #191C21;
  --hud-ink: #DBE0E6;
  --hud-line: rgba(255, 255, 255, .08);
  --hud-sep: rgba(255, 255, 255, .12);
  --hud-hover: rgba(255, 255, 255, .09);
  --hud-press: rgba(255, 255, 255, .14);
  --hud-shadow: 0 8px 28px rgba(0, 0, 0, .3);
  --hud-track: rgba(255, 255, 255, .22);
  --hud-fill: #578C78;
  --hud-accent: #8CC4AD;
  --hud-on: rgba(87, 140, 120, .3);
  --pop-bg: rgba(20, 23, 28, .94);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--slate);
  font: 400 17px/1.6 var(--f-sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--f-serif); font-weight: 400; line-height: 1.15; margin: 0; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.quiet-focus:focus-visible { outline: none; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Header: enso + wordmark, Learn more, Steam */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left));
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 25px; color: var(--c-ink); white-space: nowrap; }
.enso {
  width: 30px; height: 30px; flex: none;
  background: var(--c-accent);
  -webkit-mask: url("web/enso-mark.png") center / contain no-repeat;
  mask: url("web/enso-mark.png") center / contain no-repeat;
}
.wordmark { letter-spacing: -.005em; }
.wm-b { font-style: italic; color: var(--c-accent); }
.top-links { display: none; align-items: center; gap: 8px; flex: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px;
  padding: 6px 14px; border-radius: 999px; white-space: nowrap;
  color: var(--c-ink); text-decoration: none;
  background: var(--c-chip); border: 1px solid var(--c-chip-line);
}
.chip:hover { border-color: currentColor; }
.learn { font: italic 400 16px/1.2 var(--f-serif); letter-spacing: .01em; }
.steam-pill { padding-left: 10px; font: 500 14px/1.2 var(--f-sans); letter-spacing: .01em; }
.steam-mark { width: 18px; height: 18px; flex: none; display: block; }
.pill-short { display: none; }

/* Without JS: an ordinary page */
.stage, .scrim, .sheet-head, .js-only { display: none; }
.sheet-body { max-width: 680px; margin: 0 auto; padding: 8px 20px 24px; }
.foot { max-width: 680px; margin: 0 auto; padding: 0 20px 40px; }

/* While board.js starts, the page is hidden; if it never starts (blocked,
   failed, very slow), the plain page shows after a few seconds. */
.js-pending body { visibility: hidden; animation: show-plain 0s linear 4s forwards; }
@keyframes show-plain { to { visibility: visible; } }

/* With JS: the board is the page */
.js, .js body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.js body {
  background: var(--ground);
  transition: background-color var(--tone-time) ease;
  -webkit-tap-highlight-color: transparent;
}
.js .js-only { display: revert; }
.js .stage { display: block; }
.js .board { position: fixed; inset: 0; z-index: 0; }
.js #pad {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  cursor: crosshair;
}
/* the brush cursor: an outline the size of the brush in the ink colour
   (mouse and pen only; board.js shows it and hides the system cursor) */
.brush {
  position: absolute; left: 0; top: 0; z-index: 1;
  width: var(--d, 20px); height: var(--d, 20px); margin: calc(var(--d, 20px) / -2) 0 0 calc(var(--d, 20px) / -2);
  border-radius: 50%; pointer-events: none;
  border: 1.5px solid color-mix(in srgb, var(--brush-ink, #141216) 60%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ground) 50%, transparent);
  opacity: 0; transition: opacity .25s ease, width .2s ease, height .2s ease, margin .2s ease;
  will-change: transform;
}
.brush.is-on { opacity: .75; }
.js .board.brush-on #pad { cursor: none; }
@media (hover: none), (pointer: coarse) { .brush { display: none; } }
/* The ink-wash scene at the edge of the board, on light surfaces only.
   The sumi-e paintings are the site's adopted art. board.js sets data-scene
   (which painting) and data-state: full, whisper (the board is in use) or
   gone. Normally board.js paints the scene into a canvas of its own and
   adds .is-live, and the ink-in, step-back and dry-out happen there; the
   rules below without .is-live are the plain fade used when it can't.
   The paintings are ink on white, so multiply leaves the ground untouched.
   board.js loads assets/web/scene-<name>.webp too, so new art keeps those
   names, or change both (assets/web is cached for a year). */
@property --ink { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --strength { syntax: "<number>"; inherits: false; initial-value: .16; }
.scene {
  position: absolute; right: 0; bottom: 0; z-index: 1;
  width: min(50vw, 700px); height: min(64vh, 620px);
  background: no-repeat right bottom / contain;
  mix-blend-mode: multiply; pointer-events: none;
  --ink: 0; --strength: .16;
  opacity: calc(var(--ink) * var(--strength));
  -webkit-mask-image: radial-gradient(120% 110% at 72% 62%, #000 calc(var(--ink) * 50%), transparent calc(var(--ink) * 50% + 40%));
  mask-image: radial-gradient(120% 110% at 72% 62%, #000 calc(var(--ink) * 50%), transparent calc(var(--ink) * 50% + 40%));
  transition: --ink 3s cubic-bezier(.3, .5, .25, 1), --strength 1.6s ease;
}
.scene[data-scene="hill"] { background-image: url("web/scene-hill.webp"); }
.scene[data-scene="cliff"] { background-image: url("web/scene-cliff.webp"); }
.scene[data-state="full"] { --ink: 1; }
.scene[data-state="whisper"] { --ink: 1; --strength: .05; }
.scene[data-state="gone"] { --ink: 0; transition-duration: 1.4s, 1.6s; }
.scene.is-live, .scene.is-live[data-state] { background-image: none; --ink: 1; --strength: .16; transition: none; }
.scene-art { display: block; width: 100%; height: 100%; object-fit: contain; object-position: right bottom; }
@media (max-width: 640px) {
  .scene { left: 0; width: auto; height: 44vh; bottom: 70px; background-position: 70% bottom; }
  .scene-art { object-position: 70% bottom; }
}
@media (prefers-reduced-motion: reduce) {
  .scene, .scene.is-live, .scene.is-live[data-state] { --strength: .1; }
}

/* the welcome line under the enso; board.js places it and sets its opacity */
.welcome {
  position: absolute; z-index: 1; left: 50%; top: 50%; margin: 0;
  transform: translateX(-50%);
  font: italic 400 30px/1.2 var(--f-serif); letter-spacing: .005em; white-space: nowrap;
  color: var(--c-ink); opacity: 0;
  pointer-events: none; user-select: none; -webkit-user-select: none;
}
.welcome.is-washed { transition: opacity .8s ease; }
/* a faint ink bloom where a stroke begins */
.bloom {
  position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none;
  border-radius: 50%; border: 1px solid var(--brush-ink, #141216);
  opacity: 0; animation: bloom .9s cubic-bezier(.2, .7, .3, 1) forwards;
}
@keyframes bloom {
  from { opacity: .4; transform: scale(.6); }
  to { opacity: 0; transform: scale(3.2); }
}
.js .top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2;
  pointer-events: none;
}
.js .top > * { pointer-events: auto; }
.js .top, .js .dock {
  touch-action: manipulation;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.js .brand {
  text-shadow: 0 0 10px var(--ground), 0 0 3px var(--ground);
  transition: color var(--tone-time) ease, text-shadow .3s ease;
}
/* while the surface changes, the wordmark's halo steps aside */
.is-switching .brand { text-shadow: none; }
.js .enso { transition: background-color var(--tone-time) ease; }
.js .wm-b { transition: color var(--tone-time) ease; }
.js .top-links { display: flex; }
.js .chip { transition: color var(--tone-time) ease, background-color var(--tone-time) ease, border-color .2s ease; }

/* Dock: the HUD */
.js .dock {
  display: flex; justify-content: center;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 0 max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  pointer-events: none;
}
.dock > * { pointer-events: auto; }

.hud {
  display: flex; align-items: center; gap: 4px;
  max-width: 100%;
  padding: 5px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-line);
  border-radius: 14px;
  box-shadow: var(--hud-shadow);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  color: var(--hud-ink);
  font: 400 15px/1 var(--f-sans);
  transition: opacity .45s ease, transform .45s var(--ease), background-color var(--tone-time) ease, color var(--tone-time) ease, border-color var(--tone-time) ease;
}
.hud.is-away { opacity: 0; transform: translateY(6px); }
.hud.is-away:focus-within, .hud.is-away:hover { opacity: 1; transform: none; }
/* groups: surface | fade, let go | size, mirror | draw for me */
.hud-group { display: flex; align-items: center; gap: 4px; padding-left: 5px; box-shadow: inset 1px 0 var(--hud-sep); }

.hud-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 12px;
  border: 0; border-radius: 9px; background: transparent;
  color: inherit; font: 500 15px/1 var(--f-sans);
  cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease;
}
.hud-btn:hover { background: var(--hud-hover); }
.hud-btn:active { background: var(--hud-press); }
.hud :focus-visible, .pop :focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.hud .quiet-focus:focus-visible, .pop .quiet-focus:focus-visible { outline: none; }
.hud-val {
  font: 500 14px/1 var(--f-sans); font-variant-numeric: tabular-nums; padding: 4px 6px; border-radius: 6px;
  background: var(--hud-hover); min-width: 3ch; text-align: center;
}
.hud-btn[aria-pressed="true"] .hud-val { background: #3C6B59; color: #fff; }
.hud-draw { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hud-accent) 60%, transparent); }
.hud-draw[aria-pressed="true"] { background: var(--hud-on); box-shadow: inset 0 0 0 1px var(--hud-accent); }
/* on/off light: a hollow ring when off, a filled jade dot when on */
.draw-led {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  box-shadow: inset 0 0 0 1.5px currentColor; opacity: .8;
}
.hud-draw[aria-pressed="true"] .draw-led { background: var(--hud-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--hud-accent) 30%, transparent); opacity: 1; animation: led 2.4s ease-in-out infinite; }
@keyframes led { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--hud-accent) 12%, transparent); } }

.hud-surface { position: relative; }
.surf-btn { padding-left: 10px; justify-content: flex-start; gap: 8px; }
.surf-btn .caret { width: 12px; height: 12px; margin-left: 2px; opacity: .85; transition: transform .2s ease; }
.surf-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }
.surf-name { overflow: hidden; text-overflow: ellipsis; }
.surf-dot, .pop-dot {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  background: var(--dot-ground, #EEEADF);
  box-shadow: inset 0 0 0 4px var(--dot-ground, #EEEADF), inset 0 0 0 9px var(--dot-ink, #141216), 0 0 0 1px var(--hud-line);
}

.hud-fade { display: inline-flex; align-items: center; gap: 10px; padding: 0 8px 0 8px; min-height: 40px; cursor: pointer; }
.hud-label { font: italic 400 16px/1 var(--f-serif); letter-spacing: .01em; }
.hud-read { font: 500 14px/1 var(--f-sans); font-variant-numeric: tabular-nums; min-width: 3.6ch; text-align: right; }

/* brush size: four dots, a native radio group (arrow keys move the choice);
   each dot names itself on hover and keyboard focus */
.hud-size { display: inline-flex; align-items: center; gap: 2px; padding: 0 2px 0 6px; min-height: 40px; }
.hud-size .hud-label { margin-right: 6px; }
.size-opt {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 40px; border-radius: 8px; cursor: pointer;
  transition: background-color .15s ease;
}
.size-opt:hover { background: var(--hud-hover); }
.size-opt input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: pointer;
}
.size-dot {
  display: block; border-radius: 50%; background: currentColor; opacity: .7;
  transition: opacity .15s ease, box-shadow .15s ease;
}
.size-opt:nth-of-type(1) .size-dot { width: 5px; height: 5px; }
.size-opt:nth-of-type(2) .size-dot { width: 9px; height: 9px; }
.size-opt:nth-of-type(3) .size-dot { width: 14px; height: 14px; }
.size-opt:nth-of-type(4) .size-dot { width: 20px; height: 20px; }
.size-opt input:checked + .size-dot { opacity: 1; box-shadow: 0 0 0 2px var(--hud-solid), 0 0 0 4px var(--hud-accent); }
.size-opt input:focus-visible + .size-dot { outline: 2px solid var(--focus); outline-offset: 5px; }
.tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  padding: 5px 8px; border-radius: 6px; white-space: nowrap;
  font: 500 13px/1 var(--f-sans); color: var(--hud-ink); background: var(--pop-bg);
  box-shadow: 0 0 0 1px var(--hud-line), 0 4px 14px rgba(0, 0, 0, .14);
  opacity: 0; pointer-events: none; transition: opacity .15s ease;
}
.size-opt:hover .tip, .size-opt:focus-within .tip { opacity: 1; }

/* the slider with its two ends named underneath */
.fade-track { display: inline-flex; flex-direction: column; align-items: stretch; }
.fade-ends {
  display: flex; justify-content: space-between; margin-top: -3px;
  font: italic 400 13px/1 var(--f-serif); letter-spacing: .01em;
}
#fade {
  -webkit-appearance: none; appearance: none;
  width: 120px; height: 24px; margin: 0; background: transparent; cursor: pointer;
  --p: 68%;
}
#fade::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--hud-fill) var(--p), var(--hud-track) var(--p));
}
#fade::-moz-range-track { height: 4px; border-radius: 2px; background: var(--hud-track); }
#fade::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--hud-fill); }
#fade::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; margin-top: -7px; border-radius: 50%;
  background: var(--hud-ink); border: 2px solid var(--hud-solid); box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
#fade::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--hud-ink); border: 2px solid var(--hud-solid); box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
#fade:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* surface popover */
.pop {
  position: absolute; left: 0; bottom: calc(100% + 10px);
  width: 250px; padding: 6px;
  background: var(--pop-bg); color: var(--hud-ink);
  border: 1px solid var(--hud-line); border-radius: 13px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .2);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transform-origin: 20% 100%;
  animation: pop-in .18s var(--ease);
}
.pop[hidden] { display: none; }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.pop-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  min-height: 42px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: inherit;
  font: 400 15px/1.2 var(--f-sans); text-align: left; cursor: pointer;
}
.pop-item:hover { background: var(--hud-hover); }
.pop-item[aria-pressed="true"] { background: var(--hud-on); }
.pop-check { margin-left: auto; font: 500 14px/1 var(--f-sans); opacity: 0; }
.pop-item[aria-pressed="true"] .pop-check { opacity: 1; }

/* The sheet */
.js .scrim {
  display: block; position: fixed; inset: 0; z-index: 4;
  background: rgba(46, 40, 30, .14);
  -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px);
  opacity: 0; transition: opacity .45s ease;
}
.js .scrim[hidden] { display: none; }
.js .scrim.is-on { opacity: 1; }

.js .sheet {
  position: fixed; z-index: 5; left: 0; right: 0; bottom: 0;
  margin: 0 auto; width: min(100%, 920px);
  height: 88vh; height: 88dvh;
  display: flex; flex-direction: column;
  background: var(--sheet);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -18px 60px rgba(20, 23, 28, .22), 0 -1px 0 rgba(255, 255, 255, .6) inset;
  transform: translateY(105%);
  visibility: hidden;
  transition: transform .36s cubic-bezier(.4, 0, .7, .2), visibility 0s linear .36s;
}
.js .sheet.is-open {
  transform: translateY(var(--drag, 0px));
  visibility: visible;
  transition: transform .5s var(--ease), visibility 0s;
}
.js .sheet.is-dragging { transition: none; }
.js .sheet-head {
  display: flex; align-items: center; justify-content: flex-end;
  position: relative; flex: none; padding: 10px 12px 4px;
  touch-action: none; cursor: grab;
}
.grab {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%);
  width: 44px; height: 5px; border-radius: 3px; background: rgba(46, 53, 59, .28);
}
.sheet-close {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 999px;
  background: rgba(255, 255, 255, .55); color: var(--slate);
  font: 500 14px/1 var(--f-sans); cursor: pointer;
}
.sheet-close:hover { background: #fff; }
.js .sheet-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.js .sheet-body { padding: 0 24px 8px; }

/* Sheet content */
.sheet-body section { padding: 28px 0 8px; border-top: 1px solid var(--rule); }
.sheet-body section.intro { border-top: 0; padding-top: 4px; }
/* the sheet's header painting, one of the site's sumi-e scenes (to change
   it, use a new file name in index.html, since assets/web is cached for a year) */
.sheet-art {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 7; object-fit: cover;
  margin: 0 0 18px; border-radius: 14px;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}
.sheet-body h2 { font-size: clamp(27px, 4vw, 34px); margin: 0 0 14px; color: var(--slate); }
.sheet-body h2:focus { outline: none; }
.sheet-body h2:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
.intro h2 { font-size: clamp(34px, 6vw, 48px); letter-spacing: -.01em; }
.kicker, .tools dt { font: italic 400 18px/1.35 var(--f-serif); letter-spacing: .005em; }
.badge { font: 500 14px/1.3 var(--f-sans); letter-spacing: .01em; }
.kicker { color: var(--accent-ink); margin-bottom: 10px; }
.lede { font-size: 19px; }
.sheet-body p { max-width: 62ch; }

.surf-list {
  list-style: none; margin: 18px 0 8px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px;
}
.surf-list li, .surf-tile {
  display: grid; grid-template-columns: 72px 1fr; grid-template-rows: auto 1fr; column-gap: 14px; row-gap: 2px;
  align-items: start;
}
.surf-list li { padding: 12px; border: 1px solid var(--rule); border-radius: 13px; background: rgba(255, 255, 255, .35); }
.js .surf-list li { padding: 0; border: 0; background: none; display: block; }
.surf-tile {
  width: 100%; padding: 12px; text-align: left; cursor: pointer;
  border: 1px solid var(--rule); border-radius: 13px; background: rgba(255, 255, 255, .4);
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.surf-tile:hover { background: #fff; border-color: rgba(46, 53, 59, .3); }
.surf-tile:active { transform: scale(.99); }
.surf-tile[aria-current="true"] { border-color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-ink); }
.swatch { grid-row: 1 / span 2; width: 72px; height: 44px; display: block; border-radius: 9px; box-shadow: 0 0 0 1px rgba(46, 53, 59, .12); }
.surf-list strong, .surf-tile strong { font: 500 16px/1.3 var(--f-sans); color: var(--slate); }
.surf-list span, .surf-tile span { font-size: 15px; line-height: 1.45; color: var(--slate-soft); }
.surf-tile .now { font: italic 400 15px var(--f-serif); color: var(--accent-ink); }

.tools { margin: 14px 0 0; display: grid; gap: 18px; }
.tools dt { color: var(--accent-ink); margin-bottom: 2px; font-size: 20px; }
.tools dd { margin: 0; max-width: 62ch; }

.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; margin-top: 8px; }
.mode { padding: 18px 18px 6px; border: 1px solid var(--rule); border-radius: 13px; background: rgba(255, 255, 255, .35); }
.mode h3 { font-size: 26px; margin: 0 0 8px; }
.badge {
  display: inline-block; margin: 0 0 10px; padding: 4px 9px; border-radius: 999px;
  color: #fff; background: var(--accent-ink);
}
.badge-soon { color: var(--slate); background: transparent; box-shadow: inset 0 0 0 1px var(--slate-soft); }
.badge::before, .status::before {
  content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .45em; vertical-align: .05em;
  border-radius: 50%; border: 1.5px solid currentColor; background: currentColor;
}
.badge-soon::before, .status.prog::before { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.status.next::before { background: transparent; }
.mode-list { margin: 0 0 12px; padding-left: 18px; }
.mode-list li { margin-bottom: 6px; }
.mode-list strong { font-weight: 500; }
.sub { font-size: 22px; margin: 26px 0 0; color: var(--slate); }

.road { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.road li { max-width: 62ch; display: grid; grid-template-columns: 7.5em 1fr; gap: 8px; }
.status { font: italic 400 17px/1.6 var(--f-serif); color: var(--accent-ink); white-space: nowrap; }
.status.next { color: var(--slate-soft); }

/* email signup (works without JS; posts to Buttondown in a new tab) */
.notify { margin: 18px 0 6px; max-width: 520px; }
.notify-label { display: block; font: 500 15px/1.3 var(--f-sans); margin-bottom: 6px; }
.notify-row { display: flex; flex-wrap: wrap; gap: 8px; }
.notify-input {
  flex: 1 1 220px; min-height: 44px; padding: 0 14px;
  font: 400 16px/1.2 var(--f-sans); color: var(--slate);
  background: #fff; border: 1px solid var(--slate-soft); border-radius: 10px;
}
.notify-input::placeholder { color: #6A7075; }
.notify-btn {
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 10px; cursor: pointer;
  font: 500 15px/1 var(--f-sans); color: #fff; background: var(--accent-ink);
}
.notify-btn:hover { background: #2F4A3D; }
.notify-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notify-note { font-size: 15px; color: var(--slate-soft); margin-top: 10px; }
.press { color: var(--slate-soft); }


.foot { padding-top: 28px; padding-bottom: max(36px, env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); color: var(--slate-soft); font-size: 15px; }
.js .foot { max-width: none; margin: 16px 24px 0; padding-left: 0; padding-right: 0; }

/* Tablets and phones: the HUD in two rows */
/* row 1: surface, then fade and let go; row 2: size and mirror, then draw */
@media (max-width: 900px) {
  .hud {
    display: grid; width: 100%; max-width: 520px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 2px 4px;
  }
  .hud-time { grid-column: 2 / 4; }
  .hud-brush { grid-column: 1 / 3; }
  .hud-group { padding-left: 0; box-shadow: none; }
  .hud-time, .hud-auto { justify-content: flex-end; }
  .hud-brush { padding-top: 2px; box-shadow: inset 0 1px var(--hud-sep); }
  .hud-auto { padding-top: 2px; box-shadow: inset 0 1px var(--hud-sep); }
  .hud-fade { flex: 1; min-width: 0; }
  .fade-track { flex: 1; min-width: 0; }
  #fade { width: 100%; min-width: 64px; }
}
@media (max-width: 640px) {
  .brand { font-size: 21px; gap: 8px; }
  .enso { width: 26px; height: 26px; }
  .surf-name { max-width: 7em; }
  .hud-btn { padding: 0 10px; }
  .hud-btn, .hud-fade, .hud-size { min-height: 44px; }
  .size-opt { width: 32px; height: 44px; flex: none; }
  .pop { width: min(280px, calc(100vw - 32px)); }
  .pop-item { min-height: 44px; }
  .js .sheet-body { padding: 0 18px 8px; }
  .js .foot { margin: 16px 18px 0; }
  .lede { font-size: 18px; }
}
@media (max-width: 420px) {
  .top { gap: 8px; }
  .brand { font-size: 19px; gap: 7px; }
  .enso { width: 23px; height: 23px; }
  .top-links { gap: 6px; }
  .chip { padding: 6px 11px; }
  .learn { font-size: 15px; }
  .steam-pill { padding-left: 8px; gap: 6px; }
  .pill-long { display: none; }
  .pill-short { display: inline; }
  .hud-size .hud-label, .hud-fade .hud-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .hud-btn { padding: 0 9px; }
  .size-opt { width: 30px; }
}
@media (max-width: 400px) {
  .hud-btn { padding: 0 7px; font-size: 14px; gap: 6px; }
  .hud-val { padding: 3px 4px; }
  .size-opt { width: 26px; }
  .hud-group { gap: 2px; }
}
@media (max-width: 360px) {
  .brand { font-size: 17px; gap: 6px; }
  .chip { padding: 6px 9px; }
  .steam-pill { padding-left: 7px; }
  .enso { width: 21px; height: 21px; }
}
/* short screens (and 200% zoom): slimmer rows, still pinned to the bottom */
@media (max-height: 500px) {
  .top { padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 8px; }
  .hud-btn, .hud-fade, .hud-size, .size-opt { min-height: 36px; height: auto; }
  .size-opt { height: 36px; }
  .js .dock { padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .js .sheet { height: 94vh; height: 94dvh; }
}

/* Reduced motion: no travel, instant changes */
@media (prefers-reduced-motion: reduce) {
  body *, body *::before, body *::after { animation: none !important; transition-duration: 0s !important; transition-delay: 0s !important; }
}
