/* ==========================================================================
   Ballast — ballast.ing
   System font only, no web fonts. Tokens in OKLCH. Light + dark.
   The theme follows <html data-theme>, dark unless the visitor picks light.
   ========================================================================== */

:root {
  color-scheme: light;
  --bg:            oklch(1 0 0);
  --bg-sunken:     oklch(0.979 0.003 250);
  --surface:       oklch(1 0 0);
  --surface-raised:oklch(1 0 0);
  --text:          oklch(0.23 0.016 256);
  --text-2:        oklch(0.515 0.015 256);
  --text-3:        oklch(0.645 0.013 256);
  --hairline:      oklch(0.912 0.005 256);
  --hairline-soft: oklch(0.948 0.004 256);
  --accent:        oklch(0.48 0.155 248);
  --accent-hover:  oklch(0.42 0.155 248);
  --accent-ink:    oklch(0.985 0.005 248);
  --accent-soft:   oklch(0.962 0.022 248);
  --accent-edge:   oklch(0.87 0.055 248);

  --ok:      oklch(0.64 0.165 147);
  --warn:    oklch(0.735 0.165 68);
  --bad:     oklch(0.585 0.205 26);
  --idle:    oklch(0.68 0.012 256);

  --shadow-card: 0 1px 2px oklch(0.23 0.016 256 / 0.04);
  --shadow-pop:  0 24px 60px -16px oklch(0.23 0.03 256 / 0.28),
                 0 2px 8px oklch(0.23 0.03 256 / 0.08);

  --measure: 1120px;
  --prose: 44rem;
  --radius: 14px;
  --radius-sm: 9px;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
}

/* On any element, not just the root, so a section can stay dark in a light
   page (see .spotlight). */
[data-theme="dark"] {
  color-scheme: dark;
  --bg:            oklch(0.175 0.012 258);
  --bg-sunken:     oklch(0.205 0.013 258);
  --surface:       oklch(0.215 0.013 258);
  --surface-raised:oklch(0.245 0.014 258);
  --text:          oklch(0.965 0.004 256);
  --text-2:        oklch(0.735 0.012 256);
  --text-3:        oklch(0.605 0.013 256);
  --hairline:      oklch(0.305 0.013 258);
  --hairline-soft: oklch(0.262 0.013 258);
  --accent:        oklch(0.70 0.145 248);
  --accent-hover:  oklch(0.78 0.135 248);
  --accent-ink:    oklch(0.17 0.03 248);
  --accent-soft:   oklch(0.265 0.045 248);
  --accent-edge:   oklch(0.37 0.07 248);

  --ok:   oklch(0.72 0.16 147);
  --warn: oklch(0.79 0.15 70);
  --bad:  oklch(0.68 0.185 26);
  --idle: oklch(0.56 0.012 256);

  --shadow-card: 0 1px 2px oklch(0 0 0 / 0.25);
  --shadow-pop:  0 28px 70px -16px oklch(0 0 0 / 0.65),
                 0 2px 10px oklch(0 0 0 / 0.35);
}

/* --- reset ---------------------------------------------------------------- */

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

html {
  /* Respects the user's text-size setting; everything below sizes in rem. */
  font: 100%/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; }

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

::selection { background: var(--accent-soft); color: var(--text); }

/* --- type ----------------------------------------------------------------- */

/* Tracking is size-specific: tight as text grows, near zero for body copy. */

h1, h2, h3 { font-weight: 600; }

.display {
  font-size: clamp(2.25rem, 1.15rem + 4.4vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -0.028em;
  font-weight: 700;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

h3 {
  font-size: 1.0625rem;
  line-height: 1.35;
  letter-spacing: -0.011em;
}

.lede {
  font-size: clamp(1.0625rem, 0.98rem + 0.4vw, 1.25rem);
  line-height: 1.55;
  letter-spacing: -0.006em;
  color: var(--text-2);
  text-wrap: pretty;
}

/* No word left alone on its last line, anywhere; headings balance instead. */
body { text-wrap: pretty; }

.muted { color: var(--text-2); }
.fine  { font-size: 0.875rem; color: var(--text-3); }

code, kbd, .mono { font-family: var(--mono); font-size: 0.9em; }

/* --- layout --------------------------------------------------------------- */

.wrap {
  width: min(100% - 2.5rem, var(--measure));
  margin-inline: auto;
}

section { padding-block: clamp(5rem, 2rem + 10vw, 11rem); }
.sunken { background: var(--bg-sunken); border-block: 1px solid var(--hairline-soft); }

.section-head { max-width: var(--prose); margin-bottom: 3rem; }
.section-head > * + * { margin-top: 0.875rem; }
.center { margin-inline: auto; text-align: center; }
.center .lede { text-wrap: balance; }

/* --- nav ------------------------------------------------------------------ */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  /* A translucent layer the page scrolls under, not an opaque strip. */
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid color-mix(in oklab, var(--hairline) 60%, transparent);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  height: 3.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-decoration: none;
  font-size: 1.0625rem;
  /* Pushes the theme switch, GitHub and Download right. */
  margin-right: auto;
}
.brand svg { width: 22px; height: 22px; border-radius: 5px; }

/* Light/dark switch. Shows the mode a click takes you to; the two glyphs
   share a cell and trade places. */
.theme-toggle, .nav-github {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  color: var(--text-2);
  cursor: pointer;
  transition: color 120ms ease-out, background-color 120ms ease-out;
}
.theme-toggle:hover, .nav-github:hover { color: var(--text); background: var(--hairline-soft); }
.theme-toggle:active, .nav-github:active { transform: scale(0.94); }
/* The two icons sit as a pair, closer to each other than to Download. */
.theme-toggle { margin-right: -1.5rem; }
.nav-github { margin-right: -0.75rem; }
.nav-github svg { width: 17px; height: 17px; }
.theme-toggle svg {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  transition: opacity 200ms ease-out, transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.theme-toggle .i-to-light,
[data-theme="light"] .theme-toggle .i-to-dark { opacity: 1; transform: none; }
.theme-toggle .i-to-dark,
[data-theme="light"] .theme-toggle .i-to-light { opacity: 0; transform: rotate(-60deg) scale(0.6); }

/* --- buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.008em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease-out, border-color 140ms ease-out,
              transform 100ms ease-out;
}

/* Feedback on press, not release. */
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--text-3); }

.btn-sm { padding: 0.4375rem 0.875rem; font-size: 0.875rem; border-radius: 8px; }

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  cursor: pointer;
  transition: color 120ms ease-out;
}
.btn-text:hover { color: var(--accent); }
.btn-text:active { transform: scale(0.97); }

