/* ==========================================================================
   YNS results page — styles
   Brand palette (exact hex, no other hues; only opacity variants are derived):
     Isabelline #FAF4ED  background / inverse text
     Black Coral #3D5467 body text, dark section backgrounds
     Forest Green #264012 "strong" state, strengths, green-band dial arc
     Ember #CC7046       orange-band dial arc (Vermilion/Camel blend, pending approval)
     Cafe Noir #442A0F   brand-kit accent, defined but currently unused
     Camel #BF9460       decorative accents, yellow-band dial arc
     Vermilion #D94B2B   the single "priority" card accent + red-band dial arc

   AA note: on Isabelline, Camel (2.9:1) and Vermilion (4.0:1) fail AA for body
   text, so ALL text is Coral or Forest. Camel and the state dots are decorative
   and redundant with a text label, so they are exempt from the text-contrast rule.
   ========================================================================== */

:root {
  --isabelline: #FAF4ED;
  --coral: #3D5467;
  --forest: #264012;
  --camel: #BF9460;
  --vermilion: #D94B2B;

  /* Cafe Noir — a brand-kit palette colour (brand kit §4) not previously used in
     this stylesheet. Kept as a defined option (it is a real brand colour) but no
     longer the orange-band arc; see --ember below. */
  --cafe-noir: #442A0F;
  /* Ember — the 50/50 interpolation of Vermilion #D94B2B and Camel #BF9460. Added
     under the brand kit's "avoid adding new colours unless the project specifically
     requires it" clause: a 4-step band scale needs an orange and the palette has
     none. PENDING NICK'S APPROVAL 2026-09-14. */
  --ember: #CC7046;

  --coral-06: rgba(61, 84, 103, .06);
  --coral-10: rgba(61, 84, 103, .10);
  --coral-16: rgba(61, 84, 103, .16);
  --coral-22: rgba(61, 84, 103, .22);
  --forest-06: rgba(38, 64, 18, .07);
  --forest-13: rgba(38, 64, 18, .13);
  --camel-10: rgba(191, 148, 96, .12);
  --vermilion-45: rgba(217, 75, 43, .45);

  /* Score-dial arc colour, one per band:
       red    -> Vermilion (the alert accent)
       orange -> Ember     (Vermilion/Camel blend, pending Nick's approval)
       yellow -> Camel     (the warm accent)
       green  -> Forest    (the "strong / handled" green)
     The dial arc is decorative (redundant with the band name + scale below it),
     so it is exempt from the AA text-contrast rule like the other accents. */
  --dial-red: var(--vermilion);
  --dial-orange: var(--ember);
  --dial-yellow: var(--camel);
  --dial-green: var(--forest);

  --f-head: "Raleway", "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  --f-body: "Open Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --f-script: "Satisfy", "Segoe Script", "Brush Script MT", cursive;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--f-body);
  color: var(--coral);
  background: var(--isabelline);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The whole page lives inside a <=600px column (the Heartbeat iframe width).
   Centred so it also reads correctly if opened directly. */
.page {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  background: var(--isabelline);
}
.inner { padding: 0 22px 34px; }

a { color: var(--coral); }

/* keyboard focus — visible on every interactive element */
a:focus-visible,
summary:focus-visible,
button:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- brand header (removed) ----------
   The .brandbar/logo was intentionally removed to reclaim ~45px above the 800px
   Heartbeat fold: inside the Academy the sidebar already shows this logo, so it
   was redundant on screen. The image asset is retained in assets/ for any future
   use of this page outside Heartbeat. No .brandbar styles remain by design. */

