/* ============================================================
   Cà Phê Tales — style.css
   Warm, authentic Vietnamese coffee aesthetic.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;

  --bg: #17100b;
  --bg-soft: #1d140d;
  --surface: #241811;
  --card: #2a1c12;
  --card-hover: #332214;
  --line: #3d2b1c;
  --line-soft: #33251a;

  --text: #f3e6d2;
  --text-dim: #d6c2a6;
  --muted: #a89077;

  --accent: #d9944a;
  --accent-strong: #f0b06a;
  --accent-deep: #a65f22;
  --leaf: #7a8f63;

  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --container: 1180px;
  --nav-h: 74px;
}

[data-theme="light"] {
  --bg: #f7efe0;
  --bg-soft: #f3e9d6;
  --surface: #fbf5e9;
  --card: #fffaf0;
  --card-hover: #fffdf6;
  --line: #e2d0b4;
  --line-soft: #eadbc2;

  --text: #2b1a12;
  --text-dim: #4a3422;
  --muted: #7d664c;

  --accent: #a65f22;
  --accent-strong: #8a4e18;
  --accent-deep: #7c4512;
  --leaf: #5c7350;

  --shadow: 0 20px 50px rgba(90, 60, 30, 0.14);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-weight: 400;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: none; transition: color 0.25s ease; }
a:hover { color: var(--accent-strong); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; color: var(--text); }

button { font-family: var(--font-body); cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--accent); color: #1c120a; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #1c120a;
  padding: 10px 18px;
  z-index: 2000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.container { width: min(var(--container), 92%); margin-inline: auto; }

.section { padding: 110px 0; }
.section-tinted { background: var(--bg-soft); }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  margin-bottom: 18px;
}

.section-sub {
  color: var(--muted);
  max-width: 640px;
  font-size: 1.02rem;
}

.section-head { margin-bottom: 64px; }

.text-link {
  font-weight: 600;
  display: inline-block;
  margin-top: 8px;
}
.text-link:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  border: 1.5px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff8ec;
  box-shadow: 0 10px 30px rgba(169, 95, 34, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(169, 95, 34, 0.45); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.3s ease;
}

.nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand:hover { color: var(--text); }
.brand-mark { font-size: 1.35rem; filter: saturate(1.15); }
.brand-name em { font-style: normal; color: var(--accent); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-link {
  display: block;
  padding: 9px 14px;
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: 999px;
}
.nav-link:hover { color: var(--accent-strong); background: var(--card); }
.nav-link.is-active { color: var(--accent-strong); background: var(--card); }

.theme-toggle {
  margin-left: 8px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--accent-strong);
  font-size: 1.05rem;
  display: grid;
  place-items: center;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.theme-toggle:hover { transform: rotate(20deg); border-color: var(--accent); }

[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  width: 42px;
  height: 42px;
  position: relative;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px auto;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url("https://images.unsplash.com/photo-1518057111178-44a106bad636?auto=format&fit=crop&w=1920&q=80");
  background-size: cover;
  background-position: center 30%;
  animation: heroZoom 24s ease-in-out infinite alternate;
}
@keyframes heroZoom {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 45%, rgba(23, 16, 11, 0.25) 0%, rgba(23, 16, 11, 0.72) 70%),
    linear-gradient(180deg, rgba(23, 16, 11, 0.35) 0%, rgba(23, 16, 11, 0.55) 55%, var(--bg) 100%);
}

[data-theme="light"] .hero-overlay {
  background:
    radial-gradient(ellipse at 30% 45%, rgba(247, 239, 224, 0.15) 0%, rgba(23, 16, 11, 0.5) 70%),
    linear-gradient(180deg, rgba(23, 16, 11, 0.35) 0%, rgba(23, 16, 11, 0.5) 55%, var(--bg) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
  padding: 120px 0 160px;
}

.hero-eyebrow { color: var(--accent-strong); }

.hero-title {
  font-size: clamp(2.6rem, 6.2vw, 4.6rem);
  font-weight: 700;
  line-height: 1.08;
  color: #f6ead4;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.55);
  margin-bottom: 22px;
}
.hero-title .amp { font-style: italic; color: var(--accent-strong); font-weight: 400; }

.hero-sub {
  color: #e5d4ba;
  font-size: 1.08rem;
  max-width: 620px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
  margin-bottom: 38px;
}

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

.hero-word {
  position: absolute;
  right: -1.5rem;
  bottom: 6%;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(6rem, 20vw, 17rem);
  font-weight: 700;
  color: rgba(217, 148, 74, 0.09);
  line-height: 1;
  user-select: none;
  pointer-events: none;
  letter-spacing: 0.04em;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #e5d4ba;
}
.scroll-hint-text { font-size: 0.78rem; letter-spacing: 0.28em; text-transform: uppercase; }
.scroll-hint-line {
  width: 1.5px;
  height: 52px;
  background: linear-gradient(180deg, var(--accent-strong), transparent);
  animation: drip 2.2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes drip {
  0% { transform: scaleY(0); }
  50% { transform: scaleY(1); }
  100% { transform: scaleY(1); opacity: 0.2; }
}

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 18px 0;
}
.marquee-track {
  display: flex;
  gap: 34px;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.marquee-track span { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: 0.22em; color: var(--text-dim); white-space: nowrap; }
.marquee-track .dot { color: var(--accent); font-size: 0.8rem; align-self: center; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Prologue ---------- */
.prologue-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 70px;
  align-items: start;
}

