:root {
  color-scheme: dark;
  --black: #050504;
  --onyx: #090908;
  --onyx-soft: #11100e;
  --panel: #0d0c0a;
  --ivory: #f2eee5;
  --ivory-soft: #d5cec0;
  --muted: #9a9285;
  --gold: #b89555;
  --gold-light: #dec78f;
  --gold-dark: #71572d;
  --line: rgba(212, 184, 121, 0.25);
  --line-soft: rgba(255, 255, 255, 0.1);
  --serif: Didot, "Bodoni 72", "Bodoni MT", Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 36%, rgba(111, 83, 38, 0.11), transparent 30rem),
    linear-gradient(180deg, var(--black), #090908 55%, #050504);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.17;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 4px; }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.1;
  pointer-events: none;
}

.ambient-one { top: 18vh; right: -18rem; width: 30rem; height: 30rem; background: #a97b32; }
.ambient-two { bottom: 12vh; left: -14rem; width: 24rem; height: 24rem; background: #635137; }

.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1320px, calc(100% - 64px));
  margin: 0 auto;
  padding: 28px 0 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.wordmark {
  color: var(--ivory);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0.4em;
  text-decoration: none;
}

main { width: 100%; }

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 640px;
  align-items: center;
  overflow: hidden;
  padding: 138px max(32px, calc((100vw - 1320px) / 2)) 98px;
  border-bottom: 1px solid rgba(212, 184, 121, 0.18);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(3, 3, 2, 0.97) 0%, rgba(3, 3, 2, 0.87) 35%, rgba(3, 3, 2, 0.32) 67%, rgba(3, 3, 2, 0.18) 100%),
    linear-gradient(180deg, rgba(3, 3, 2, 0.2) 55%, rgba(3, 3, 2, 0.78) 100%);
}

.hero::after {
  content: "";
  position: absolute;
  right: clamp(24px, 6vw, 100px);
  bottom: 92px;
  z-index: 0;
  width: clamp(80px, 12vw, 170px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-light));
  opacity: 0.6;
}

.hero-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.82) contrast(1.05);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(650px, 58vw);
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--gold-light);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.24em;
  line-height: 1.5;
  text-transform: uppercase;
}

h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 400; }

h1 {
  max-width: 650px;
  font-size: clamp(3.9rem, 7.2vw, 6.8rem);
  letter-spacing: -0.06em;
  line-height: 0.88;
  text-wrap: balance;
}

.hero-copy {
  max-width: 540px;
  margin: 28px 0 24px;
  color: var(--ivory-soft);
  font-family: var(--serif);
  font-size: clamp(1.08rem, 1.8vw, 1.35rem);
  line-height: 1.55;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  min-height: 44px;
  padding: 11px 0 9px;
  border-bottom: 1px solid var(--gold);
  color: var(--ivory);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.17em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 180ms ease, border-color 180ms ease;
}

.text-link:hover { color: var(--gold-light); border-color: var(--gold-light); }

.hero-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  margin-top: 44px;
  color: #a59d90;
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-details span { display: inline-flex; align-items: center; gap: 10px; }
.hero-details span:not(:first-child)::before { content: "◆"; color: var(--gold-dark); font-size: 0.45rem; }

.selector-section,
.results-section {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 48px));
  margin-right: auto;
  margin-left: auto;
  padding: clamp(34px, 5vw, 64px);
  border: 1px solid var(--line);
  border-radius: 2px;
  background:
    linear-gradient(135deg, rgba(184, 149, 85, 0.055), transparent 30%),
    linear-gradient(160deg, #12110e, #090907 65%);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45);
}

.selector-section { margin-top: -54px; margin-bottom: 90px; }
.selector-section::before,
.results-section::before {
  content: "";
  position: absolute;
  top: -1px;
  left: clamp(34px, 5vw, 64px);
  width: 96px;
  height: 1px;
  background: var(--gold-light);
}

.results-section { margin-bottom: 80px; }
.results-section[hidden] { display: none; }
.results-section.reveal { animation: reveal 560ms cubic-bezier(.2, .75, .25, 1) both; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-heading,
.results-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 34px;
  margin-bottom: 48px;
}

h2 {
  font-size: clamp(2.7rem, 5.6vw, 5.2rem);
  letter-spacing: -0.055em;
  line-height: 0.94;
  text-wrap: balance;
}