.link {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* --- hero ----------------------------------------------------------------- */

/* At least one screen tall, less the nav, with the laptop pushed to the
   bottom, so its lid stands on the bottom edge of the first view rather
   than leaving a strip of page under it. On a tall screen the height to
   spare is shared, a third above the copy and two thirds below it, so the
   copy doesn't sit marooned at the top. */
.hero {
  padding-top: clamp(3.5rem, 2rem + 5vw, 6rem);
  padding-bottom: 0;
  min-height: calc(100svh - 3.5rem - 1px);
  display: flex;
  flex-direction: column;
}
.hero::before { content: ""; flex: 1 1 0; }
.hero > .wrap { flex: 2 1 auto; padding-bottom: var(--stage-gap); }

.hero-copy { max-width: 48rem; margin-inline: auto; text-align: center; }
.hero-copy > * + * { margin-top: 1.375rem; }
/* Narrower than the headline, so its two lines come out about even and
   break after "are up,". In em, so the break holds as the type scales. */
.hero-copy .lede { max-width: 23.5em; margin-inline: auto; }

.hero-actions {
  display: flex;
  gap: 0.875rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.hero-fine { font-size: 0.875rem; color: var(--text-3); margin-top: 1rem; }

/* --- the product visual --------------------------------------------------- */

.hero { --stage-gap: clamp(2.5rem, 1rem + 5vw, 4.5rem); }
.stage {
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* The bottom edge is the hinge: anything of the lid below it, while it is
     still shut or nearly so, is out of view, as the base would hide it.
     Only the bottom: mid-swing the lid's top edge leans out past its box. */
  clip-path: inset(-50vh 0 0 0);
}

/* The screen is a laptop lid, hinged along its bottom edge. The eye is
   level with the hinge, so the lid rises from the edge of the section as it
   opens. At rest it is tipped back a few degrees, so it reads as a screen
   on a desk rather than a picture square to the page. The perspective is in
   the transform itself, where Safari honours it, not on a parent. */
.lid {
  --lid-rest: perspective(2600px) rotateX(7deg);
  --bezel: clamp(7px, 0.25rem + 0.7vw, 14px);
  --bezel-color: oklch(0.2 0.006 256);
  position: relative;
  width: min(100%, 1200px);
  /* Never smaller than a screen the menu fits at its real size. Narrower
     than this, the lid keeps its size and the stage crops it (see below). */
  min-width: 720px;
  flex: none;
  transform: var(--lid-rest);
  transform-origin: 50% 100%;
  /* The bezel: a dark frame round the screen, a little deeper at the chin,
     inside a thin rim of the case. */
  padding: var(--bezel) var(--bezel) calc(var(--bezel) * 1.6);
  border-radius: 18px 18px 0 0;
  background: var(--bezel-color);
  border: 1px solid oklch(0.74 0.006 256);
  border-bottom: 0;
}

/* The bezel overlaps the screen's edge by a pixel. Otherwise the wallpaper
   bleeds through the antialiased edge as a hairline when the dark
   screensaver is over it. */
.lid::after {
  content: "";
  position: absolute;
  inset: calc(var(--bezel) - 1px) calc(var(--bezel) - 1px) calc(var(--bezel) * 1.6 - 1px);
  z-index: 3;
  border: 2px solid var(--bezel-color);
  border-radius: 9px 9px 0 0;
  pointer-events: none;
}

/* The hero ends at the hinge; a line marks where the next section starts. */
.sec-how { border-top: 1px solid var(--hairline); }

/* A screen in a laptop's proportions. */
.mac {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  padding-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

[data-theme="dark"] .lid { --bezel-color: oklch(0.11 0.004 258); border-color: oklch(0.34 0.008 258); }

/* The desktop backdrop, shared by the hero and the feature tour. */
.mac, .tour-stage {
  background:
    radial-gradient(120% 140% at 25% 0%, oklch(0.62 0.13 248 / 0.22), transparent 62%),
    radial-gradient(110% 120% at 85% 10%, oklch(0.58 0.12 192 / 0.18), transparent 58%),
    var(--bg-sunken);
}

/* The hero's screen has a real wallpaper; the tour keeps the plain one.
   Browsers without image-set types keep the WebP. */
.mac {
  background: var(--bg-sunken) url("/https/ballast.ing/images/wallpaper.webp") center / cover no-repeat;
  background-image: image-set(
    url("/https/ballast.ing/images/wallpaper.avif") type("image/avif"),
    url("/https/ballast.ing/images/wallpaper.webp") type("image/webp"));
}

/* macOS menu bar strip */
.menubar {
  display: flex;
  align-items: center;
  gap: 1.125rem;
  height: 26px;
  padding-inline: 0.75rem;
  font-size: 11.5px;
  background: color-mix(in oklab, var(--bg) 55%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid color-mix(in oklab, var(--hairline) 45%, transparent);
  color: var(--text-2);
}
.menubar-apple { display: flex; color: var(--text); }
.menubar-apple svg { width: 15px; height: 15px; }
.menubar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

/* The Ballast menu bar item itself: glyph + a count of what's wrong. */
.menubar-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 4px;
  border-radius: 5px;
  color: var(--text);
  transition: background-color 180ms ease-out;
}
.menubar-item.is-alert { background: color-mix(in oklab, var(--text) 10%, transparent); }
.menubar-item svg { width: 14px; height: 14px; }
.menubar-item .count {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity 200ms ease-out, max-width 200ms ease-out;
}
.menubar-item.is-alert .count { opacity: 1; max-width: 1.5rem; }

/* The popover. Width and metrics mirror MenuContentView / ContainerRow. */
.popover-anchor {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 0.625rem 0;
}

.popover {
  width: 340px;
  max-width: 100%;
  text-align: left;
  background: var(--surface-raised);
  border: 1px solid color-mix(in oklab, var(--hairline) 85%, transparent);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  /* Anchored to the menu bar item it came from. */
  transform-origin: top right;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.3;
}

.pop-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 12px;
}
.pop-title { font-size: 13px; font-weight: 600; letter-spacing: -0.006em; }
.pop-summary {
  font-size: 11px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.pop-tools { margin-left: auto; display: flex; gap: 4px; align-self: center; }
.pop-tool {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-2);
  background: color-mix(in oklab, var(--text) 6%, transparent);
}
.pop-tool svg { width: 11px; height: 11px; }

.pop-divider { height: 1px; background: var(--hairline); }

.pop-list { padding: 4px; }

.pop-group {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 7px 10px 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-3);
}
.pop-group .n { font-weight: 400; opacity: 0.7; }

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background-color 120ms ease-out;
}
.row:hover { background: color-mix(in oklab, var(--text) 6%, transparent); }
.row.is-hot { background: var(--accent); color: var(--accent-ink); }
.row.is-hot .row-ver, .row.is-hot .row-port { color: inherit; opacity: 0.75; }

.row-glyph { width: 14px; flex: none; display: grid; place-items: center; }
.row-glyph svg { width: 11px; height: 11px; }

.row-name { font-size: 13px; letter-spacing: -0.004em; white-space: nowrap; }
/* Sits in the slack after the name, so nothing moves when it appears. */
.row-update { flex: none; display: grid; place-items: center; margin-left: -3px; color: var(--accent); }
.row-update svg { width: 10px; height: 10px; }
.row-ver {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: none;
}
.row:hover .row-ver { display: block; }
.row-port {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.row-port.is-na { opacity: 0.55; }

/* Hover swaps the port for the controls, as the app does. */
.row-actions { margin-left: auto; display: none; gap: 2px; flex: none; }
.row-actions button {
  width: 18px; height: 18px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 5px;
  color: var(--text-2);
  cursor: pointer;
}
.row-actions button:hover { background: color-mix(in oklab, var(--text) 10%, transparent); }
.row-actions button:active { transform: scale(0.9); }
.row-actions svg { width: 11px; height: 11px; }
.row:hover .row-port { display: none; }
.row:hover .row-actions { display: flex; }
.row.no-open:hover { background: none; }

/* While an action is in flight the app shows a spinner in a fixed frame, so
   the row neither reflows nor offers the control a second time. */
.row-busy {
  margin-left: auto;
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex: none;
}
.row.is-busy .row-busy { display: flex; }
.row.is-busy .row-port,
.row.is-busy .row-actions,
.row.is-busy .row-ver { display: none; }
.row.is-busy { background: none; }

.busy-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  white-space: nowrap;
}