.lede { font-size: 1.13rem; color: var(--text-dim); margin-bottom: 20px; }
.prologue-copy p:not(.lede):not(.eyebrow) { color: var(--muted); margin-bottom: 18px; }

.pull-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--accent-strong);
  border-left: 3px solid var(--accent);
  padding: 6px 0 6px 24px;
  margin: 30px 0;
}
.pull-quote em { color: var(--text); }

.prologue-media figure {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
}
.prologue-media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; transition: transform 0.6s ease; }
.prologue-media figure:hover img { transform: scale(1.04); }
.prologue-media figcaption {
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--surface);
}

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
}
.stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-label { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }

/* ---------- Stories ---------- */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.story-card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.story-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.story-media { position: relative; overflow: hidden; aspect-ratio: 10/7; }
.story-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.story-card:hover .story-media img { transform: scale(1.07); }

.story-era {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(23, 16, 11, 0.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(240, 176, 106, 0.4);
}

.story-body { padding: 22px 24px 26px; }
.story-title { font-size: 1.35rem; margin-bottom: 6px; }
.story-tagline { color: var(--muted); font-size: 0.95rem; margin-bottom: 12px; }
.story-blend { font-size: 0.85rem; color: var(--text-dim); }
.story-blend strong { color: var(--accent); font-weight: 600; }
.story-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent);
}
.story-card:hover .story-link { color: var(--accent-strong); }
.story-link span { transition: transform 0.3s ease; }
.story-card:hover .story-link span { transform: translateX(6px); }

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  max-width: 860px;
  margin-inline: auto;
  padding: 10px 0;
}

.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--line);
  transform: translateX(-50%);
}
.timeline-progress {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--accent-strong), var(--accent-deep));
  transform: scaleY(0);
  transform-origin: top;
}

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  margin-bottom: 56px;
}
.tl-item:last-child { margin-bottom: 0; }

.tl-dot {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--accent);
  transform: translateX(-50%);
  z-index: 2;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}
.tl-item.is-visible .tl-dot { background: var(--accent-strong); box-shadow: 0 0 0 7px rgba(217, 148, 74, 0.18); }

.tl-card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.tl-item:nth-child(even) .tl-card { grid-column: 2; }
.tl-item:nth-child(odd) .tl-card { grid-column: 1; text-align: right; }
.tl-item:nth-child(odd) .tl-card img { margin-inline-start: auto; }

.tl-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.tl-year {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #1c120a;
  background: var(--accent);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.tl-title { font-size: 1.3rem; margin-bottom: 10px; }
.tl-card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 16px; }
.tl-card img { width: 100%; aspect-ratio: 3/2; object-fit: cover; border-radius: 10px; }

/* ---------- Blends ---------- */
.blend-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 34px;
  align-items: stretch;
}

.blend-tabs { display: flex; flex-direction: column; gap: 10px; }
.blend-tab {
  text-align: left;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--card);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.98rem;
  font-family: var(--font-display);
  transition: all 0.3s ease;
}
.blend-tab:hover { border-color: var(--accent); transform: translateX(4px); }
.blend-tab.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff8ec;
  border-color: transparent;
  box-shadow: 0 10px 26px rgba(169, 95, 34, 0.35);
  transform: translateX(4px);
}