/* ---------- score / dial ---------- */
.scorewrap { text-align: center; padding: 14px 0 0; }
.eyebrow {
  font-family: var(--f-head);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 10.5px;
  color: var(--coral);
  margin-bottom: 2px;
}
.dial { position: relative; width: 180px; height: 97px; margin: 2px auto 0; }
.dial svg { display: block; width: 100%; height: 100%; overflow: visible; }
.dialnum {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-family: var(--f-head); font-weight: 800; font-size: 42px;
  line-height: 1; color: var(--coral);
}
.dialnum .suffix {
  font-size: 13px; font-weight: 600; color: var(--coral); opacity: .7;
  display: block; margin-top: 2px; letter-spacing: .06em;
}
.bandname { font-family: var(--f-head); font-weight: 700; font-size: 19px; margin: 6px 0 0; color: var(--coral); }
.bandsub { font-size: 13px; color: var(--coral); opacity: .85; margin: 2px 0 0; }

.scale {
  display: flex; height: 9px; border-radius: 5px; overflow: hidden;
  margin: 11px 0 5px; box-shadow: inset 0 0 0 1px var(--coral-10);
}
.scale i { flex: 1; background: var(--coral-10); }
.scale i.on { background: var(--camel); }        /* decorative active marker */
.scalelabels {
  display: flex; font-size: 9px; letter-spacing: .03em; text-transform: uppercase;
  font-family: var(--f-head); font-weight: 700; color: var(--coral); opacity: .5;
}
.scalelabels span { flex: 1; text-align: center; }
.scalelabels span.on { opacity: 1; }

/* ---------- section scaffolding ---------- */
.sect { margin-top: 20px; }
.secthead { font-family: var(--f-head); font-weight: 800; font-size: 20px; margin: 0 0 4px; line-height: 1.25; color: var(--coral); }
.sectlede { font-size: 13.5px; color: var(--coral); opacity: .8; margin: 0 0 11px; }

/* ---------- strengths ---------- */
.wins { list-style: none; margin: 0; padding: 0; }
.wins li {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--forest-06);
  border-left: 3px solid var(--forest);
  border-radius: 0 8px 8px 0;
  padding: 5px 12px; margin-bottom: 3px; font-size: 13px;
}
.wins .tick { color: var(--forest); font-weight: 700; flex: 0 0 auto; line-height: 1.5; }
.wins b {
  font-family: var(--f-head); font-weight: 700; display: block;
  font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--forest); margin-bottom: 1px;
}

/* ---------- the single next step ---------- */
.nextstep {
  margin-top: 18px;
  background: var(--coral); color: var(--isabelline);
  border-radius: 12px; padding: 17px 19px;
}
.nextstep .eyebrow { color: var(--isabelline); opacity: .85; margin-bottom: 5px; }
.nextstep h3 { font-family: var(--f-head); font-weight: 800; font-size: 18.5px; margin: 0 0 7px; line-height: 1.3; color: var(--isabelline); }
.nextstep p { margin: 0; font-size: 13.5px; color: var(--isabelline); opacity: .95; }
.nextstep .cta {
  display: inline-block; margin-top: 14px;
  background: var(--isabelline); color: var(--coral); text-decoration: none;
  font-family: var(--f-head); font-weight: 700; font-size: 13px;
  padding: 10px 18px; border-radius: 7px; letter-spacing: .02em;
}

