@font-face {
  font-family: "Cormorant Garamond";
  src: url("../assets/fonts/cormorant-garamond.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("../assets/fonts/manrope.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F5EEE8;
  --surface: #FCFAF8;
  --surface-card: #FFFFFF;
  --text-main: #2B101C;
  --text-muted: #6E5A64;
  --brand-burgundy: #58152E;
  --brand-rose: #B98276;
  --brand-blush: #D3A594;
  --border-light: #E7DBD2;
  --shadow-sm: 0 2px 8px rgba(43, 16, 28, 0.04);
  --shadow-md: 0 4px 16px rgba(43, 16, 28, 0.08);
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text-main);
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100dvh; display: flex; flex-direction: column; font-size: 17px; line-height: 1.5; }
.top { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; padding: 14px 20px 6px; max-width: 920px; width: 100%; margin: 0 auto; }
.brand-link { justify-self: center; display: flex; align-items: center; text-decoration: none; }
.logo { height: 36px; width: auto; max-width: 190px; object-fit: contain; display: block; }
.top-spacer { width: 42px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border-light); background: var(--surface); color: var(--text-main); padding: 0; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover:not(:disabled) { border-color: var(--brand-burgundy); color: var(--brand-burgundy); background: #fff; }
.icon-btn:disabled { opacity: 0; pointer-events: none; }
.progress { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 6px 0 10px; min-height: 24px; }
.progress span { width: 8px; height: 8px; border-radius: 50%; background: var(--border-light); transition: all .3s; }
.progress span.on { background: var(--brand-burgundy); width: 22px; border-radius: 4px; }
.progress em { font-style: normal; font-size: 12px; color: var(--text-muted); margin-left: 6px; font-weight: 600; }

main { flex: 1; width: 100%; max-width: 920px; margin: 0 auto; padding: 8px 20px 36px; display: flex; flex-direction: column; justify-content: safe center; }
.fade-in { animation: stage-in .6s ease-out both; }
@keyframes stage-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.eyebrow { text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .16em; color: var(--brand-rose); margin: 0 0 10px; }
.prompt { font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(30px, 5vw, 48px); font-weight: 600; line-height: 1.15; margin: 8px auto 10px; text-align: center; max-width: 20ch; text-wrap: balance; }
.why { text-align: center; color: var(--text-muted); font-size: 16px; margin: 0 auto 22px; max-width: 46ch; }
.prompt + .cards { margin-top: 14px; }

.cards { display: grid; gap: 14px; width: 100%; margin: 0 auto; }
.cards.c2 { grid-template-columns: 1fr 1fr; max-width: 620px; }
.cards.c3 { grid-template-columns: repeat(3, 1fr); max-width: 820px; }
.cards.c4 { grid-template-columns: 1fr 1fr; max-width: 680px; }
.cards.c5 { grid-template-columns: repeat(6, 1fr); max-width: 760px; }
.cards.c5 .card { grid-column: span 2; }
.cards.c5 .card:nth-child(4) { grid-column: 2 / span 2; }
.cards.c5 .card:nth-child(5) { grid-column: 4 / span 2; }
.cards.c6 { grid-template-columns: repeat(3, 1fr); max-width: 840px; }

.card { appearance: none; font: inherit; border: 1px solid var(--border-light); background: var(--surface-card); color: var(--text-main); text-align: left; padding: 20px; border-radius: 12px; cursor: pointer; min-height: 88px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 14px; position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s; animation: rise .7s cubic-bezier(.22,1,.36,1) both; }
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--brand-burgundy); opacity: 0; transition: opacity .2s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand-rose); }
.card:hover::before, .card:focus-visible::before { opacity: 1; }
.card:focus-visible, .btn:focus-visible, .icon-btn:focus-visible, .shop-btn:focus-visible, .again button:focus-visible, .escape a:focus-visible { outline: 3px solid var(--brand-burgundy); outline-offset: 3px; }
.card b { display: block; font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(20px, 2.5vw, 26px); font-weight: 600; line-height: 1.2; }
.card-icon { flex: 0 0 34px; height: 34px; border-radius: 8px; background: rgba(88,21,46,.06); color: var(--brand-burgundy); display: grid; place-items: center; }
.card:hover .card-icon { background: var(--brand-burgundy); color: #fff; }
.card.fast { border-style: dashed; }

/* image tiles (Q4) */
.tile { flex-direction: column; align-items: stretch; padding: 0; min-height: 0; gap: 0; }
.tile .art { height: 120px; display: grid; place-items: center; }
.tile .art svg { width: 64px; height: 64px; }
.tile b { padding: 12px 14px 14px; font-size: 21px; }
.tile.none .art { background: repeating-linear-gradient(135deg, #f4ede8 0 10px, #efe6e0 10px 20px); color: var(--text-muted); }
.btn { appearance: none; border: 0; font: inherit; font-weight: 700; font-size: 16px; padding: 15px 34px; border-radius: 10px; cursor: pointer; background: var(--brand-burgundy); color: #fff; box-shadow: var(--shadow-md); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { background: #400e20; }

/* S0 start */
.start { text-align: center; max-width: 640px; margin: 0 auto; }
.start .prompt { font-size: clamp(40px, 7vw, 64px); max-width: none; margin-bottom: 14px; }
.start p.body { font-size: 18px; color: var(--text-muted); max-width: 40ch; margin: 0 auto 28px; }
.bottles { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 0; margin: 0 auto 26px; height: 230px; }
.bottles::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 300px; height: 22px; transform: translateX(-50%); background: radial-gradient(ellipse at center, rgba(88,21,46,.18), rgba(88,21,46,0) 70%); z-index: 0; }
.bottles img { position: relative; z-index: 1; width: auto; filter: drop-shadow(0 10px 12px rgba(43,16,28,.16)); }
.bottles img:nth-child(1) { height: 180px; transform: rotate(-7deg); margin-right: -6px; }
.bottles img:nth-child(2) { height: 220px; z-index: 2; }
.bottles img:nth-child(3) { height: 180px; transform: rotate(7deg); margin-left: -6px; }

/* newcomer lesson */
.lesson { max-width: 640px; margin: 0 auto; text-align: center; }
.lesson .prompt { max-width: 22ch; margin-bottom: 28px; }
.lesson-points { list-style: none; padding: 0; margin: 0 auto 30px; display: grid; gap: 12px; max-width: 460px; text-align: left; }
.lesson-points li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; background: #fff; border: 1px solid var(--border-light); border-radius: 12px; padding: 16px 18px; animation: rise .7s cubic-bezier(.22,1,.36,1) both; }
.lesson-num { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-burgundy); color: #fff; font-family: "Manrope", sans-serif; font-size: 18px; font-weight: 700; font-variant-numeric: lining-nums; }
.lesson-points b { display: block; font-family: "Cormorant Garamond", serif; font-size: 23px; font-weight: 600; color: var(--brand-burgundy); line-height: 1.2; margin-bottom: 4px; }
.lesson-points p { margin: 0; font-size: 18px; color: var(--text-muted); }
@media (max-width: 600px) { .lesson-points p { font-size: 16px; } .lesson-points b { font-size: 21px; } }

/* B1 milestone */
.milestone { max-width: 700px; margin: 0 auto; text-align: center; }
.milestone .prompt { max-width: 24ch; }
.milestone .closer { font-family: "Cormorant Garamond", serif; font-size: 24px; font-weight: 600; font-style: italic; color: var(--brand-burgundy); margin: 0 0 26px; }
.milestone p.body { font-size: 18px; color: var(--text-muted); max-width: 44ch; margin: 0 auto 10px; text-wrap: pretty; }
.layers { display: grid; gap: 8px; max-width: 420px; margin: 0 auto 30px; }
.layer { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border-light); border-radius: 10px; padding: 10px 14px; text-align: left; animation: rise .7s cubic-bezier(.22,1,.36,1) both; }
.layer span { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--brand-rose); text-transform: uppercase; }
.layer i { font-style: normal; font-family: "Cormorant Garamond", serif; font-size: 20px; font-weight: 600; }
.layer.base { background: var(--brand-burgundy); border-color: var(--brand-burgundy); }
.layer.base span { color: var(--brand-blush); } .layer.base i { color: #fff; }
.layer .bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: rgba(88,21,46,.12); overflow: hidden; }
.layer .bar::after { content: ""; display: block; height: 100%; background: var(--brand-rose); width: var(--w); }
.layer.base .bar { background: rgba(255,255,255,.2); } .layer.base .bar::after { background: var(--brand-blush); }

/* A1 anticipation */
.anticipate { text-align: center; }
.ring { width: 76px; height: 76px; margin: 0 auto 26px; border-radius: 50%; border: 3px solid var(--border-light); border-top-color: var(--brand-burgundy); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.echo { font-family: "Cormorant Garamond", serif; font-style: italic; font-size: 24px; color: var(--brand-rose); margin: 0; }
.loadbar { width: 220px; height: 4px; background: var(--border-light); border-radius: 2px; margin: 26px auto 0; overflow: hidden; }
.loadbar::after { content: ""; display: block; height: 100%; width: 0; background: var(--brand-burgundy); animation: fill 1.8s linear forwards; }
@keyframes fill { to { width: 100%; } }

/* R1 results */
.results { max-width: 1060px; padding-top: 4px; justify-content: flex-start; }
.results-lead { font-family: "Cormorant Garamond", serif; font-size: clamp(26px, 3.8vw, 38px); font-weight: 600; line-height: 1.2; margin: 6px auto 6px; text-align: center; max-width: 30ch; text-wrap: balance; }
.results-sub { text-align: center; color: var(--text-muted); margin: 0 0 20px; font-size: 16px; }
.results-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.result { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border-light); border-radius: 12px; padding: 16px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; animation: rise .7s cubic-bezier(.22,1,.36,1) both; }
.result::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--brand-burgundy); }
.result.best { border-color: var(--brand-burgundy); box-shadow: 0 6px 22px rgba(88,21,46,.14); }
.badge { position: absolute; top: 12px; left: 12px; z-index: 1; background: var(--brand-burgundy); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; }
.img-wrap { height: 140px; background: #FFFFFF; border-radius: 8px; display: grid; place-items: center; margin-bottom: 10px; }
.img-wrap img { max-height: 128px; max-width: 85%; object-fit: contain; }
.house { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--brand-rose); margin: 0 0 2px; }
.result h2 { font-family: "Cormorant Garamond", serif; font-size: 23px; font-weight: 600; margin: 0 0 8px; line-height: 1.2; }
.notes { display: flex; flex-wrap: wrap; gap: 4px 6px; list-style: none; margin: 0 0 10px; padding: 0; }
.notes li { background: rgba(88,21,46,.05); padding: 3px 8px; border-radius: 4px; font-size: 12px; }
.reasons { list-style: none; margin: 0 0 14px; padding: 10px 0 0; border-top: 1px solid var(--border-light); display: grid; gap: 6px; }
.reasons li { display: flex; align-items: flex-start; gap: 8px; font-size: 15px; line-height: 1.35; font-weight: 600; color: var(--text-main); }
.reasons svg { flex: 0 0 18px; margin-top: 1px; color: #fff; background: var(--brand-burgundy); border-radius: 50%; padding: 3px; }
.result-body, .result-rest { display: flex; flex-direction: column; flex: 1; }
.offer { margin-top: auto; }
.price { color: var(--brand-burgundy); font-weight: 700; font-size: 15px; margin: 0 0 10px; }
.shop-btn { display: flex; width: 100%; justify-content: center; align-items: center; gap: 6px; background: var(--brand-burgundy); color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; padding: 11px 14px; border-radius: 8px; }
.shop-btn:hover { background: #400e20; }
.escape { text-align: center; margin: 26px 0 6px; font-size: 16px; color: var(--text-muted); }
.escape a { color: var(--brand-burgundy); font-weight: 700; text-underline-offset: 3px; }
.again { text-align: center; margin-top: 12px; }
.again button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border-light); background: #fff; color: var(--text-main); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; padding: 8px 20px; border-radius: 999px; }

/* ---------- narrow (container) ---------- */
@media (max-width: 767px) {
  .results { padding: 6px 14px 24px; }
  .results-list { display: flex; flex-direction: column; gap: 12px; }
  .result { display: grid; grid-template-columns: 96px 1fr; column-gap: 14px; padding: 14px; }
  .result::before { inset: 0 auto 0 0; width: 3px; height: auto; }
  .badge { top: 10px; left: 10px; font-size: 10px; padding: 3px 7px; }
  .img-wrap { height: 128px; margin: 22px 0 0; grid-row: 1 / span 2; align-self: start; }
  .img-wrap img { max-height: 116px; max-width: 84px; }
  .result h2 { font-size: 21px; margin-bottom: 6px; }
  .result-body { display: contents; }
  .result-rest { display: block; }
  .result-head { grid-column: 2; padding-top: 22px; }
  .result-rest { grid-column: 1 / -1; margin-top: 10px; }
  .notes { margin-bottom: 0; }
}
@media (max-width: 640px) {
  html, body, #app { font-size: 16px; }
  main { padding: 6px 16px 28px; }
  .cards.c2, .cards.c3, .cards.c4 { grid-template-columns: 1fr; }
  .cards.c5 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cards.c5 .card, .cards.c5 .card:nth-child(4) { grid-column: auto; }
  .cards.c5 .card:nth-child(5) { grid-column: 1 / -1; }
  .cards.c6 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 16px 14px; min-height: 68px; }
  .tile { padding: 0; }
  .tile .art { height: 92px; }
  .tile .art svg { width: 50px; height: 50px; }
  .tile b { font-size: 18px; padding: 10px 12px 12px; }
  .prompt { font-size: 28px; }
  .why { font-size: 16px; margin-bottom: 18px; }
  .start .prompt { font-size: 44px; }
  .start p.body, .milestone p.body { font-size: 17px; }
  .bottles { height: 180px; margin-bottom: 20px; } .bottles img:nth-child(1), .bottles img:nth-child(3) { height: 140px; } .bottles img:nth-child(2) { height: 172px; } .bottles::after { width: 240px; }
  .btn { width: 100%; }
}

.error-box { background: #FFF1F0; border: 1px solid #FFA39E; padding: 20px; border-radius: 8px; text-align: center; color: #CF1322; margin: 40px auto; max-width: 500px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .loadbar::after { width: 100%; }
}
