/* ============================================================
   Eve Bliss — Mood to Drink
   Design system v2 · warm paper / editorial type / one brand accent
   （舊版保留於 style_classic.css；?design=classic 可即時退回）
   ============================================================ */

:root {
  /* warm paper neutrals — 帶黃棕底調，唔用冷灰 */
  --paper:      #F7F3EA;
  --paper-deep: #F2EADB;
  --canvas:     #FFFFFF;
  --ink:        #1A1611;   /* 暖近黑 */
  --ink-soft:   #3F3A31;
  --muted:      #665F52;   /* 對白底 5.6:1 — 過 WCAG AA */
  --accent:     #0E5A3A;   /* 品牌深綠：唯一強調色 */
  --line:       rgba(26, 22, 17, .14);
  --line-mid:   rgba(26, 22, 17, .22);
  --control:    rgba(26, 22, 17, .26);   /* 控件邊框：對白底 ≥3:1（WCAG 1.4.11） */
  --wash:       rgba(26, 22, 17, .035);

  --serif-display: 'Instrument Serif', 'Noto Serif SC', 'Songti SC', serif;
  --serif:         'Noto Serif SC', 'Songti SC', Georgia, serif;
  --sans:          'Outfit', -apple-system, 'Segoe UI', system-ui, sans-serif;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur:  200ms;
  --pad:  clamp(1.85rem, 5vw, 3.5rem);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* 極淡紙紋：令米白有材質感，唔係死白 */
  background-image:
    radial-gradient(120% 80% at 100% 0%, rgba(26,22,17,.04) 0%, transparent 55%),
    radial-gradient(90% 60% at 0% 100%, rgba(26,22,17,.03) 0%, transparent 60%);
  background-attachment: fixed;
}

::selection { background: var(--ink); color: var(--paper); }

/* 中文唔應該有字距（字距只適用於拉丁大寫微標） */
html[lang="zh-HK"] .btn,
html[lang="zh-HK"] .footnote,
html[lang="zh-HK"] .r-label,
html[lang="zh-HK"] .aside-label,
html[lang="zh-HK"] .quiz-head-note,
html[lang="zh-HK"] .aside-note,
html[lang="zh-HK"] .lang-btn { letter-spacing: 0; }

/* ---- Language bar ------------------------------------------------ */
.lang-bar {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: .1rem;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .18rem .3rem;
  box-shadow: 0 1px 2px rgba(26,22,17,.04);
}

.lang-btn {
  position: relative;
  background: none;
  border: 0;
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 400;
  letter-spacing: .12em;
  color: var(--muted);
  cursor: pointer;
  padding: .45rem .55rem;
  min-width: 2.4rem;
  transition: color var(--dur) var(--ease);
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.active { background: var(--ink); color: var(--paper); font-weight: 500; border-radius: 999px; }
.lang-btn.active::after { content: none; }
.lang-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.lang-dot { color: var(--line-mid); font-size: .7rem; }

/* ---- Layout ------------------------------------------------------ */
.root {
  display: flex;
  align-items: flex-start;          /* 唔用 center：內容高過視窗時會切走頂部 */
  justify-content: center;
  min-height: 100vh;
  padding: clamp(1.25rem, 4vw, 3rem);
}

.sheet {
  background: var(--canvas);
  border: 1px solid var(--line);
  width: 100%;
  position: relative;
  margin: auto 0;                   /* 有空間就居中，冇空間就正常捲動 */
  box-shadow:
    0 1px 2px rgba(26,22,17,.03),
    0 8px 22px -6px rgba(26,22,17,.05),
    0 32px 60px -30px rgba(26,22,17,.12);
}

/* ---- Home -------------------------------------------------------- */
.home-sheet {
  max-width: 1020px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr);
}

.home-main { padding: var(--pad); }

.home-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--sans);
  font-size: .64rem;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink);
}

.brand-rule { flex: 0 0 2rem; height: 1px; background: var(--line-mid); }