/* ---------- category cards ---------- */
.cards { margin-top: 12px; }
.card {
  background: var(--isabelline);
  border: 1px solid var(--coral-10);
  border-radius: 10px; margin-bottom: 9px;
  box-shadow: 0 1px 3px var(--coral-10);
  overflow: hidden;
}
.card > summary {
  list-style: none; cursor: pointer;
  padding: 13px 15px; display: flex; align-items: center; gap: 11px;
}
.card > summary::-webkit-details-marker { display: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.s-strong .dot { background: var(--forest); }
.s-watch .dot { background: var(--camel); }
.s-priority .dot { background: var(--vermilion); }     /* vermilion use (single priority) */
.s-needswork .dot { background: var(--coral); }        /* red concern (not priority) or access=okay — no left border; vermilion stays reserved for the one priority card */
.s-neutral .dot { background: var(--coral-22); }       /* unresolved area — no verdict (opacity variant, in-palette) */
/* The underline is deliberate: these summaries are the primary way a member
   opens and closes an area, so the name has to read as a control, not a label.
   Without it the only affordance was an 11px chevron sitting at 50% opacity. */
.card .name {
  font-family: var(--f-head); font-weight: 700; font-size: 14.5px; flex: 1; color: var(--coral);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.card .state {
  font-size: 11px; font-family: var(--f-head); font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--coral);
}
.card .chev { font-size: 11px; color: var(--coral); opacity: .5; transition: transform .2s; }
@media (prefers-reduced-motion: reduce) { .card .chev { transition: none; } }
.card[open] .chev { transform: rotate(180deg); }

/* the one priority card carries the single vermilion accent */
.card.s-priority { border-left: 4px solid var(--vermilion); }

.card .body { padding: 2px 15px 16px; font-size: 13.5px; border-top: 1px solid var(--coral-06); }
.card .body p { margin: 11px 0; }
.card .body .lead { font-weight: 600; }
.card .body h4 {
  font-family: var(--f-head); font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase; margin: 15px 0 6px; color: var(--coral);
}
.card .body ul { margin: 0; padding-left: 18px; }
.card .body li { margin-bottom: 6px; }
.card .body ul ul { margin-top: 6px; }
.strongbody { color: var(--forest); font-weight: 600; }

/* Minimize control at the end of an open card. Secondary chrome: small Coral
   text, underlined to echo the card name, no fill and no border, tucked to the
   right with a little air above it. Vermilion is reserved for the one priority
   card and Forest means "handled", so this stays plain Coral. Keyboard focus is
   covered by the global button:focus-visible ring — no separate rule needed. */
.cardmin {
  display: block; margin: 14px 0 0 auto; width: fit-content;
  padding: 0; border: 0; background: transparent; cursor: pointer;
  font-family: var(--f-head); font-size: 12px; color: var(--coral);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}

/* Real per-answer resource links (block-level or category fallback). Rendered
   as a plain list rather than in the dashed placeholder box, since these are
   live links, not an empty slot. Forest link colour matches the "strong" green. */
.reslinks {
  list-style: none; margin: 14px 0 0; padding: 0;
}
.reslinks li { margin: 0 0 5px; font-size: 12.5px; line-height: 1.4; }
.reslinks li:last-child { margin-bottom: 0; }
.reslinks a { color: var(--forest); font-weight: 600; }

.linkslot {
  margin-top: 14px; border: 1px dashed var(--camel);
  border-radius: 8px; padding: 10px 12px; font-size: 11.5px;
  background: var(--camel-10); color: var(--coral);
}
.linkslot b {
  font-family: var(--f-head); font-size: 10px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--coral); display: block; margin-bottom: 2px;
}
.todo {
  background: rgba(217, 75, 43, .08); border: 1px dashed var(--vermilion-45);
  color: var(--coral); border-radius: 8px; padding: 11px 12px; font-size: 12px;
}
.todo b {
  font-family: var(--f-head); letter-spacing: .07em; text-transform: uppercase;
  font-size: 10px; display: block; margin-bottom: 2px; color: var(--coral);
}

/* ---------- footer ---------- */
.foot { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--coral-06); text-align: center; }
.foot .btn {
  display: inline-block; margin: 4px 4px 0; padding: 10px 16px; border-radius: 7px;
  font-family: var(--f-head); font-weight: 700; font-size: 12.5px; text-decoration: none;
  border: 1.5px solid var(--coral); color: var(--coral); background: transparent;
}
.foot .btn.solid { background: var(--forest); border-color: var(--forest); color: var(--isabelline); }
.foot .tiny { font-size: 11px; color: var(--coral); opacity: .65; margin-top: 12px; }

