:root {
  --bg: #faf7f2;
  --bg-alt: #ffffff;
  --text: #2a1f1a;
  --text-muted: #6b5d54;
  --border: #e6dcd0;
  --accent: #7a1f3d;
  --accent-hover: #5e1730;
  --accent-soft: #f4e4ea;
  --card-shadow: 0 2px 10px rgba(122, 31, 61, 0.08);
  --radius: 12px;
  --gold: #c9a24b;
  --success: #3a7d44;
  --danger: #b3261e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #17110f;
  --bg-alt: #221a17;
  --text: #f2e9e4;
  --text-muted: #b8a99e;
  --border: #3a2d27;
  --accent: #d98aa3;
  --accent-hover: #e8a5ba;
  --accent-soft: #382025;
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  --gold: #d9b566;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  line-height: 1.25;
  margin: 0 0 0.5em;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Nav ─────────────────────────────────────────────────────────────── */
.site-nav {
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.nav-brand:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 18px;
  flex: 1;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-link.active {
  color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.nav-account {
  display: inline-block;
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  vertical-align: middle;
}

.nav-login {
  background: var(--accent);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 999px;
}
.nav-login:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.icon-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

/* ── Language picker (Apple System Preferences-style popover) ──────────── */
.lang-picker {
  position: relative;
}

.lang-picker-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.lang-picker-trigger:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.lang-picker-flag { font-size: 1rem; line-height: 1; }
.lang-picker-code { letter-spacing: 0.03em; }
.lang-picker-chevron {
  width: 10px;
  height: 10px;
  transition: transform 0.18s ease;
  color: var(--text-muted);
}
.lang-picker.open .lang-picker-chevron { transform: rotate(180deg); }

.lang-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  z-index: 100;
  transform-origin: top right;
  transform: scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.14s ease;
}
.lang-picker.open .lang-picker-menu {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

.lang-picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
}
.lang-picker-option:hover { background: var(--accent-soft); }
.lang-picker-option .flag { font-size: 1.05rem; }
.lang-picker-option .name { flex: 1; }
.lang-picker-option .check { color: var(--accent); font-weight: 700; opacity: 0; }
.lang-picker-option.selected .check { opacity: 1; }
.lang-picker-option.selected { font-weight: 600; }

/* ── Buttons / forms ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover {
  background: var(--accent-hover);
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover {
  background: var(--accent-soft);
}

.btn-small {
  padding: 6px 14px;
  font-size: 0.85rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-alt);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}
textarea {
  resize: vertical;
  min-height: 80px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.field {
  margin-bottom: 16px;
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  padding: 72px 20px 56px;
  text-align: center;
  background: linear-gradient(180deg, var(--accent-soft), transparent);
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.hero p {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 28px;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Cards / grid ────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.wine-card {
  padding: 0;
  color: var(--text);
  display: flex;
  flex-direction: column;
}
.wine-card:hover {
  text-decoration: none;
  border-color: var(--accent);
}

.wine-swatch {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.wine-swatch.type-red { background: linear-gradient(135deg, #7a1f3d, #4a1226); }
.wine-swatch.type-white { background: linear-gradient(135deg, #eddca0, #d9c67a); }
.wine-swatch.type-rose { background: linear-gradient(135deg, #f2b8c6, #e58aa3); }
.wine-swatch.type-sparkling { background: linear-gradient(135deg, #f4e9c9, #e0c98f); }
.wine-swatch.type-dessert { background: linear-gradient(135deg, #b8863a, #8a5f24); }

.wine-card-photo {
  height: 170px;
  width: 100%;
  object-fit: cover;
  display: block;
  background: var(--accent-soft);
}

.wine-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wine-card-name {
  font-weight: 700;
  font-size: 1.02rem;
}

.wine-card-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.wine-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
}

.stars {
  color: var(--gold);
  letter-spacing: 1px;
}

.price-tag {
  font-weight: 700;
  color: var(--text);
}

.price-try {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.85em;
}

/* ── Sections ────────────────────────────────────────────────────────── */
.section {
  padding: 48px 0;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}

/* ── Filters ─────────────────────────────────────────────────────────── */
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
  padding: 18px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filters .field {
  margin-bottom: 0;
}

/* ── Wine detail ─────────────────────────────────────────────────────── */
.wine-detail-header {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.wine-detail-photo {
  width: 220px;
  height: 280px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--card-shadow);
}

.wine-detail-swatch {
  width: 160px;
  height: 220px;
  border-radius: var(--radius);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
}

.wine-detail-info h1 {
  margin-bottom: 4px;
}

.wine-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 20px 0;
  padding: 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.wine-fact-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.wine-fact-value {
  font-weight: 600;
}

/* ── Reviews / comments ──────────────────────────────────────────────── */
.review, .comment {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.review:last-child, .comment:last-child {
  border-bottom: none;
}

.review-header, .comment-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.star-input {
  display: flex;
  gap: 4px;
  font-size: 1.5rem;
  cursor: pointer;
}
.star-input .star {
  color: var(--border);
}
.star-input .star.filled {
  color: var(--gold);
}

/* ── Avatars ─────────────────────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  color: #fff;
  font-family: "Fraunces", "Playfair Display", serif;
  font-weight: 600;
  line-height: 1;
}

/* ── Community posts ─────────────────────────────────────────────────── */
.post-card {
  padding: 20px 22px;
  color: var(--text);
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.post-card:hover {
  text-decoration: none;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(20, 8, 12, 0.1);
}

.post-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.post-author-name {
  font-weight: 600;
  color: var(--text);
}

.post-card-author {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.wine-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
}

.post-card-content {
  margin-bottom: 14px;
  line-height: 1.6;
  font-size: 1rem;
}

.post-card-stats {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.post-card-stats a {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.post-card-stats a:hover { color: var(--accent); text-decoration: none; }

.like-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s ease;
}
.like-btn svg { width: 15px; height: 15px; }
.like-btn:hover { color: var(--accent); }
.like-btn.liked {
  color: var(--accent);
  font-weight: 600;
}
.like-btn.liked svg { fill: var(--accent); }

/* ── Quiz ────────────────────────────────────────────────────────────── */
.quiz-card {
  max-width: 620px;
  margin: 0 auto;
  padding: 32px;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.quiz-option {
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-alt);
  font-weight: 500;
  font-size: 0.9rem;
}
.quiz-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.recommendation-card {
  border-left: 4px solid var(--accent);
  padding: 18px;
  margin-bottom: 16px;
  background: var(--bg-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.recommendation-reason {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

/* ── Chat widget (frosted-glass "AI Sommelier" panel) ───────────────────── */
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(155deg, var(--accent-hover), var(--accent) 60%, #9c2743);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(122, 31, 61, 0.38);
  z-index: 60;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.chat-fab:hover { transform: scale(1.06); }
.chat-fab svg { width: 24px; height: 24px; position: relative; z-index: 1; }
.chat-fab::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  opacity: 0;
  animation: chat-fab-ping 2.8s cubic-bezier(0.2, 0.7, 0.3, 1) infinite;
}
@keyframes chat-fab-ping {
  0% { transform: scale(0.85); opacity: 0.55; }
  70%, 100% { transform: scale(1.35); opacity: 0; }
}

.chat-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: min(380px, calc(100vw - 40px));
  height: min(560px, calc(100vh - 110px));
  background: color-mix(in srgb, var(--bg-alt) 82%, transparent);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 22px;
  box-shadow: 0 16px 48px rgba(20, 8, 12, 0.22), 0 2px 8px rgba(20, 8, 12, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 60;
  overflow: hidden;
  transform-origin: bottom right;
  animation: chat-panel-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes chat-panel-in {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.chat-header {
  padding: 16px 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Fraunces", "Playfair Display", serif;
  font-weight: 600;
  font-size: 1.02rem;
}
.chat-header-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-header-icon svg { width: 16px; height: 16px; }

.chat-close {
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s ease;
}
.chat-close:hover { background: var(--accent-soft); }
.chat-close svg { width: 14px; height: 14px; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  padding: 10px 15px;
  border-radius: 18px;
  font-size: 0.92rem;
  max-width: 85%;
  line-height: 1.45;
  animation: chat-msg-in 0.18s ease-out;
}
@keyframes chat-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(155deg, var(--accent), var(--accent-hover));
  color: #fff;
  border-bottom-right-radius: 6px;
}
.chat-msg.assistant {
  align-self: flex-start;
  background: var(--accent-soft);
  color: var(--text);
  border-bottom-left-radius: 6px;
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.chat-input-row input {
  flex: 1;
  border-radius: 999px;
  background: var(--bg);
  border-color: color-mix(in srgb, var(--border) 80%, transparent);
}
.chat-send-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
.chat-send-btn:hover { background: var(--accent-hover); }
.chat-send-btn:active { transform: scale(0.92); }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-send-btn svg { width: 15px; height: 15px; }

/* ── Auth pages ──────────────────────────────────────────────────────── */
.auth-card {
  max-width: 400px;
  margin: 64px auto;
  padding: 32px;
}

.auth-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── Misc ────────────────────────────────────────────────────────────── */
.muted {
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.error-msg {
  color: var(--danger);
  font-size: 0.88rem;
  margin-top: 8px;
}

.success-msg {
  color: var(--success);
  font-size: 0.88rem;
  margin-top: 8px;
}

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 40px;
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }
  .site-nav-inner {
    padding: 10px 16px;
    gap: 12px;
  }
  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 14px;
  }
  .nav-actions {
    gap: 8px;
  }
  .wine-detail-header {
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }
  .wine-detail-info {
    width: 100%;
    text-align: left;
  }
  .quiz-card {
    padding: 22px 18px;
  }
  .post-card {
    padding: 16px;
  }
  .chat-fab {
    bottom: 16px;
    right: 16px;
  }
  .chat-panel {
    bottom: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

@media (max-width: 400px) {
  .nav-brand-text {
    display: none;
  }
  .lang-picker-code {
    display: none;
  }
  .lang-picker-trigger {
    padding: 6px 8px;
  }
  .nav-account {
    max-width: 90px;
  }
}

/* ── Pour hero (homepage) — deliberately always white/ink, independent of
   the light/dark toggle, like a printed wine label ───────────────────── */
.pour-hero-track {
  position: relative;
  height: 320vh;
}

.pour-hero-sticky {
  position: sticky;
  top: var(--nav-height, 65px);
  height: calc(100vh - var(--nav-height, 65px));
  min-height: 480px;
  overflow: hidden;
  background: #ffffff;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  align-items: center;
}

.pour-hero-copy {
  position: relative;
  z-index: 3;
  padding: 0 clamp(24px, 6vw, 88px);
  max-width: 480px;
}

.pour-hero-eyebrow {
  font-family: "Archivo", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
  display: inline-block;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 6px;
}

.pour-hero-copy h1 {
  font-family: "Fraunces", "Playfair Display", serif;
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: #241f1b;
}

.pour-hero-copy p {
  margin: 20px 0 28px;
  font-size: 1.02rem;
  line-height: 1.6;
  color: #8a8178;
  max-width: 40ch;
}

.pour-hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.pour-scroll-cue {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 36px;
  font-family: "Archivo", sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8a8178;
  transition: opacity 0.3s ease;
}
.pour-scroll-cue svg { width: 14px; height: 14px; animation: pour-bob 1.6s ease-in-out infinite; }
@keyframes pour-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

#home-content {
  position: relative;
  z-index: 2;
  background: var(--bg);
  transition: opacity 0.2s ease;
}

.pour-hero-scene {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pour-hero-scene svg { width: min(78%, 460px); height: auto; overflow: visible; }

@media (max-width: 760px) {
  .pour-hero-sticky { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .pour-hero-copy { padding-top: 6vh; max-width: none; }
  .pour-hero-scene svg { width: 58%; }
}

@media (prefers-reduced-motion: reduce) {
  .pour-scroll-cue svg { animation: none; }
}

/* ── Auth split layout — form + a continuous ambient wine motif panel ──── */
.auth-split {
  min-height: calc(100vh - var(--nav-height, 65px));
  display: grid;
  grid-template-columns: minmax(320px, 480px) 1fr;
}

.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  max-width: 380px;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.auth-eyebrow {
  font-family: "Archivo", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
  display: inline-block;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 5px;
}

.auth-card h1 {
  font-family: "Fraunces", "Playfair Display", serif;
}

.auth-wine-panel {
  position: relative;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(24px, 6vh, 64px);
  padding: 32px 0;
}

.wine-marquee-row {
  overflow: hidden;
  width: 100%;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.wine-marquee-track {
  display: flex;
  width: max-content;
  gap: 48px;
  animation: wine-marquee linear infinite;
  animation-duration: var(--duration, 30s);
}
@keyframes wine-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.wine-marquee-row.back .wine-marquee-track { gap: 40px; }
.wine-marquee-row.back svg { width: 28px; height: 28px; opacity: 0.35; }
.wine-marquee-row.front svg { width: 40px; height: 40px; opacity: 0.7; }

.wine-marquee-track svg {
  flex-shrink: 0;
  color: #241f1b;
}

.wine-swirl-glass {
  display: flex;
  align-items: center;
  justify-content: center;
}
.wine-swirl-glass svg { width: min(58%, 220px); height: auto; }

.wine-swirl-highlight {
  transform-origin: 240px 470px;
  animation: wine-swirl 7s linear infinite;
}
@keyframes wine-swirl {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 860px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-wine-panel { min-height: 280px; order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  .wine-marquee-track, .wine-swirl-highlight { animation: none; }
}

/* ── Pour loading animation (quiz "AI is thinking" state) ───────────────── */
.pour-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 24px 0 8px;
}
.pour-loader svg { width: min(70%, 210px); height: auto; }
.pour-loader-label {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ── Quiz page background video ─────────────────────────────────────── */
.quiz-bg-video-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
}
.quiz-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(18px) saturate(1.1) brightness(0.85);
  transform: scale(1.08); /* hides the soft blurred edge from the viewport */
}
.quiz-bg-video-overlay {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}
.quiz-container-wrap,
.section:has(.quiz-card) {
  position: relative;
  z-index: 1;
}

/* ── Quiz step wizard ────────────────────────────────────────────────── */
.quiz-progress {
  display: flex;
  gap: 7px;
  justify-content: center;
  margin: 4px 0 28px;
}
.quiz-progress-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s ease, transform 0.2s ease;
}
.quiz-progress-dot.active { background: var(--accent); transform: scale(1.35); }
.quiz-progress-dot.done { background: var(--gold); }

.quiz-step { animation: quiz-step-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes quiz-step-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.quiz-step.exiting {
  animation: quiz-step-out 0.16s ease forwards;
}
@keyframes quiz-step-out {
  to { opacity: 0; transform: translateX(-20px); }
}

.quiz-step-question {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 18px;
  text-align: center;
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 26px;
}
.quiz-back-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px 4px;
  visibility: hidden;
}
.quiz-back-btn.visible { visibility: visible; }
.quiz-back-btn:hover { color: var(--accent); }
