/* StrictTools — shared components. Every class is prefixed st-. Requires
   tokens.css and base.css. A variation styles ON TOP of these (its own
   style.css) and re-colours them through its tokens.css; it never redefines
   the geometry declared here.

   Contents: layout, the notch, buttons, badges and labels, section frames,
   cards, the hero pieces, the brand line, ordered dithering, reveals, the
   newsletter funnel, the arrow layer, sticky headers, the bar, the footer. */

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

.st-container {
  width: min(100% - 2 * var(--gutter), var(--content-max));
  margin-inline: auto;
}
.st-section { padding-block: var(--section-gap); position: relative; }
.st-section + .st-section { padding-top: 0; }
.st-grid {
  display: grid;
  gap: var(--space-24);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.st-stack > * + * { margin-top: var(--space-16); }
.st-row { display: flex; flex-wrap: wrap; gap: var(--space-12); align-items: center; }

/* ---------- the notch ---------- */

/* A notched box is painted by two clipped pseudo-elements: ::before is the
   outline (the full polygon in the line colour) and ::after is the fill (the
   same polygon, inset by the line width). The element's own box stays
   unclipped and transparent, so its drop-shadow filter follows the notched
   silhouette instead of the rectangle, which is how the solid offset shadow
   keeps the cut corner. Content sits above both through z-index.

   --notch is the rise of the cut; the run is derived from the brand angle.
   Override --notch, --line, --fill on the element to vary one instance.

   THE CORNER RULE. A notch is cut on the bottom-right corner, on the top-left
   corner, or on both. The top-right and the bottom-left corners are never
   cut, and no element is ever cut on four corners. The kit page states and
   demonstrates the rule; scripts/verify.mjs asserts it in the browser against
   the resolved clip-path of every element on every page. */
.st-notch {
  position: relative;
  isolation: isolate;
  --_run: calc(var(--notch) * var(--notch-run-ratio));
  --_poly: polygon(
    0 0,
    100% 0,
    100% calc(100% - var(--notch)),
    calc(100% - var(--_run)) 100%,
    0 100%
  );
  --fill: var(--surface); /* must be opaque: the outline layer sits underneath */
}
.st-notch::before,
.st-notch::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: var(--_poly);
  transition: background var(--dur-base) ease;
}
.st-notch::before { background: var(--line); }
.st-notch::after {
  inset: var(--line-w);
  background: var(--fill-image, none) 0 0 / var(--dither-cell) var(--dither-cell) repeat, var(--fill);
}
.st-notch.st-line-2 { --line-w: 2px; }
.st-notch.st-line-3 { --line-w: 3px; }
/* The two other legal shapes: the top-left corner alone, and both legal
   corners together. There is no class for the top-right or the bottom-left
   corner, because neither may ever be cut. */
.st-notch.st-notch-tl {
  --_poly: polygon(
    var(--_run) 0,
    100% 0,
    100% 100%,
    0 100%,
    0 var(--notch)
  );
}
.st-notch.st-notch-tl-br {
  --_poly: polygon(
    var(--_run) 0,
    100% 0,
    100% calc(100% - var(--notch)),
    calc(100% - var(--_run)) 100%,
    0 100%,
    0 var(--notch)
  );
}
.st-notch.st-notch-sm { --notch: var(--notch-sm); }
.st-notch.st-notch-lg { --notch: var(--notch-lg); }

/* The solid offset shadow. Applied through a filter so it follows the notch.
   The shadow is black, never an accent: a coloured offset block reads as glow
   rather than as weight. The page under it is near-black, so what makes the
   shadow visible is the dot grid and the dithering it covers up, and what
   makes the shape read is the hairline outline the notch paints. */
.st-shadow {
  filter: drop-shadow(var(--shadow-x) var(--shadow-y) 0 var(--shadow-color));
  transition: filter var(--dur-base) ease, transform var(--dur-base) ease;
}
.st-shadow:hover,
.st-shadow.is-hover {
  filter: drop-shadow(var(--shadow-hover-x) var(--shadow-hover-y) 0 var(--shadow-color-hover));
  transform: translate(-2px, -2px);
}

