:root {
  color-scheme: dark;
  --background: #111319;
  --red: #e50914;
  --text: #f7f7f5;
  --muted: #9ca0aa;
  /* Secondary accent (design review, 2026-07-28): used sparingly against the
     red — the verdict pull-quote mark and the archetype-match caption. */
  --gold: #d9a441;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--background);
  font-family: "DM Sans", system-ui, sans-serif;
}

.page-shell { width: min(100%, 1180px); margin: 0 auto; padding: clamp(48px, 7vh, 82px) 30px 28px; }
.masthead { max-width: 920px; margin: 0 auto; text-align: center; }
.eyebrow, footer, .year, .count { font-family: "DM Mono", monospace; letter-spacing: .04em; }
.eyebrow { margin: 0 0 26px; color: var(--red); font-size: .66rem; text-transform: uppercase; }
h1 { margin: 0; font-family: "Google Sans Flex", "DM Sans", system-ui, sans-serif; font-size: clamp(2.45rem, 5.3vw, 5rem); line-height: .96; letter-spacing: -.058em; font-weight: 400; }
h1 span, h1 strong { display: block; }
h1 span { color: #a5413c; font-variation-settings: "opsz" 72, "wdth" 91, "GRAD" -35; font-weight: 300; }
h1 strong { margin-top: 5px; color: var(--red); font-variation-settings: "opsz" 72, "wdth" 91, "GRAD" 0; font-weight: 750; }
.divider { width: 42px; height: 1px; margin: clamp(38px, 6vh, 62px) auto clamp(34px, 5vh, 52px); background: var(--text); opacity: .8; }
.intro { max-width: 780px; margin: 0 auto; color: #d6d7dc; font-family: "Google Sans Flex", "DM Sans", system-ui, sans-serif; font-size: clamp(1rem, 1.55vw, 1.33rem); font-variation-settings: "opsz" 24, "wdth" 96, "GRAD" -15; font-weight: 390; line-height: 1.38; }
.tools { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }
.upload-button, .download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 37px;
  padding: 0 15px;
  border: 1px solid rgba(247,247,245,.3);
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  font: 500 .72rem "DM Mono", monospace;
  letter-spacing: .02em;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.upload-button:hover, .download-button:hover { border-color: var(--red); background: rgba(229,9,20,.1); }
.download-button:disabled { cursor: wait; opacity: .55; }
.upload-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.privacy-badge {
  display: inline-flex;
  align-items: center;
  margin: 14px 0 0;
  padding: 4px 12px;
  border: 1px solid rgba(247,247,245,.16);
  border-radius: 999px;
  color: var(--muted);
  font: 500 .62rem "DM Mono", monospace;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.data-source { min-height: 1.2em; margin: 10px 0 0; color: var(--muted); font: .64rem "DM Mono", monospace; }
.csv-help { max-width: 560px; margin: 21px auto 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.csv-help strong { display: block; margin-bottom: 3px; color: var(--text); font: 500 .7rem "DM Mono", monospace; letter-spacing: .02em; }
.csv-help a { color: var(--text); text-decoration-color: var(--red); text-underline-offset: 3px; }
.csv-help a:hover { color: var(--red); }
.visualization { position: relative; margin-top: 5px; }
#chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: hidden;
  contain: layout paint;
}
.status { padding: 80px 0; color: var(--muted); font-family: "DM Mono", monospace; font-size: .85rem; }
.error { color: #ff807f; line-height: 1.5; }
footer { display: flex; justify-content: space-between; gap: 16px; padding-top: 25px; color: var(--muted); font-size: .67rem; text-transform: uppercase; }

/* Stroke width/opacity tuned to survive WhatsApp/Slack's JPEG re-encode of
   shared images: a thin, low-opacity red line on near-black is almost pure
   chroma with no luminance contrast, and JPEG throws away far more color
   detail than brightness detail (4:2:0 chroma subsampling) — so this was the
   first thing to disappear on mobile. Thicker + more opaque gives it enough
   luminance signal to survive re-compression. */
/* Base appearance only — the scroll-in reveal (armRevealAnimation in
   script.js) drives stroke-dasharray/dashoffset and opacity via inline
   styles once the chart enters the viewport. These rules are what's
   visible before JS runs and what a no-JS/no-IntersectionObserver browser
   falls back to. */
.connector { fill: none; stroke: var(--red); stroke-width: 1.15; stroke-linecap: round; opacity: .32; }
.dot { fill: var(--text); opacity: .8; cursor: crosshair; }
.bar { fill: var(--red); }
.year { fill: var(--muted); font-size: 12px; text-anchor: middle; }
.count { fill: var(--text); font-size: 15px; font-weight: 500; text-anchor: middle; }
.dot:focus { outline: none; stroke: var(--text); stroke-width: 2px; }
.tooltip { position: absolute; z-index: 2; max-width: 250px; padding: 9px 11px; color: var(--background); background: var(--text); border-radius: 3px; font-size: .76rem; line-height: 1.35; pointer-events: none; }

.report { margin-top: 48px; padding-top: 36px; border-top: 1px solid rgba(247,247,245,.08); }

.tone-toggle { display: flex; justify-content: center; gap: 8px; margin: 22px 0 40px; }
.tone-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid rgba(247,247,245,.3);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 500 .7rem "DM Mono", monospace;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.tone-button:hover { border-color: var(--red); }
.tone-button[aria-pressed="true"] { border-color: var(--red); color: var(--text); background: rgba(229,9,20,.12); }

/* Hero verdict card: persona score on the left, headline + supporting line on the right. */
.verdict-hero {
  position: relative;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: center;
  padding: 34px 40px;
  border: 1px solid rgba(229,9,20,.3);
  border-radius: 20px;
  background: radial-gradient(120% 140% at 15% 0%, rgba(229,9,20,.08), rgba(247,247,245,.02) 60%);
  overflow: hidden;
}
.corner-spark { position: absolute; top: 18px; right: 22px; color: var(--red); font-size: .85rem; opacity: .8; }
/* Faint Netflix "N" watermark (design review, round 2 + Zair's logo ask):
   recolored via currentColor/--muted rather than the official brand red —
   a nod to what the tool is for, not a claim of affiliation. Kept out of
   the tab order and off assistive tech via aria-hidden. */
.hero-watermark {
  position: absolute;
  right: 24px;
  bottom: 18px;
  width: 90px;
  height: auto;
  color: var(--muted);
  fill: currentColor;
  /* Lowered from .07 (design review, round 3: "my eye catches it before it
     should — it should be something users notice on the second look"). */
  opacity: .045;
  pointer-events: none;
}
.disclaimer { margin: 10px 0 0; color: var(--muted); font-size: .62rem; text-align: center; opacity: .7; }
.persona-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding-right: 32px;
  border-right: 1px solid rgba(247,247,245,.14);
}
.persona-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  margin-bottom: 6px;
  border: 1px solid rgba(229,9,20,.4);
  border-radius: 999px;
  font-size: 1.7rem;
  background: rgba(229,9,20,.08);
}
.persona-label { margin: 0; color: var(--muted); font: 500 .62rem "DM Mono", monospace; letter-spacing: .06em; text-transform: uppercase; }
/* Persona name renders as dots (buildDotMatrixSvg) — same visual language
   as the chart above it — instead of plain type. The raw composite score
   used to headline as a bare, meaningless-looking "68%"; it's now a small,
   honestly-labeled caption in the gold accent, underneath the name. */
/* Margins bumped (design review, round 3: "give it 10-15px more breathing
   room") — was 10px/12px, now 18px/20px (on top of .persona-face's own
   6px flex gap). */
.persona-name-dots { margin: 18px 0 0; line-height: 0; }
.persona-name-dots svg { display: block; margin: 0 auto; }
.persona-score { margin: 20px 0 0; color: var(--gold); font: 500 .68rem "DM Mono", monospace; letter-spacing: .03em; }
/* Closest archetypes (design review, 2026-07-30, item 5): a graded read
   under the hard "You Are" label — computed purely from the visitor's own
   real stats via closestArchetypes() in script.js, no cross-visitor data. */
.archetype-affinities { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.affinities-label { margin: 0 0 4px; color: var(--muted); font: 500 .58rem "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.affinity-row { margin: 0; font-family: "Google Sans Flex", "DM Sans", system-ui, sans-serif; font-size: .78rem; }
.affinity-pct { color: var(--red); font-weight: 600; margin-right: 5px; }
.affinity-name { color: var(--muted); }
/* Link to the new Archetype Collection page (archetypes.html) — live page
   only, never part of the poster export (buildPosterReportSvg builds its
   own hero card independently and never touches this element). */
.archetype-catalog-link { display: inline-block; margin-top: 14px; color: var(--muted); font: 500 .64rem "DM Mono", monospace; letter-spacing: .03em; text-decoration: none; border-bottom: 1px solid rgba(247,247,245,.3); }
.archetype-catalog-link:hover { color: var(--text); border-color: var(--red); }

.verdict-face { min-width: 0; }
.verdict-kicker-label { margin: 0 0 10px; color: var(--red); font: 500 .64rem "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
/* Observation line (design review, items 4 & 7): a plain, tone-neutral fact
   shown before the pull-quote, so the verdict reads Observation → Roast/
   Compliment instead of one flat paragraph. */
.verdict-observation { margin: 0 0 12px; padding-left: 30px; color: var(--muted); font-family: "Google Sans Flex", "DM Sans", system-ui, sans-serif; font-size: .82rem; }
/* Pull-quote treatment (design review): quieter than the old boxed "AI
   VERDICT" eyebrow label, more whitespace, a large gold quote mark instead
   of a mono tag. <blockquote> renders as a plain block by default, so reset
   its margins before applying the quote styling. */
.verdict-headline {
  position: relative;
  margin: 0;
  padding-left: 30px;
  color: var(--text);
  font-family: "Google Sans Flex", "DM Sans", system-ui, sans-serif;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -.01em;
}
.verdict-headline::before {
  content: "\201C";
  position: absolute;
  left: -6px;
  top: -.28em;
  /* Recolored gold->off-white, low opacity (design review, round 3: gold
     here "introduces a third accent color" competing with the red kicker
     text right below it — off-white keeps the mark quiet and is the
     standard neutral color for a pull-quote glyph anyway). Gold stays
     elsewhere (persona-score, legendary achievement tier) where it's the
     only accent in view. */
  color: var(--text);
  opacity: .32;
  /* Same font stack as the headline itself, deliberately — see the poster
     export's equivalent quote mark comment for why. */
  font-family: "Google Sans Flex", "DM Sans", system-ui, sans-serif;
  font-size: 2.3em;
  font-weight: 700;
}
.verdict-headline .kicker { color: var(--red); font-weight: 750; }
.verdict-sub { margin: 18px 0 0; padding-left: 30px; max-width: 560px; color: #c8c9ce; font-family: "Google Sans Flex", "DM Sans", system-ui, sans-serif; font-size: .92rem; font-weight: 390; line-height: 1.5; }

/* Section headers: small red label between two rule lines. */
.section-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 40px 0 20px;
  color: var(--red);
  font: 500 .68rem "DM Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
}
.section-heading::before, .section-heading::after { content: ""; flex: 1; height: 1px; background: rgba(247,247,245,.14); }

/* DNA cards: icon-over-value, spaced apart rather than boxed together. */
.dna-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; }
.dna-card { display: flex; flex-direction: column; align-items: center; text-align: center; width: 190px; }
/* Apple-Fitness-style progress ring (design review, round 2) wraps each
   icon — a quiet secondary cue behind the (now dominant) number. Replaces
   the old plain bordered-circle icon. */
.dna-icon-wrap { position: relative; width: 52px; height: 52px; margin-bottom: 10px; }
.dna-ring { position: absolute; inset: 0; }
.dna-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}
/* Lead with the number (design review): value renders first in markup,
   bigger, so it's the thing people scan first — label is now the smaller
   supporting caption underneath it. */
.dna-value { margin-top: 6px; color: var(--red); font: 500 1.55rem "DM Mono", monospace; }
.dna-label { margin-top: 3px; color: var(--muted); font: 500 .58rem "DM Mono", monospace; letter-spacing: .05em; text-transform: uppercase; }
.dna-meta { margin-top: 4px; color: var(--muted); font-size: .72rem; line-height: 1.35; }
.dna-card .card-bar { margin-top: 8px; width: 100%; height: 3px; border-radius: 999px; background: rgba(247,247,245,.12); overflow: hidden; }
.dna-card .card-bar span { display: block; height: 100%; background: var(--red); }

/* Achievement cards: full bordered boxes with icon, title, description. */
/* grid-template-columns is set inline per-render by script.js (paintReport),
   row-balanced to match the poster's layout — see the comment there.
   justify-content centers that (now fixed-width) track set instead of
   stretching it edge-to-edge, so a shorter last row sits centered rather
   than stranded on the left with dead space to its right. */
.achievement-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); justify-content: center; gap: 14px; }
.achievement-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 26px 18px 22px;
  border: 1px solid rgba(229,9,20,.28);
  border-radius: 16px;
  background: rgba(229,9,20,.04);
}
.achievement-card.placeholder { border-color: rgba(247,247,245,.16); background: transparent; }
/* Rarity tier label (design review, round 2): Common/Rare/Epic/Legendary,
   colored inline per-achievement via JS (RARITY in script.js) since the
   color varies per instance, not per class. */
