/* Matlock's shared design system — the Reserve Batch Lab's premium
 * expression as reusable primitives (BRAND_PROFILE.md "Premium expression",
 * codified 2026-07-14).
 *
 * LOCKSTEP: token values are extracted VERBATIM from
 * public/batch-lab/index.html's :root (the visual source of truth, kept
 * self-contained by design — do not restyle the deployed funnel from
 * here). If the Batch Lab tokens ever change, change these to match.
 * Consumed by the homepage and the taste-test survey.
 *
 * System rules (BRAND_PROFILE.md): zero border-radius; no elevation
 * shadows — depth is gold hairlines and 1.5px translucent-green
 * interactive borders; dark panels use a double frame; the gold-foil
 * gradient goes on hero display type and at most one CTA per screen. */

:root {
  --green: #004413;
  --green-2: #00330E;
  --green-3: #002309;
  --cream: #F4EFE3;
  --field: #FFFDF4;
  --gold: #AD9962;
  --gold-light: #E0CD9A;
  --gold-olive: #7C6A3C;
  --ink: #00330E;
  --ink-muted: rgba(0, 51, 14, .6);
  --on-green: #F4EFE3;
  --on-green-soft: rgba(244, 239, 227, .78);
  --on-green-faint: rgba(244, 239, 227, .55);
  --hairline: rgba(173, 153, 98, .35);
  --hairline-strong: rgba(173, 153, 98, .55);
  --border-interactive: 1.5px solid rgba(0, 68, 19, .22);
  --error-border: #B0653F;
  --error-fill: rgba(176, 101, 63, .08);
  --error-text: #8A4526;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --foil: linear-gradient(100deg, #6E5E34, #C9B576, #F2E4B4, #AD9962, #EBDBA4, #8E7A40, #C9B576);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }

/* Dark-ground page default (the Batch Lab body treatment). */
body.brand-dark {
  font-family: var(--sans);
  color: var(--on-green);
  background: var(--green-3);
  background-image: radial-gradient(1400px 900px at 50% -10%, var(--green) 0%, var(--green-2) 68%, var(--green-3) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  font-weight: 300;
  font-size: 15px;
}

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

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--gold); color: var(--green-3);
  padding: 10px 16px; z-index: 40; font-weight: 600;
}
.skip:focus { left: 0; }

a { color: inherit; }
button { font-family: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---- Labels & display type ---------------------------------------------- */

.overline {
  font-size: 10px;
  letter-spacing: .35em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gold-light);
}
.overline.on-cream { color: var(--gold-olive); }

