/* =========================================================
   Scenta — styles
   Mobile-first, RTL. Palette: ink navy & saffron.
   Type: Secular One (display) · Rubik (text).
   Light is the default; <html data-theme="dark"> switches to dark.
   Raw colors live here; everything else is derived below.
   --gold is the accent (name kept for history); --on-accent is text on it.
   ========================================================= */

/* ---------- Light (default) ---------- */
:root {
  --bg: #f5f6fa; --bg-raised: #eaedf5; --surface: #ffffff; --surface-hover: #f1f3f9;
  --text: #0f1426; --muted: #525b78; --faint: #8f96ad;
  --gold: #b36400; --gold-strong: #cf7600; --on-accent: #ffffff;
  --ok: #2f7a3a; --warn: #a3620b;
  --scrim: rgba(15, 20, 38, 0.35); --shadow: 0 18px 40px rgba(15, 20, 38, 0.12);
  color-scheme: light;
}

/* ---------- Dark ---------- */
:root[data-theme='dark'] {
  --bg: #0a0e19; --bg-raised: #101627; --surface: #151c30; --surface-hover: #1b2440;
  --text: #f1f3fa; --muted: #a3abc4; --faint: #646d88;
  --gold: #ffb020; --gold-strong: #ffc452; --on-accent: #1a1000;
  --ok: #8fca8a; --warn: #ffc452;
  --scrim: rgba(3, 5, 12, 0.66); --shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* ---------- Type ---------- */
:root {
  --display: 'Secular One', 'Rubik', sans-serif;
  --display-weight: 400;
  --display-scale: 0.76; /* Secular One is wide; keeps headlines to two lines */
  --sans: 'Rubik', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}

/* ---------- Derived tokens (follow light / dark) ---------- */
:root {
  --line: color-mix(in srgb, var(--text) 10%, transparent);
  --line-strong: color-mix(in srgb, var(--text) 22%, transparent);
  --gold-soft: color-mix(in srgb, var(--gold) 12%, transparent);
  --gold-line: color-mix(in srgb, var(--gold) 50%, transparent);
  --sheen: color-mix(in srgb, var(--gold) 11%, transparent);
  --header-bg: color-mix(in srgb, var(--bg) 93%, transparent);

  --radius: 4px;
  --radius-lg: 8px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: 16px;
  --max: 1180px;
}

/* smooth light/dark switch (not on first paint) */
html.theme-anim body,
html.theme-anim body *:not(.liquid):not(.wave) {
  transition: background-color 0.45s var(--ease), color 0.45s var(--ease), border-color 0.45s var(--ease), fill 0.45s var(--ease), stroke 0.45s var(--ease) !important;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main { flex: 1; }

h1, h2, h3, h4 { margin: 0; font-weight: 400; }
h1, h2, h3 { font-weight: var(--display-weight); }
p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: inherit; }
svg { display: block; }

:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }
::selection { background: var(--gold); color: var(--on-accent); }

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
@media (min-width: 760px) { :root { --gutter: 32px; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.header-actions { margin-inline-start: auto; }
@media (min-width: 760px) { .header-inner { gap: 44px; } }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 11px; height: 11px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  position: relative;
}
.brand-mark::after {
  content: ''; position: absolute; inset: 3px;
  background: var(--gold); border-radius: 50%;
  animation: breathe 3.2s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(0.45); opacity: 0.6; } }

.brand-word {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.4em;
  direction: ltr; /* logo wordmark only */
  margin-inline-end: -0.4em;
}
.brand-word.small { font-size: 12px; color: var(--muted); font-weight: 600; }

.header-nav { display: flex; align-items: center; gap: 20px; }
.nav-link {
  position: relative;
  font-size: 15px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.nav-link::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: -3px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { transform: scaleX(1); }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 26px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.3s var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

/* fill sweep on hover */
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--gold-strong);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease-out);
}
.btn:hover::before { transform: scaleX(1); }
.btn-ghost::before { background: var(--text); }
.btn-ghost:hover { color: var(--bg); border-color: var(--text); }

.btn-primary { background: var(--text); color: var(--bg); }
.btn-ghost { border-color: var(--line-strong); background: transparent; }
.btn-gold { background: var(--gold); color: var(--on-accent); }
.btn-gold:hover { color: var(--bg); }
.btn-primary:hover { color: var(--on-accent); }
.btn-gold::before { background: var(--text); }

.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; }

.btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.btn[disabled]::before { display: none; }

.btn-arrow {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.35s var(--ease-out);
}
.btn:hover .btn-arrow { transform: translateX(-5px); }

.btn-magnetic { transition: transform 0.4s var(--ease-out), background-color 0.25s var(--ease); }

.link-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 6px 0;
  color: var(--muted); font-size: 15px; cursor: pointer;
  transition: color 0.2s var(--ease);
}
.link-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s var(--ease-out); }
.link-btn:hover { color: var(--text); }
.link-btn:hover svg { transform: translateX(4px); }