.spinner {
  width: 11px;
  height: 11px;
  flex: none;
  border-radius: 50%;
  border: 1.6px solid color-mix(in oklab, var(--text) 20%, transparent);
  border-top-color: var(--text-2);
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pop-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 11px;
  color: var(--text-3);
}

/* --- the opening sequence ---------------------------------------------------
   The lid starts shut and lifts on its hinge, carries on past upright and a
   little past its tilt back, and settles forward onto it; then the menu bar item is clicked and the popover grows out
   of it. Until then the copy is held back and the laptop is lifted into its
   place by --intro-lift, so on a short window the whole thing plays in view;
   once the menu is open the laptop settles down to where it belongs and the
   copy comes in above it. The inline script in <head> sets .intro before
   first paint, main.js adds .intro-open once it has aimed the popover at the
   item and measured the lift, and both classes come off when the laptop has
   settled, the last frame matching the resting styles. */

/* The timings DialKit tunes on a local server (dial.js). Everything after
   the lid is timed from the end of its swing, so it keeps step with it. */
:root {
  --lid-delay: 0ms;
  --lid-dur: 1350ms;
  --lid-end: calc(var(--lid-delay) + var(--lid-dur));
  --glare-delay: 150ms;
  --glare-dur: 1750ms;
}

.intro .lid { transform: perspective(2600px) rotateX(-90deg); }
.intro .popover { opacity: 0; transform: scale(0.35); }
.intro .stage {
  transform: translateY(calc(-1 * var(--intro-lift, 0px))) scale(var(--intro-scale, 1));
  transform-origin: 50% 100%;
}
.intro .hero-copy > * { opacity: 0; }

.intro-open .lid {
  animation: lid-open var(--lid-dur) var(--lid-delay) both;
}
.intro-open .menubar-item { animation: item-press 600ms calc(var(--lid-end) - 250ms) ease-out; }
.intro-open .popover {
  transform-origin: var(--pop-origin, top right);
  animation: pop-open 480ms calc(var(--lid-end) - 200ms) cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* The laptop's settle is the last thing to finish: main.js ends the sequence
   on it, so the copy has to be in by the time it ends. */
.intro-open .stage {
  animation: stage-settle 900ms calc(var(--lid-end) + 450ms) cubic-bezier(0.65, 0, 0.35, 1) both;
}
.intro-open .hero-copy > * {
  animation: copy-in 600ms calc(var(--lid-end) + 600ms + var(--i, 0) * 70ms) cubic-bezier(0.16, 1, 0.3, 1) both;
}
/* As the lid swings up through the light, a soft glare crosses the glass,
   top left to bottom right. It starts just after the lid does, from just
   off the top left corner, so it is on the glass from early in the swing,
   and fades out as the laptop settles. It sits
   over the whole screen, as a reflection on the glass would, and exists
   only for the opening. */
.intro-open .mac::after {
  content: "";
  position: absolute;
  /* Twice the screen's size and centred on it, so the band, which runs
     corner to corner along the other diagonal, spans the whole screen
     wherever it is on the way across. */
  inset: -50%;
  z-index: 4;
  background: linear-gradient(to bottom right,
    transparent 42%,
    oklch(1 0 0 / 0.07) 47%,
    oklch(1 0 0 / 0.16) 50%,
    oklch(1 0 0 / 0.07) 53%,
    transparent 58%);
  pointer-events: none;
  animation: screen-glare var(--glare-dur) var(--glare-delay) cubic-bezier(0.25, 0.4, 0.4, 1) both;
}
.hero-copy > :nth-child(2) { --i: 1; }
.hero-copy > :nth-child(3) { --i: 2; }
.hero-copy > :nth-child(4) { --i: 3; }

/* Each leg comes to rest at its end, so the swing slows to a stop at the
   overshoot before easing back. */
@keyframes lid-open {
  from {
    transform: perspective(2600px) rotateX(-90deg);
    animation-timing-function: cubic-bezier(0.5, 0, 0.25, 1);
  }
  70% {
    transform: perspective(2600px) rotateX(14deg);
    animation-timing-function: cubic-bezier(0.45, 0, 0.3, 1);
  }
  to { transform: var(--lid-rest); }
}
@keyframes screen-glare {
  from { transform: translate(-34%, -34%); opacity: 0; }
  8%   { opacity: 1; }
  80%  { opacity: 1; }
  to   { transform: translate(34%, 34%); opacity: 0; }
}
@keyframes item-press {
  from { background: color-mix(in oklab, var(--text) 16%, transparent); }
}
@keyframes pop-open {
  from { opacity: 0; transform: scale(0.35); }
  to   { opacity: 1; transform: none; }
}
@keyframes stage-settle {
  from { transform: translateY(calc(-1 * var(--intro-lift, 0px))) scale(var(--intro-scale, 1)); }
  to   { transform: none; }
}
/* Drifting down with the laptop, so the whole hero settles one way. */
@keyframes copy-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}

/* --- the screensaver ---------------------------------------------------------
   Left alone on the hero, the screen dims into Apple's "hello": the word
   writes itself, holds, fades, and comes back in the next colour. Any input
   wakes it, faster than it came on, and the desktop is as it was. main.js
   keeps the idle clock and sets data-state; the screen is dark whatever the
   page's theme, as a screensaver is. */

@property --hello {
  syntax: '<color>';
  inherits: true;
  initial-value: oklch(0.74 0.14 250);
}

.saver {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(55% 60% at var(--saver-x, 50%) var(--saver-y, 50%), color-mix(in oklab, var(--hello) 16%, transparent), transparent 72%),
    oklch(0.12 0.008 260);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 450ms ease-out, --hello 1400ms ease;
}
.saver[data-state] { visibility: visible; }
.saver[data-state="on"] { opacity: 1; transition: opacity 1200ms ease-in-out, --hello 1400ms ease; }

/* At --saver-x, --saver-y: main.js puts that in the middle of the screen, or
   of the part of it in view, and shrinks it by --saver-scale if that part is
   short. --saver-w is how much of the screen's width is in view; on a phone,
   only the right-hand corner. */
.saver-hello {
  position: absolute;
  left: var(--saver-x, 50%);
  top: var(--saver-y, 50%);
  width: min(46%, var(--saver-w, 100%) * 0.72);
  transform: translate(-50%, -50%) scale(var(--saver-scale, 1));
  overflow: visible;
}
.saver-hello path {
  fill: none;
  stroke: var(--hello);
  stroke-width: 13;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* Past the start, so the round cap of an empty dash leaves no dot. */
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1.01;
}
.saver[data-state] .saver-hello path { animation: hello-write 7s infinite; }