.section-intro,
.result-summary {
  max-width: 660px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.progress-wrap {
  display: grid;
  gap: 12px;
  min-width: 170px;
  color: #8f877a;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-align: right;
  text-transform: uppercase;
}

.progress-track { display: block; width: 170px; height: 1px; background: rgba(255, 255, 255, 0.16); }
#progress-bar { display: block; width: 0; height: 100%; background: var(--gold-light); transition: width 260ms ease; }

.question-grid { display: grid; gap: 0; border-top: 1px solid var(--line-soft); }

.choice-group {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) 1.8fr;
  align-items: start;
  gap: 30px;
  margin: 0;
  padding: 30px 0;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
}

.choice-group legend {
  float: left;
  width: 100%;
  padding: 13px 0 0;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1.2;
}

.choice-group legend span {
  display: block;
  margin: 0 0 10px;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.18em;
}

.choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.choices-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choices-intensity { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.choice {
  position: relative;
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.018);
  color: #c9c2b6;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.35;
  text-align: left;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}

.choice:hover { border-color: rgba(222, 199, 143, 0.5); color: var(--ivory); transform: translateY(-1px); }
.choice.selected { border-color: var(--gold); background: linear-gradient(135deg, rgba(184, 149, 85, 0.17), rgba(184, 149, 85, 0.035)); color: #fffaf0; }
.choice.selected::before { content: "◆"; margin-right: 10px; color: var(--gold-light); font-size: 0.52rem; vertical-align: 2px; }

.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.profile-toggle { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line-soft); border-radius: 2px; }
.profile {
  min-height: 42px;
  padding: 10px 15px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
}
.profile:last-child { border-right: 0; }
.profile.active { background: var(--ivory); color: #11100d; }

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  width: 100%;
  min-height: 60px;
  margin-top: 30px;
  padding: 19px 24px;
  border: 1px solid var(--gold-light);
  border-radius: 2px;
  background: linear-gradient(110deg, #a67f3e, #dfc78c 45%, #957039);
  color: #151109;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  transition: filter 180ms ease, transform 180ms ease;
}

.primary-button:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-2px); }
.primary-button:disabled { border-color: var(--line-soft); background: rgba(255, 255, 255, 0.045); color: #6f695e; cursor: not-allowed; }
.selection-hint { margin: 13px 0 0; color: #817a6e; font-size: 0.78rem; text-align: center; }

.results-heading { align-items: center; }
.ghost-button,
.share-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 12px 17px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--ivory);
  cursor: pointer;
  font-size: 0.84rem;
  transition: border-color 180ms ease, color 180ms ease;
}
.ghost-button:hover,
.share-button:hover { border-color: var(--gold-light); color: var(--gold-light); }

.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.perfume-card {
  position: relative;
  display: flex;
  min-height: 430px;
  flex-direction: column;
  overflow: hidden;
  padding: 30px 26px 26px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.035), transparent 36%),
    #0b0b09;
}

.perfume-card:first-child {
  border-color: rgba(222, 199, 143, 0.5);
  background:
    linear-gradient(155deg, rgba(145, 109, 52, 0.18), transparent 46%),
    #0b0b09;
}

.perfume-card::before {
  position: absolute;
  top: 18px;
  right: 20px;
  color: rgba(222, 199, 143, 0.11);
  font-family: var(--serif);
  font-size: 4.8rem;
  line-height: 1;
}
.perfume-card:nth-child(1)::before { content: "01"; }
.perfume-card:nth-child(2)::before { content: "02"; }
.perfume-card:nth-child(3)::before { content: "03"; }