/* ---------- Views & reveal ---------- */
.view { display: none; }
.view.is-active { display: block; animation: viewIn 0.6s var(--ease) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.reveal-up { animation: riseIn 0.9s var(--ease-out) both; animation-delay: var(--d, 0ms); }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* scroll-triggered */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); transition-delay: var(--d, 0ms); }
.reveal.is-in { opacity: 1; transform: none; }

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin-bottom: 20px;
  font-weight: 500;
}

/* ---------- Hero ---------- */
.view-hero { padding-top: 56px; }

.hero-grid { display: grid; gap: 48px; align-items: center; }

.hero-title {
  font-family: var(--display);
  font-size: calc(clamp(50px, 12.5vw, 104px) * var(--display-scale));
  line-height: 1.02;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.hero-title .line > * {
  display: inline-block;
  animation: lineUp 1.1s var(--ease-out) both;
  animation-delay: var(--d, 0ms);
}
@keyframes lineUp {
  from { transform: translateY(105%); }
  to   { transform: none; }
}
.hero-title em { font-style: normal; color: var(--gold); }

.hero-lead {
  margin-top: 28px;
  max-width: 46ch;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
  font-weight: 300;
}

.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; }
.hero-meta { font-size: 14px; color: var(--faint); }

.hero-stats {
  margin: 56px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 460px;
}
.hero-stats dt { font-family: var(--display); font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-stats dd { margin: 8px 0 0; font-size: 14px; color: var(--muted); }

.hero-visual {
  margin: 0;
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  aspect-ratio: 4 / 5;
  max-width: 420px;
  width: 100%;
  justify-self: center;
  display: grid;
  place-items: center;
  overflow: hidden;
  perspective: 900px;
  animation: riseIn 1s var(--ease-out) 0.2s both;
}
.hero-visual::before {
  content: ''; position: absolute; inset: 14px;
  border: 1px solid var(--line); border-radius: 2px;
  pointer-events: none;
}

.bottle-tilt {
  width: 62%;
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease-out);
}
.bottle-art { width: 100%; height: auto; overflow: visible; }
.bottle-art .ln { fill: none; stroke: var(--text); stroke-width: 1.1; opacity: 0.85; }
.bottle-art .ln.thin { stroke-width: 0.7; opacity: 0.4; }
.draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1.6s var(--ease-out) forwards;
  animation-delay: calc(var(--d, 0ms) + 400ms);
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.bottle-label {
  font-family: var(--display); font-size: 44px; fill: var(--gold);
  opacity: 0; animation: fadeIn 1s var(--ease) 1.6s forwards;
}
.bottle-sub {
  font-family: var(--sans); font-size: 8px; letter-spacing: 0.4em; fill: var(--muted); unicode-bidi: isolate;
  opacity: 0; animation: fadeIn 1s var(--ease) 1.8s forwards;
}

.liquid { transform: translateY(160px); animation: fillUp 2.4s var(--ease-out) 1s forwards; }
@keyframes fillUp { to { transform: none; } }
.wave { fill: var(--gold); }
.wave-back { opacity: 0.08; animation: waveMove 7s linear infinite reverse; }
.wave-front { opacity: 0.14; animation: waveMove 5s linear infinite; }
@keyframes waveMove { to { transform: translateX(160px); } }

.hero-caption {
  position: absolute;
  inset-inline: 28px;
  bottom: 26px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  unicode-bidi: isolate;
}

/* how it works */
#how { scroll-margin-top: 88px; padding-block: 120px 96px; }
.how-title { font-family: var(--display); font-size: calc(clamp(34px, 7vw, 52px) * var(--display-scale)); line-height: 1.1; }
.how-list {
  list-style: none;
  margin: 44px 0 0;
  padding: 0;
  display: grid;
  border-top: 1px solid var(--line);
}
.how-list li {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 4px 16px;
  position: relative;
}
.how-list li::before {
  /* hover line */
  content: ''; position: absolute; top: -1px; inset-inline: 0; height: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: right;
  transition: transform 0.6s var(--ease-out);
}
.how-list li:hover::before { transform: scaleX(1); }
.how-num { grid-row: span 2; font-family: var(--display); color: var(--gold); font-size: 26px; line-height: 1.2; }
.how-list h3 { font-size: 19px; font-weight: 600; }
.how-list p { color: var(--muted); font-size: 16px; }
.how-cta { margin-top: 36px; }

.how-flash { animation: flash 1.4s var(--ease); }
@keyframes flash { 30% { background: var(--gold-soft); } }

@media (min-width: 900px) {
  .view-hero { padding-top: 96px; }
  .hero-grid { grid-template-columns: 1.25fr 1fr; gap: 72px; }
  .how-list { grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
  .how-list li { border-bottom: 0; padding: 32px 0 32px 32px; }
  .how-list li + li { border-inline-start: 1px solid var(--line); padding-inline-start: 32px; }
}

/* ---------- Quiz ---------- */
.view-quiz { padding-block: 32px 72px; }
.quiz-shell { max-width: 980px; }

.quiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.quiz-count { font-family: var(--display); font-size: 18px; color: var(--muted); unicode-bidi: isolate; }
.quiz-count #step-current { color: var(--text); display: inline-block; }
.quiz-count #step-current.tick { animation: tick 0.4s var(--ease-out); }
@keyframes tick { from { transform: translateY(-60%); opacity: 0; } }

.progress { height: 1px; background: var(--line-strong); position: relative; }
.progress-bar {
  position: absolute; inset-block: 0; inset-inline-start: 0;
  width: 0; background: var(--gold);
  transition: width 0.7s var(--ease-out);
}
.progress-bar::after {
  content: ''; position: absolute; inset-inline-end: -3px; top: -3px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--gold);
}

