/* Self-hosted display face (CSP blocks font CDNs by design — privacy).
   Playfair Display, latin subset, "Classic Elegant" pairing for
   beauty/fashion per the ui-ux-pro-max design database. */
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/playfair-600.woff2") format("woff2");
}
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/playfair-700.woff2") format("woff2");
}
@font-face {
  font-family: "Playfair Display";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/playfair-600-italic.woff2") format("woff2");
}

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f3ede3;
  --border: #e6dccc;
  --text: #2c2126;
  --text-muted: #75696e;
  --brand: #a4325f;
  --brand-dark: #86234a;
  --brand-contrast: #ffffff;
  --brand-soft: #f7e4ec;
  --accent: #2f7a6b;
  --accent-soft: #e0f0ec;
  --sun: #e0a92f;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(60, 20, 40, 0.07), 0 10px 28px rgba(60, 20, 40, 0.07);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171114;
    --surface: #211a1e;
    --surface-2: #2a2127;
    --border: #3c3037;
    --text: #f0e7ec;
    --text-muted: #a8969f;
    --brand: #d65f92;
    --brand-dark: #a4325f;
    --brand-soft: #3a2230;
    --accent: #4bb99d;
    --accent-soft: #1c332d;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.45), 0 10px 28px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
section, #result, #season-detail { scroll-margin-top: 76px; }

/* Keyboard focus: visible ring on every interactive element */
:focus-visible {
  outline: 2.5px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}
.swatch.clickable:focus-visible { outline-offset: 1px; }

/* Skip link for keyboard/screen-reader users */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: var(--brand-contrast);
  padding: 10px 18px; border-radius: 0 0 10px 0; font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* Scroll-reveal: sections fade-rise once as they enter the viewport.
   Applied only when JS adds .reveal, so no-JS users see everything. */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.45s ease, transform 0.45s ease; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* Inline SVG icons inherit text color and align to text */
.icon { width: 1.05em; height: 1.05em; vertical-align: -0.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, .result-season { font-family: var(--display); font-weight: 700; }

.container { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px; gap: 16px;
}
.logo { font-weight: 800; font-size: 1.25rem; text-decoration: none; color: var(--text); }
.logo span { color: var(--brand); }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
.nav a:hover { color: var(--text); }
.nav .nav-cta {
  background: var(--brand); color: var(--brand-contrast);
  padding: 8px 16px; border-radius: 999px; font-weight: 700;
}
.nav .nav-cta:hover { background: var(--brand-dark); color: var(--brand-contrast); }

/* Sections */
section { padding: 64px 0; }
section.alt { background: var(--surface-2); }
.section-title { font-size: 1.9rem; line-height: 1.25; margin-bottom: 10px; }
.section-sub { color: var(--text-muted); max-width: 680px; margin-bottom: 32px; }

/* Hero */
.hero { padding: 64px 0 56px; text-align: center; }
.hero-swatches { display: flex; justify-content: center; gap: 6px; margin-bottom: 26px; }
.hero-swatches span {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--surface); box-shadow: var(--shadow);
}
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.18; max-width: 860px; margin: 0 auto 18px; letter-spacing: -0.01em; text-wrap: balance; }
.hero h1 em { font-style: italic; color: var(--brand); }
.hero .sub { color: var(--text-muted); max-width: 660px; margin: 0 auto 28px; font-size: 1.08rem; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.badge-row {
  display: flex; gap: 10px 22px; justify-content: center; flex-wrap: wrap;
  margin-top: 26px; color: var(--text-muted); font-size: 0.9rem;
}
.badge-row span::before { content: "✓ "; color: var(--accent); font-weight: 700; }

/* Buttons */
.btn {
  display: inline-block; padding: 13px 26px; border: none; border-radius: 999px;
  background: var(--brand); color: var(--brand-contrast);
  font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn.secondary {
  background: var(--surface); color: var(--text);
  border: 1.5px solid var(--border);
}
.btn.secondary:hover { background: var(--surface-2); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.step {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.step .num {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; background: var(--brand); color: var(--brand-contrast);
  font-weight: 800; margin-bottom: 12px;
}
.step h3 { margin-bottom: 6px; font-size: 1.05rem; }
.step p { color: var(--text-muted); font-size: 0.95rem; }

/* Quiz */
.quiz-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow);
  max-width: 720px; margin: 0 auto;
}
.quiz-progress {
  height: 6px; border-radius: 999px; background: var(--surface-2);
  overflow: hidden; margin-bottom: 22px;
}
.quiz-progress-bar {
  height: 100%; width: 0; background: var(--brand);
  transition: width 0.25s ease;
}
.quiz-count { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.quiz-q { font-size: 1.25rem; line-height: 1.35; margin-bottom: 18px; }
.quiz-answers { display: flex; flex-direction: column; gap: 10px; }
.quiz-answer {
  text-align: left; padding: 13px 18px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 0.98rem; transition: all 0.12s ease;
}
.quiz-answer:hover { border-color: var(--brand); background: var(--brand-soft); }
.quiz-answer.selected { border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.quiz-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }
.quiz-nav .btn { padding: 9px 18px; font-size: 0.9rem; }

/* Result / season detail */
.result-card {
  background: var(--surface); border: 1.5px solid var(--brand);
  border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow);
  max-width: 760px; margin: 26px auto 0;
}
.result-eyebrow { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }
.result-season { font-size: 2.2rem; line-height: 1.15; }
.result-tagline { color: var(--text-muted); font-style: italic; margin-bottom: 14px; }
.result-traits { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-bottom: 16px; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); }
.result-desc { margin-bottom: 16px; }
.result-card h4 { margin: 18px 0 8px; font-size: 0.9rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.result-second {
  margin-top: 16px; padding: 12px 16px; border-radius: 10px;
  background: var(--surface-2); font-size: 0.95rem;
}
.result-ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.signs { list-style: none; }
.signs li { padding: 4px 0 4px 24px; position: relative; font-size: 0.95rem; }
.signs li::before { content: "✓"; position: absolute; left: 2px; color: var(--accent); font-weight: 800; }

/* Swatches */
.swatch-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
  width: 30px; height: 30px; border-radius: 8px; display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.12); cursor: default;
}
.swatch-strip.big .swatch { width: 38px; height: 38px; }
.swatch.clickable { cursor: pointer; transition: transform 0.1s ease; border: none; }
.swatch.clickable:hover { transform: scale(1.15); }