/* The brand hatch: 1px hairlines at the brand angle (tinymoon's splitter
   grip). A texture for label strips, frame tabs and dead space. */
.st-hatch {
  background-image: repeating-linear-gradient(112.5deg, var(--line) 0 1px, transparent 1px 5px);
}
.st-hatch-accent {
  background-image: repeating-linear-gradient(112.5deg, var(--accent) 0 1px, transparent 1px 5px);
}

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

.st-btn {
  --notch: var(--notch-sm);
  --line: var(--border-2);
  --fill: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  min-height: 44px;
  padding: var(--space-10) var(--space-20);
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: 0;
  white-space: nowrap;
  transition: color var(--dur-base) ease, transform var(--dur-base) var(--ease-out), filter var(--dur-base) ease;
}
/* A button answers the pointer with its line, a shadow and two pixels of
   movement. Its fill never changes, so the text on it keeps its contrast. */
.st-btn:hover, .st-btn.is-hover {
  --line: var(--accent);
  transform: translate(-2px, -2px);
  filter: drop-shadow(4px 4px 0 var(--shadow-color));
}
.st-btn:active { transform: translate(1px, 1px); filter: none; }
.st-btn:disabled { opacity: 0.45; cursor: default; pointer-events: none; }
.st-btn.st-primary { --fill: var(--accent); --line: var(--accent); color: var(--on-accent); }
.st-btn.st-primary:hover, .st-btn.st-primary.is-hover { --line: var(--accent-hi); }
.st-btn.st-ghost { --fill: var(--bg); --line: var(--border-2); color: var(--text); }
.st-btn.st-ghost:hover { --line: var(--text); }
.st-btn.st-big { min-height: 56px; padding-inline: var(--space-28); font-size: var(--text-lg); --notch: 14px; }
.st-btn svg { width: 16px; height: 16px; flex: none; }
.st-btn .st-arrow-glyph { transition: transform var(--dur-base) var(--ease-out); }

/* ---------- badges, labels, keycaps ---------- */

.st-label {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.st-label::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent);
  flex: none;
  transition: transform var(--dur-base) var(--ease-out), background var(--dur-base) ease;
}
.is-hover .st-label::before, .is-near .st-label::before { transform: rotate(45deg) scale(1.2); }
.st-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-8);
  border: var(--line-w) solid var(--border-2);
  font-family: var(--font-mono);
  font-size: var(--text-3xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: border-color var(--dur-base) ease, color var(--dur-base) ease, background var(--dur-base) ease;
}
.st-badge.st-accent { border-color: var(--accent); color: var(--accent-hi); }
.st-badge.st-solid { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
:is(.st-card, .st-frame):is(:hover, .is-hover) .st-badge { border-color: var(--accent); }
.st-kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 var(--space-6);
  border: var(--line-w) solid var(--border-2);
  border-bottom-width: 3px;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  text-align: center;
  background: var(--surface-2);
}

/* ---------- section frames ---------- */

/* A frame is a hairline-outlined, notched section box with a label sitting on
   its top edge. It reacts to a hovered child (.is-near from hover.js) by
   lighting its line and nudging its label. */
.st-frame {
  --line: var(--border-2);
  --fill: var(--bg);
  padding: clamp(1.25rem, 3vw, 2.5rem);
  margin-top: var(--space-16);
}
.st-frame.is-near, .st-frame:has(.st-card:hover) { --line: var(--accent); }
.st-frame-label {
  position: absolute;
  top: 0;
  left: var(--space-24);
  transform: translateY(-50%);
  padding: var(--space-3) var(--space-10);
  background: var(--bg);
  border: var(--line-w) solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  z-index: 2;
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base) ease, color var(--dur-base) ease, background var(--dur-base) ease;
}
.st-frame.is-near > .st-frame-label,
.st-frame:has(.st-card:hover) > .st-frame-label {
  transform: translate(6px, -50%);
  border-color: var(--accent);
}
.st-frame-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  pointer-events: none;
  transition: transform var(--dur-base) var(--ease-out);
}
.st-frame-corner.tl { top: -3px; left: -3px; border-right: 0; border-bottom: 0; }
.st-frame-corner.br { bottom: -3px; right: -3px; border-left: 0; border-top: 0; }
.st-frame.is-near .st-frame-corner.tl { transform: translate(-3px, -3px); }
.st-frame.is-near .st-frame-corner.br { transform: translate(3px, 3px); }