/* answer trail */
.trail {
  display: flex; flex-wrap: wrap; gap: 8px;
  min-height: 34px;
  margin-top: 18px;
}
.trail-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: none;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  animation: chipIn 0.45s var(--ease-out) both;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.trail-chip b { color: var(--text); font-weight: 600; }
.trail-chip:hover { border-color: var(--gold); color: var(--gold); }
@keyframes chipIn { from { opacity: 0; transform: scale(0.85); } }

.quiz-stage { padding-top: 28px; }

.step { animation: stepIn 0.5s var(--ease-out) both; }
.step.is-leaving { animation: stepOut 0.22s var(--ease) both; }
.step.is-back { animation-name: stepInBack; }
@keyframes stepIn { from { opacity: 0; transform: translateX(-24px); } }
@keyframes stepOut { to { opacity: 0; transform: translateX(24px); } }
@keyframes stepInBack { from { opacity: 0; transform: translateX(24px); } }

.step-kicker { font-size: 13px; letter-spacing: 0.16em; color: var(--gold); margin-bottom: 12px; font-weight: 500; }
.step-title { font-family: var(--display); font-size: calc(clamp(34px, 7.5vw, 54px) * var(--display-scale)); line-height: 1.1; }
.step-sub { margin-top: 12px; color: var(--muted); font-weight: 300; font-size: 17px; }

.options {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.options.cols-3 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .options.cols-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 760px) {
  .options { gap: 16px; }
  .options.cols-4 { grid-template-columns: repeat(4, 1fr); }
  .options.cols-5 { grid-template-columns: repeat(5, 1fr); }
}

.option {
  position: relative;
  text-align: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 18px 20px;
  min-height: 172px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  cursor: pointer;
  overflow: hidden;
  animation: optIn 0.55s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 55ms + 80ms);
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease), transform 0.35s var(--ease-out);
}
@keyframes optIn { from { opacity: 0; transform: translateY(14px); } }

/* cursor-follow sheen */
.option::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), var(--sheen), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.option:hover::before { opacity: 1; }
.option:hover { border-color: var(--line-strong); background: var(--surface-hover); transform: translateY(-3px); }
.option:active { transform: scale(0.98); }
.option[aria-pressed='true'] { border-color: var(--gold); background: var(--gold-soft); }

/* selection pulse */
.option.pulse::after {
  content: '';
  position: absolute;
  inset: -1px;
  border: 1px solid var(--gold);
  border-radius: inherit;
  animation: pulse 0.6s var(--ease-out) forwards;
  pointer-events: none;
}
@keyframes pulse { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.06); } }

.option-num {
  position: absolute; bottom: 14px; inset-inline-end: 16px;
  font-family: var(--display); font-size: 14px; color: var(--faint);
}
.option-icon { width: 42px; height: 42px; color: var(--muted); transition: color 0.25s var(--ease), transform 0.4s var(--ease-out); }
.option-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; }
.option:hover .option-icon { transform: translateY(-2px) scale(1.05); }
.option:hover .option-icon,
.option[aria-pressed='true'] .option-icon { color: var(--gold); }
.option:hover .option-icon .d,
.option.pulse .option-icon .d { stroke-dasharray: 1; animation: redraw 0.9s var(--ease-out); }
@keyframes redraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.option-text { margin-top: auto; position: relative; }
.option-label { display: block; font-size: 17px; font-weight: 600; line-height: 1.35; }
.option-hint { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); line-height: 1.5; }

.option-mark {
  font-family: var(--display); font-size: 30px; color: var(--muted); line-height: 1;
  letter-spacing: 0.04em; transition: color 0.25s var(--ease), transform 0.4s var(--ease-out);
}
.option:hover .option-mark { transform: translateY(-2px); }
.option:hover .option-mark,
.option[aria-pressed='true'] .option-mark { color: var(--gold); }

.option-check {
  position: absolute; top: 14px; inset-inline-end: 14px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  transition: all 0.3s var(--ease-out);
}
.option-check svg { width: 12px; height: 12px; fill: none; stroke: var(--on-accent); stroke-width: 2; stroke-dasharray: 12; stroke-dashoffset: 12; transition: stroke-dashoffset 0.35s var(--ease-out) 0.08s; }
.option[aria-pressed='true'] .option-check { background: var(--gold); border-color: var(--gold); transform: scale(1.1); }
.option[aria-pressed='true'] .option-check svg { stroke-dashoffset: 0; }

