:root {
  --cream: #f8f3eb;
  --paper: rgba(255, 253, 249, 0.9);
  --paper-solid: #fffdfa;
  --sand: #eadbca;
  --taupe: #b49a86;
  --cocoa: #6f5849;
  --ink: #3d312b;
  --muted: #7a6b62;
  --rose: #d8a8a4;
  --rose-deep: #a76f6d;
  --line: rgba(91, 66, 51, 0.14);
  --shadow: 0 24px 70px rgba(91, 67, 51, 0.12);
  --radius: 30px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 8%, rgba(255,255,255,.92), transparent 30%),
    linear-gradient(145deg, #f9f5ee 0%, #f3e9de 52%, #eee1d7 100%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC",
    "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 99;
  padding: 10px 16px;
  color: #fff;
  background: var(--ink);
  border-radius: 12px;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.ambient {
  position: fixed;
  z-index: -1;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(12px);
  opacity: .5;
  pointer-events: none;
}
.ambient-one { top: -130px; right: -90px; background: rgba(216,168,164,.35); }
.ambient-two { bottom: -150px; left: -120px; background: rgba(255,255,255,.8); }

.site-header {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--paper-solid);
  background: var(--cocoa);
  border-radius: 50% 50% 45% 45%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}
.brand strong, .brand small { display: block; }
.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  letter-spacing: .04em;
}
.brand small {
  margin-top: -4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .16em;
}
.header-note {
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-style: italic;
  letter-spacing: .12em;
}

#app {
  width: min(1120px, calc(100% - 32px));
  min-height: calc(100vh - 190px);
  margin: 0 auto;
  outline: none;
}

.screen { animation: reveal .55s ease both; }