/* Season grid */
.season-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.season-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  text-align: left; cursor: pointer; transition: border-color 0.12s ease, transform 0.12s ease;
}
.season-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.season-fam { font-size: 0.76rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); }
.season-card h3 { font-family: var(--display); font-size: 1.2rem; margin: 2px 0 10px; }
.season-card .swatch-strip { margin-bottom: 10px; }
.season-card p { color: var(--text-muted); font-size: 0.88rem; font-style: italic; }

/* Mirror */
.mirror-wrap { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 30px; align-items: start; }
.mirror-stage { position: sticky; top: 80px; }
.mirror-drape {
  background: var(--surface-2); border-radius: var(--radius);
  padding: 48px; transition: background 0.25s ease; box-shadow: var(--shadow);
}
.mirror-photo-holder {
  width: 100%; min-height: 220px; border-radius: 12px; overflow: hidden;
  background: var(--surface); display: flex; align-items: center; justify-content: center;
}
.mirror-photo-holder canvas { max-width: 100%; height: auto; display: block; cursor: crosshair; }
.mirror-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.mirror-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; text-align: center; color: var(--text-muted);
  font-size: 0.95rem; padding: 28px 20px;
}
.mirror-placeholder small { font-size: 0.8rem; }
.mirror-illustration { width: 96px; height: 96px; margin: 0 auto 10px; display: block; color: var(--border); }
.mirror-color-name { text-align: center; margin-top: 12px; color: var(--text-muted); font-size: 0.92rem; min-height: 1.5em; }
.mirror-controls { display: flex; flex-direction: column; gap: 18px; }
.file-btn { display: inline-block; width: fit-content; }
.mirror-season-label { font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mirror-season-label select, .kit-select-label select {
  padding: 9px 14px; border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer;
}
.mirror-group h4 { font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch-row .swatch { width: 40px; height: 40px; }
@media (pointer: coarse) {
  /* finger-sized targets on touch devices */
  .swatch-row .swatch { width: 44px; height: 44px; }
}
.mirror-hint { color: var(--text-muted); font-size: 0.9rem; }

/* Products */
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; max-width: 860px; margin: 0 auto; }
.product-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.product-card.featured { border-color: var(--brand); position: relative; }
.product-card .flag {
  position: absolute; top: -13px; left: 20px;
  background: var(--sun); color: #3a2a00; font-size: 0.78rem; font-weight: 800;
  padding: 3px 12px; border-radius: 999px;
}
.product-card h3 { font-size: 1.15rem; margin-bottom: 4px; }
.product-card .price { font-size: 1.7rem; font-weight: 800; color: var(--brand); margin-bottom: 14px; }
.product-card .price small { font-size: 0.95rem; color: var(--text-muted); font-weight: 500; }
.product-card ul { list-style: none; margin-bottom: 20px; flex: 1; }
.product-card li { padding: 5px 0 5px 24px; position: relative; font-size: 0.94rem; }
.product-card li::before { content: "✓"; position: absolute; left: 2px; color: var(--accent); font-weight: 800; }
.product-card .btn { width: 100%; text-align: center; }
.kit-select-label { font-weight: 600; font-size: 0.95rem; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.kit-note { text-align: center; color: var(--text-muted); font-size: 0.92rem; margin-top: 20px; }

/* FAQ */
.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px;
}
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin-top: 10px; color: var(--text-muted); }
.faq details[open] p { animation: faq-open 0.25s ease; }
@keyframes faq-open { from { opacity: 0; transform: translateY(-4px); } }

/* Quiz step change: content slides in gently */
#quiz-body.step-in { animation: step-in 0.22s ease; }
@keyframes step-in { from { opacity: 0; transform: translateX(12px); } }

/* Season browser: family group labels spanning the grid */
.season-fam-header {
  grid-column: 1 / -1; margin-top: 10px;
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
  display: flex; align-items: center; gap: 12px;
}
.season-fam-header::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border); padding: 40px 0 24px;
  color: var(--text-muted); font-size: 0.9rem;
}
.site-footer a { color: var(--text-muted); }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1.4fr; gap: 28px;
  padding-bottom: 24px;
}
.footer-col { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.footer-col h4 {
  font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text); margin-bottom: 4px;
}
.footer-brand .logo { font-size: 1.1rem; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { color: var(--text); text-decoration: underline; }
.footer-legal { border-top: 1px solid var(--border); padding-top: 16px; text-align: center; font-size: 0.82rem; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 12px 22px;
  border-radius: 999px; font-size: 0.92rem; box-shadow: var(--shadow); z-index: 50;
}

@media (max-width: 760px) {
  section { padding: 44px 0; }
  .hero { padding: 48px 0 40px; }
  .nav a:not(.nav-cta) { display: none; }
  .mirror-wrap { grid-template-columns: 1fr; }
  .mirror-stage { position: static; }
  .hero-swatches span { width: 20px; height: 20px; }
}