.step-footer {
  margin-top: 36px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.step-footer .helper { font-size: 14px; color: var(--faint); }

.kbd-hint { display: none; margin-top: 40px; font-size: 13px; color: var(--faint); }
.kbd-hint kbd {
  font-family: var(--sans); font-size: 12px;
  border: 1px solid var(--line-strong); border-radius: 3px;
  padding: 0 6px; color: var(--muted);
}
@media (hover: hover) and (min-width: 760px) { .kbd-hint { display: block; } }

/* location step */
.field { margin-top: 32px; max-width: 420px; animation: optIn 0.55s var(--ease-out) 0.25s both; }
.field-label { display: block; font-size: 13px; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 10px; }
.select-wrap { position: relative; }
.select-wrap svg {
  position: absolute; inset-inline-end: 16px; top: 50%;
  width: 16px; height: 16px; transform: translateY(-50%);
  fill: none; stroke: var(--muted); stroke-width: 1.5; pointer-events: none;
}
.select {
  appearance: none; -webkit-appearance: none;
  width: 100%; height: 54px;
  padding-inline: 18px 44px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font: inherit; font-size: 17px; cursor: pointer;
  transition: border-color 0.2s var(--ease);
}
.select:hover, .select:focus { border-color: var(--gold); outline: none; }
.select option, .select optgroup { background: var(--surface); color: var(--text); }

/* ---------- Loading ---------- */
.view-loading { padding-block: 20vh; }
.loading-inner { max-width: 420px; text-align: center; display: grid; justify-items: center; }
.fill-bottle { width: 72px; height: auto; }
.fill-bottle .ln { fill: none; stroke: var(--text); stroke-width: 1.2; opacity: 0.8; }
.fill-level { fill: var(--gold); opacity: 0.55; transform: translateY(110px); animation: fillBottle 1.7s var(--ease) forwards; }
@keyframes fillBottle { to { transform: translateY(34px); } }
.loading-text { margin-top: 26px; font-family: var(--display); font-size: 24px; color: var(--muted); min-height: 1.5em; }
.loading-text.swap { animation: riseIn 0.4s var(--ease-out); }

/* ---------- Results ---------- */
.view-results { padding-block: 44px 80px; }

.profile { padding-bottom: 36px; border-bottom: 1px solid var(--line); }
.profile-title { font-family: var(--display); font-size: calc(clamp(36px, 8vw, 66px) * var(--display-scale)); line-height: 1.1; max-width: 20ch; }
.profile-title .w { display: inline-block; opacity: 0; animation: riseIn 0.8s var(--ease-out) both; animation-delay: calc(var(--i) * 60ms + 100ms); }
.profile-title em { font-style: normal; color: var(--gold); }

.profile-chips { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 14px; color: var(--muted);
  animation: chipIn 0.5s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 50ms + 400ms);
}
.chip b { color: var(--text); font-weight: 600; }

/* controls bar */
.locbar {
  margin-top: 28px;
  display: flex; flex-direction: column; gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  animation: riseIn 0.7s var(--ease-out) 0.5s both;
}
.locbar-info { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.locbar-info svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--gold); stroke-width: 1.3; }
.locbar-info small { display: block; color: var(--muted); font-size: 14px; }
.locbar-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.locbar-controls .select { height: 42px; font-size: 15px; width: auto; min-width: 150px; }
.locbar-controls .select-wrap svg { width: 14px; height: 14px; }
@media (min-width: 900px) {
  .locbar { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* switch */
.switch {
  display: inline-flex; align-items: center; gap: 12px;
  background: none;
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding-inline: 16px 8px;
  min-height: 42px;
  cursor: pointer; font-size: 15px;
  transition: border-color 0.2s var(--ease);
}
.switch:hover { border-color: var(--text); }
.switch-track {
  width: 36px; height: 20px; border-radius: 999px;
  background: var(--line-strong); position: relative; flex: none;
  transition: background-color 0.25s var(--ease);
}
.switch-thumb {
  position: absolute; top: 3px; inset-inline-start: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text);
  transition: inset-inline-start 0.35s var(--ease-out), background-color 0.25s var(--ease), width 0.2s var(--ease);
}
.switch:active .switch-thumb { width: 18px; }
.switch[aria-checked='true'] { border-color: var(--gold); }
.switch[aria-checked='true'] .switch-track { background: var(--gold); }
.switch[aria-checked='true'] .switch-thumb { inset-inline-start: 19px; background: var(--on-accent); }
.switch[aria-checked='true']:active .switch-thumb { inset-inline-start: 15px; }

.section-head {
  margin-top: 52px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
}
.section-head h2 { font-family: var(--display); font-size: 32px; }
.section-head span { font-size: 14px; color: var(--muted); }

/* cards */
.cards { margin-top: 24px; display: grid; gap: 16px; align-items: start; }
@media (min-width: 760px) { .cards { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(3, 1fr); } }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  transition: border-color 0.3s var(--ease), transform 0.5s var(--ease-out);
  animation: cardIn 0.8s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 120ms + 300ms);
  transform-style: preserve-3d;
}
.card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), var(--sheen), transparent 65%);
  opacity: 0; transition: opacity 0.35s var(--ease);
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card:hover { border-color: var(--line-strong); }
@keyframes cardIn { from { opacity: 0; transform: translateY(28px); } }

.card-body { padding: 24px 22px; position: relative; }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-rank { font-family: var(--display); font-size: 15px; color: var(--faint); letter-spacing: 0.06em; }
.card-rank.is-top { color: var(--gold); }