/* Written like a pen: off the mark slowly, quick through the middle, slowing
   into the last stroke. Then it holds, and fades before the next colour. */
@keyframes hello-write {
  from { stroke-dashoffset: 1.01; opacity: 1; animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1); }
  45%  { stroke-dashoffset: 0; opacity: 1; }
  82%  { stroke-dashoffset: 0; opacity: 1; }
  to   { stroke-dashoffset: 0; opacity: 0; }
}



/* --- how it works: the isometric figure ------------------------------------
   The geometry is generated by figures/how-it-works.mjs; these are the kit's
   drawing styles with its tokens mapped onto the site palette. */

.iso-figure {
  --anatomy-card:    var(--surface);
  --anatomy-paper:   var(--surface);
  --anatomy-text:    var(--text-2);
  --anatomy-muted:   var(--text-3);
  --anatomy-face:    oklch(1 0 0);
  --anatomy-top:     oklch(1 0 0);
  --anatomy-shade-0: oklch(0.885 0.006 256);
  --anatomy-shade-1: oklch(0.915 0.005 256);
  --anatomy-shade-2: oklch(0.942 0.004 256);
  --anatomy-shade-3: oklch(0.968 0.003 256);
  --anatomy-lit-top: oklch(1 0 0);
  --anatomy-lit-shade: oklch(0.95 0.012 248);
  --anatomy-hi:      oklch(0.27 0.012 256);
  --anatomy-mid:     oklch(0.62 0.012 256);
  --anatomy-lo:      oklch(0.76 0.009 256);
  --anatomy-faint:   oklch(0.87 0.006 256);
  --anatomy-lit:     var(--accent);
  --anatomy-halo:    oklch(0.55 0.02 256);
  --anatomy-halo-opacity: 0.3;
  --anatomy-dot:     oklch(0.3 0.012 256);
  --anatomy-weight:  0.6px;

  --hw-glass: oklch(0.93 0.025 245);
  --hw-bar:   oklch(0.965 0.012 245);
  --hw-pop:   oklch(0.995 0.002 256);
  --hw-term:  oklch(0.985 0.003 256);
  --hw-well:  oklch(0.83 0.008 256);
  --hw-tray:  oklch(0.95 0.004 256);
  --hw-shadow: oklch(0.4 0.03 250 / 0.14);

  margin: 0;
}

[data-theme="dark"] .iso-figure {
  --anatomy-face:    oklch(0.255 0.014 258);
  --anatomy-top:     oklch(0.255 0.014 258);
  --anatomy-shade-0: oklch(0.19 0.012 258);
  --anatomy-shade-1: oklch(0.205 0.012 258);
  --anatomy-shade-2: oklch(0.222 0.013 258);
  --anatomy-shade-3: oklch(0.238 0.013 258);
  --anatomy-lit-top: oklch(0.31 0.03 250);
  --anatomy-lit-shade: oklch(0.27 0.025 250);
  --anatomy-hi:      oklch(0.88 0.008 256);
  --anatomy-mid:     oklch(0.54 0.013 256);
  --anatomy-lo:      oklch(0.38 0.013 258);
  --anatomy-faint:   oklch(0.295 0.013 258);
  --anatomy-halo:    oklch(0.08 0.01 258);
  --anatomy-halo-opacity: 0.85;
  --anatomy-dot:     oklch(0.9 0.008 256);

  --hw-glass: oklch(0.26 0.035 255);
  --hw-bar:   oklch(0.3 0.03 255);
  --hw-pop:   oklch(0.27 0.014 258);
  --hw-term:  oklch(0.17 0.01 258);
  --hw-well:  oklch(0.14 0.01 258);
  --hw-tray:  oklch(0.21 0.012 258);
  --hw-shadow: oklch(0.05 0.01 258 / 0.5);
}

.iso-svg { display: block; width: 100%; height: auto; overflow: visible; }
.iso-svg path, .iso-svg circle { vector-effect: non-scaling-stroke; }
.iso-fill { fill: var(--anatomy-paper); stroke: none; }
.iso-solid[data-lit] > .iso-fill { fill: var(--anatomy-face); }
.iso-shade, .iso-top { stroke: none; }
.iso-shade[data-shade="0"] { fill: var(--anatomy-shade-0); }
.iso-shade[data-shade="1"] { fill: var(--anatomy-shade-1); }
.iso-shade[data-shade="2"] { fill: var(--anatomy-shade-2); }
.iso-shade[data-shade="3"] { fill: var(--anatomy-shade-3); }
.iso-top { fill: var(--anatomy-top); }
.iso-solid[data-lit] > .iso-top { fill: var(--anatomy-lit-top); }
.iso-solid[data-lit] > .iso-shade { fill: var(--anatomy-lit-shade); }
.iso-solid[data-lit] > .iso-edge { stroke: var(--anatomy-lit); }
.iso-halo { fill: var(--anatomy-halo); stroke: none; filter: blur(9px); opacity: var(--anatomy-halo-opacity); transform: translateY(3px); }
.iso-line { fill: none; stroke: var(--anatomy-lo); stroke-width: var(--anatomy-weight); stroke-linecap: round; stroke-linejoin: round; }
.iso-line[data-tone="hi"] { stroke: var(--anatomy-hi); }
.iso-line[data-tone="mid"] { stroke: var(--anatomy-mid); }
.iso-line[data-tone="faint"] { stroke: var(--anatomy-faint); }
.iso-line[data-tone="lit"] { stroke: var(--anatomy-lit); }
.iso-dots circle { fill: var(--anatomy-dot); stroke: none; opacity: 0.32; }
.iso-dots[data-tone="hi"] circle { opacity: 0.85; }
.iso-dots[data-tone="mid"] circle { opacity: 0.45; }
.iso-dots[data-tone="lo"] circle { opacity: 0.22; }
.iso-face-text { fill: var(--anatomy-mid); font-family: var(--mono); letter-spacing: 0.04em; }
.iso-face-text[data-tone="lo"] { fill: var(--anatomy-lo); }
.tb-body { fill: var(--anatomy-shade-2); stroke: none; }
.tb-shine { fill: var(--anatomy-top); stroke: none; }
.tb-shade { fill: var(--anatomy-shade-0); stroke: none; }

