/* Sylvaris web demo -- dark, quiet, the GROVE is the hero. Everything here
   is plain CSS (no framework) at 2-space indent, per Task 9's brief. */

:root {
  --bg: #05080a;
  --panel: #0c1310;         /* SCENE.panel, grove.js -- same colour under the canvas */
  --text: #cfe8dd;
  --text-dim: #7fa696;
  --accent: #6fe8b5;        /* SCENE.tints[0], grove.js -- the scene's own mint */
  --accent-dim: rgba(111, 232, 181, 0.35);
  --border: rgba(207, 232, 221, 0.12);
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

/* The [hidden] attribute is how index.html's script toggles every panel
   below (overlay states, the dev self-test row) -- but a class rule that
   sets its own `display` (e.g. .selftest-row's `display: flex`) outranks
   the UA stylesheet's bare-attribute `[hidden] { display: none }` on
   specificity alone, so an element can end up BOTH hidden and flexed.
   Force the attribute to win everywhere on this page. */
[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  /* No horizontal scroll at any width -- the canvas and controls all clamp
     to the viewport instead. */
  overflow-x: hidden;
}

/* ---- iOS touch polish (live round, Chris's iPhone) ------------------------
   Screenshot evidence: dragging a knob, or holding a pond note, selected the
   invisible/painted-on-canvas label text underneath and popped iOS's
   Copy/Look Up callout mid-gesture. Scoped to the instrument's own input
   surfaces -- the pond canvas, the whole footer (knobs/chips/labels), preset
   chips, the tap-to-begin overlay, the status row -- deliberately NOT a
   blanket rule on body: the email input, gallery/intro/attribution copy, and
   licenses.html all stay normally selectable. Listed explicitly (leaves
   included, not left to inherit) because -webkit-touch-callout is not
   reliably inherited across older WebKit. */
.grove-wrap,
#grove,
.footer-card,
#footer,
.footer-controls,
.footer-knob,
.footer-chip,
.footer-hint,
.controls,
.presets,
.chip,
.overlay,
.overlay *,
.start-btn,
.retry-btn,
.status-row {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* touch-action does not inherit -- each drag/tap surface opts out of native
   gestures itself. #grove already carries `none` below (Task 8); the footer
   knob does too (a drag surface, further down); chips are the same kind of
   pure-instrument tap target and get the same treatment so a chip tap can
   never turn into a page scroll or selection drag. */
.footer-chip {
  touch-action: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
}

.stage {
  /* Live round 1b: 960 -> 1160. The footer draws the plugin's own layout at
     the plugin's own default 150% scale (footer.js pickScale); at 960 the
     page could only afford ~105%, which is what made the 8.5px chip type
     read fuzzy. The wider column buys the scale back -- and the GROVE canvas
     is resolution-independent, so it simply renders bigger. */
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(12px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---- Headline (F6, final-review: share-readiness) ----------------------- */

.headline {
  text-align: center;
}

.headline h1 {
  margin: 0;
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.headline p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-dim);
}

/* ---- GROVE canvas + overlay -------------------------------------------- */

.grove-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--border);
}

#grove {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 960 / 450;
  touch-action: none;
  cursor: crosshair;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--panel);
  opacity: 1;
  transition: opacity 0.6s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.75);
}

.overlay-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 8, 10, 0.15) 0%, rgba(5, 8, 10, 0.55) 100%);
}

.overlay-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
}

.start-btn {
  font: inherit;
  font-size: clamp(15px, 3.4vw, 18px);
  font-weight: 600;
  color: var(--panel);
  background: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 14px 34px;
  cursor: pointer;
  box-shadow: 0 0 24px var(--accent-dim);
}

.start-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.overlay-hint,
.overlay-error {
  margin: 0;
  max-width: 40ch;
  font-size: 13px;
  color: var(--text-dim);
}

.overlay-error {
  color: #ffc07a;   /* SCENE.tints[2] -- reads as a caution note without leaving the palette */
}

.retry-btn {
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
}

.fallback {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-dim);
}

.fallback a {
  color: var(--accent);
}

/* ---- Landscape immersive GROVE (Chris: "it would be great if the grove
   could go full screen when tilting the phone") -----------------------------
   iOS Safari has no Element.requestFullscreen (iPad only, not iPhone), so
   this is a CSS-only immersive mode: index.html's script adds/removes
   `.immersive` on `.grove-wrap` from a matchMedia('(orientation: landscape)')
   query gated to pointer:coarse in every branch (no-hover touch, or a short
   viewport as a fallback for touch devices with unreliable hover reporting)
   so a desktop mouse window -- wide OR resized short-and-wide -- never gets
   hijacked (live-tested: a naive height-only fallback did hijack one), and
   only once the demo has actually started (never fullscreen the tap-to-begin
   poster). `dvh`, not `vh` -- iOS's URL bar changes the static viewport
   height mid-session and only the dynamic unit tracks it. The canvas itself
   needs no extra resize wiring: draw() calls resizeBuffer() every rAF frame
   regardless of state, so the next frame after the class flips already reads
   the new getBoundingClientRect(). */
