/* Colorful Wardrobe.
 *
 * The interface is deliberately monochrome so that the only saturated colour on any
 * page belongs to the season. If the chrome is neutral, the season's colour reads as
 * the answer rather than as decoration.
 *
 * --ground and --ink are set per page from the database. Ink is derived from ground
 * and guaranteed >= 4.5:1 by a database constraint, so no page can render unreadable
 * text no matter what is saved.
 */

:root {
  --ground: #ffffff;
  --ink: #1c1a18;
  --accent-1: #c9c4bc;
  --accent-2: #b3ada4;
  --accent-3: #9c968d;

  --paper: #ffffff;
  --graphite: #1c1a18;
  --muted: #5f5952;
  --rule: #ddd8d1;
  --wash: #f7f5f2;

  --measure: 34rem;
  --gap: clamp(1.5rem, 4vw, 3rem);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--graphite);
  background: var(--paper);
  overflow-wrap: break-word;
}

body.themed { background: var(--ground); color: var(--ink); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p, ul, ol, dl { margin: 0 0 1rem; }
a { color: inherit; }

/* Focus must always be visible — WCAG 2.4.7. Never remove without a replacement. */
:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--graphite); color: var(--paper);
  padding: 0.75rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- chrome -- */

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 1rem var(--gap);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
body.themed .site-header { background: transparent; border-color: rgba(0,0,0,.12); }

.brand {
  font-weight: 700; text-decoration: none; letter-spacing: 0.02em;
  text-transform: uppercase; font-size: 0.95rem;
}
.site-header nav { display: flex; gap: 1.5rem; }
.site-header nav a {
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem;
  font-weight: 600; text-decoration: none; padding: 0.5rem 0;
}
.site-header nav a:hover { text-decoration: underline; }

.site-footer {
  margin-top: 4rem; padding: 2rem var(--gap) 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem; color: var(--muted);
  background: var(--paper);
}
body.themed .site-footer { background: transparent; border-color: rgba(0,0,0,.12); color: inherit; opacity: .8; }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1rem; }
.site-footer a { padding: 0.4rem 0; }
.footer-note { max-width: 44rem; margin: 0 0 .5rem; }

/* --------------------------------------------------------------- content -- */

main { display: block; }

.hero { position: relative; padding: clamp(3rem, 10vw, 7rem) var(--gap); overflow: hidden; }
.hero-media {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  filter: grayscale(1) contrast(1.05); opacity: .18;
}
.hero-inner { position: relative; max-width: 46rem; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: var(--measure); }
body.themed .lede { color: inherit; opacity: .85; }
.hero-meta { font-size: .9rem; color: var(--muted); margin-top: 1rem; }

.band { padding: clamp(2rem, 6vw, 4rem) var(--gap); }
.band > * { max-width: var(--measure); }
.band-alt { background: var(--wash); }
.page-head, .prose, .result, .season-detail, .quiz, .quiz-intro, .quiz-sending {
  padding: clamp(2rem, 6vw, 4rem) var(--gap);
}
.prose { max-width: 42rem; }
.prose h2 { margin-top: 2rem; }
.meta { color: var(--muted); font-size: .9rem; }

.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: .75rem; }

.cta { padding: clamp(2rem, 6vw, 4rem) var(--gap); border-top: 1px solid var(--rule); }

/* --------------------------------------------------------------- buttons -- */