.achievement-tier { font: 500 .58rem "DM Mono", monospace; letter-spacing: .08em; }
/* Moved to the top-right corner (design review, round 3: "it feels more
   like a collectible trading card" in the corner than centered above the
   icon). Taken out of the card's flex flow so the icon/title/text below
   are unaffected. */
.achievement-tier.corner { position: absolute; top: 16px; right: 18px; }
.achievement-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-top: 4px;
  border: 1px solid rgba(229,9,20,.4);
  border-radius: 999px;
  font-size: 1.15rem;
  background: rgba(229,9,20,.08);
}
.achievement-card.placeholder .achievement-icon { border-color: rgba(247,247,245,.2); background: transparent; }
.achievement-title { color: var(--text); font: 500 .68rem "DM Mono", monospace; letter-spacing: .04em; }
.achievement-text { color: var(--muted); font-size: .76rem; line-height: 1.4; }
.achievement-card::after { content: "✦"; margin-top: 2px; color: var(--red); font-size: .7rem; opacity: .7; }
.achievement-card.placeholder::after { color: var(--muted); }

@media (max-width: 700px) {
  .verdict-hero { grid-template-columns: 1fr; text-align: center; padding: 28px 24px; }
  .persona-face { padding-right: 0; padding-bottom: 22px; border-right: none; border-bottom: 1px solid rgba(247,247,245,.14); }
  .verdict-headline, .verdict-sub, .verdict-observation { padding-left: 0; }
  .verdict-headline::before { position: static; display: block; margin-bottom: 4px; }
  .verdict-sub { margin-inline: auto; }
}