/* The card, in the site's own card style. */
.iso-plate {
  position: relative;
  padding: 2rem 1.5rem;
  background: var(--anatomy-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.iso-plate .iso-svg { max-width: 920px; margin: 0 auto; }

/* On a phone the drawing gets the card's side air. */
@media (max-width: 560px) {
  .iso-plate { padding: 1.5rem 0; overflow: hidden; }
  .iso-plate .iso-svg { width: 118%; margin-left: -9%; }
}

.how-stage { border-radius: var(--radius-sm); }
.how-stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }

/* What's on the display. */
.hw-glass  { fill: var(--hw-glass); }
.hw-bar    { fill: var(--hw-bar); }
.hw-pop    { fill: var(--hw-pop); }
.hw-term   { fill: var(--hw-term); }
.hw-well   { fill: var(--hw-well); }
.hw-tray   { fill: var(--hw-tray); }
.hw-shadow { fill: var(--hw-shadow); filter: blur(1.5px); }
.hw-ink circle  { fill: var(--anatomy-mid); }
.hw-mark circle { fill: var(--accent); }
.hw-caret  { fill: var(--anatomy-mid); }
.hw-glyph circle { fill: none; stroke: var(--anatomy-hi); stroke-width: 0.6px; vector-effect: non-scaling-stroke; }
.hw-glyph .hw-glyph-dot { fill: var(--anatomy-hi); stroke: none; }
.hw-ok circle { fill: var(--ok); }
.hw-row-hi { fill: var(--accent); opacity: 0; }
.hw-row[data-fresh] .hw-row-hi { animation: hw-fresh 900ms cubic-bezier(.2, .7, .3, 1) both; }
@keyframes hw-fresh { from { opacity: 0.32; } to { opacity: 0; } }

/* The NAS's lights. Disk lights flicker while ballast-agent reads Docker. */
.hw-led circle { fill: var(--ok); }
.hw-disk circle { opacity: 0.55; transition: opacity 90ms linear; }
.hw-disk[data-on] circle { opacity: 1; }

/* The pulse that runs down the cable. */
.hw-track { fill: none; stroke: none; }
.hw-pulse circle { fill: var(--accent); }
.hw-pulse circle.hw-halo { fill: var(--accent); opacity: 0.22; }

.wire {
  margin-top: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
}
.wire pre {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.75;
  color: var(--text-2);
  white-space: pre;
}
.wire .hl { color: var(--accent); font-weight: 600; }

/* --- signals -------------------------------------------------------------- */

.signals {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.signal {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.375rem 1.5rem;
}
.signal > * + * { margin-top: 0.5rem; }
.signal p { font-size: 0.9375rem; color: var(--text-2); }
.signal h3 { display: flex; align-items: center; gap: 0.5rem; }
.signal h3 svg { width: 15px; height: 15px; flex: none; }

.callout {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.875rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--accent-edge);
  background: var(--accent-soft);
  border-radius: var(--radius);
}
.callout svg { width: 18px; height: 18px; flex: none; color: var(--accent); margin-top: 2px; }
.callout p { font-size: 0.9375rem; color: var(--text-2); }
.callout strong { color: var(--text); font-weight: 600; }

/* --- feature tour --------------------------------------------------------- */

.tour {
  display: grid;
  grid-template-columns: 20rem minmax(0, 1fr);
  gap: clamp(2rem, 1rem + 3vw, 4rem);
}

.tour-list { display: flex; flex-direction: column; }

.tour-tab {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.875rem 0 0.875rem 1.375rem;
  cursor: pointer;
}
.tour-tab:focus-visible { outline-offset: -2px; }

/* A hairline track down the left edge; the selected tab's bar fills it, and
   while the tour plays the fill doubles as the countdown to the next one. */
.tour-tab::before,
.tour-bar {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  border-radius: 2px;
}
.tour-tab::before { background: var(--hairline); }
.tour-bar {
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 200ms ease-out;
}
.tour-tab[aria-selected="true"] .tour-bar { transform: scaleY(1); }
.tour.is-auto .tour-tab[aria-selected="true"] .tour-bar {
  animation: tour-fill var(--tour-ms, 6000ms) linear both;
}
.tour.is-paused .tour-bar { animation-play-state: paused; }
@keyframes tour-fill { from { transform: scaleY(0); } }

.tour-title {
  display: block;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.011em;
  color: var(--text-2);
  transition: color 160ms ease-out;
}
.tour-tab[aria-selected="true"] .tour-title { color: var(--text); }
/* Touch browsers leave :hover stuck on the last row tapped, which would read
   as a second selected row — so only brighten on real pointers. */
@media (hover: hover) {
  .tour-tab:hover .tour-title { color: var(--text); }
}

/* Only the selected tab shows its sentence; the rest stay a list of titles. */
.tour-desc {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows 320ms cubic-bezier(0.2, 0, 0, 1),
              opacity 160ms ease-out, visibility 0s 320ms;
}
.tour-desc > span { overflow: hidden; }
.tour-desc > span > span {
  display: block;
  padding-top: 0.375rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-2);
  text-wrap: pretty;
}
.tour-short { display: none; }
.tour-tab[aria-selected="true"] .tour-desc {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition: grid-template-rows 320ms cubic-bezier(0.2, 0, 0, 1),
              opacity 240ms ease-out 80ms, visibility 0s;
}

.tour-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 27rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Panels share one grid cell, so switching never changes the stage's size. */
.tour-panel {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 2rem 1.25rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.98);
  transition: opacity 200ms ease-out, transform 200ms ease-out, visibility 0s 200ms;
}
.tour-panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 320ms ease-out 60ms,
              transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1) 60ms, visibility 0s;
}

/* Faithful fragments of the real UI, drawn at app size and zoomed up. */
.shot {
  width: 340px;
  max-width: 100%;
  zoom: var(--shot-zoom, 1);
  padding: 4px;
  background: var(--surface-raised);
  border: 1px solid color-mix(in oklab, var(--hairline) 85%, transparent);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  font-size: 13px;
  line-height: 1.3;
}

.shot-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: -0.004em;
  white-space: nowrap;
  overflow: hidden;
}
/* The row highlight in the app is a neutral 8% tint, not the accent. */
.shot-row.is-hover { background: color-mix(in oklab, var(--text) 8%, transparent); }

.shot-meta {
  margin-left: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
}
.shot-ver { font-family: var(--mono); font-size: 10px; color: var(--text-3); }

.shot-actions { margin-left: auto; display: flex; gap: 2px; color: var(--text-2); }
.shot-actions span { width: 18px; height: 18px; display: grid; place-items: center; }
.shot-actions svg { width: 11px; height: 11px; }

.shot-search {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  margin-bottom: 4px;
  padding-inline: 8px;
  border-radius: 6px;
  background: color-mix(in oklab, var(--text) 6%, transparent);
  color: var(--text-3);
}
.shot-search svg { width: 12px; height: 12px; }
.shot-search b { font-weight: 400; color: var(--text); }

.shot-foot {
  margin: 4px -4px -4px;
  padding: 7px 12px;
  border-top: 1px solid var(--hairline);
  font-size: 11px;
  color: var(--text-3);
}

.shot.notif {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 14px;
}
.notif .ico {
  width: 28px; height: 28px; flex: none;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid; place-items: center;
}
.notif .ico svg { width: 15px; height: 15px; }
.notif-text { flex: 1; min-width: 0; }
.notif-head { display: flex; align-items: baseline; gap: 8px; }
.notif-title { font-size: 12.5px; font-weight: 600; }
.notif-body { display: block; font-size: 11.5px; color: var(--text-2); text-wrap: pretty; }
.notif-when { margin-left: auto; font-size: 10.5px; color: var(--text-3); flex: none; }

/* --- cards --------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.card .card-art { margin-bottom: 0.5rem; }
.card p { font-size: 0.9375rem; color: var(--text-2); }

/* Small faithful fragments of the real UI used as card art. */
.chiplist { display: flex; flex-direction: column; gap: 3px; }
.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg-sunken);
  border: 1px solid var(--hairline-soft);
  font-size: 12px;
}
.chip .row-glyph svg { width: 10px; height: 10px; }
.chip .row-update svg { width: 10px; height: 10px; }