.btn {
  display: inline-block; padding: 0.9rem 1.6rem; margin: 0 .5rem .5rem 0;
  font-size: 0.9rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; border: 1.5px solid currentColor; background: none;
  color: inherit; cursor: pointer; min-height: 44px;
}
.btn-primary { background: var(--graphite); color: var(--paper); border-color: var(--graphite); }
body.themed .btn-primary { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.btn-secondary { background: none; }
.btn-quiet { border-color: var(--rule); font-weight: 600; }
.btn:hover { opacity: .85; }
.linkish {
  background: none; border: 0; padding: .5rem 0; font: inherit; color: inherit;
  text-decoration: underline; cursor: pointer; min-height: 44px;
}

/* ------------------------------------------------------------------ quiz -- */

.prep { padding-left: 1.2rem; max-width: var(--measure); }
.prep li { margin-bottom: .5rem; }
.note { font-size: .9rem; color: var(--muted); max-width: var(--measure); }
.note-strong { border-left: 3px solid currentColor; padding-left: 1rem; color: inherit; }
.quiz-alt { margin-top: 1.5rem; }

.quiz-progress { height: 3px; background: var(--rule); margin-bottom: 1.5rem; }
.quiz-progress-bar { height: 3px; background: var(--graphite); width: 0; transition: width .2s ease; }
.quiz-count { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.q-title { font-size: clamp(1.5rem, 4vw, 2.25rem); max-width: 30rem; }
.q-title:focus { outline: none; }
.q-sub { color: var(--muted); max-width: var(--measure); }
.q-help { margin: 1rem 0; max-width: var(--measure); font-size: .95rem; }
.q-help summary { cursor: pointer; padding: .5rem 0; min-height: 44px; }

.options { list-style: none; padding: 0; margin: 1.5rem 0; max-width: 40rem; }
.options li { margin-bottom: .5rem; }
.option {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 1rem 1.2rem; min-height: 44px;
  border: 1.5px solid var(--rule); background: var(--paper);
  font: inherit; color: inherit;
}
.option:hover { border-color: var(--graphite); }
.option.is-chosen { border-color: var(--graphite); border-width: 2.5px; }
.option.is-chosen .option-label::before { content: "\2713\00a0"; font-weight: 700; }
.option-label { display: block; font-weight: 600; }
.option-examples { display: block; font-size: .9rem; color: var(--muted); margin-top: .25rem; }
.quiz-nav { margin-top: 1rem; }

/* -------------------------------------------------------------- swatches -- */

.swatch-pair { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0; }
.swatch { margin: 0; flex: 1 1 12rem; max-width: 18rem; }
.swatch-chip {
  height: 8rem; border: 1px solid rgba(0,0,0,.28); /* 3:1 boundary — WCAG 1.4.11 */
}
.swatch figcaption { padding-top: .5rem; font-size: .9rem; }
.swatch-name { display: block; font-weight: 600; }
.swatch-hex { display: block; color: var(--muted); font-family: ui-monospace, monospace; font-size: .8rem; }

.palette-strip { display: flex; height: 4.5rem; margin: 1.5rem 0; max-width: 34rem; }
.palette-strip span { flex: 1; }

/* ---------------------------------------------------------------- result -- */

.result-band {
  text-transform: uppercase; letter-spacing: .12em; font-size: .75rem;
  font-weight: 700; margin-bottom: .5rem;
}
.result h1 { max-width: 24rem; }
.runner-up { font-size: 1rem; opacity: .8; }
.result-formula { font-size: .95rem; opacity: .85; max-width: var(--measure); }
.offer { margin: 3rem 0; padding-top: 2rem; border-top: 1px solid currentColor; }
.offer-grid { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.offer-card { flex: 1 1 18rem; border: 1.5px solid currentColor; padding: 1.5rem; }
.offer-aside { font-size: .95rem; margin-top: 1rem; }
.traits { margin-top: 3rem; }
.trait { margin-bottom: 2rem; }
.trait ul { padding-left: 1.2rem; max-width: var(--measure); }
.permalink code { font-size: .85rem; word-break: break-all; }
.share, .prior { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid currentColor; }

/* --------------------------------------------------------------- seasons -- */

.season-grid {
  list-style: none; padding: 0 var(--gap) 3rem; margin: 0;
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}
.season-card a {
  display: block; padding: 1.5rem; text-decoration: none; height: 100%;
  background: var(--ground); color: var(--ink); border: 1px solid rgba(0,0,0,.12);
}
.season-name { display: block; font-weight: 700; font-size: 1.2rem; }
.season-formula { display: block; font-size: .85rem; opacity: .8; margin-bottom: 1rem; }
.season-strip { display: flex; height: 2.5rem; }
.season-strip span { flex: 1; }

.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; }
.formula { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin: 2rem 0; }
/* No opacity here. The database guarantees ink against ground at >= 4.5:1, but any
 * opacity applied afterwards silently undoes that guarantee — this exact rule was
 * caught failing contrast at 0.7 by the real-browser check. Hierarchy comes from
 * size, casing and letter-spacing instead, which cost no contrast at all. */
.formula dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.formula dd { margin: 0; font-weight: 600; }

/* ----------------------------------------------------------------- flash -- */

.flash { padding: 1rem 1.25rem; border-left: 3px solid currentColor; margin: 0 0 1.5rem; max-width: 44rem; }
.flash-error { background: #fdf0f0; color: #7a1c22; }
.flash-ok { background: #eef6ef; color: #1f5128; }
.flash-warn { background: #fdf6e6; color: #6b4c10; }

/* --------------------------------------------------------------- reflow --- */
/* Content must reflow at 320px with no horizontal scrolling (WCAG 1.4.10). */

@media (max-width: 30rem) {
  :root { --gap: 1.25rem; }
  .site-header { flex-direction: column; align-items: flex-start; }
  .btn { width: 100%; margin-right: 0; text-align: center; }
  .swatch { flex: 1 1 100%; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------- close-call offer ------- */
/* Two pairs, not four choices. The visitor answers "which of these two am I?"
 * and, only if they want, "how do I find out for certain?" — two easy decisions
 * instead of one hard four-way one. Built mobile-first: most of this traffic
 * arrives on a phone, much of it inside the Instagram in-app browser. */

.offer-lead {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .1em;
  margin: 2rem 0 .75rem; opacity: .75;
}

.pick-pair { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .pick-pair { grid-template-columns: 1fr 1fr; } }

.pick { border: 1.5px solid currentColor; padding: 1.25rem; display: flex; flex-direction: column; }
.pick h3 { margin-bottom: .5rem; }
.pick-strip { display: flex; height: 2rem; margin-bottom: .75rem; }
.pick-strip span { flex: 1; }
.pick-tell { font-size: .95rem; opacity: .85; flex: 1; }
.pick .btn { width: 100%; text-align: center; margin: 0; }

.settle { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .settle { grid-template-columns: 1fr 1fr; } }
.settle-item { border: 1px solid currentColor; padding: 1.25rem; }
.settle-item h4 { margin: 0 0 .4rem; font-size: 1rem; }
.settle-item p { font-size: .95rem; opacity: .85; }

/* Progressive disclosure without JavaScript. <details> is keyboard operable and
 * screen-reader announced for free, and keeps the page short on a phone. */
.intake summary { cursor: pointer; width: 100%; text-align: center; }
.intake summary::-webkit-details-marker { display: none; }
.intake summary { list-style: none; }
.intake[open] summary { margin-bottom: 1rem; }
.intake-form { border-top: 1px solid currentColor; padding-top: 1rem; }
.intake-why { font-size: .95rem; opacity: .85; }
.intake-form label { display: block; font-weight: 600; margin: .75rem 0 .25rem; font-size: .95rem; }
.intake-form input, .intake-form select {
  width: 100%; padding: .85rem; border: 1.5px solid currentColor;
  background: var(--paper); color: inherit; border-radius: 0;
  /* 16px minimum: below this, iOS Safari zooms the page on focus and the visitor
   * has to pinch back out — a common and very visible mobile defect. */
  font-size: 16px; min-height: 48px;
}
body.themed .intake-form input, body.themed .intake-form select { background: rgba(255,255,255,.55); }
.intake-form .btn { width: 100%; margin-top: 1rem; }
/* NO opacity. The database guarantees ink against ground at >= 4.5:1, and any
 * opacity applied afterwards silently undoes that guarantee — this exact rule was
 * caught at 4.2:1 by the real-browser check. Weight and case carry the de-emphasis
 * instead, which costs no contrast at all. This is the second time this trap has
 * been hit; treat `opacity` on text as a contrast bug by default. */
.optional { font-weight: 400; text-transform: lowercase; font-size: .9em; }
.intake-note { font-size: .82rem; opacity: .75; margin-top: .75rem; }
.intake-done { border-top: 1px solid currentColor; padding-top: 1rem; }
.intake-thanks { font-weight: 600; }
.intake-done .btn { width: 100%; text-align: center; }