.grove-wrap.immersive {
  position: fixed;
  inset: 0;
  width: 100dvw;
  height: 100dvh;
  z-index: 1000;
  border-radius: 0;
  box-shadow: none;
}

.grove-wrap.immersive #grove {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;   /* fill the viewport rect instead of holding 960/450 */
}

/* Locked on <body> only while immersive is active (index.html toggles the
   class alongside .immersive itself) -- the fixed grove already covers the
   full viewport so there is nothing reachable to scroll, this is a backstop
   against iOS's rubber-band overscroll. No scroll position is ever changed,
   so there is nothing to restore on exit -- just remove the class. */
body.immersive-lock {
  overflow: hidden;
  height: 100dvh;
}

/* The only chrome immersive mode keeps: a small pill that fades in on entry
   and fades itself out a couple of seconds later (index.html's
   showImmersiveHint/hideImmersiveHint). [hidden] (global rule, top of file)
   handles the fully-hidden state; this class only drives the fade. */
.immersive-hint {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 1001;
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: rgba(12, 19, 16, 0.55);
  border: 1px solid var(--border);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.immersive-hint.visible {
  opacity: 1;
}

/* Rotate-for-fullscreen hint (Chris's ruling, 2026-08-09): same pill as
   .immersive-hint above, deliberately at the OPPOSITE corner (bottom-left)
   so a visitor who has seen one never mistakes it for the other -- this one
   only ever shows once, in portrait, before the visitor has rotated. */
.rotate-hint {
  position: absolute;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: max(10px, env(safe-area-inset-left));
  z-index: 1001;
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: rgba(12, 19, 16, 0.55);
  border: 1px solid var(--border);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.rotate-hint.visible {
  opacity: 1;
}

/* ---- The real GROVE footer (live round 1) --------------------------------
   The canvas paints the plugin's own footer (footer.js, every constant
   cited); .footer-controls sits exactly on top of it and carries the
   interactive DOM, positioned at the painted rects. Those elements are
   deliberately INVISIBLE (transparent text/background) rather than
   opacity:0, so a :focus-visible outline still shows -- the canvas has no
   focus ring of its own to give. */

.footer-card {
  position: relative;
  width: 100%;
}

#footer {
  display: block;
  width: 100%;
}

.footer-controls {
  position: absolute;
  inset: 0;
}

.footer-knob,
.footer-chip {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  font: inherit;
  font-size: 8px;             /* keeps the invisible label out of layout math */
  overflow: hidden;
  cursor: pointer;
}

.footer-knob {
  border-radius: 50%;
  touch-action: none;         /* a knob drag is a gesture, not a page scroll */
  cursor: ns-resize;
}

.footer-knob[aria-disabled="true"],
.footer-chip:disabled {
  cursor: default;
}

.footer-knob:focus-visible,
.footer-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Quick-pick popover. The picker is DOM, not canvas, so THESE rules are the
   live metrics -- QuickPickPopover.cpp's own, cited per declaration below
   (padH 12 / padV 10 :6-7, gapAfterCaption 6 :9, gridGap 6 :10, chipRowHeight
   44 :13, chipWidth's +20 :21) over Theme.h's overlay panel (rgba(16,26,20,
   .93) T:52, cardBorder T:34, cardRadiusSmall 12 T:56). Q:8's captionHeight 14
   is the one metric with no counterpart: the plugin reserves a fixed caption
   band, this caption is a text node that sizes itself. */
.footer-popover {
  position: absolute;
  z-index: 3;
  padding: 10px 12px;         /* Q:7 padV 10, Q:6 padH 12 */
  background: rgba(16, 26, 20, 0.93);
  border: 1px solid rgba(242, 239, 228, 0.12);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.footer-popover-caption {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #ffc677;             /* ArpCluster.h:260 -- the cluster's own amber */
  margin-bottom: 6px;         /* Q:9 gapAfterCaption */
}

.footer-popover-grid {
  display: grid;
  gap: 6px;                   /* Q:10 gridGap */
}

/* Q:19 chipWidth's jmax(40, ...) floor, Q:13 chipRowHeight 44 (the codebase's
   own touch floor -- these rows were 32px, below both the plugin's value and
   the footer chips' own hit boxes), Q:21 chipWidth's +20 of text padding,
   split evenly as 10 per side. */
.footer-popover-option {
  min-width: 40px;
  min-height: 44px;
  padding: 0 10px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid rgba(242, 239, 228, 0.12);
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.footer-popover-option:hover {
  background: rgba(242, 239, 228, 0.04);
}

.footer-popover-option.on {
  color: #ffc677;
  border-color: #ffc677;
  background: rgba(255, 198, 119, 0.16);   /* Chip.cpp:63 accent @ 0.16 */
}

/* ---- Hover captions (Copy cycle) ------------------------------------------
   A styled tooltip, not the browser's native title box -- consistent dark
   theme, and (unlike title) something a screenshot actually shows. The pond
   canvas can't host a pseudo-element (replaced elements don't paint ::after)
   and keeps a native title attribute instead -- see index.html. Touch has
   no hover for either path -- see .footer-hint. */

/* The presets group: a plain div with no overflow clipping, so a ::after
   tooltip on it works directly. */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translate(-50%, 4px);
  width: max-content;
  max-width: 220px;
  padding: 7px 10px;
  background: rgba(16, 26, 20, 0.96);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  letter-spacing: normal;
  text-transform: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 30;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* The footer knobs/chips: .footer-knob/.footer-chip below carry their own
   `overflow: hidden` (to keep their invisible aria-label text out of layout
   math), which would clip a ::after generated inside that same box. This is
   a single shared element instead (footer.js showTooltip/hideTooltip),
   appended as a SIBLING to .footer-controls and positioned in JS from the
   hovered control's own rect -- not clipped by anything it hovers over. */
.footer-tooltip {
  position: absolute;
  max-width: 220px;
  padding: 7px 10px;
  background: rgba(16, 26, 20, 0.96);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  letter-spacing: normal;
  text-transform: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -100%);
  transition: opacity 0.12s ease;
  z-index: 30;
}

.footer-tooltip.visible {
  opacity: 1;
}

/* ---- Touch hint (Copy cycle) ---------------------------------------------
   Desktop gets per-control title tooltips (footer.js, the pond canvas, the
   presets group); touch has no hover to reveal those, so this one slim line
   always carries the same "what does this do" job. Deliberately plain text,
   not a control -- it must never compete with the footer for touch targets. */

.footer-hint {
  margin: 0;
  padding: 0 4px;
  text-align: center;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-dim);
}

/* ---- Module gallery (Chris's ruling, 2026-08-09) --------------------------
   Replaces the Copy cycle's text-only features strip. Sits BELOW the email
   form (the form stays directly under the demo) and shows what the demo
   leaves out with real captures of the plugin.

   Sizing rule: every shot is a 1:1 crop of a blessed GUI snapshot, and none
   of them is ever displayed LARGER than it was captured -- an upscaled UI
   screenshot reads as a blurry one. The tiles are wide enough for the card
   crops to sit at natural size; the three wide shots take a full row and,
   when even that is too narrow (a phone), scroll inside their own figure
   rather than shrinking into a smudge or pushing the page sideways. */

.gallery {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  /* Flex item: without this the section refuses to shrink below its widest
     descendant and the 970px SEASONS shot silently pushes the whole gallery
     past the phone viewport (body's overflow-x:hidden then CLIPS it, which
     is worse than a scrollbar -- the content is just gone). */
  min-width: 0;
}

.gallery h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

/* Whole-instrument intro (Chris-approved copy, second gallery addition,
   2026-08-09) -- sits above the corrected per-voice lead-in. Deliberately
   larger and lighter-weight than both the lead-in and the tile body copy
   below (.gallery-lead 13.5px, .module-card p 12.5px, both var(--text-dim))
   so it reads as the section's opening statement, not another tile
   caption. */
.gallery-intro {
  margin: 0 0 16px;
  max-width: 65ch;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--text);
}

.gallery-lead {
  margin: 0 0 20px;
  max-width: 62ch;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-dim);
}

