/* ==========================================================
   POUR — coffee bar
   ========================================================== */

:root {
  --cream: #f5e6d0;
  --cream-dim: rgba(245, 230, 208, 0.78);
  --cream-faint: rgba(245, 230, 208, 0.45);
  --ink: #2a190d;
  --ink-hover: #3a2414;

  --wall-light: #bc6638;
  --wall: #964e27;
  --wall-dark: #76381a;
  --table-glow: #d2753b;
  --table: #ba6233;
  --table-dark: #8a4220;

  --display: "Anton", "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 8.3vw, 140px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* one deliberate look (warm terracotta), the same in light and dark mode */
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  background: var(--wall);
}

body {
  margin: 0;
  background: var(--wall);
  color: var(--cream);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
p { margin: 0; }

/* Film grain over everything — makes flat gradients feel photographic */
.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------------- Nav ---------------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px var(--gutter);
  padding-top: calc(26px + env(safe-area-inset-top, 0px));
  padding-left: clamp(16px, 3.4vw, 56px);
  padding-right: clamp(16px, 3.4vw, 56px);
}

.logo {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: clamp(18px, 2.6vw, 40px);
  font-size: 13px;
  color: var(--cream-dim);
}

.nav-links a,
.bag-link { transition: color 0.2s; }
.nav-links a:hover,
.bag-link:hover { color: var(--cream); }

.bag-link.bump { animation: bump 0.45s var(--ease); }
@keyframes bump {
  40% { transform: scale(1.18); color: var(--cream); }
}

/* ---------------- Replay ---------------- */

.replay {
  position: fixed;
  top: calc(76px + env(safe-area-inset-top, 0px));
  right: clamp(16px, 3.4vw, 56px);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(42, 25, 13, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 11px;
  color: var(--cream-dim);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.4s, transform 0.4s var(--ease), color 0.2s;
}
.replay svg { width: 11px; height: 11px; }
.replay.show { opacity: 1; transform: none; pointer-events: auto; }
.replay:hover { color: var(--cream); }

/* ---------------- Panels ---------------- */

.panel {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  scroll-snap-align: start;
  isolation: isolate;
}

.stage {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

/* CSS-only backdrop: terracotta wall + glossy wooden table.
   Used until you drop real photos into /images. */
.scene {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 70% at 0% 0%, rgba(232, 124, 58, 0.6), transparent 60%),
    radial-gradient(60% 55% at 72% 38%, rgba(214, 108, 46, 0.35), transparent 70%),
    linear-gradient(90deg, transparent 50%, rgba(78, 28, 4, 0.42) 100%),
    linear-gradient(180deg, #b0582a 0%, #a24f23 35%, #974920 63%);
}

.scene::before {
  /* table top */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 61%;
  bottom: 0;
  background:
    linear-gradient(180deg, rgba(255, 178, 96, 0.45) 0%, rgba(255, 160, 80, 0.14) 14%, transparent 38%),
    linear-gradient(180deg, transparent 45%, rgba(72, 24, 2, 0.36) 100%),
    repeating-linear-gradient(179.3deg, rgba(96, 32, 6, 0.07) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(178.6deg, rgba(255, 196, 140, 0.04) 0 2px, transparent 2px 11px),
    linear-gradient(90deg, #dc7433 0%, #cf6a2c 38%, #b45827 72%, #8e411c 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 7%);
  mask-image: linear-gradient(180deg, transparent 0, #000 7%);
}

.scene::after {
  /* vignette */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(130% 110% at 40% 45%, transparent 55%, rgba(50, 18, 4, 0.45) 100%);
}

/* Photo / video mode */
.media {
  position: absolute;
  inset: 0;
}

.media img,
.media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 50%;
  opacity: 0;
  transition: opacity 0.9s ease;
}
.media img.on,
.media video.on { opacity: 1; }

/* readability wash over photos, on the text side */
.media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(90, 38, 14, 0.35) 0%, transparent 45%);
  pointer-events: none;
}

/* SVG glass placeholder */
.glass-wrap {
  position: absolute;
  left: 72.5%;
  bottom: 14.5%;
  height: var(--gh, 46%);
  transform: translateX(-50%);
}
.glass-wrap svg {
  display: block;
  height: 100%;
  width: auto;
  overflow: visible;
}

/* ---------------- Copy ---------------- */

.copy {
  position: absolute;
  left: var(--gutter);
  top: 50%;
  transform: translateY(-58%);
  display: flex;
  align-items: flex-start;
  gap: clamp(28px, 2.8vw, 48px);
  z-index: 2;
}

.hero .copy { transform: translateY(-55%); display: block; }

.hero-title {
  margin: 0 0 22px;
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(64px, 11.4vw, 210px);
  line-height: 0.92;
  letter-spacing: -0.005em;
  color: var(--cream);
}
.hero-title span { display: block; }

.hero-sub {
  font-size: 13px;
  line-height: 1.45;
  color: var(--cream-dim);
  margin-bottom: 26px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(40, 14, 2, 0.28);
  transition: background 0.25s, transform 0.25s var(--ease);
}
.pill:hover { background: var(--ink-hover); transform: translateY(-1px); }
.pill:active { transform: translateY(1px); }
.pill span { transition: transform 0.25s var(--ease); }
.pill:hover span { transform: translateX(3px); }
.pill.add:hover span { transform: rotate(90deg); }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 13%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--cream-dim);
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.scroll-cue span { display: inline-block; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin-bottom: 8px;
}

.drink-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(44px, 6vw, 108px);
  line-height: 0.95;
  white-space: nowrap;
}