.rank {
  position: relative;
  z-index: 1;
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.perfume-card h3 {
  position: relative;
  z-index: 1;
  max-width: 88%;
  margin: 64px 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.house { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; }
.reason { margin: 25px 0; color: #c8c0b3; font-size: 0.94rem; line-height: 1.68; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.tag { padding: 7px 9px; border: 1px solid var(--line-soft); border-radius: 2px; color: #9d968a; font-size: 0.68rem; letter-spacing: 0.07em; text-transform: uppercase; }
.card-action { display: flex; align-items: stretch; flex-direction: column; gap: 14px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.match { color: var(--gold-light); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }

.shop-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--gold-light);
  border-radius: 2px;
  background: linear-gradient(110deg, #a67f3e, #dfc78c 45%, #957039);
  color: #151109;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-decoration: none;
  text-transform: uppercase;
  transition: filter 180ms ease, transform 180ms ease;
}
.shop-link:hover { filter: brightness(1.08); transform: translateY(-1px); }

.results-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 28px; }
.catalog-link { color: var(--gold-light); font-size: 0.8rem; font-weight: 750; letter-spacing: 0.11em; text-decoration: none; text-transform: uppercase; }
.disclaimer { margin: 30px 0 0; padding-top: 21px; border-top: 1px solid var(--line-soft); color: #777166; font-size: 0.76rem; line-height: 1.6; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 48px;
  border-top: 1px solid var(--line-soft);
  color: #817a6d;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 10;
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--ivory);
  color: #16130d;
  font-size: 0.84rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 960px) {
  .hero { min-height: 650px; }
  .hero-content { width: min(670px, 74vw); }
  .hero::before { background: linear-gradient(90deg, rgba(3,3,2,.97), rgba(3,3,2,.78) 54%, rgba(3,3,2,.26)); }
  .choice-group { grid-template-columns: 1fr; gap: 16px; }
  .choice-group legend { padding-top: 0; }
  .result-grid { grid-template-columns: 1fr; }
  .perfume-card { min-height: 360px; }
}

@media (max-width: 680px) {
  .topbar { width: calc(100% - 32px); padding: 20px 0 17px; }
  .wordmark { font-size: 0.88rem; letter-spacing: 0.34em; }

  .hero {
    min-height: 620px;
    align-items: flex-end;
    padding: 116px 20px 84px;
  }
  .hero::before {
    background:
      linear-gradient(180deg, rgba(3,3,2,.22) 0%, rgba(3,3,2,.4) 28%, rgba(3,3,2,.94) 68%, rgba(3,3,2,.99) 100%),
      linear-gradient(90deg, rgba(3,3,2,.82), rgba(3,3,2,.18));
  }
  .hero::after { right: 20px; bottom: 54px; width: 72px; }
  .hero-art { object-position: 68% center; }
  .hero-content { width: 100%; }
  h1 { max-width: 96%; font-size: clamp(3.35rem, 15vw, 5.1rem); }
  .hero-copy { max-width: 92%; margin-top: 22px; font-size: 1.08rem; }
  .hero-details { gap: 9px 16px; margin-top: 30px; font-size: 0.64rem; }

  .selector-section,
  .results-section { width: calc(100% - 24px); padding: 32px 18px; }
  .selector-section { margin-top: -38px; margin-bottom: 40px; }
  .selector-section::before,
  .results-section::before { left: 18px; }
  .section-heading,
  .results-heading { align-items: flex-start; flex-direction: column; margin-bottom: 36px; }
  h2 { font-size: clamp(2.75rem, 13vw, 4.3rem); }
  .section-intro,
  .result-summary { font-size: 0.96rem; }

  .progress-wrap { width: 100%; text-align: left; }
  .progress-track { width: 100%; }
  .choice-group { padding: 27px 0; }
  .choice-group legend { font-size: 1.22rem; }
  .choices { grid-template-columns: 1fr 1fr; gap: 8px; }
  .choices-compact { grid-template-columns: repeat(3, 1fr); }
  .choices-intensity { grid-template-columns: 1fr 1fr; }
  .choice { min-height: 56px; padding: 11px 12px; font-size: 0.82rem; }
  .profile-row { align-items: flex-start; flex-direction: column; }
  .profile-toggle { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .profile { min-height: 44px; border-bottom: 1px solid var(--line-soft); }
  .profile:nth-child(2) { border-right: 0; }
  .profile:nth-child(3),
  .profile:nth-child(4) { border-bottom: 0; }
  .primary-button { min-height: 62px; }
  .ghost-button { width: 100%; }

  .perfume-card { min-height: 390px; padding: 26px 20px 22px; }
  .perfume-card h3 { margin-top: 54px; }
  .results-actions { align-items: stretch; flex-direction: column; }
  .share-button { min-height: 48px; }
  .catalog-link { padding: 12px 2px; text-align: center; }
  footer { align-items: flex-start; flex-direction: column; width: calc(100% - 32px); }
}

@media (max-width: 380px) {
  .choices { grid-template-columns: 1fr; }
  .choices-compact { grid-template-columns: 1fr 1fr 1fr; }
  .choices-intensity { grid-template-columns: 1fr; }
  .hero-details span:not(:first-child)::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