.match { display: flex; align-items: center; gap: 10px; }
.match-ring { width: 48px; height: 48px; transform: rotate(-90deg); }
.match-ring circle { fill: none; stroke-width: 2; }
.match-ring .track { stroke: var(--line-strong); }
.match-ring .val { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset 1.6s var(--ease-out); }
.match-num { font-family: var(--display); font-size: 32px; line-height: 1; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.match-num small { font-size: 16px; color: var(--muted); }
.match-lbl { display: block; font-size: 12px; letter-spacing: 0.12em; color: var(--muted); margin-top: 4px; }

.card-brand {
  margin-top: 22px;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted); unicode-bidi: isolate; font-weight: 600;
}
.card-name {
  margin-top: 6px;
  font-family: var(--display);
  font-size: 34px; line-height: 1.1;
  unicode-bidi: isolate;
}

.card-meta { margin-top: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 14px; color: var(--muted); }
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.tier { padding: 2px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; color: var(--text); }
.tier.niche { border-color: var(--gold); color: var(--gold); }

.notes { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 6px; }
.note {
  padding: 4px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  cursor: default;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease), background-color 0.25s var(--ease), transform 0.3s var(--ease-out);
}
.note:hover, .note.is-hl { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.note.is-hl { transform: translateY(-2px); }

.why { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.why h4 { font-size: 13px; letter-spacing: 0.14em; color: var(--gold); margin-bottom: 8px; font-weight: 600; }
.why p { font-size: 16px; line-height: 1.7; }
.why ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.why li { display: flex; gap: 10px; font-size: 14px; color: var(--muted); }
.why li::before { content: ''; flex: none; width: 10px; height: 1px; background: var(--gold); margin-top: 0.8em; }

/* dupe strip */
.dupe {
  margin-top: 22px;
  padding: 16px;
  border: 1px dashed var(--gold-line);
  border-radius: var(--radius-lg);
  background: var(--gold-soft);
  animation: riseIn 0.6s var(--ease-out) both;
}
.dupe-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.dupe-tag {
  display: inline-block; padding: 1px 9px;
  background: var(--gold); color: var(--on-accent);
  border-radius: 999px; font-size: 12px; font-weight: 700; margin-inline-end: 6px;
}
.dupe-save { color: var(--ok); font-weight: 600; }
.dupe-brand { margin-top: 12px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); unicode-bidi: isolate; font-weight: 600; }
.dupe-name { font-family: var(--display); font-size: 22px; line-height: 1.2; unicode-bidi: isolate; }
.sim { margin-top: 12px; }
.sim-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.sim-row b { color: var(--text); font-weight: 600; }
.sim-bar { margin-top: 6px; height: 3px; background: var(--line-strong); border-radius: 2px; overflow: hidden; }
.sim-bar span { display: block; height: 100%; width: 0; background: var(--gold); border-radius: inherit; transition: width 1.4s var(--ease-out); }
.dupe-foot { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dupe-price { font-family: var(--display); font-size: 22px; }
.dupe-foot .btn { min-height: 38px; font-size: 14px; padding: 0 14px; }
.dupe-none { margin-top: 18px; font-size: 13px; color: var(--faint); }

.card-actions { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-actions .btn { padding: 0 12px; font-size: 15px; }
.card-actions svg, .dupe-foot svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* stores inside card */
.stores {
  border-top: 1px solid var(--line);
  padding: 18px 22px 22px;
  background: var(--bg-raised);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  position: relative;
}
.stores-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 8px;
}
.stores-head b { color: var(--text); font-weight: 600; letter-spacing: 0; }

.store-list { list-style: none; margin: 0; padding: 0; }
.store {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  animation: storeIn 0.5s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.store:last-child { border-bottom: 0; }
.store[hidden] { display: none; }
@keyframes storeIn { from { opacity: 0; transform: translateX(-10px); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.store-name { font-size: 15px; font-weight: 600; }
.store-place { font-size: 14px; color: var(--muted); }
.store-stock { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 2px; }
.store-stock::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.store-stock.in { color: var(--ok); }
.store-stock.in::before { animation: breathe 2.4s ease-in-out infinite; }
.store-stock.low { color: var(--warn); }
.store-dist { color: var(--faint); font-size: 13px; margin-inline-start: 6px; }

.store-nav {
  flex: none; width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 50%;
  color: var(--muted);
  transition: all 0.3s var(--ease-out);
}
.store-nav:hover { color: var(--on-accent); background: var(--gold); border-color: var(--gold); transform: rotate(-12deg) scale(1.08); }
.store-nav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

.stores-more { margin-top: 6px; color: var(--gold); font-size: 14px; }
.stores-empty { font-size: 15px; color: var(--muted); line-height: 1.6; padding: 6px 0 2px; }
.stores-empty .link-btn { color: var(--gold); padding: 0; margin-top: 6px; }


.results-foot {
  margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
}
.results-foot p { color: var(--muted); font-size: 15px; }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translate(-50%, 20px);
  padding: 12px 20px;
  background: var(--text); color: var(--bg);
  border-radius: var(--radius);
  font-size: 15px; font-weight: 600;
  opacity: 0; pointer-events: none; z-index: 50;
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 28px; }
.footer-inner { display: flex; flex-direction: column; gap: 10px; }
.footer-inner p { font-size: 13px; color: var(--faint); }
@media (min-width: 760px) {
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: center; }
}

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

/* =========================================================
   Round 3 — nav, similar search, catalogue, wardrobe, detail,
   compare, refine & share
   ========================================================= */

/* ---------- Header nav ---------- */
.header-nav { gap: 14px; }
@media (min-width: 760px) { .header-nav { gap: 22px; } }
.nav-desktop { display: none; }
@media (min-width: 900px) { .nav-desktop { display: inline; } }

.nav-icon {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 0; padding: 4px 2px; cursor: pointer;
}
.nav-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; }
.nav-icon span { display: none; }
@media (min-width: 760px) { .nav-icon span { display: inline; } }
.nav-icon.is-current { color: var(--text); }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--gold); color: var(--on-accent);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.badge.bump { animation: bump 0.5s var(--ease-out); }
@keyframes bump { 40% { transform: scale(1.45); } }

/* ---------- Icon button & heart ---------- */
.icon-btn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 50%;
  background: none; color: var(--muted); cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.3s var(--ease-out);
}
.icon-btn:hover { color: var(--text); border-color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

.heart svg path { transition: fill 0.25s var(--ease), stroke 0.25s var(--ease); }
.heart[aria-pressed='true'] { color: var(--gold); border-color: var(--gold); }
.heart[aria-pressed='true'] svg path { fill: var(--gold); }
.heart.pop { animation: heartPop 0.5s var(--ease-out); }
@keyframes heartPop { 30% { transform: scale(1.25); } 60% { transform: scale(0.92); } }

/* ---------- Similar search ---------- */
#similar { padding-bottom: 110px; scroll-margin-top: 88px; }
.similar-box {
  display: grid; gap: 28px;
  padding: 28px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
}
@media (min-width: 900px) {
  .similar-box { grid-template-columns: 1fr 1fr; align-items: end; padding: 44px; gap: 56px; }
}
.similar-lead { margin-top: 12px; color: var(--muted); font-weight: 300; }

.combo { position: relative; }
.combo-field { position: relative; }
.combo-field svg {
  position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.4; pointer-events: none;
}
.combo-field input {
  width: 100%; height: 56px;
  padding-inline: 46px 18px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font: inherit; font-size: 17px;
  transition: border-color 0.2s var(--ease);
}
.combo-field input::placeholder { color: var(--faint); }
.combo-field input:focus { outline: none; border-color: var(--gold); }
.combo-list {
  position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 10;
  list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  max-height: 300px; overflow-y: auto;
  box-shadow: var(--shadow);
  animation: optIn 0.25s var(--ease-out);
}
.combo-list li {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 10px 12px; border-radius: 3px; cursor: pointer;
}
.combo-list li[aria-selected='true'], .combo-list li:hover { background: var(--surface-hover); }
.combo-list .c-name { font-family: var(--display); font-size: 19px; unicode-bidi: isolate; }
.combo-list .c-brand { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); unicode-bidi: isolate; }
.combo-list .c-empty { color: var(--muted); cursor: default; }