.module-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  /* Cards stretch to their row's height rather than each ending wherever its
     own crop happens to stop -- the card crops differ by 250px of height and
     ragged bottoms read as a broken grid. */
  align-items: stretch;
}

.module-card {
  margin: 0;
  padding: 14px 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  /* Grid item: same reason as .gallery above -- a grid item's automatic
     minimum size is its content's, so without this a card is as wide as its
     shot and the .module-shot scroll container never gets to do its job. */
  min-width: 0;
}

/* The three shots that are wider than a tile take the whole row. */
.module-card.wide {
  grid-column: 1 / -1;
}

.module-shot {
  margin: 0 0 12px;
  overflow-x: auto;          /* wide shots scroll HERE, never the page */
  border-radius: 8px;
  /* A visible (thin) track is the only affordance a scrollable figure gets;
     without it a phone visitor has no cue that the shot continues. */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  overscroll-behavior-x: contain;   /* don't hand the page a sideways swipe */
}

.module-shot::-webkit-scrollbar {
  height: 6px;
}

.module-shot::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
}

.module-shot img {
  display: block;
  margin: 0 auto;            /* centred while it fits; scrolls once it doesn't */
  border-radius: 8px;
}

.module-card h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.module-card p {
  margin: 0;
  max-width: 62ch;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-dim);
}