/* ---------- email capture (quiz end screen + results footer) ----------
   Shared by both mount points. 600px-first, brand palette only. All text is
   Coral or Forest (Camel/Vermilion fail AA as text on Isabelline). The submit
   button reuses the Forest "solid" treatment already used by the footer button
   and the quiz CTA; the single Vermilion accent stays on the priority card and
   is NOT spent again here. */
.emailcap { margin: 18px 0 0; text-align: left; }
.emailcap-head {
  font-family: var(--f-head); font-weight: 800; font-size: 16px;
  color: var(--coral); margin: 0 0 9px; line-height: 1.3;
}
.emailcap-form { display: flex; flex-direction: column; gap: 9px; }
.emailcap-label {
  font-family: var(--f-head); font-weight: 700; font-size: 11px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--coral);
}
.emailcap input[type="email"] {
  width: 100%; min-height: 46px; padding: 11px 13px;
  font-family: var(--f-body); font-size: 15px; color: var(--coral);
  background: var(--isabelline);
  border: 1.5px solid var(--coral-16); border-radius: 8px;
}
.emailcap input[type="email"]:focus-visible {
  outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 8px;
}
/* Honeypot: kept in the DOM (so bots fill it) but out of sight and out of the
   layout. Not display:none — some bots skip hidden fields. */
.emailcap-hp {
  position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden;
}
.emailcap-btn {
  min-height: 46px; padding: 12px 18px; cursor: pointer;
  font-family: var(--f-head); font-weight: 700; font-size: 14px;
  color: var(--isabelline); background: var(--forest);
  border: 1.5px solid var(--forest); border-radius: 8px;
}
.emailcap-btn:hover { filter: brightness(.9); }  /* darker-of-same-colour, no new hue */
.emailcap-btn:disabled { opacity: .6; cursor: default; }
.emailcap-consent {
  font-size: 11px; color: var(--coral); opacity: .7;
  margin: 9px 0 0; line-height: 1.5;
}
.emailcap-status { font-size: 12.5px; color: var(--coral); margin: 7px 0 0; }
.emailcap-done {
  font-family: var(--f-head); font-weight: 700; font-size: 14px;
  color: var(--forest); margin: 18px 0 0; text-align: left;
}

.noscript {
  margin: 20px; padding: 14px 16px; border: 1px solid var(--coral-16);
  border-radius: 8px; font-size: 13.5px; color: var(--coral);
}

/* ==========================================================================
   Assessment (quiz.html) — one question per screen. All rules are scoped under
   #quiz so they cannot touch the frozen results page (index.html has no #quiz).
   Same brand tokens, 600px-first, large tap targets, visible keyboard focus.
   ========================================================================== */
#quiz { padding-top: 18px; }

/* Academy logo lockup, centred above the progress bar on every screen. Sizing
   follows the food-storage-planner pattern (src/styles.css .hero-logo,
   docs/BRAND.md): the horizontal mark is 1000x140 (aspect 7.14), so
   max-width:24rem renders it ~384x54. A narrower cap would leave it ~34px tall
   and unreadable (that planner's own note). Served by relative path, not inlined
   — this page already makes external requests (Google Fonts) and is not a
   single-file bundle. No colour introduced. */
#quiz .qlogo { margin: 0 0 14px; }
#quiz .qlogo img {
  display: block;
  width: 100%;
  max-width: 24rem;
  height: auto;
  margin: 0 auto;
}

#quiz .qprogress {
  height: 8px; border-radius: 5px; background: var(--coral-10);
  overflow: hidden; margin-bottom: 16px;
}
#quiz .qbar {
  height: 100%; background: var(--forest); border-radius: 5px;
  transition: width .25s ease;
}
@media (prefers-reduced-motion: reduce) { #quiz .qbar { transition: none; } }

#quiz .qeyebrow {
  font-family: var(--f-head); font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; font-size: 11px; color: var(--coral); opacity: .75;
  margin-bottom: 6px;
}
/* The area name carries slightly more weight than the count beside it. */
#quiz .qarea { font-weight: 800; }
#quiz .qtext {
  font-family: var(--f-head); font-weight: 800; font-size: 22px; line-height: 1.25;
  color: var(--coral); margin: 0 0 6px;
}
/* The heading is a programmatic focus target (renderQuestion focuses it so a
   screen reader announces the new question). It is not interactive, so it must
   not draw a focus ring. */