.brand-sub {
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 300;
  letter-spacing: .06em;
  color: var(--muted);
}

.title {
  font-family: var(--serif-display);
  font-size: clamp(3rem, 8vw, 4.6rem);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.02em;
  margin-bottom: 1.5rem;
}

.d-block { display: block; }

.sub {
  font-family: var(--serif);
  font-size: clamp(.98rem, 1.6vw, 1.08rem);
  line-height: 1.9;
  color: var(--ink-soft);
  max-width: 28rem;
}

.rule {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 2.1rem 0 1.6rem;
  max-width: 28rem;
}

.desc {
  font-family: var(--sans);
  font-size: .86rem;
  font-weight: 300;
  line-height: 2;
  color: var(--ink-soft);
  max-width: 26rem;
  margin-bottom: 2.9rem;
}

.cta-block { display: flex; flex-direction: column; gap: .85rem; align-items: flex-start; }

/* ---- Aside: the six drinks --------------------------------------- */
.home-aside {
  border-left: 1px solid var(--line);
  background: var(--paper-deep);
  padding: var(--pad) calc(var(--pad) * .8);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.75rem;
}

.aside-label {
  font-family: var(--sans);
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}

.drink-index {
  list-style: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 12rem;
}

.drink-index li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: .52rem 0;
  border-top: 1px solid var(--line);
  font-family: var(--serif-display);
  font-size: 1.1rem;
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--ink);
}
.drink-index li:last-child { border-bottom: 1px solid var(--line); }

.idx-body { display: flex; flex-direction: column; gap: .18rem; min-width: 0; }
.idx-body b {
  font-family: var(--serif-display);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.2;
}
.idx-body i {
  font-style: normal;
  font-family: var(--sans);
  font-size: .56rem;
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.idx-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  object-fit: cover;
  object-position: 50% 50%;
  border: 1px solid var(--line);
  background: var(--paper-deep);
  transition: transform var(--dur) var(--ease);
}
.drink-index li:hover .idx-thumb { transform: scale(1.04); }

/* 菜單式編號：01–06（同測驗選項同一套數字系統） */
.drink-index { counter-reset: drink; }
.drink-index li::before {
  counter-increment: drink;
  content: counter(drink, decimal-leading-zero);
  font-family: var(--sans);
  font-size: .66rem;
  letter-spacing: .1em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  flex: 0 0 1.9rem;
}

.legal {
  font-family: var(--sans);
  font-size: .66rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--muted);
  margin-top: .9rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
  text-wrap: pretty;
}

.aside-note {
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 300;
  line-height: 1.9;
  color: var(--muted);
  text-wrap: pretty;
}

/* ---- Buttons ---------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #F7F3EA;
  text-decoration: none;
  font-family: var(--sans);
  font-size: .83rem;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1;
  padding: 1.15rem 2.3rem;
  min-height: 48px;
  border: 0;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  box-shadow: 0 1px 2px rgba(14,90,58,.16);
}
.btn:hover {
  background: #0A4630;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(14,90,58,.22);
}
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.btn-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .6rem .1rem;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn-link { border-bottom-color: var(--line); }
.btn-link:hover { color: var(--ink); border-bottom-color: var(--ink); }
.btn-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.footnote {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 300;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Quiz -------------------------------------------------------- */
.quiz-card { max-width: 620px; padding: var(--pad); }