@media (max-width: 620px) { .page-shell { padding: 48px 18px 22px; } h1 { font-size: clamp(2.3rem, 12vw, 3.3rem); } .intro { font-size: .98rem; } .tools { margin-top: 20px; } footer { flex-direction: column; gap: 8px; }
  /* Achievement grid column count is set inline per-render by script.js
     (repeat(N, minmax(200px, 240px))) for desktop row-balancing. That fixed
     200px-per-column minimum doesn't fit two-up on phone widths (needs
     ~450px+ viewport) and was causing horizontal page scroll on mobile.
     Force single column below this breakpoint — !important is required to
     beat the inline style script.js sets on the element. */
  .achievement-grid { grid-template-columns: 1fr !important; }
}

/* ---- Archetype Collection page (archetypes.html) ----
   Design review (2026-07-30): "the archetype becomes the story" — a static
   catalog of all 18 archetypes, personality-test-style. Fixed at 3 columns
   (18 divides evenly into 6 full rows, so — unlike the achievement grid —
   there's no uneven last row to balance) with justify-content centering the
   track set on very wide viewports. */
.archetype-catalog { margin-top: 48px; padding-top: 36px; border-top: 1px solid rgba(247,247,245,.08); }
.archetype-grid { display: grid; grid-template-columns: repeat(3, minmax(240px, 320px)); justify-content: center; gap: 18px; }
.archetype-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 30px 22px 26px;
  border: 1px solid rgba(229,9,20,.28);
  border-radius: 18px;
  background: rgba(229,9,20,.04);
}
.archetype-number { color: var(--gold); font: 500 .62rem "DM Mono", monospace; letter-spacing: .08em; }
.archetype-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-top: 6px;
  border: 1px solid rgba(229,9,20,.4);
  border-radius: 999px;
  font-size: 1.5rem;
  background: rgba(229,9,20,.08);
}
.archetype-name-dots { margin-top: 8px; line-height: 0; }
.archetype-name-dots svg { display: block; margin: 0 auto; }
.archetype-trigger { margin: 10px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.archetype-line { margin: 8px 0 0; color: #c8c9ce; font-family: "Google Sans Flex", "DM Sans", system-ui, sans-serif; font-size: .82rem; font-style: italic; line-height: 1.4; }

@media (max-width: 900px) { .archetype-grid { grid-template-columns: repeat(2, minmax(220px, 320px)); } }
@media (max-width: 620px) { .archetype-grid { grid-template-columns: minmax(0, 340px); } }