/* A help tooltip, hanging under the row it describes, flush with its left edge. */
.tipmock {
  margin: 2px 0 6px;
  padding: 5px 8px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  box-shadow: var(--shadow-card);
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-2);
}

/* The update demo plays once on scroll: the row lights up as if hovered, the
   badge resolves out of a blur, then the tooltip opens and its lines follow.
   main.js only sets data-anim when motion is allowed, so without it (no JS,
   reduced motion) this is simply the finished picture. */
/* Shown at reading size, like the hero popover, rather than at card-art size. */
.update-demo { zoom: var(--demo-zoom, 1.45); }
.tipmock { display: block; }
.tipmock > span { display: block; }
.tip-reveal { display: grid; grid-template-rows: 1fr; }
.tip-reveal > div { min-height: 0; overflow: hidden; }

.update-demo[data-anim="pending"] .chip.is-hover {
  background: var(--bg-sunken);
  border-color: var(--hairline-soft);
}
.update-demo[data-anim="pending"] .row-update {
  opacity: 0;
  transform: scale(0.4);
  filter: blur(4px);
}
.update-demo[data-anim="pending"] .tip-reveal { grid-template-rows: 0fr; }
.update-demo[data-anim="pending"] .tipmock { opacity: 0; }
.update-demo[data-anim="pending"] .tipmock > span {
  opacity: 0;
  transform: translateY(-4px);
  filter: blur(4px);
}

.update-demo[data-anim="played"] .chip.is-hover {
  transition: background-color 220ms ease-out, border-color 220ms ease-out;
}
.update-demo[data-anim="played"] .row-update {
  transition: transform 520ms cubic-bezier(0.34, 1.56, 0.64, 1) 300ms,
              opacity 200ms ease-out 300ms,
              filter 360ms ease-out 300ms;
}
.update-demo[data-anim="played"] .tip-reveal {
  transition: grid-template-rows 360ms cubic-bezier(0.22, 1, 0.36, 1) 820ms;
}
.update-demo[data-anim="played"] .tipmock {
  transition: opacity 200ms ease-out 820ms;
}
.update-demo[data-anim="played"] .tipmock > span {
  transition: opacity 380ms ease-out, transform 380ms ease-out, filter 380ms ease-out;
  transition-delay: 920ms;
}
.update-demo[data-anim="played"] .tipmock > span + span { transition-delay: 1010ms; }
.chip .meta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
}
/* The row highlight in the app is a neutral 8% tint, not the accent. */
.chip.is-hover {
  background: color-mix(in oklab, var(--text) 8%, var(--surface));
  border-color: transparent;
}

/* --- label table ---------------------------------------------------------- */

.labels { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.labels th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 0.75rem 0.625rem 0;
  border-bottom: 1px solid var(--hairline);
}
.labels td {
  padding: 0.5625rem 0.75rem 0.5625rem 0;
  border-bottom: 1px solid var(--hairline-soft);
  color: var(--text-2);
  vertical-align: baseline;
}
.labels td:first-child { white-space: nowrap; }
.labels code {
  font-size: 0.8125rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.125rem 0.375rem;
  border-radius: 5px;
}
.labels tr:last-child td { border-bottom: 0; }

/* --- privacy list --------------------------------------------------------- */

.checks { list-style: none; padding: 0; display: grid; gap: 1.125rem; }
.checks li { display: flex; gap: 0.75rem; align-items: flex-start; }
.checks svg { width: 19px; height: 19px; flex: none; color: var(--accent); margin-top: 2px; }
.checks p { font-size: 0.9375rem; color: var(--text-2); }
.checks strong { color: var(--text); font-weight: 600; display: block; }

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: start;
}

/* --- requirements --------------------------------------------------------- */

.reqs {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.reqs li {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.25rem 1.375rem;
}
.reqs strong { display: block; font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.25rem; }
.reqs span { font-size: 0.875rem; color: var(--text-2); }

/* --- closing + footer ----------------------------------------------------- */

.closing { text-align: center; }
.closing > * + * { margin-top: 1.25rem; }
.closing svg.mark { width: 56px; height: 56px; margin-inline: auto; border-radius: 13px; }

footer {
  border-top: 1px solid var(--hairline);
  padding-block: 2.5rem;
  font-size: 0.875rem;
  color: var(--text-3);
}
.foot-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
footer a { color: var(--text-2); text-decoration: none; }
footer a:hover { color: var(--text); }

/* --- section formats -------------------------------------------------------
   Each section gets its own shape, so the scroll has a rhythm rather than
   the same heading-left, box-right band over and over: a centred figure on
   the page itself, a sunken tour, an unframed split, a dark full-bleed
   statement, a compact spec list, and the close. */

/* How it works: centred, the check drawn with the same UI fragments as the
   tour, on the page with no card. */
.sec-how { padding-block: clamp(8rem, 2rem + 18vw, 19rem); }
.sec-how .section-head { margin-bottom: clamp(4rem, 2rem + 5vw, 7rem); }

/* --- how it works: one check, on a loop ------------------------------------
   The NAS, the SSH line and the menu, at app size and zoomed up like .shot.
   The check starts at the menu, on the right; the line is drawn mirrored
   so its keyframes can run start to end.
   Every animation shares one period and keys its steps to it:
     0–2%    the check starts; the footer says so
     2–14%   a pulse runs down the line to the NAS
     14–26%  ballast-agent runs, the disk lights flicker
     26–38%  the reply runs back
     38%+    the rows refresh, one after another
   The countdown under the line runs the whole period, 30 down to 0. */

.ping {
  --period: 5s;
  display: grid;
  grid-template-columns: 250px minmax(120px, 1fr) 300px;
  align-items: center;
  max-width: 820px;
  margin: 0 auto;
  zoom: var(--ping-zoom, 1);
}
.ping .shot { width: auto; zoom: 1; }

.ping-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -4px -4px 4px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--hairline);
}
.ping-head .pop-summary { align-self: baseline; }
.ping-nas-ico { width: 13px; height: 13px; color: var(--text-2); }
.ping-foot { display: flex; align-items: center; gap: 5px; }
.ping-foot svg { width: 11px; height: 11px; flex: none; }

/* Two states stacked in one cell; the idle one shows unless the loop says
   otherwise, so without motion this is the picture between checks. */
.ping-swap { display: inline-grid; }
.ping-swap > * { grid-area: 1 / 1; }
.ping-busy { opacity: 0; }
.shot-meta.ping-swap { justify-items: end; }

.ping-leds { margin-left: auto; display: flex; gap: 3px; }
.ping-leds i { width: 4px; height: 4px; border-radius: 50%; background: var(--ok); opacity: 0.5; }

/* The SSH line. */
.ping-wire {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding-inline: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  text-align: center;
}
.ping-label { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.ping-label svg { width: 12px; height: 12px; }
.ping-line {
  position: relative;
  height: 2px;
  border-radius: 1px;
  background: var(--hairline);
  transform: scaleX(-1);
}
.ping-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--accent);
  box-shadow: 0 0 8px color-mix(in oklab, var(--accent) 70%, transparent);
  transform: scaleX(0);
  transform-origin: left;
}
.ping-glow-back { transform-origin: right; }
/* Each dot rides a box the size of the line, so translating the box by its
   own width carries the dot from one end to the other. */