/* ---------- section headers ---------- */

.st-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-16);
  flex-wrap: wrap;
  margin-bottom: var(--space-28);
}
.st-section-head h2 { font-size: var(--display-2); line-height: var(--leading-display); text-transform: uppercase; }
.st-sticky-head {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  padding: var(--space-10) 0;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(2px);
  border-bottom: var(--line-w) solid var(--border-2);
}

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

/* The tool card: a notched, outlined, offset-shadowed block. Hover lifts it
   and lights its neighbours (hover.js adds .is-near to siblings and to the
   frame). The card is a link target: the title link's ::after covers the
   card so the whole surface is one big pointer target while the docs and
   GitHub links stay separate, real links. */
.st-card {
  --fill: var(--surface);
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  padding: var(--space-24);
  min-height: 100%;
  color: var(--text);
  transition: transform var(--dur-base) var(--ease-out), filter var(--dur-base) ease;
}
.st-card.is-near { --line: var(--accent-a40); }
.st-card:hover, .st-card.is-hover { --line: var(--accent); }
.st-card-title { font-size: var(--text-3xl); font-family: var(--font-display); letter-spacing: 0; }
.st-card-lang { font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin: 0; }
.st-card-title a { color: inherit; }
.st-card-title a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.st-card-desc {
  color: var(--text-dim);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  flex: 1;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--card-lines, 3);
  line-clamp: var(--card-lines, 3);
  overflow: hidden;
}
.st-card-meta { display: flex; flex-wrap: wrap; gap: var(--space-6); }
.st-card-links { display: flex; gap: var(--space-14); position: relative; z-index: 1; }
.st-card-links a {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: var(--line-w) solid transparent;
  transition: color var(--dur-base) ease, border-color var(--dur-base) ease;
}
.st-card-links a:hover { border-color: var(--accent-hi); }
.st-card-install {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.st-hero { padding-block: clamp(3rem, 9vw, 7rem) var(--section-gap); position: relative; }
.st-hero h1 {
  font-size: var(--display-1);
  line-height: var(--leading-display);
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.st-hero .st-lead { font-size: var(--lead); color: var(--text-dim); max-width: 60ch; line-height: var(--leading-relaxed); }

/* ---------- the three lines a home page leads with ---------- */

/* The motto is the page's h1 and the largest type on it. Its two clauses are
   separate spans, so a line can only ever break where the sentence already
   pauses: side by side while they fit, one per line at 390px, and never a
   break inside a clause. The spans change nothing a screen reader hears — it
   reads the one sentence the h1 is. */
.st-motto { display: block; text-transform: none; text-wrap: balance; }
.st-motto-clause { display: inline-block; }

/* Under the motto: smaller than it, larger than body text, and at full text
   contrast because it is the second thing read, not an aside. */
.st-support {
  font-size: var(--support);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  color: var(--text);
  max-width: 34ch;
  text-wrap: pretty;
}
/* Under that, at reading size. */
.st-adopt {
  font-size: var(--lead);
  line-height: var(--leading-relaxed);
  color: var(--text-dim);
  max-width: 46ch;
  text-wrap: pretty;
}

@media (max-width: 899px) {
  /* A phone takes the motto one clause per line, so the break falls on the
     comma and the words are never hyphenated or split. */
  .st-motto-clause { display: block; }
}

.st-glow-text { text-shadow: 0 0 18px var(--accent-glow), 0 0 2px var(--accent-hi); }
.st-outline-text {
  color: transparent;
  -webkit-text-stroke: 1px var(--text);
}
.st-cmd {
  display: inline-flex;
  align-items: center;
  gap: var(--space-10);
  padding: var(--space-8) var(--space-14);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  --fill: var(--surface);
}
.st-cmd .st-prompt { color: var(--accent-hi); }
@keyframes st-blink { 50% { opacity: 0; } }

/* ---------- ordered dithering ---------- */

/* Three routes to the same 4x4 Bayer look:

   [data-dither="--from,--to"]  dither.js paints a true ordered-dither ramp
        between the two token colours into a canvas inside the element. It is
        one static paint and no motion, so it runs on every device.
   .st-dither-tex / -25 / -75   a CSS checker at --dither-cell: the 25%, 50%
        and 75% rows of the Bayer matrix as a flat texture. Needs no script,
        so a field is never empty while the page loads.
   filter: url(#st-dither)      the two-tone SVG filter, for plates and for
        hover states.

   Any element that paints a canvas must form a stacking context, or the
   canvas (z-index -1) falls behind the element's own background. */
.st-dither-canvas { image-rendering: pixelated; }
[data-dither] { isolation: isolate; }

.st-dither-tex,
.st-dither-tex-25,
.st-dither-tex-75 {
  background-size: var(--dither-cell) var(--dither-cell);
  background-position: 0 0;
}
.st-dither-tex { background-image: var(--dither-checker); }
.st-dither-tex-25 { background-image: var(--dither-checker-25); }
.st-dither-tex-75 { background-image: var(--dither-checker-75); }

/* A full-bleed band between two sections: the page fading into the accent
   through a dither ramp. The CSS gradient and checker underneath are what a
   reader sees before (or without) the canvas paint. */
.st-dither-band {
  position: relative;
  isolation: isolate;
  height: var(--dither-band-height);
  overflow: hidden;
  background-image: linear-gradient(to bottom, var(--bg) 0%, color-mix(in srgb, var(--accent) 70%, var(--bg)) 100%);
}
.st-dither-band::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: conic-gradient(var(--bg) 25%, transparent 0 50%, var(--bg) 0 75%, transparent 0);
  background-size: var(--dither-cell) var(--dither-cell);
  -webkit-mask-image: linear-gradient(to bottom, #000 0 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0 45%, transparent 100%);
  pointer-events: none;
}
.st-band-layer {
  position: absolute;
  inset: -40% 0;
  background-size: calc(var(--dither-cell) * 3) calc(var(--dither-cell) * 3);
  opacity: 0.5;
  will-change: transform;
}
.st-dither-band.st-flip { background-image: linear-gradient(to top, var(--bg) 0%, color-mix(in srgb, var(--accent) 70%, var(--bg)) 100%); }
.st-dither-band.st-flip::after {
  -webkit-mask-image: linear-gradient(to top, #000 0 45%, transparent 100%);
  mask-image: linear-gradient(to top, #000 0 45%, transparent 100%);
}

/* A dithered plate: a square colour field, two-toned through the SVG filter
   where it is available. Used as the one piece of imagery a page carries. */
.st-dither-plate {
  position: relative;
  isolation: isolate;
  aspect-ratio: 1 / 1;
  background-image: linear-gradient(135deg, var(--accent) 0%, var(--bg) 62%, var(--accent-2) 100%);
}
/* A plate that carries [data-dither] is already dithered by the canvas the
   painter puts in it; the two-tone filter is for the plates that are not. */
.st-heavy .st-dither-plate:not([data-dither]) { filter: url(#st-dither); }

/* ---------- scroll reveals ---------- */

/* effects.js toggles .is-in when the element enters the viewport and removes
   it when it leaves, so scrolling back up replays the reveal. Under reduced
   motion --dur-reveal is 0 and the shift is collapsed, so nothing moves. */
[data-reveal] {
  opacity: 0;
  transform: translateY(var(--reveal-shift));
  transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}
[data-reveal="left"] { transform: translateX(calc(-1 * var(--reveal-shift))); }
[data-reveal="right"] { transform: translateX(var(--reveal-shift)); }
[data-reveal="scale"] { transform: scale(0.94); }
[data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; } }
/* The review override (?motion=force): the reveals are put back for that one
   page load, so they can be watched on a machine that asks for less motion. */
.st-motion-force [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(var(--reveal-shift)); }
.st-motion-force [data-reveal="left"]:not(.is-in) { transform: translateX(calc(-1 * var(--reveal-shift))); }
.st-motion-force [data-reveal="right"]:not(.is-in) { transform: translateX(var(--reveal-shift)); }
.st-motion-force [data-reveal="scale"]:not(.is-in) { transform: scale(0.94); }

/* ---------- the newsletter funnel ---------- */

/* One form, four states on data-state: idle, submitting, success, error.
   The success and error panels are in the markup, hidden until their state,
   so the reader with script off still sees a complete form. */
.st-newsletter { --fill: var(--surface); padding: clamp(1.5rem, 4vw, 3rem); }
.st-newsletter h2 { font-size: var(--display-3); text-transform: uppercase; margin-bottom: var(--space-8); }
.st-newsletter p { color: var(--text-dim); max-width: 52ch; }
.st-nl-form { display: flex; gap: var(--space-10); flex-wrap: wrap; margin-top: var(--space-20); }
.st-nl-form input[type="email"] {
  flex: 1 1 260px;
  min-height: 44px;
  padding: var(--space-8) var(--space-14);
  background: var(--input-bg);
  border: var(--line-w) solid var(--border-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  transition: border-color var(--dur-base) ease, box-shadow var(--dur-base) ease;
}
.st-nl-form input[type="email"]:hover { border-color: var(--hover-border); }
.st-nl-form input[type="email"]:focus { border-color: var(--accent); box-shadow: 0 0 10px var(--accent-a18); outline: none; }
.st-nl-form input[type="email"]::placeholder { color: var(--text-faint); }
.st-nl-form input[aria-invalid="true"] { border-color: var(--red); }
.st-nl-form .st-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.st-nl-status { margin-top: var(--space-12); font-family: var(--font-mono); font-size: var(--text-xs); min-height: 1.4em; }
.st-nl-panel { display: none; margin-top: var(--space-16); padding: var(--space-14) var(--space-16); border: var(--line-w) solid; font-family: var(--font-mono); font-size: var(--text-sm); }
.st-nl-panel .st-btn { margin-top: var(--space-10); }
.st-nl-success { border-color: var(--green); color: var(--text); background: color-mix(in srgb, var(--green) 12%, transparent); }
.st-nl-error { border-color: var(--red); color: var(--text); background: color-mix(in srgb, var(--red) 12%, transparent); }
.st-newsletter[data-state="success"] .st-nl-success { display: block; }
.st-newsletter[data-state="error"] .st-nl-error { display: block; }
.st-newsletter[data-state="success"] .st-nl-form { display: none; }
.st-newsletter[data-state="submitting"] .st-btn { opacity: 0.6; pointer-events: none; }
.st-newsletter[data-state="submitting"] .st-nl-status::after { content: " \2588"; animation: st-blink 0.6s steps(1) infinite; }

/* ---------- the arrow layer ---------- */

/* arrows.js writes one absolutely positioned SVG over the page's main
   element (which must be position: relative). The dashed stroke is revealed
   through a mask whose dashoffset follows the scroll position, so the same
   scroll position always shows the same drawn length: scrolling up undraws. */
.st-arrows {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: var(--z-arrows);
}
.st-arrow {
  fill: none;
  stroke: var(--arrow-color);
  stroke-width: var(--arrow-width);
  stroke-dasharray: var(--arrow-dash);
  stroke-linecap: butt;
  stroke-linejoin: miter;
  filter: drop-shadow(0 0 6px var(--arrow-glow));
  transition: stroke var(--dur-base) ease;
}
.st-arrow-head { fill: var(--arrow-color); stroke: none; transition: opacity var(--dur-base) ease; }

/* ---------- connected hover ---------- */

/* Almost everything a pointer can reach answers it, and its neighbours answer
   with it. hover.js writes .is-hover on the hovered [data-connect] and
   .is-near on every sibling inside the nearest [data-connect-group], on the
   frame around it and on that frame's label. Cards and buttons carry their own,
   louder answers above; this is the floor under everything else. The module
   only mounts on a fine pointer with motion allowed, so a touch screen gets
   none of it.

   THE HOVER RULE. Nothing a pointer does changes the colour of any text or
   paints anything behind text. A hover answer is a line, an outline, the
   notch, the offset shadow, or a small movement — never contrast. */
[data-connect] {
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base) ease;
}
[data-connect]:not(.st-card):not(.st-newsletter):not(.st-btn).is-hover {
  transform: translateY(-2px);
}
/* The neighbours answer in the only currency this rule leaves: a line. A link
   already carries a transparent rule under it, so lighting it moves nothing;
   a notched box answers with its outline. */
a[data-connect].is-near { border-bottom-color: var(--border-2); }
.st-notch[data-connect].is-near { --line: var(--accent-a40); }

/* ---------- footer ---------- */

.st-footer {
  margin-top: var(--section-gap);
  padding: var(--space-28) 0 var(--space-48);
  border-top: var(--line-w) solid var(--border-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-dim);
}
.st-footer a { color: var(--text); border-bottom: var(--line-w) solid transparent; }
.st-footer a:hover { border-color: var(--text); }
.st-footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-16); }
.st-footer-links { display: flex; gap: var(--space-20); }
.st-footer-links a.is-hover, .st-footer-links a:hover { border-color: var(--text); }

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

.st-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  padding: var(--space-10) var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: var(--line-w) solid var(--border-2);
  backdrop-filter: blur(3px);
}
.st-nav-mark { display: flex; align-items: baseline; gap: var(--space-8); min-width: 0; }
.st-nav-brand { font-family: var(--font-display); font-weight: var(--weight-bold); letter-spacing: 0.04em; text-transform: uppercase; color: var(--text); }
.st-nav-brand b { color: var(--accent-hi); }
/* The bar names what the page is about, so a screenshot of it carries the
   name. */
.st-nav-here {
  display: flex;
  align-items: baseline;
  gap: var(--space-8);
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.st-nav-slash { color: var(--text-faint); }
.st-nav-links { display: flex; gap: var(--space-20); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; }
.st-nav-links a { color: var(--text); border-bottom: var(--line-w) solid transparent; }
.st-nav-links a:hover { border-color: var(--text); }

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

/* Shared touch floor. Every variation designs its own small-screen layout in
   its style.css; these are the common corrections: no fixed shadows offset
   beyond the gutter, larger tap targets, no hover-only affordances. */
@media (max-width: 899px) {
  /* Sideways reveals would widen the document while hidden; on small screens
     every reveal rises instead. */
  [data-reveal="left"], [data-reveal="right"] { transform: translateY(var(--reveal-shift)); }
  [data-reveal].is-in { transform: none; }
  :root { --shadow-x: 4px; --shadow-y: 4px; --shadow-hover-x: 4px; --shadow-hover-y: 4px; --notch: 14px; }
  .st-nav-links { display: none; }
  .st-card { padding: var(--space-20); }
  .st-card-title a::after { content: none; }
  .st-card-links a { min-height: 44px; display: inline-flex; align-items: center; }
  .st-arrows { display: none; }
  .st-section-head h2 { font-size: var(--display-3); }
  .st-shadow:hover { transform: none; }
  .st-mobile-only { display: revert; }
  .st-desktop-only { display: none !important; }
}
@media (min-width: 900px) {
  .st-mobile-only { display: none !important; }
}
/* A snap rail: the mobile card system. Cards scroll horizontally with snap. */
.st-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(84vw, 340px);
  gap: var(--space-14);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: var(--space-8) var(--gutter) var(--space-16);
  margin-inline: calc(-1 * var(--gutter));
  scrollbar-width: none;
}
.st-rail::-webkit-scrollbar { display: none; }
.st-rail > * { scroll-snap-align: start; }
/* The sticky bottom call to action for touch screens. */
.st-mobile-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-nav);
  display: none;
  padding: var(--space-10) var(--gutter);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-top: var(--line-w) solid var(--border-2);
  backdrop-filter: blur(3px);
}
.st-mobile-cta .st-btn { width: 100%; }
@media (max-width: 899px) and (pointer: coarse) {
  .st-mobile-cta { display: block; }
  body { padding-bottom: 72px; }
}