.tagline {
  margin-top: 8px;
  font-size: 16px;
  color: var(--cream-dim);
}

.rule {
  display: block;
  width: 40px;
  height: 1px;
  margin: 22px 0 18px;
  background: var(--cream-faint);
}

.ingredients { font-size: 12px; color: var(--cream-faint); }

.price {
  margin: 2px 0 22px;
  font-size: 19px;
  font-weight: 600;
}

/* step indicator */
.steps {
  list-style: none;
  margin: 70px 0 0;
  padding: 0;
  position: relative;
  display: grid;
  gap: 18px;
}
.steps::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--cream-faint);
}
.steps a {
  display: grid;
  grid-template-columns: 18px 12px auto;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--cream-faint);
  white-space: nowrap;
  transition: color 0.2s;
}
.steps a:hover { color: var(--cream); }
.steps .n { font-size: 9px; letter-spacing: 0.04em; }
.steps .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--cream-dim);
  background: var(--wall);
  position: relative;
  z-index: 1;
  transition: background 0.3s, border-color 0.3s;
}
.steps .active a { color: var(--cream); font-weight: 500; }
.steps .active .dot { background: var(--cream); border-color: var(--cream); }

/* entrance: text is visible at rest and rises in as its section scrolls into view */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
}
.entered .copy-main > *,
.entered .steps,
.entered.hero .copy > * { animation: rise 0.8s var(--ease) backwards; }
.entered .copy-main > :nth-child(2),
.entered.hero .copy > :nth-child(2) { animation-delay: 0.06s; }
.entered .copy-main > :nth-child(3),
.entered.hero .copy > :nth-child(3) { animation-delay: 0.12s; }
.entered .copy-main > :nth-child(4) { animation-delay: 0.16s; }
.entered .copy-main > :nth-child(5) { animation-delay: 0.2s; }
.entered .copy-main > :nth-child(6) { animation-delay: 0.24s; }
.entered .copy-main > :nth-child(7) { animation-delay: 0.28s; }
.entered .steps { animation-delay: 0.3s; }

/* ---------------- Steam ---------------- */

.steam {
  position: absolute;
  left: 72.5%;
  bottom: 52%;
  width: 18vw;
  height: 34vh;
  transform: translateX(-50%);
  pointer-events: none;
}
.steam i {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 34%;
  height: 60%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 238, 220, 0.5), transparent);
  filter: blur(14px);
  opacity: 0;
  animation: steam 6s ease-in-out infinite;
}
.steam i:nth-child(1) { margin-left: -22%; animation-delay: 0s; }
.steam i:nth-child(2) { margin-left: -6%; animation-delay: 1.5s; width: 28%; }
.steam i:nth-child(3) { margin-left: -14%; animation-delay: 3s; width: 40%; }
.steam i:nth-child(4) { margin-left: 2%; animation-delay: 4.5s; width: 26%; }
@keyframes steam {
  0%   { opacity: 0; transform: translate(-50%, 20%) scale(0.6, 0.8) skewX(0deg); }
  25%  { opacity: 0.55; }
  60%  { opacity: 0.3; transform: translate(-40%, -45%) scale(1, 1.2) skewX(-8deg); }
  100% { opacity: 0; transform: translate(-60%, -110%) scale(1.4, 1.5) skewX(6deg); }
}
.has-media .steam { opacity: 0.55; }