.quiz-eyebrow {
  font-family: var(--sans);
  font-size: .62rem;
  font-weight: 400;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.quiz-eyebrow .brand { font-size: .62rem; letter-spacing: .22em; color: var(--ink); }
.quiz-eyebrow-sep { margin: 0 .5rem; color: var(--line-mid); }
html[lang="zh-HK"] .quiz-eyebrow { letter-spacing: 0; }

.quiz-head { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.1rem; }

.quiz-hint {
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 300;
  letter-spacing: .06em;
  color: var(--muted);
  text-align: right;
  line-height: 1.4;
}
@media (max-width: 520px) { .quiz-hint { display: none; } }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .1em;
  color: var(--muted);
  padding: .25rem .05rem;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.back-btn:hover { color: var(--ink); border-bottom-color: var(--line-mid); }
.back-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
html[lang="zh-HK"] .back-btn { letter-spacing: 0; }

.step {
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .18em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.quiz-head-rule { flex: 1; height: 1px; background: var(--line); }

.quiz-head-note {
  font-family: var(--sans);
  font-size: .62rem;
  font-weight: 300;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* 進度：一條線切成 3 段；JS 只需照舊改 width */
/* 連續幼軌（唔用分段 mask，避免 fill 跨過空隙睇落似壞咗） */
.progress-line {
  position: relative;
  width: 100%;
  height: 2px;
  background: var(--line);
  margin-bottom: 2.6rem;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width .45s var(--ease);
}

.q-text {
  font-family: var(--serif);
  font-size: clamp(1.28rem, 2.6vw, 1.52rem);
  font-weight: 500;
  line-height: 1.68;
  margin-bottom: 2.35rem;
  min-height: 3.4rem;
  text-wrap: pretty;
}

.opts { display: flex; flex-direction: column; gap: .6rem; counter-reset: opt; margin-bottom: .4rem; }

.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: 56px;
  padding: 1.1rem 1.2rem;
  background: var(--canvas);
  border: 1px solid var(--control);
  font-family: var(--serif);
  font-size: .93rem;
  line-height: 1.55;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  counter-increment: opt;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease), color var(--dur) var(--ease);
  animation: opt-in .42s var(--ease) both;
}

.opt::before {
  content: counter(opt, decimal-leading-zero);
  font-family: var(--sans);
  font-size: .66rem;
  letter-spacing: .1em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  flex: 0 0 1.6rem;
  transition: color var(--dur) var(--ease);
}

.opt:nth-child(1) { animation-delay: .02s; }
.opt:nth-child(2) { animation-delay: .07s; }
.opt:nth-child(3) { animation-delay: .12s; }
.opt:nth-child(4) { animation-delay: .17s; }

.opt:hover {
  background: var(--wash);
  border-color: var(--line-mid);
  transform: translateX(3px);
}
.opt:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.opt:hover::before { color: var(--accent); }

/* 右側箭嘴：明確話俾用戶知按咗會前進 */
.opt::after {
  content: "→";
  margin-left: auto;
  padding-left: .9rem;
  font-family: var(--sans);
  font-size: .8rem;
  color: var(--muted);
  opacity: .55;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease),
              color var(--dur) var(--ease);
}
.opt:hover::after { transform: translateX(3px); opacity: 1; color: var(--accent); }
.opt.selected::after { color: rgba(247,243,234,.85); opacity: 1; transform: translateX(3px); }

.opt.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #F7F3EA;
  transform: translateX(3px);
}
.opt.selected::before { color: rgba(247,243,234,.6); }

@keyframes opt-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Result ----------------------------------------------------- */
.result-card {
  max-width: 640px;
  padding: var(--pad);
  text-align: left;
  overflow: hidden;
}

/* 飲品主色由卡片頂部柔和滲出（JS 只設定 background colour） */
.r-glow {
  position: absolute;
  top: -140px;
  left: 50%;
  transform: translateX(-50%);
  width: 130%;
  height: 320px;
  border-radius: 50%;
  opacity: .16;
  filter: blur(58px);
  pointer-events: none;
  transition: background .6s var(--ease);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
          mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
}