.ping-dot { position: absolute; inset: 0; opacity: 0; }
.ping-dot::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 22%, transparent),
              0 0 14px var(--accent);
}
.ping-next { font-variant-numeric: tabular-nums; }
.ping-count { display: none; }
.ping-secs { font-weight: 400; }

/* main.js sets data-anim only when motion is allowed, and pauses it off
   screen. */
.ping[data-anim] .ping-every { display: none; }
.ping[data-anim] .ping-count { display: inline; }
.ping[data-anim="paused"] * { animation-play-state: paused !important; }

.ping[data-anim] .ping-dot-out  { animation: ping-out  var(--period) infinite; }
.ping[data-anim] .ping-dot-back { animation: ping-back var(--period) infinite; }
.ping[data-anim] .ping-glow-out  { animation: ping-glow-out  var(--period) infinite; }
.ping[data-anim] .ping-glow-back { animation: ping-glow-back var(--period) infinite; }
.ping[data-anim] .ping-leds i { animation: ping-led var(--period) calc(var(--i) * 45ms) infinite; }
.ping[data-anim] .ping-agent .ping-busy { animation: ping-agent-on  var(--period) infinite; }
.ping[data-anim] .ping-agent .ping-idle { animation: ping-agent-off var(--period) infinite; }
.ping[data-anim] .ping-foot .ping-busy  { animation: ping-check-on  var(--period) infinite; }
.ping[data-anim] .ping-foot .ping-idle  { animation: ping-check-off var(--period) infinite; }
.ping[data-anim] .ping-foot svg { animation: ping-spin var(--period) infinite; }
.ping[data-anim] .ping-row { animation: ping-flash var(--period) calc(var(--i) * 70ms) infinite; }
.ping[data-anim] .ping-row > * { animation: ping-fresh var(--period) calc(var(--i) * 70ms) infinite; }
.ping[data-anim] .ping-secs {
  counter-reset: secs var(--secs);
  animation: ping-count var(--period) linear infinite;
}
.ping[data-anim] .ping-secs::before { content: counter(secs); }

@property --secs { syntax: "<integer>"; inherits: false; initial-value: 30; }
@keyframes ping-count { from { --secs: 30; } to { --secs: 0; } }

@keyframes ping-out {
  0%       { transform: translateX(0); opacity: 0; }
  2%       { transform: translateX(0); opacity: 1; animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1); }
  14%      { transform: translateX(100%); opacity: 1; }
  17%, to  { transform: translateX(100%); opacity: 0; }
}
@keyframes ping-back {
  0%, 25%  { transform: translateX(100%); opacity: 0; }
  26%      { transform: translateX(100%); opacity: 1; animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1); }
  38%      { transform: translateX(0); opacity: 1; }
  41%, to  { transform: translateX(0); opacity: 0; }
}
@keyframes ping-glow-out {
  0%, 2%   { transform: scaleX(0); opacity: 1; animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1); }
  14%      { transform: scaleX(1); opacity: 1; }
  26%, to  { transform: scaleX(1); opacity: 0; }
}
@keyframes ping-glow-back {
  0%, 26%  { transform: scaleX(0); opacity: 1; animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1); }
  38%      { transform: scaleX(1); opacity: 1; }
  52%, to  { transform: scaleX(1); opacity: 0; }
}
@keyframes ping-led {
  0%, 14%  { opacity: 0.5; }
  15%      { opacity: 1; }
  16.5%    { opacity: 0.35; }
  18%      { opacity: 1; }
  19.5%    { opacity: 0.45; }
  21%      { opacity: 1; }
  22.5%    { opacity: 0.35; }
  24%      { opacity: 1; }
  26%, to  { opacity: 0.5; }
}
/* The swaps hand over rather than crossfade, so two labels never show at
   once: each one leaves before the other arrives. */
@keyframes ping-agent-on {
  0%, 14%    { opacity: 0; }
  15.5%, 28% { opacity: 1; }
  29.5%, to  { opacity: 0; }
}
@keyframes ping-agent-off {
  0%, 12.5%  { opacity: 1; }
  14%, 29.5% { opacity: 0; }
  31%, to    { opacity: 1; }
}
@keyframes ping-check-on {
  0%, 1%     { opacity: 0; }
  2.5%, 40%  { opacity: 1; }
  41.5%, to  { opacity: 0; }
}
@keyframes ping-check-off {
  0%         { opacity: 1; }
  1%, 41.5%  { opacity: 0; }
  43%, to    { opacity: 1; }
}
@keyframes ping-spin {
  0%       { transform: rotate(0); animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1); }
  40%, to  { transform: rotate(360deg); }
}
/* Each row is replaced as its reply lands: it drops out, resolves back in
   from a blur, and its highlight fades after it. */
@keyframes ping-fresh {
  0%, 37.9% { opacity: 1; filter: blur(0); transform: none; }
  38%       { opacity: 0.15; filter: blur(3px); transform: translateY(3px); animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1); }
  47%, to   { opacity: 1; filter: blur(0); transform: none; }
}
@keyframes ping-flash {
  0%, 37.9% { background-color: transparent; }
  38%       { background-color: color-mix(in oklab, var(--accent) 22%, transparent); animation-timing-function: ease-out; }
  60%, to   { background-color: transparent; }
}

/* Stacked on a phone: the NAS, the line, then the menu, which the check
   starts from, so the line runs bottom to top. */
@media (max-width: 760px) {
  .ping { grid-template-columns: minmax(0, 300px); justify-content: center; }
  .ping-wire {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 14px;
    padding: 6px 0;
  }
  .ping-label, .ping-next { flex: 1 1 0; }
  .ping-label { justify-content: flex-end; }
  .ping-next { text-align: left; }
  .ping-line { width: 2px; height: 64px; flex: none; transform: scaleY(-1); }
  .ping-glow { transform: scaleY(0); transform-origin: top; }
  .ping-glow-back { transform-origin: bottom; }
  .ping-dot::before { left: 50%; top: -4px; margin: 0 0 0 -4px; }
  .ping[data-anim] .ping-dot-out  { animation-name: ping-out-v; }
  .ping[data-anim] .ping-dot-back { animation-name: ping-back-v; }
  .ping[data-anim] .ping-glow-out  { animation-name: ping-glow-out-v; }
  .ping[data-anim] .ping-glow-back { animation-name: ping-glow-back-v; }
}
@keyframes ping-out-v {
  0%       { transform: translateY(0); opacity: 0; }
  2%       { transform: translateY(0); opacity: 1; animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1); }
  14%      { transform: translateY(100%); opacity: 1; }
  17%, to  { transform: translateY(100%); opacity: 0; }
}
@keyframes ping-back-v {
  0%, 25%  { transform: translateY(100%); opacity: 0; }
  26%      { transform: translateY(100%); opacity: 1; animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1); }
  38%      { transform: translateY(0); opacity: 1; }
  41%, to  { transform: translateY(0); opacity: 0; }
}
@keyframes ping-glow-out-v {
  0%, 2%   { transform: scaleY(0); opacity: 1; animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1); }
  14%      { transform: scaleY(1); opacity: 1; }
  26%, to  { transform: scaleY(1); opacity: 0; }
}
@keyframes ping-glow-back-v {
  0%, 26%  { transform: scaleY(0); opacity: 1; animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1); }
  38%      { transform: scaleY(1); opacity: 1; }
  52%, to  { transform: scaleY(1); opacity: 0; }
}