#quiz .qtext:focus { outline: none; }
#quiz .qhelp { font-size: 13px; color: var(--coral); opacity: .8; margin: 0 0 14px; }

#quiz .opts { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
#quiz .opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  min-height: 54px; padding: 13px 15px;
  font-family: var(--f-body); font-size: 15px; color: var(--coral);
  background: var(--isabelline); border: 1.5px solid var(--coral-16);
  border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s;
}
@media (prefers-reduced-motion: reduce) { #quiz .opt { transition: none; } }
#quiz .opt:hover { border-color: var(--camel); background: var(--camel-10); }
#quiz .opt.on { border-color: var(--forest); background: var(--forest-06); }
/* Keyboard focus must stay clearly visible but must NOT be mistaken for the
   selected state. Focus = a solid coral ring sitting OUTSIDE the button (offset),
   no fill; selected = a solid forest border WITH a forest-06 fill — so the two
   remain distinguishable. Coral (not Camel: Camel on Isabelline is ~2:1 and would
   fail the 3:1 a focus indicator needs). Keeps the 10px shape. */
#quiz .opt:focus-visible {
  outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 10px;
}
#quiz .optkey {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--f-head); font-weight: 700; font-size: 12px;
  color: var(--coral); background: var(--coral-10);
}
#quiz .opt.on .optkey { background: var(--forest); color: var(--isabelline); }
#quiz .optlabel { flex: 1; }

#quiz .qback {
  margin-top: 18px; background: transparent; border: 0; cursor: pointer;
  font-family: var(--f-head); font-weight: 700; font-size: 13px; color: var(--coral);
  padding: 8px 4px;
}
#quiz .qback:hover { color: var(--vermilion); }

/* ---- end screen ---- */
#quiz .endscore {
  font-family: var(--f-head); font-weight: 800; font-size: 64px; line-height: 1;
  color: var(--coral); margin: 10px 0 2px; text-align: center;
}
#quiz .endscore.band-red { color: var(--dial-red); }
#quiz .endscore.band-orange { color: var(--dial-orange); }
#quiz .endscore.band-yellow { color: var(--dial-yellow); }
#quiz .endscore.band-green { color: var(--dial-green); }
#quiz .endsuffix {
  display: block; font-size: 13px; font-weight: 600; color: var(--coral);
  opacity: .7; letter-spacing: .06em; margin-top: 4px;
}
#quiz .endband {
  font-family: var(--f-head); font-weight: 800; font-size: 22px; color: var(--coral);
  text-align: center; margin: 8px 0 4px;
}
#quiz .enddesc { font-size: 14px; color: var(--coral); opacity: .85; text-align: center; margin: 0 auto 18px; max-width: 46ch; }
#quiz .cta {
  display: block; text-align: center; text-decoration: none;
  background: var(--forest); color: var(--isabelline);
  font-family: var(--f-head); font-weight: 700; font-size: 15px;
  padding: 14px 20px; border-radius: 8px; margin-top: 8px;
}
#quiz .cta:hover { filter: brightness(.9); }  /* darker-of-same-colour hover, no new hue */

/* ---------- optional 800px ruler (dev aid: append ?ruler=1) ---------- */
.ruler {
  position: absolute; left: 0; right: 0; top: 800px; height: 0;
  border-top: 2px dashed var(--vermilion); pointer-events: none; z-index: 2;
}
.ruler::after {
  content: "800px — Heartbeat fold"; position: absolute; right: 4px; top: 2px;
  font-size: 9px; color: var(--vermilion); font-family: var(--f-head); letter-spacing: .05em;
}