/* 飲品實拍：完整正方形（不裁切，保住杯口），居中 */
.r-photo {
  position: relative;
  display: block;
  width: min(100%, 320px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 50% 50%;
  background: var(--canvas);
  border: 1px solid var(--line);
  margin: 0 auto 1.7rem;
}

.r-mood {
  position: relative;
  font-family: var(--serif);
  font-size: .96rem;
  font-style: italic;
  line-height: 1.95;
  color: var(--ink-soft);
  margin-bottom: 1.8rem;
  text-wrap: pretty;
}

.divider {
  border: 0;
  width: 100%;
  height: 1px;
  background: var(--line);
  margin: 0 0 1.6rem;
}

.r-name {
  position: relative;
  font-family: var(--serif-display);
  font-size: clamp(2.15rem, 5vw, 2.7rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.01em;
  margin-bottom: .55rem;
  transition: color .5s var(--ease);
}

.r-tagline {
  font-family: var(--sans);
  font-size: .84rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 1.7rem;
}

.r-section { margin-bottom: 1.45rem; padding-top: 1.45rem; border-top: 1px solid var(--line); }
.r-section:first-of-type { padding-top: 0; border-top: 0; }

.r-label {
  font-family: var(--sans);
  font-size: .64rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .5rem;
}

.r-body {
  font-family: var(--serif);
  font-size: .89rem;
  line-height: 1.9;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.r-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 2.35rem;
  padding-top: 1.85rem;
  border-top: 1px solid var(--line);
}

/* ---- Particles -------------------------------------------------- */
.r-particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.particle {
  position: absolute;
  bottom: -10px;
  border-radius: 50%;
  opacity: 0;
  animation: particle-rise 3s ease-out forwards;
}
@keyframes particle-rise {
  0%   { opacity: 0; transform: translateY(0) scale(.5); }
  20%  { opacity: .45; }
  100% { opacity: 0; transform: translateY(-140px) scale(1); }
}

/* ---- Result entrance ------------------------------------------- */
.result-card .r-mood,
.result-card .divider,
.result-card .r-name,
.result-card .r-tagline,
.result-card .r-section,
.result-card .r-actions { animation: fade-up .55s var(--ease) both; }

.result-card .r-photo   { animation-delay: .05s; }
.result-card .r-mood    { animation-delay: .15s; }
.result-card .divider   { animation-delay: .3s; }
.result-card .r-name    { animation-delay: .38s; }
.result-card .r-tagline { animation-delay: .5s; }
.result-card .r-section:nth-of-type(1) { animation-delay: .62s; }
.result-card .r-section:nth-of-type(2) { animation-delay: .7s; }
.result-card .r-section:nth-of-type(3) { animation-delay: .78s; }
.result-card .r-section:nth-of-type(4) { animation-delay: .86s; }
.result-card .r-actions { animation-delay: 1.05s; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Responsive ------------------------------------------------- */
@media (max-width: 900px) {
  .home-sheet { grid-template-columns: 1fr; }
  .home-aside {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: calc(var(--pad) * .8) var(--pad);
  }
  .drink-index { min-height: 0; }
}

/* 矮身螢幕（laptop ~720-800px）：收窄內距，令結果頁更易一屏睇完 */
@media (max-height: 820px) {
  :root { --pad: 2rem; }
  .r-photo { width: min(100%, 260px); margin-bottom: 1.25rem; }
  .result-card .r-mood { margin-bottom: 1.1rem; font-size: .92rem; }
  .result-card .divider { margin-bottom: 1.15rem; }
  .result-card .r-tagline { margin-bottom: 1.2rem; }
  .r-section { margin-bottom: .95rem; padding-top: .95rem; }
  .result-card .r-actions { margin-top: 1.5rem; padding-top: 1.25rem; }
}

@media (max-width: 560px) {
  :root { --pad: 1.5rem; }
  .root { padding: 4.5rem .9rem 1.5rem; align-items: flex-start; }
  .title { font-size: clamp(2.6rem, 15vw, 3.4rem); }
  .desc { margin-bottom: 2rem; }
  .cta-block { align-items: stretch; }
  .btn { width: 100%; }
  .footnote { text-align: center; }
  .r-actions { flex-direction: column; align-items: stretch; gap: .75rem; }
  .r-actions .btn { width: 100%; }
  .r-actions .btn-link { text-align: center; }
}

/* ---- Motion preference ----------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