.home {
  min-height: 680px;
  display: grid;
  align-items: center;
  gap: 40px;
  padding: 28px 0 64px;
}
.eyebrow {
  margin: 0 0 18px;
  color: var(--rose-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2, .result-name {
  font-family: Georgia, "Times New Roman", "Songti TC", serif;
  font-weight: 500;
  letter-spacing: -.025em;
}
.home h1 {
  max-width: 720px;
  margin-bottom: 22px;
  font-size: clamp(44px, 11vw, 76px);
  line-height: 1.13;
}
.lead {
  max-width: 570px;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: 16px;
}
.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.btn {
  min-height: 52px;
  padding: 14px 25px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:focus-visible, .option:focus-visible {
  outline: 3px solid rgba(167,111,109,.35);
  outline-offset: 3px;
}
.btn-primary {
  color: #fff;
  background: var(--cocoa);
  box-shadow: 0 12px 28px rgba(79, 59, 48, .2);
}
.btn-primary:hover { background: #5f493d; }
.btn-secondary {
  color: var(--cocoa);
  background: rgba(255,255,255,.56);
  border-color: rgba(111,88,73,.22);
}
.btn-secondary:hover { background: rgba(255,255,255,.9); }
.microcopy {
  margin: 14px 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.bottle-scene {
  position: relative;
  min-height: 380px;
  display: grid;
  place-items: center;
}
.halo {
  position: absolute;
  width: 330px;
  height: 330px;
  background: radial-gradient(circle, rgba(255,255,255,.9), rgba(216,168,164,.2) 48%, transparent 70%);
  border-radius: 50%;
}
.bottle {
  position: relative;
  width: 176px;
  height: 232px;
  border: 1px solid rgba(111,88,73,.38);
  border-radius: 24px 24px 34px 34px;
  background: linear-gradient(145deg, rgba(255,255,255,.8), rgba(216,168,164,.18));
  box-shadow: inset 15px 10px 30px rgba(255,255,255,.7), 0 28px 70px rgba(91,67,51,.13);
}
.bottle::before {
  content: "";
  position: absolute;
  left: 55px;
  top: -56px;
  width: 64px;
  height: 58px;
  border: 1px solid rgba(111,88,73,.35);
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(#b8a18f, #89705e);
  box-shadow: inset 0 10px rgba(255,255,255,.22);
}
.bottle::after {
  content: "SOOTHE\\A EAU DE PARFUM";
  white-space: pre;
  position: absolute;
  inset: 76px 22px auto;
  padding: 18px 5px;
  color: var(--cocoa);
  background: rgba(255,253,249,.74);
  border: 1px solid rgba(111,88,73,.2);
  text-align: center;
  font-family: Georgia, serif;
  font-size: 13px;
  line-height: 1.8;
  letter-spacing: .09em;
}
.scent-note {
  position: absolute;
  right: 2%;
  bottom: 7%;
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 11px;
  font-style: italic;
  letter-spacing: .12em;
  transform: rotate(-5deg);
}

.quiz-shell {
  max-width: 760px;
  margin: 35px auto 70px;
  padding: clamp(24px, 6vw, 52px);
  background: var(--paper);
  border: 1px solid rgba(255,255,255,.66);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.quiz-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 12px;
  letter-spacing: .1em;
}
.progress {
  height: 5px;
  overflow: hidden;
  margin-bottom: 34px;
  background: var(--sand);
  border-radius: 99px;
}
.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--taupe), var(--rose));
  border-radius: inherit;
  transition: width .4s ease;
}
.question {
  margin-bottom: 28px;
  font-size: clamp(25px, 6vw, 36px);
  line-height: 1.35;
}
.options {
  display: grid;
  gap: 12px;
}
.option {
  width: 100%;
  padding: 17px 18px;
  color: var(--ink);
  background: rgba(255,255,255,.68);
  border: 1px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 11px;
  text-align: left;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.option:hover { transform: translateX(4px); border-color: var(--taupe); }
.option.selected { background: #f1e3db; border-color: var(--rose-deep); }
.option-letter {
  color: var(--rose-deep);
  font-family: Georgia, serif;
  font-weight: 700;
}
.quiz-nav {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
}
.text-button {
  padding: 9px 2px;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 5px;
}
.text-button:hover { color: var(--ink); text-decoration-color: currentColor; }

.loading {
  min-height: 620px;
  display: grid;
  place-items: center;
  text-align: center;
}
.loading-orbit {
  position: relative;
  width: 102px;
  height: 102px;
  margin: 0 auto 28px;
  border: 1px solid var(--sand);
  border-radius: 50%;
}
.loading-orbit::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 43px;
  width: 14px;
  height: 14px;
  background: var(--rose);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(216,168,164,.8);
  animation: orbit 1.4s linear infinite;
  transform-origin: 7px 55px;
}
.loading h2 { font-size: clamp(27px, 6vw, 38px); }
.loading p { color: var(--muted); }

.result {
  max-width: 950px;
  margin: 30px auto 70px;
}
.result-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(140deg, rgba(255,253,249,.96), rgba(232,213,202,.9));
  border: 1px solid rgba(255,255,255,.72);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.result-hero::after {
  content: attr(data-mbti);
  position: absolute;
  z-index: 0;
  right: -8px;
  bottom: -28px;
  color: rgba(111,88,73,.055);
  font-family: Georgia, serif;
  font-size: clamp(92px, 27vw, 150px);
  line-height: 1;
  pointer-events: none;
}
.result-hero.quiet-theme {
  background: linear-gradient(140deg, rgba(253,254,253,.97), rgba(217,225,226,.9));
  border-color: rgba(255,255,255,.84);
}
.result-hero.quiet-theme .mbti-pill,
.result-hero.quiet-theme .personality-name { color: #68797b; }
.result-hero-copy {
  position: relative;
  z-index: 2;
  order: 2;
  align-self: center;
  padding: 30px 24px 36px;
}
.result-visual {
  position: relative;
  z-index: 1;
  order: 1;
  min-height: 260px;
  margin: 0;
  overflow: hidden;
  background: #ece9e4;
}
.result-visual::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 54px;
  background: linear-gradient(to bottom, transparent, rgba(250,246,240,.9));
  pointer-events: none;
}
.quiet-theme .result-visual::after {
  background: linear-gradient(to bottom, transparent, rgba(240,244,243,.92));
}
.result-visual img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.result-hero[data-perfume="blank-space"] .result-visual {
  background: linear-gradient(145deg, #f8fafb, #dfe8ee);
}
.result-hero[data-perfume="blank-space"] .result-visual img {
  padding: 20px 26px 12px;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.mbti-pill {
  position: relative;
  z-index: 1;
  width: fit-content;
  padding: 7px 14px;
  color: var(--rose-deep);
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(167,111,109,.25);
  border-radius: 99px;
  font-size: 12px;
  letter-spacing: .08em;
}
.result-name {
  position: relative;
  z-index: 1;
  margin: 25px 0 10px;
  font-size: clamp(40px, 11vw, 54px);
  line-height: 1.08;
}
.personality-name {
  position: relative;
  z-index: 1;
  color: var(--rose-deep);
  font-size: 16px;
  letter-spacing: .08em;
}
.result-description {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 16px;
}
.result-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}
.result-card {
  padding: 26px;
  background: var(--paper);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 24px;
  box-shadow: 0 14px 40px rgba(91,67,51,.07);
}
.result-card h3 {
  margin-bottom: 18px;
  font-family: Georgia, "Songti TC", serif;
  font-size: 20px;
  font-weight: 500;
}
.note-list { display: grid; gap: 14px; margin: 0; }
.note-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 12px;
}
.note-row dt { color: var(--rose-deep); font-size: 13px; }
.note-row dd { margin: 0; color: var(--muted); }
.quote {
  margin: 0;
  padding-left: 18px;
  border-left: 2px solid var(--rose);
  font-family: Georgia, "Songti TC", serif;
  font-size: 22px;
  line-height: 1.55;
}
.occasion { color: var(--muted); margin-bottom: 0; }
.keyword-list {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.keyword-list span {
  padding: 5px 10px;
  color: #68797b;
  background: rgba(220,229,230,.58);
  border: 1px solid rgba(104,121,123,.16);
  border-radius: 999px;
  font-size: 11px;
}

.discount-card {
  padding: 30px;
  color: #fff;
  background: linear-gradient(135deg, #765e50, #544138);
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(77,55,44,.2);
}
.discount-label {
  margin-bottom: 4px;
  color: rgba(255,255,255,.68);
  font-size: 12px;
  letter-spacing: .12em;
}
.discount-code {
  margin: 6px 0 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(26px, 7vw, 42px);
  letter-spacing: .06em;
  word-break: break-all;
}
.discount-card p { color: rgba(255,255,255,.75); }
.discount-offer { font-weight: 700; color: #fff !important; }
.discount-note {
  margin: 14px 0 0;
  color: rgba(255,255,255,.58) !important;
  font-size: 11px;
  line-height: 1.6;
}
.discount-card .btn { width: 100%; margin-top: 8px; color: var(--cocoa); background: #fff; }
.result-actions {
  margin-top: 24px;
  display: grid;
  gap: 12px;
}
.result-actions .btn { width: 100%; }

.layering-section {
  margin-top: 60px;
  padding-top: 50px;
  border-top: 1px solid var(--line);
}
.layering-header {
  max-width: 700px;
  margin: 0 auto 30px;
  text-align: center;
}
.layering-header .eyebrow { margin-bottom: 12px; }
.layering-header h2 {
  margin-bottom: 16px;
  font-size: clamp(29px, 7vw, 44px);
  line-height: 1.25;
}
.layering-header > p:not(.eyebrow) {
  margin-bottom: 10px;
  color: var(--muted);
}
.layering-header small { color: var(--rose-deep); letter-spacing: .08em; }
.layering-grid {
  display: grid;
  gap: 18px;
}
.layering-card {
  position: relative;
  padding: clamp(24px, 5vw, 34px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(150deg, rgba(255,253,249,.96), rgba(239,229,220,.85));
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 26px;
  box-shadow: 0 16px 45px rgba(91,67,51,.08);
}
.layering-card::after {
  content: attr(data-option);
  position: absolute;
  right: -5px;
  top: -20px;
  color: rgba(111,88,73,.045);
  font-family: Georgia, serif;
  font-size: 118px;
  line-height: 1;
  pointer-events: none;
}
.layering-option {
  position: relative;
  z-index: 1;
  color: var(--rose-deep);
  font-family: Georgia, serif;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.layering-feeling {
  position: relative;
  z-index: 1;
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .04em;
}
.layering-card h3 {
  position: relative;
  z-index: 1;
  margin-bottom: 22px;
  font-family: Georgia, "Songti TC", serif;
  font-size: clamp(25px, 5vw, 32px);
  font-weight: 500;
  line-height: 1.35;
}
.layering-perfume {
  position: relative;
  z-index: 1;
  padding: 15px 17px;
  background: rgba(255,255,255,.58);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.layering-perfume span {
  display: block;
  color: var(--cocoa);
  font-family: Georgia, "Songti TC", serif;
  font-size: 21px;
}
.layering-perfume small { color: var(--muted); }
.layering-ratio {
  margin: 17px 0;
  padding-bottom: 17px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.layering-ratio strong { color: var(--rose-deep); }
.layering-description { color: var(--muted); font-size: 14px; }
.layering-why {
  margin-top: 4px;
  padding: 15px 17px;
  background: rgba(216,168,164,.09);
  border-radius: 15px;
}
.layering-why strong { color: var(--cocoa); font-size: 12px; }
.layering-why p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.layering-keywords {
  margin: 18px 0 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.layering-keywords span {
  padding: 5px 9px;
  color: var(--rose-deep);
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(167,111,109,.15);
  border-radius: 999px;
  font-size: 10px;
}
.layering-card .layering-cta {
  width: 100%;
  margin-top: auto;
  background: rgba(255,255,255,.74);
}
.layering-tips {
  margin-top: 20px;
  padding: clamp(22px, 5vw, 30px);
  color: var(--muted);
  background: rgba(255,255,255,.42);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 22px;
}
.layering-tips-brand {
  margin-bottom: 7px;
  color: var(--rose-deep);
  font-family: Georgia, "Songti TC", serif;
  font-size: 18px;
}
.layering-tips h3 { margin-bottom: 10px; color: var(--ink); font-size: 15px; }
.layering-tips p:not(.layering-tips-brand) { margin-bottom: 8px; font-size: 12px; }
.layering-tips small { color: rgba(122,107,98,.76); font-size: 10px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 50;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  color: #fff;
  background: rgba(61,49,43,.94);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,.16);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

footer {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 36px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-size: 11px;
}
footer p { margin: 0; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes orbit { to { transform: rotate(360deg); } }

@media (min-width: 760px) {
  .home { grid-template-columns: 1.12fr .88fr; }
  .result-hero {
    grid-template-columns: minmax(0, 1.16fr) minmax(320px, .84fr);
    min-height: 540px;
  }
  .result-hero::after {
    right: 37%;
    bottom: -58px;
    font-size: clamp(140px, 20vw, 220px);
  }
  .result-hero-copy {
    order: 1;
    padding: clamp(44px, 6vw, 68px) clamp(38px, 5vw, 60px);
  }
  .result-visual {
    order: 2;
    min-height: 100%;
  }
  .result-visual::after {
    inset: 0 auto 0 0;
    width: 72px;
    height: auto;
    background: linear-gradient(to right, rgba(246,238,230,.92), transparent);
  }
  .quiet-theme .result-visual::after {
    background: linear-gradient(to right, rgba(235,241,240,.92), transparent);
  }
  .result-hero[data-perfume="blank-space"] .result-visual img {
    padding: 36px 26px 30px;
  }
  .result-name { font-size: clamp(48px, 6vw, 70px); }
  .result-grid { grid-template-columns: 1.1fr .9fr; }
  .result-actions { grid-template-columns: 1.3fr 1fr 1fr; }
  .layering-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
}

@media (max-width: 520px) {
  .header-note { display: none; }
  .site-header { padding-top: 18px; }
  .home { min-height: 670px; align-content: center; }
  .home-copy { order: 2; }
  .bottle-scene { min-height: 265px; }
  .halo { width: 250px; height: 250px; }
  .bottle { width: 124px; height: 166px; border-radius: 17px 17px 25px 25px; }
  .bottle::before { left: 38px; top: -42px; width: 47px; height: 44px; }
  .bottle::after { inset: 53px 14px auto; padding: 10px 2px; font-size: 9px; }
  .scent-note { right: 0; bottom: 2%; }
  .action-row .btn { width: 100%; }
  .quiz-shell { margin-top: 18px; padding: 25px 18px; border-radius: 24px; }
  .option { padding: 15px 14px; }
  .layering-section { margin-top: 42px; padding-top: 38px; }
  .layering-card { border-radius: 22px; }
  .layering-description { font-size: 13px; }
  footer { display: block; }
  footer p + p { margin-top: 4px; }
}

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