@media (max-width: 640px) {
  .module-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ---- Tab showcase (Chris's ruling, 2026-08-09) ---------------------------
   Sits AFTER the module-tile gallery -- four full-canvas captures of the
   real plugin tabs (GROVE/PATCH/FX/SEASONS), the same 2x-scale technique
   the gallery crops already use (tests/GuiSnapshot.cc marketing2x block),
   uncropped this time so the whole tab reads at once. Single column,
   "full-width-ish": each shot displays at natural/2 (1000x650, the editor's
   own logical size) so it's sharp on retina and never upscaled. */

.tab-showcase {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 24px;
  min-width: 0;   /* same flex/grid-shrink reasoning as .gallery above */
}

.tab-showcase h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

.tab-lead {
  margin: 0 0 20px;
  max-width: 62ch;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-dim);
}

.tab-shots {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tab-shot {
  margin: 0;
}

.tab-shot-btn {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  cursor: zoom-in;
  overflow: hidden;
}

.tab-shot-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tab-shot img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 1000px;
  margin: 0 auto;
}

.tab-shot h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.tab-shot p {
  margin: 0;
  max-width: 62ch;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-dim);
}

/* Dependency-free lightbox: one shared overlay, its <img src> swapped per
   tap. Mirrors the tap-to-begin overlay's own scrim idiom (fixed inset,
   dim backdrop) rather than inventing a second visual language. */
.tab-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 5, 4, 0.88);
  cursor: zoom-out;
}

.tab-lightbox[hidden] {
  display: none;
}

.tab-lightbox img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--border);
}

.tab-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.tab-lightbox-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Controls: preset chips --------------------------------------------- */

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Restyled into the footer's Chip family (live round 1): mono, tracked,
   uppercase, the same 12px pill radius and cardBorder outline Chip.cpp
   paints, with the ON state's accent @ 0.16 fill. Sized up from the
   plugin's 8.5px, which is a plugin-window size, not a web-page one. */
.chip {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid rgba(242, 239, 228, 0.12);
  border-radius: 12px;
  padding: 9px 14px;
  cursor: pointer;
}

.chip:disabled {
  opacity: 0.4;
  cursor: default;
}

.chip:not(:disabled):hover {
  background: rgba(242, 239, 228, 0.04);
}

.chip.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(111, 232, 181, 0.16);
}

.status-row {
  width: 100%;
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--text-dim);
}

/* ---- Kit form ------------------------------------------------------------- */
/* KIT-FORM-LIVE: posts to /api/subscribe (web-demo/site/api/subscribe.js),
   which upserts via Kit v4 and tags the `sylvaris` tag (id 22355387). See
   the form's own markup comment in index.html for the request shape. */

.kit-form {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kit-form h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.kit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kit-row input[type="email"] {
  flex: 1 1 200px;
  min-width: 0;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
}

.kit-row button {
  font: inherit;
  font-size: 13px;
  color: var(--panel);
  background: var(--accent);
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  cursor: pointer;
}

.kit-row input:disabled,
.kit-row button:disabled {
  opacity: 0.45;
  cursor: default;
}

.kit-note {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}

.kit-note-error {
  color: #ffc07a;   /* SCENE.tints[2] -- same caution note as .overlay-error */
}

.kit-success {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}

/* Honeypot: present in the DOM (some bots skip fields hidden by
   display:none but still fill anything visually offscreen-but-present is
   the safer bet either way) -- pulled off-screen rather than hidden, never
   in the tab order, real visitors never see or reach it. */
.kit-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Footer: attribution ------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attribution {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-dim);
}

.attribution a {
  color: var(--text-dim);
  text-decoration: underline;
}

.brand-line {
  margin: 0;
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.7;
}

/* ---- Dev-only self test (hidden unless ?debug=1) ------------------------- */

.selftest-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-dim);
}

.selftest-row button {
  font: inherit;
  font-size: 12px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
}

/* ---- Phone widths --------------------------------------------------------- */

@media (max-width: 480px) {
  .controls {
    gap: 12px;
  }

  .chip {
    font-size: 10px;
    padding: 8px 11px;
  }
}
