/* Lights Back On: "Flip the Switch" design tokens and base components.
   Fonts (put in <head>):
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&family=DM+Sans:wght@400;500;700&display=swap">
*/

:root {
  /* Brand colors. There is no blue anywhere in this brand. */
  --lamp: #FFD23F;      /* ground of the on state; selected answers on Ink */
  --ink: #1B1A17;       /* type; ground of the out state */
  --daylight: #FFF8E1;  /* cards and results; type on Ink */
  --dim: #5A5648;       /* secondary type on Lamp or Daylight */
  --ash: #9A9584;       /* unlit type and outlines, on Ink only */
  --ink-2: #3A382F;     /* tracks, unlit windows and raised surfaces on Ink */
  --lamp-deep: #D1AD37; /* tracks and hairlines on Lamp */
  --ember: #A3341B;     /* error text on Lamp or Daylight, nothing else */
  --ember-out: #FF9C80; /* error text on Ink, nothing else */
  --ash-light: #B9B4A3; /* secondary type inside a card on Ink */

  /* Type */
  --font-display: "Bricolage Grotesque", "Trebuchet MS", Arial, sans-serif;
  --font-body: "DM Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --h1: clamp(2.5rem, 1.6rem + 4.2vw, 4rem);      /* 40 to 64px */
  --h2: clamp(1.75rem, 1.4rem + 1.8vw, 2.5rem);   /* 28 to 40px */
  --h3: 1.375rem;                                  /* 22px */
  --body: 1.125rem;                                /* 18px, never smaller for running copy */
  --small: 0.9375rem;                              /* 15px */
  --label: 0.8125rem;                              /* 13px caps */

  /* Shape and space */
  --r-card: 28px;
  --r-field: 16px;
  --r-pill: 999px;
  --line: 2px;
  --tap: 48px;                                     /* minimum touch target */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --quiz-width: 720px;
  --page-width: 1120px;

  /* Motion */
  --flip: 500ms cubic-bezier(0.2, 0.7, 0.2, 1);    /* the out-to-on change */
  --quick: 150ms ease-out;                         /* hovers, presses, a window lighting */
}

/* The two states. Put data-state on <body> or on the quiz wrapper. */
[data-state="on"] {
  --ground: var(--lamp);
  --surface: var(--daylight);
  --text: var(--ink);
  --text-2: var(--dim);
  --edge: var(--ink);
  --track: var(--lamp-deep);
  --fill: var(--ink);
  --btn-bg: var(--ink);
  --btn-text: var(--lamp);
  --chip-edge: var(--ink);
  --chip-on-bg: var(--ink);
  --chip-on-text: var(--lamp);
  --error: var(--ember);
  --focus: var(--ink);
}
[data-state="out"] {
  --ground: var(--ink);
  --surface: var(--ink-2);
  --text: var(--daylight);
  --text-2: var(--ash);
  --edge: var(--ash);
  --track: var(--ink-2);
  --fill: var(--lamp);
  --btn-bg: var(--lamp);
  --btn-text: var(--ink);
  --chip-edge: var(--ash);
  --chip-on-bg: var(--lamp);
  --chip-on-text: var(--ink);
  --error: var(--ember-out);
  --focus: var(--lamp);
}
[data-state="out"] .card { --text-2: var(--ash-light); }
[data-state] {
  background-color: var(--ground);
  color: var(--text);
  transition: background-color var(--flip), color var(--flip);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-body); font-size: var(--body); line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); text-wrap: balance; }
h1 { font-size: var(--h1); font-weight: 800; line-height: 1.02; letter-spacing: -0.02em; }
h2 { font-size: var(--h2); font-weight: 700; line-height: 1.08; letter-spacing: -0.01em; }
h3 { font-size: var(--h3); font-weight: 700; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.label { font-size: var(--label); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); }
.muted { color: var(--text-2); }
.small { font-size: var(--small); line-height: 1.45; }
.aside { font-size: var(--small); color: var(--text-2); }            /* the one dry line per screen */
.price { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }

/* Primary button: one per screen */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--tap); padding: 0 var(--s5);
  border: var(--line) solid var(--btn-bg); border-radius: var(--r-pill);
  background: var(--btn-bg); color: var(--btn-text);
  font-family: var(--font-body); font-size: 1.0625rem; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform var(--quick), background-color var(--flip), color var(--flip), border-color var(--flip);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn--quiet { background: transparent; color: var(--text); border-color: var(--edge); }

/* Answer chip: a real <button aria-pressed> */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  min-height: var(--tap); padding: 0 18px;
  border: var(--line) solid var(--chip-edge); border-radius: var(--r-pill);
  background: transparent; color: var(--text);
  font-family: var(--font-body); font-size: 1.0625rem; font-weight: 500; cursor: pointer;
  transition: background-color var(--quick), color var(--quick), border-color var(--quick);
}
.chip[aria-pressed="true"] { background: var(--chip-on-bg); color: var(--chip-on-text); border-color: var(--chip-on-bg); }

/* Progress: a bar, never a countdown */
.progress { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 3px; background: var(--fill); transition: width var(--flip); }

/* Card */
.card { background: var(--surface); border-radius: var(--r-card); padding: clamp(var(--s5), 5vw, var(--s6)); }
.card--framed { background: transparent; border: 3px solid var(--edge); }

/* Cost rows on a result */
.rows { display: grid; }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); padding: var(--s3) 0; border-top: var(--line) solid var(--edge); }
.row:last-child { border-bottom: var(--line) solid var(--edge); }

/* Form field */
.field { display: grid; gap: var(--s2); }
.field input { min-height: var(--tap); padding: 0 var(--s4); border: var(--line) solid var(--edge); border-radius: var(--r-field); background: transparent; color: var(--text); font: inherit; }
.field .error { color: var(--error); font-size: var(--small); }

/* Disclosure line: sits in the footer and directly under any gear recommendation */
.disclosure { font-size: var(--small); line-height: 1.5; color: var(--text-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