.blend-panel {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 38px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.blend-anim { animation: fadeSlide 0.45s ease; }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.blend-panel-top { display: flex; gap: 26px; align-items: flex-start; }
.blend-badge {
  flex-shrink: 0;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff8ec;
  background: radial-gradient(circle at 30% 25%, var(--accent-strong), var(--accent-deep));
  box-shadow: 0 10px 30px rgba(169, 95, 34, 0.4);
}
.blend-name { font-size: 1.9rem; margin-bottom: 6px; }
.blend-story { color: var(--muted); font-style: italic; font-family: var(--font-display); font-size: 1.05rem; }

.blend-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  border-top: 1px dashed var(--line);
  padding-top: 28px;
}
.blend-col h4 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.blend-col p { color: var(--muted); font-size: 0.92rem; }
.notes-list { list-style: none; color: var(--muted); font-size: 0.92rem; }
.notes-list li { padding-left: 18px; position: relative; margin-bottom: 6px; }
.notes-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Recipes ---------- */
.recipes-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 960px;
  margin-inline: auto;
}

.recipe-item {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s ease;
}
.recipe-item.is-open { border-color: var(--accent); }

.recipe-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
  background: none;
  border: none;
  text-align: left;
  color: var(--text);
}

.recipe-num {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--accent);
  width: 46px;
}

.recipe-heading { flex: 1; }
.recipe-name { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; display: block; }
.recipe-meta { font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.recipe-toggle {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  position: relative;
  transition: transform 0.35s ease, border-color 0.35s ease;
}
.recipe-toggle::before,
.recipe-toggle::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  background: var(--accent);
}
.recipe-toggle::before { width: 14px; height: 2px; }
.recipe-toggle::after { width: 2px; height: 14px; }
.recipe-item.is-open .recipe-toggle { transform: rotate(45deg); border-color: var(--accent); }

.recipe-body { border-top: 1px dashed var(--line); }
.recipe-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 34px;
  padding: 30px 28px;
}

.recipe-media img { width: 100%; aspect-ratio: 10/7; object-fit: cover; border-radius: 12px; }
.recipe-caption {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 10px;
  font-family: var(--font-display);
}

.recipe-story { color: var(--text-dim); margin-bottom: 22px; }

.recipe-detail h4 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 18px 0 10px;
}
.recipe-detail h4:first-of-type { margin-top: 0; }

.ingredients, .steps { list-style: none; counter-reset: steps; }
.ingredients li {
  padding: 7px 0 7px 22px;
  position: relative;
  color: var(--muted);
  font-size: 0.95rem;
  border-bottom: 1px dotted var(--line-soft);
}
.ingredients li::before {
  content: "●";
  position: absolute;
  left: 0;
  font-size: 0.6rem;
  color: var(--accent);
  top: 11px;
}
.ingredients li:last-child { border-bottom: none; }

.steps li {
  counter-increment: steps;
  padding: 8px 0 8px 40px;
  position: relative;
  color: var(--muted);
  font-size: 0.95rem;
}
.steps li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 9px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.78rem;
  display: grid;
  place-items: center;
}

.recipe-tip {
  margin-top: 22px;
  padding: 14px 18px;
  background: var(--card);
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.recipe-tip strong { color: var(--accent-strong); }

/* ---------- Brew guide ---------- */
.brew-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 50px;
  align-items: start;
}

.brew-list { list-style: none; display: flex; flex-direction: column; gap: 18px; }
.brew-list li {
  display: flex;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 20px 24px;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.brew-list li:hover { transform: translateX(6px); border-color: var(--accent); }
.brew-step-num {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff8ec;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.brew-list h3 { font-size: 1.1rem; font-family: var(--font-body); font-weight: 600; margin-bottom: 2px; }
.brew-list p { color: var(--muted); font-size: 0.9rem; }

.timer-card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 44px 38px;
  text-align: center;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.timer-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep), var(--accent));
  background-size: 200% 100%;
  animation: shimmer 4s linear infinite;
}
@keyframes shimmer {
  from { background-position: 0 0; }
  to { background-position: -200% 0; }
}

.timer-title { font-size: 1.5rem; margin-bottom: 6px; }
.timer-sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 30px; }

.timer-display {
  font-family: var(--font-display);
  font-size: 4.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  margin-bottom: 26px;
}
.timer-display.is-running { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { text-shadow: 0 0 0 rgba(217, 148, 74, 0); }
  50% { text-shadow: 0 0 28px rgba(217, 148, 74, 0.45); }
}