.foil-text {
  background: var(--foil);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.serif-display {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.01em;
}

/* ---- Top bar + progress -------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(0, 35, 9, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-inner {
  max-width: 1060px; margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.brand { display: flex; flex-direction: column; gap: 2px; text-decoration: none; }
.brand-name {
  font-family: var(--serif); font-weight: 600; font-size: 2.1rem; line-height: 1;
  background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { font-size: 9px; letter-spacing: .3em; color: var(--gold-light); text-transform: uppercase; }
.progress-track { height: 2px; background: rgba(173, 153, 98, .25); }
.progress-fill {
  height: 100%; width: 0%;
  background: var(--gold);
  transition: width .4s cubic-bezier(.22, 1, .36, 1);
}

/* ---- Panels --------------------------------------------------------------- */

.card { background: var(--cream); color: var(--ink); padding: 30px 26px; }

/* Double gold frame for dark panels / imagery (BRAND_PROFILE depth rule). */
.framed {
  border: 1px solid var(--hairline-strong);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.hairline-rule { height: 1px; background: var(--hairline); border: 0; }

/* ---- Buttons -------------------------------------------------------------- */

.btn-luxe {
  font-family: var(--sans); font-weight: 600; font-size: 12px;
  letter-spacing: .22em; text-transform: uppercase;
  cursor: pointer; min-height: 52px; padding: 0 28px;
  background: var(--green); border: 1px solid var(--gold); color: var(--on-green);
}
.btn-luxe:hover { background: var(--green-2); }
.btn-luxe:disabled { opacity: .5; cursor: not-allowed; }

.btn-luxe--foil {
  background: var(--foil);
  color: var(--green-3);
  border: 1px solid var(--gold);
}
.btn-luxe--foil:hover { background: var(--foil); filter: brightness(1.06); }

/* Quiet buttons: hairline outline; one variant per ground. */
.btn-quiet {
  font-family: var(--sans); font-weight: 600; font-size: 11px;
  letter-spacing: .22em; text-transform: uppercase;
  cursor: pointer; min-height: 52px; padding: 0 20px;
  background: none; border: 1px solid var(--hairline-strong); color: var(--on-green);
}
.btn-quiet:hover { border-color: var(--gold); }
.btn-quiet.on-cream { border: var(--border-interactive); color: var(--green); }
.btn-quiet.on-cream:hover { border-color: var(--green); }
.btn-quiet:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Selectable option rows (cream ground) -------------------------------- */
/* Structure: <label class="opt"><input …><span class="opt-face">…</span></label>
 * The input is invisible but focusable; the face carries the visible focus
 * ring (input:focus-visible + .opt-face). */

.opt {
  position: relative; display: block;
  border: var(--border-interactive); background: var(--field);
  padding: 14px 16px; cursor: pointer;
  transition: border-color .15s ease;
  min-height: 52px;
}
.opt:hover { border-color: var(--green); }
.opt input {
  position: absolute; opacity: 0; inset: 0;
  width: 100%; height: 100%; margin: 0; cursor: pointer;
}
.opt input:focus-visible + .opt-face { outline: 2px solid var(--gold); outline-offset: 4px; }
.opt.selected { background: var(--green); border-color: var(--gold); color: var(--on-green); }
.opt.selected::after {
  content: "\2713";
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--gold); font-weight: 700;
}
.opt-face { display: block; pointer-events: none; }
.opt-title { font-weight: 600; font-size: 15px; display: block; }
.opt-desc { font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; display: block; }
.opt.selected .opt-desc { color: var(--on-green-soft); }

/* ---- Numeric scale grid (1-10) -------------------------------------------- */

.scale-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.scale-cell {
  position: relative; display: flex; align-items: center; justify-content: center;
  border: var(--border-interactive); background: var(--field);
  min-height: 52px; cursor: pointer;
  font-weight: 600; font-size: 16px; color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: border-color .15s ease;
}
.scale-cell:hover { border-color: var(--green); }
.scale-cell input {
  position: absolute; opacity: 0; inset: 0;
  width: 100%; height: 100%; margin: 0; cursor: pointer;
}
.scale-cell input:focus-visible + .scale-face { outline: 2px solid var(--gold); outline-offset: 4px; }
.scale-face { pointer-events: none; }
.scale-cell.selected { background: var(--green); border-color: var(--gold); color: var(--on-green); }
.scale-legend {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12px; color: var(--ink-muted); margin: 0 0 10px;
}

/* ---- Text fields ----------------------------------------------------------- */

.field-label {
  display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 600; color: var(--gold-olive); margin: 0 0 8px;
}
.text-input {
  width: 100%; font-family: var(--sans); font-size: 16px; color: var(--ink);
  background: var(--field); border: var(--border-interactive); padding: 13px 16px;
}
textarea.text-input { min-height: 120px; resize: vertical; line-height: 1.5; }
.text-input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(173, 153, 98, .25);
}
.field-help { font-size: 12.5px; color: var(--ink-muted); margin-top: 6px; }

/* ---- Error banner ----------------------------------------------------------- */

.error-banner {
  border: 1px solid var(--error-border); background: var(--error-fill);
  color: var(--error-text); font-size: 13px; padding: 12px 14px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