.similar-results:not(:empty) { margin-top: 36px; }
.similar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.similar-head h3 { font-family: var(--display); font-size: 28px; }
.similar-head h3 em { font-style: normal; color: var(--gold); unicode-bidi: isolate; unicode-bidi: isolate; }

/* ---------- Tiles (catalogue / similar) ---------- */
.tiles { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1150px) { .tiles.tiles-4 { grid-template-columns: repeat(4, 1fr); } }

.tile {
  position: relative;
  display: flex; flex-direction: column;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: start;
  animation: optIn 0.5s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 35ms);
  transition: border-color 0.25s var(--ease), transform 0.35s var(--ease-out), background-color 0.25s var(--ease);
}
.tile:hover { border-color: var(--line-strong); background: var(--surface-hover); transform: translateY(-3px); }
.tile:focus-visible { outline: 1px solid var(--gold); }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tile .heart { width: 34px; height: 34px; }
.tile .heart svg { width: 15px; height: 15px; }
.tile-brand { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); unicode-bidi: isolate; font-weight: 600; margin-top: 4px; }
.tile-name { margin-top: 4px; font-family: var(--display); font-size: 25px; line-height: 1.15; unicode-bidi: isolate; }
.tile-meta { margin-top: 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); }
.tile-notes { margin-top: 14px; font-size: 13px; color: var(--faint); }
.tile-sim { font-family: var(--display); font-size: 22px; color: var(--gold); line-height: 1; unicode-bidi: isolate; }
.tile-sim small { font-size: 12px; color: var(--muted); display: block; font-family: var(--sans); letter-spacing: 0.08em; margin-top: 4px; direction: rtl; }
.tag-dupe { padding: 1px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); border: 1px dashed var(--gold-line); font-size: 12px; }