.timer-presets { display: flex; justify-content: center; gap: 10px; margin-bottom: 28px; flex-wrap: wrap; }
.timer-preset {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.25s ease;
}
.timer-preset:hover { border-color: var(--accent); color: var(--accent); }
.timer-preset.is-active { background: var(--accent); border-color: var(--accent); color: #fff8ec; }

.timer-controls { display: flex; gap: 12px; justify-content: center; margin-bottom: 20px; }
.timer-controls .btn { padding: 12px 30px; }

.timer-stage {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-style: italic;
  font-family: var(--font-display);
}

/* ---------- Closing ---------- */
.closing {
  text-align: center;
  background:
    linear-gradient(rgba(23, 16, 11, 0.82), rgba(23, 16, 11, 0.88)),
    url("https://images.unsplash.com/photo-1447933601403-0c6688de566e?auto=format&fit=crop&w=1600&q=80") center/cover fixed;
}
.closing-inner { max-width: 720px; }
.closing-title { font-size: clamp(2rem, 4.5vw, 3.2rem); margin-bottom: 20px; color: #f6ead4; }
.closing-text { color: #d9c7ab; font-size: 1.08rem; margin-bottom: 40px; }
.closing-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer {
  background: #120c08;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  padding-top: 70px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 1.2fr;
  gap: 50px;
  padding-bottom: 50px;
}
.footer-brand .brand-name { color: #f3e6d2; font-size: 1.5rem; }
.footer-brand p { margin-top: 14px; font-size: 0.92rem; max-width: 320px; }
.footer-nav h4, .footer-notes h4 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.footer-nav ul { list-style: none; }
.footer-nav li { margin-bottom: 10px; }
.footer-nav a { color: var(--muted); font-size: 0.95rem; }
.footer-nav a:hover { color: var(--accent-strong); }
.footer-notes p { font-size: 0.88rem; margin-bottom: 12px; }
.footer-credits a { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--line-soft);
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.footer-tagline { font-family: var(--font-display); font-style: italic; }

[data-theme="light"] .site-footer { background: #efe2c8; }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 10, 6, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  position: relative;
  width: min(760px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: modalUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(240, 176, 106, 0.45);
  background: rgba(23, 16, 11, 0.7);
  color: #f3e6d2;
  font-size: 1rem;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: transform 0.25s ease, background 0.25s ease;
}
.modal-close:hover { transform: rotate(90deg); background: var(--accent-deep); }

.modal-media { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.modal-media img { width: 100%; height: 100%; object-fit: cover; }
.modal-era {
  top: 16px;
  left: 16px;
  font-size: 0.8rem;
  padding: 7px 14px;
}

.modal-body { padding: 34px 40px 40px; }
.modal-title { font-size: 1.9rem; margin-bottom: 16px; }
.modal-story p { color: var(--muted); margin-bottom: 14px; font-size: 0.98rem; }
.modal-story p strong { color: var(--text-dim); }

.modal-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--accent-strong);
  border-left: 3px solid var(--accent);
  padding: 6px 0 6px 20px;
  margin: 24px 0;
}

.modal-blend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: var(--card);
}
.modal-blend-label { font-size: 0.72rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
.modal-blend-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--accent-strong); }
.modal-blend .text-link { margin-top: 0; margin-left: auto; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 900;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: var(--card);
  color: var(--accent-strong);
  font-size: 1.15rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.back-to-top:hover { transform: translateY(-4px); }
.back-to-top[hidden] { opacity: 0; pointer-events: none; }

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

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

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .stories-grid { grid-template-columns: repeat(2, 1fr); }
  .prologue-grid { grid-template-columns: 1fr; gap: 40px; }
  .blend-layout { grid-template-columns: 1fr; }
  .blend-tabs { flex-direction: row; flex-wrap: wrap; }
  .blend-tab.is-active, .blend-tab:hover { transform: translateY(-3px); }
  .brew-layout { grid-template-columns: 1fr; }
  .timer-card { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 800px) {
  .section { padding: 80px 0; }

  .nav-toggle { display: block; }
  .nav-menu {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 18px 6vw 26px;
    gap: 4px;
    transform: translateY(-120%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 999;
  }
  .nav-menu.is-open { transform: translateY(0); }
  .nav-link { padding: 14px 16px; font-size: 1rem; }
  .theme-toggle { margin-left: 0; align-self: flex-end; margin-top: 10px; }

  .hero-word { font-size: 8rem; }
  .hero-content { padding: 110px 0 150px; }

  .stories-grid { grid-template-columns: 1fr; }

  .timeline-line { left: 12px; }
  .tl-item { grid-template-columns: 1fr; gap: 14px; padding-left: 40px; }
  .tl-dot { left: 12px; }
  .tl-item:nth-child(even) .tl-card,
  .tl-item:nth-child(odd) .tl-card { grid-column: 1; text-align: left; }
  .tl-item:nth-child(odd) .tl-card img { margin-inline-start: 0; }

  .blend-details { grid-template-columns: 1fr; gap: 20px; }
  .recipe-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 36px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .stat-grid { grid-template-columns: 1fr; }
}