@media (min-width: 761px)  { .ping { --ping-zoom: 1.15; } }
@media (min-width: 1040px) { .ping { --ping-zoom: 1.35; } }

/* Image updates: the roomiest section, text on the left edge, in line with the headings above,
   and the demo unframed on the right. */
.sec-updates { padding-block: clamp(6rem, 2rem + 14vw, 15rem); }
.updates-split { align-items: center; }
.updates-split > .section-head { margin-bottom: 0; }
.update-stage {
  position: relative;
  --demo-zoom: 1.75;
  /* Block padding only, so the rows sit on the page's left edge. */
  padding-block: clamp(1.5rem, 1rem + 2vw, 3rem);
}

/* Privacy: one dark full-bleed band with a statement-sized line, the
   drawing big and centred under it. */
.spotlight {
  background: oklch(0.13 0.01 258);
  color: var(--text);
  padding-block: clamp(7rem, 2rem + 16vw, 17rem);
  --anatomy-paper: oklch(0.13 0.01 258);
}
/* .iso too, to outrank figure.css's margin: 0, which loads after this. */
.spotlight .fig-privacy.iso { --anatomy-paper: oklch(0.13 0.01 258); max-width: 760px; margin-inline: auto; }
.spotlight .section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 1rem + 4vw, 4.5rem); }
.statement {
  font-size: clamp(2.75rem, 1rem + 6.5vw, 6rem);
  line-height: 1;
  letter-spacing: -0.035em;
  font-weight: 700;
}
.spotlight .lede { max-width: 36rem; margin-inline: auto; }

/* Requirements: three drawings given the full width, each standing on its
   own with its line centred under it. No cards, so the drawings carry it. */
.sec-reqs { padding-block: clamp(5.5rem, 2rem + 11vw, 12rem); }
.sec-reqs .section-head { margin-bottom: clamp(3rem, 1.5rem + 4vw, 5rem); }
.sec-reqs .reqs { gap: clamp(2rem, 1rem + 3vw, 4rem); }
.sec-reqs .reqs li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0;
  background: none;
  border: 0;
}
#requirements .fig-req.iso { width: min(100%, 17rem); margin: 0 0 1.75rem; --anatomy-paper: var(--bg); }
.sec-reqs .reqs strong { font-size: 1.1875rem; letter-spacing: -0.012em; margin-bottom: 0.375rem; }
.sec-reqs .reqs span { font-size: 0.9375rem; max-width: 17rem; }

/* Large displays: the drawings outgrow the text column. Each breaks out of
   .wrap and is centred on the viewport, scaling with the window. */
@media (min-width: 1200px) {
  .spotlight .fig-privacy.iso {
    position: relative;
    left: 50%;
    translate: -50% 0;
  }
  .spotlight .fig-privacy.iso { width: min(100vw - 6rem, 82rem); max-width: none; }
  #requirements .fig-req.iso { width: min(100%, 22rem); }
  .sec-reqs .wrap { width: min(100% - 4rem, 1320px); }
}

/* Phones: the drawing only fills the middle ~64% of its viewBox, so it
   breaks out of .wrap and is scaled until the NAS and Mac nearly reach the edges. */
@media (max-width: 760px) {
  .spotlight { overflow-x: clip; }
  .spotlight .fig-privacy.iso {
    position: relative;
    left: 50%;
    translate: -50% 0;
    width: 150vw;
    max-width: none;
  }
}

/* Admin access: one centred paragraph and the way to check it. */
.sec-source .section-head { margin-bottom: 0; }
.source-actions { padding-top: 0.875rem; }

/* The close: a glow rising from the bottom edge, in place of a band. */
.sec-closing {
  padding-block: clamp(6rem, 2rem + 12vw, 13rem);
  border-top: 1px solid var(--hairline-soft);
  background: radial-gradient(70% 90% at 50% 120%, color-mix(in oklab, var(--accent) 18%, transparent), transparent 70%);
}
.sec-closing h2 { font-size: clamp(2.25rem, 1.2rem + 3.6vw, 3.75rem); letter-spacing: -0.03em; }

/* --- responsive ----------------------------------------------------------- */

@media (min-width: 560px) {
  .shot { --shot-zoom: 1.3; }
}

@media (min-width: 1040px) {
  .shot { --shot-zoom: 1.55; }
}

@media (max-width: 860px) {
  .signals, .reqs, .two-col, .tour { grid-template-columns: minmax(0, 1fr); }
  /* Stacked, the visual leads and pins under the nav, so a tap anywhere in
     the list below updates what's in view. A ring of page colour keeps the
     scrolling list from showing in the gaps around it. */
  .tour { gap: 1.25rem; }
  .tour-stage {
    order: -1;
    position: sticky;
    top: calc(3.5rem + 1px + 0.75rem);
    z-index: 1;
    align-self: start;
    min-height: 14rem;
    box-shadow: 0 0 0 0.75rem var(--bg);
  }
  .tour-panel { padding: 1.25rem; }
  /* One short line per tab, so the list barely moves as the selection does. */
  .tour-tab { padding-block: 0.625rem; }
  .tour-long { display: none; }
  .tour-short { display: inline; }
}

/* Too narrow for the whole laptop: a close-up of its right-hand corner, where
   the menu bar item and the menu are, with the rest running off the left
   edge. The vanishing point moves over the part in view, so that is the
   part the eye faces. */
@media (max-width: 760px) {
  .lid { align-self: flex-end; transform-origin: 75% 100%; }
}

@media (max-width: 680px) {
  .lid { border-radius: 14px 14px 0 0; }
  .mac { border-radius: 6px 6px 0 0; }
  .lid::after { border-radius: 7px 7px 0 0; }
  .update-demo { zoom: 1.15; }
  /* Room for the laptop above the fold. */
  .hero { padding-top: 2rem; }
  .hero { --stage-gap: 1.75rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .hero-actions .btn-text { justify-content: center; }
}

/* On touch, the hover-to-reveal controls would be unreachable — show ports. */
@media (hover: none) {
  .row:hover .row-port { display: block; }
  .row:hover .row-actions { display: none; }
  .row:hover .row-ver { display: none; }
  .row:hover { background: none; }
}

/* --- accessibility preferences -------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .btn:active { transform: none; }
  .row-actions button:active { transform: none; }
  .theme-toggle:active, .nav-github:active { transform: none; }
  .tour-bar { display: none; }
  .tour-tab[aria-selected="true"]::before { background: var(--accent); }
  .tour-panel { transform: none; }
  .spinner { border-top-color: color-mix(in oklab, var(--text) 20%, transparent); opacity: 0.7; }
  .saver { display: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .nav { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .menubar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root, :root[data-theme="dark"] { --hairline: var(--text-3); --hairline-soft: var(--text-3); --text-2: var(--text); }
  .nav { background: var(--bg); backdrop-filter: none; }
}