/* ---------- Catalogue ---------- */
.view-catalog { padding-block: 44px 80px; }
.page-title { font-family: var(--display); font-size: calc(clamp(40px, 9vw, 72px) * var(--display-scale)); line-height: 1.05; }

.collections { margin-top: 28px; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.collections::-webkit-scrollbar { display: none; }
.pill {
  flex: none;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: none;
  font-size: 14px; color: var(--muted);
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.pill:hover { color: var(--text); border-color: var(--text); }
.pill[aria-pressed='true'] { background: var(--text); color: var(--bg); border-color: var(--text); }
.pill.gold[aria-pressed='true'] { background: var(--gold); border-color: var(--gold); color: var(--on-accent); }

.filters { margin-top: 20px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-raised); display: grid; gap: 14px; }
.filter-search input { height: 48px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-row-split { gap: 14px 20px; justify-content: space-between; }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; }
.seg button {
  background: none; border: 0; padding: 6px 14px; border-radius: 999px;
  font-size: 14px; color: var(--muted); cursor: pointer;
  transition: all 0.25s var(--ease);
}
.seg button[aria-pressed='true'] { background: var(--text); color: var(--bg); }

.range { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); flex: 1; min-width: 220px; }
.range b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.range input { flex: 1; accent-color: var(--gold); }
.sort-wrap .select { height: 42px; font-size: 14px; min-width: 160px; }
.sort-wrap svg { width: 14px; height: 14px; }

.cat-count { margin: 26px 0 14px; font-size: 14px; color: var(--muted); }
.cat-empty { padding: 48px 0; text-align: center; color: var(--muted); }

/* ---------- Overlays ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 40;
  background: var(--scrim);
  opacity: 0; transition: opacity 0.35s var(--ease);
}
.scrim.is-open { opacity: 1; }
body.is-locked { overflow: hidden; }

.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-end: 0; z-index: 45;
  width: min(420px, 100%);
  display: flex; flex-direction: column;
  background: var(--bg-raised);
  border-inline-start: 1px solid var(--line);
  transform: translateX(-100%);
  transition: transform 0.45s var(--ease-out);
}
.drawer.is-open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-family: var(--display); font-size: 28px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 22px; }
.drawer-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.drawer-foot:empty { display: none; }
.drawer-foot p { font-size: 13px; color: var(--muted); }

.saved {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
  animation: storeIn 0.4s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 50ms);
}
.saved.is-removing { animation: savedOut 0.3s var(--ease) forwards; }
@keyframes savedOut { to { opacity: 0; transform: translateX(20px); } }
.saved-check { width: 18px; height: 18px; accent-color: var(--gold); flex: none; cursor: pointer; }
.saved-info { flex: 1; min-width: 0; cursor: pointer; }
.saved-brand { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); unicode-bidi: isolate; font-weight: 600; }
.saved-name { font-family: var(--display); font-size: 21px; line-height: 1.2; unicode-bidi: isolate; }
.saved-price { font-size: 13px; color: var(--muted); }
.saved .icon-btn { width: 34px; height: 34px; }
.saved .icon-btn svg { width: 14px; height: 14px; }

.empty-state { padding: 56px 8px; text-align: center; color: var(--muted); }
.empty-state svg { width: 44px; height: 44px; margin: 0 auto 16px; fill: none; stroke: var(--faint); stroke-width: 1.1; }
.empty-state p + p { margin-top: 6px; font-size: 14px; color: var(--faint); }

.modal {
  position: fixed; inset: 0; z-index: 46;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none;
}
.modal-panel {
  position: relative;
  pointer-events: auto;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 14px 14px 0 0;
  padding: 28px 22px 32px;
  transform: translateY(100%);
  transition: transform 0.5s var(--ease-out);
}
.modal.is-open .modal-panel { transform: none; }
.modal-close { position: absolute; top: 18px; inset-inline-end: 18px; z-index: 2; background: var(--bg-raised); }
@media (min-width: 760px) {
  .modal { align-items: center; padding: 32px; }
  .modal-panel { max-width: 760px; border-radius: var(--radius-lg); padding: 40px; transform: translateY(24px) scale(0.98); opacity: 0; transition: transform 0.45s var(--ease-out), opacity 0.3s var(--ease); }
  .modal.is-open .modal-panel { transform: none; opacity: 1; }
  .modal.is-wide .modal-panel { max-width: 1040px; }
}

/* ---------- Detail sheet ---------- */
.detail-brand { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); unicode-bidi: isolate; font-weight: 600; padding-inline-end: 56px; }
.detail-name { margin-top: 6px; font-family: var(--display); font-size: calc(clamp(36px, 7vw, 52px) * var(--display-scale)); line-height: 1.05; unicode-bidi: isolate; }
.detail-desc { margin-top: 16px; font-size: 17px; color: var(--muted); max-width: 52ch; }
.detail-grid { margin-top: 28px; display: grid; gap: 22px; }
@media (min-width: 760px) { .detail-grid { grid-template-columns: 1.1fr 1fr; gap: 36px; } }
.detail-block h4 { font-size: 13px; letter-spacing: 0.14em; color: var(--gold); margin-bottom: 12px; font-weight: 600; }