/* ---------------- Story ---------------- */

.story {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 110px);
  align-items: center;
  padding: 120px var(--gutter);
  background:
    radial-gradient(70% 60% at 0% 0%, rgba(214, 120, 66, 0.3), transparent 60%),
    linear-gradient(180deg, #8a4422 0%, #6e3217 100%);
  scroll-snap-align: start;
}

.story-title {
  margin: 0 0 24px;
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(44px, 5.6vw, 96px);
  line-height: 0.95;
}

.story-text {
  max-width: 440px;
  color: var(--cream-dim);
  font-size: 16px;
  line-height: 1.65;
}

.facts {
  list-style: none;
  padding: 0;
  margin: 40px 0 0;
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 36px;
}
.facts li { display: grid; gap: 4px; }
.facts strong { font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1; }
.facts span { font-size: 12px; color: var(--cream-faint); max-width: 130px; }

.story-media {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(40, 12, 2, 0.35);
}
.story-media .stage { z-index: 0; }
.story-media .glass-row {
  position: absolute;
  inset: auto 0 18% 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 5%;
  height: 34%;
}
.story-media .glass-row svg { height: 100%; width: auto; overflow: visible; }
.story-media .glass-row svg.short { height: 68%; }

/* ---------------- Footer ---------------- */

.footer {
  padding: 80px var(--gutter) 36px;
  background: #5a2711;
  color: var(--cream-dim);
  font-size: 14px;
  scroll-snap-align: end;
}
.footer-brand {
  font-family: var(--display);
  font-size: clamp(90px, 22vw, 380px);
  line-height: 0.85;
  color: transparent;
  -webkit-text-stroke: 1px rgba(245, 230, 208, 0.35);
  margin-bottom: 48px;
  user-select: none;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(245, 230, 208, 0.15);
}
.footer-cols a:hover { color: var(--cream); }
.footer-note { margin-top: 24px; font-size: 12px; color: var(--cream-faint); }

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  transform: translate(-50%, 20px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(30, 10, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s var(--ease);
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- Tablet ---------------- */

@media (max-width: 980px) {
  .steps { display: none; }
}

/* ---------------- Mobile ---------------- */

@media (max-width: 760px) {
  html { scroll-snap-type: none; }

  .nav { padding: calc(18px + env(safe-area-inset-top, 0px)) 16px 18px; }
  .nav-links { gap: 16px; }
  .replay { top: calc(58px + env(safe-area-inset-top, 0px)); right: 16px; }

  .glass-wrap {
    left: 50%;
    bottom: auto;
    top: 13%;
    height: calc(var(--gh, 46%) * 0.72);
  }
  .steam { left: 50%; bottom: auto; top: 0; width: 50vw; height: 26vh; }

  /* photos: glass in the top part of the screen, text below on a matching background */
  .panel.has-media { background: linear-gradient(180deg, #9a4c24 0%, #6a2f14 100%); }
  .has-media .media {
    bottom: auto;
    height: 64%;
    -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
  }
  .media img,
  .media video { object-position: 88% 50%; }
  .media::after { display: none; }

  .scene::before { top: 46%; }

  .copy,
  .hero .copy {
    top: auto;
    bottom: 40px;
    left: 16px;
    right: 16px;
    transform: none;
    display: block;
  }
  .hero-title { font-size: clamp(64px, 21vw, 120px); }
  .steps { display: none; }
  .tagline { font-size: 15px; }
  .rule { margin: 16px 0 12px; }
  .scroll-cue { display: none; }

  .story {
    grid-template-columns: 1fr;
    padding: 96px 16px 64px;
    min-height: 0;
  }
  .facts { grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
  .facts strong { font-size: 26px; }
  .story-media { aspect-ratio: 4 / 4.4; }

  .footer { padding: 56px 16px 28px; }
  .footer-cols { grid-template-columns: 1fr; gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .steam i,
  .scroll-cue span { animation: none; }
  .entered .copy-main > *,
  .entered .steps,
  .entered.hero .copy > * { animation: none; }
}