.pyramid { display: grid; gap: 8px; }
.tier-row {
  display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 12px;
  animation: optIn 0.5s var(--ease-out) both; animation-delay: calc(var(--i) * 110ms + 150ms);
}
.tier-row > span { font-size: 13px; color: var(--muted); }
.tier-row .notes { margin: 0; }
.tier-row:nth-child(1) .notes { padding-inline-end: 22%; }
.tier-row:nth-child(2) .notes { padding-inline-end: 10%; }

.meter + .meter { margin-top: 14px; }
.meter-row { display: flex; justify-content: space-between; font-size: 14px; }
.meter-row span { color: var(--muted); }
.meter-bar { margin-top: 6px; height: 3px; background: var(--line-strong); border-radius: 2px; overflow: hidden; }
.meter-bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width 1.2s var(--ease-out); }

.seasons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.season {
  padding: 5px 12px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--line); color: var(--faint);
}
.season.on { border-color: var(--gold); color: var(--gold); }

.detail-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.detail-actions svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.detail-actions .heart { width: 48px; height: 48px; border-radius: var(--radius); }
.detail-similar { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }
.detail-similar .tiles { margin-top: 4px; }
@media (min-width: 760px) { .detail-similar .tiles { grid-template-columns: repeat(3, 1fr); } }
.detail-similar .tile { padding: 16px; }
.detail-similar .tile-name { font-size: 20px; }

/* ---------- Compare ---------- */
.compare-title { font-family: var(--display); font-size: 36px; margin-bottom: 22px; }
.compare-scroll { overflow-x: auto; margin-inline: -22px; padding-inline: 22px; }
.compare {
  width: 100%; min-width: 560px;
  border-collapse: collapse; font-size: 14px;
}
.compare th, .compare td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.compare thead th { vertical-align: bottom; }
.compare tbody th { color: var(--muted); font-weight: 500; width: 110px; white-space: nowrap; }
.compare .c-brand { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); unicode-bidi: isolate; }
.compare .c-name { font-family: var(--display); font-size: 22px; font-weight: 400; unicode-bidi: isolate; line-height: 1.15; }
.compare .best { color: var(--gold); font-weight: 600; }
.compare .notes { margin: 0; }
.compare .note.shared { border-color: var(--gold); color: var(--gold); }
.compare-legend { margin-top: 14px; font-size: 13px; color: var(--muted); }
.compare-legend span { color: var(--gold); }

/* ---------- Results: refine + share + card extras ---------- */
.refine { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; animation: riseIn 0.7s var(--ease-out) 0.6s both; }
.refine-label { font-size: 13px; color: var(--muted); margin-inline-end: 4px; }
.pill[disabled] { opacity: 0.3; cursor: not-allowed; }

.share-row { display: flex; flex-wrap: wrap; gap: 10px; }
.share-row .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

.card-top-end { display: flex; align-items: center; gap: 10px; }
.card .heart { width: 36px; height: 36px; }
.card .heart svg { width: 16px; height: 16px; }
.card-foot { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-more { color: var(--gold); }
.card-traits { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.card-traits b { color: var(--text); font-weight: 600; }

.cards.is-swapping .card { animation: cardOut 0.25s var(--ease) forwards; }
@keyframes cardOut { to { opacity: 0; transform: translateY(10px); } }

.more-row { margin-top: 24px; display: flex; justify-content: center; }

/* location button */
.locate-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--gold); }
.locate-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.locate-btn.is-busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.locbar-controls .icon-btn { width: 42px; height: 42px; }

/* =========================================================
   Light / dark switch
   ========================================================= */
.mode-switch {
  position: relative;
  display: inline-flex; align-items: center; justify-content: space-between;
  width: 70px; height: 36px; padding: 0 4px; flex: none;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}
.mode-switch:hover { border-color: var(--gold); }
.mode-knob {
  position: absolute; top: 3px; inset-inline-start: 3px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--gold) 40%, transparent);
  transition: inset-inline-start 0.45s var(--ease-out);
}
:root[data-theme='dark'] .mode-knob { inset-inline-start: calc(100% - 31px); }
.mode-switch svg {
  position: relative; z-index: 1;
  width: 28px; height: 28px; padding: 6px;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  color: var(--muted);
  transition: color 0.35s var(--ease), transform 0.5s var(--ease-out);
}
:root:not([data-theme='dark']) .mode-switch .i-sun,
:root[data-theme='dark'] .mode-switch .i-moon { color: var(--on-accent); }
.mode-switch:hover svg { transform: rotate(20deg); }


/* narrow phones: keep brand + switch + actions inside the gutter */
@media (max-width: 420px) {
  .header-inner { gap: 10px; }
  .header-nav { gap: 10px; }
  .brand { gap: 8px; }
  .brand-word { letter-spacing: 0.26em; margin-inline-end: -0.26em; font-size: 14px; }
  .mode-switch { width: 62px; height: 34px; }
  .mode-switch svg { width: 26px; height: 26px; padding: 5px; }
  .mode-knob { width: 26px; height: 26px; }
  :root[data-theme='dark'] .mode-knob { inset-inline-start: calc(100% - 29px); }
  .header-actions .btn-sm { padding: 0 12px; }
}
