:root {
  --bg: #08133a;
  --bg-2: #0d1b4d;
  --ink: #f6f2e8;
  --ink-soft: rgba(246, 242, 232, 0.66);
  --ink-faint: rgba(246, 242, 232, 0.14);
  --accent: #ffcc00;
  --ve-yellow: #ffcc00; --ve-blue: #00247d; --ve-red: #cf142b;
  --stage: min(62vh, 44vw);
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.8s var(--ease);
}
img { display: block; max-width: 100%; user-select: none; -webkit-user-drag: none; }
a { color: inherit; }
em { font-style: italic; font-weight: 300; color: var(--accent); transition: color 0.8s var(--ease); }

/* ---------- ambience ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 50; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
.glow {
  position: fixed; left: 0; top: 0; width: 70vmax; height: 70vmax; z-index: 0; pointer-events: none;
  margin: -35vmax 0 0 -35vmax; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 62%);
  transform: translate3d(50vw, 45vh, 0);
  transition: background 0.8s var(--ease);
}
.progress { position: fixed; left: 0; right: 0; top: 0; z-index: 60; }
.progress { height: 4px; }
.progress span { display: block; height: 100%; width: 100%; background: linear-gradient(180deg, var(--ve-yellow) 0 33.3%, var(--ve-blue) 33.3% 66.6%, var(--ve-red) 66.6%); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: calc(22px + env(safe-area-inset-top, 0px)) clamp(20px, 4vw, 56px) 22px;
  mix-blend-mode: difference;
}
.nav__logo { font-family: var(--font-display); font-size: 26px; font-weight: 600; text-decoration: none; letter-spacing: -0.02em; }
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: 28px; }
.nav__links a, .nav__cta { font-size: 13px; letter-spacing: 0.04em; text-decoration: none; opacity: 0.8; }
.nav__links a:hover, .nav__cta:hover { opacity: 1; }
.nav__cta { border: 1px solid currentColor; border-radius: 99px; padding: 9px 16px; }

/* ---------- scenes ---------- */
.scene { position: relative; z-index: 1; }
.sticky {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center;
  padding: 0 clamp(20px, 6vw, 110px);
}
.eyebrow {
  margin: 0 0 18px; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-soft);
}

/* hero */
.hero__title {
  margin: 0; font-family: var(--font-display); font-weight: 500;
  font-size: clamp(56px, 8.4vw, 150px); line-height: 0.92; letter-spacing: -0.035em;
}
.line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.line > span { display: block; }
.hero__text { max-width: 380px; margin: 30px 0 0; font-size: 17px; line-height: 1.6; color: var(--ink-soft); }
.scroll-hint {
  position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-soft);
}
.scroll-hint span { width: 1px; height: 46px; background: linear-gradient(var(--ink), transparent); animation: hint 1.8s var(--ease) infinite; transform-origin: top; }
@keyframes hint { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* stage */
.stage {
  position: relative; justify-self: center;
  width: var(--stage); height: var(--stage);
  perspective: 1400px;
}
.stage__shadow {
  position: absolute; left: 8%; right: 8%; top: 12%; bottom: 4%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.75), transparent);
  transform: translateY(8%) scale(1.05); filter: blur(18px);
}
.spin { position: absolute; inset: 0; }
.layer {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  will-change: transform, opacity, filter;
}
.layer--base { filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.55)); }
.layer--ing { filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.45)); }
.layer--lid { filter: drop-shadow(0 40px 50px rgba(0, 0, 0, 0.6)); }
.topdown { position: absolute; inset: 0; transform-origin: 50% 60%; }
.whole { position: absolute; inset: 0; transform-origin: 50% 70%; }
.lower { position: absolute; inset: 0; will-change: transform; }
.half { filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.5)); will-change: transform; }
.half--top { clip-path: polygon(0.00% 0.00%, 0.00% 50.00%, 6.40% 50.00%, 6.77% 53.08%, 7.89% 56.11%, 9.72% 59.03%, 12.24% 61.80%, 15.41% 64.37%, 19.17% 66.69%, 23.46% 68.72%, 28.20% 70.44%, 33.32% 71.80%, 38.72% 72.80%, 44.31% 73.40%, 50.00% 73.60%, 55.69% 73.40%, 61.28% 72.80%, 66.68% 71.80%, 71.80% 70.44%, 76.54% 68.72%, 80.83% 66.69%, 84.59% 64.37%, 87.76% 61.80%, 90.28% 59.03%, 92.11% 56.11%, 93.23% 53.08%, 93.60% 50.00%, 100.00% 50.00%, 100.00% 0.00%); }
.half--bottom { clip-path: polygon(0.00% 50.00%, 6.40% 50.00%, 6.77% 53.08%, 7.89% 56.11%, 9.72% 59.03%, 12.24% 61.80%, 15.41% 64.37%, 19.17% 66.69%, 23.46% 68.72%, 28.20% 70.44%, 33.32% 71.80%, 38.72% 72.80%, 44.31% 73.40%, 50.00% 73.60%, 55.69% 73.40%, 61.28% 72.80%, 66.68% 71.80%, 71.80% 70.44%, 76.54% 68.72%, 80.83% 66.69%, 84.59% 64.37%, 87.76% 61.80%, 90.28% 59.03%, 92.11% 56.11%, 93.23% 53.08%, 93.60% 50.00%, 100.00% 50.00%, 100.00% 100.00%, 0.00% 100.00%); }
.inside {
  position: absolute; left: -1.9%; width: 103.8%; top: 26%; height: 56%; object-fit: fill;
  opacity: 0; transform-origin: 50% 50%; filter: brightness(0.92);
}
.steam { position: absolute; left: 12%; right: 12%; top: 30%; height: 45%; pointer-events: none; opacity: 0; }
.steam i {
  position: absolute; bottom: 0; width: 46%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 250, 240, 0.9) 0%, rgba(255, 250, 240, 0.38) 40%, transparent 70%);
  filter: blur(18px); will-change: transform, opacity;
}
.layer--closed { opacity: 0; transform-origin: 50% 70%; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.5)); }
.scene--recipe .stage__caption { opacity: 0; bottom: -6%; }
.stage__caption {
  position: absolute; left: 50%; bottom: -12%; transform: translateX(-50%);
  margin: 0; white-space: nowrap; font-family: var(--font-display); font-style: italic; font-size: 26px; color: var(--ink-soft);
}

/* recipe */
.recipe__bgword {
  position: absolute; left: 0; top: 50%; z-index: -1; white-space: nowrap; pointer-events: none;
  font-family: var(--font-display); font-weight: 700; font-size: 30vw; line-height: 1; letter-spacing: -0.05em;
  color: transparent; -webkit-text-stroke: 1px var(--ink-faint);
  transform: translate(10vw, -50%);
}
.recipe__copy { position: relative; z-index: 2; max-width: 460px; }
.recipe__index { font-family: var(--font-display); font-size: 15px; color: var(--accent); letter-spacing: 0.1em; }
.recipe__index b { color: var(--ink-soft); font-weight: 400; }
.recipe__name {
  margin: 14px 0 20px; font-family: var(--font-display); font-weight: 500;
  font-size: clamp(48px, 6.4vw, 108px); line-height: 0.95; letter-spacing: -0.035em;
}
.recipe__desc { margin: 0 0 34px; font-size: 16px; line-height: 1.65; color: var(--ink-soft); }
.ing-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink-faint); }
.ing-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--ink-faint);
  font-size: 15px; color: var(--ink-soft);
  transition: color 0.5s var(--ease);
}
.ing-list li i {
  font-style: normal; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.4;
  transition: opacity 0.5s var(--ease), color 0.5s var(--ease);
}
.ing-list li::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; margin-right: 14px; flex: none;
  border: 1px solid var(--ink-soft); transition: background 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.ing-list li span { flex: 1; }
.ing-list li.is-in { color: var(--ink); }
.ing-list li.is-in::before { background: var(--accent); border-color: var(--accent); transform: scale(1.3); }
.ing-list li.is-in i { opacity: 1; color: var(--accent); }

.crumb {
  position: absolute; left: 50%; top: 50%; width: 11%; height: 11%; margin: -5.5% 0 0 -5.5%;
  border-radius: 40%; background-size: 900%; background-position: center; opacity: 0; pointer-events: none;
}

/* ---------- outro ---------- */
.outro { position: relative; z-index: 1; padding: 22vh clamp(20px, 6vw, 110px) 12vh; }
.outro__title {
  margin: 0 0 8vh; font-family: var(--font-display); font-weight: 500;
  font-size: clamp(44px, 6vw, 104px); line-height: 0.95; letter-spacing: -0.035em;
}
.menu { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); }
.card {
  position: relative; display: block; text-decoration: none;
  padding: 26px 22px 24px; border: 1px solid var(--ink-faint); border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0));
  transition: transform 0.6s var(--ease), border-color 0.6s var(--ease), background 0.6s var(--ease);
  transform: translateY(50px);
}
.card.is-visible { transform: none; }
.card:hover { border-color: var(--card-accent); background: linear-gradient(180deg, color-mix(in srgb, var(--card-accent) 12%, transparent), transparent); }
.card__plate { position: relative; aspect-ratio: 1; margin-bottom: 22px; transition: transform 0.8s var(--ease); }
.card:hover .card__plate { transform: translateY(-6px) scale(1.06); }
.card__plate img { position: absolute; inset: 0; width: 100%; height: 100%; }
.card__plate img:first-child { filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.5)); }
.card h3 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 500; font-size: 28px; letter-spacing: -0.02em; }
.card p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
.card small { position: absolute; top: 22px; right: 22px; font-family: var(--font-display); color: var(--card-accent); }

.credits {
  position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end;
  margin: 0 clamp(20px, 6vw, 110px); padding: 10vh 0 8vh; border-top: 1px solid var(--ink-faint);
}
.credits__title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(34px, 4vw, 64px); line-height: 1; letter-spacing: -0.03em; }
.credits__list { list-style: none; margin: 0; padding: 0; }
.credits__list li { display: flex; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--ink-faint); font-size: 15px; }
.credits__list span { width: 110px; flex: none; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); padding-top: 3px; }
.credits__list li > a { min-width: 0; overflow-wrap: anywhere; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  :root { --stage: min(78vw, 46vh); }
  /* mix-blend-mode forces the browser to recompute blending against everything scrolling
     underneath a fixed element on every frame — costly on phone GPUs. A solid bar is just as
     readable and far cheaper to composite while scrolling. */
  .nav { mix-blend-mode: normal; background: rgba(8, 19, 58, 0.85); }
  .nav__links a:not(.nav__menu):not(.nav__home) { display: none; }
  .nav__links { gap: 10px; }
  .nav__menu, .nav__home { border: 1px solid currentColor; border-radius: 99px; padding: 9px 16px; }
  .sticky { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: center; gap: 4vh; padding-top: 70px; }
  .stage { order: -1; }
  .scene--hero .stage { order: 0; }
  .hero__text { font-size: 15px; margin-top: 18px; }
  .recipe__name { margin: 8px 0 10px; }
  .recipe__desc { display: none; }
  .ing-list li { padding: 9px 0; font-size: 14px; }
  .recipe__bgword { font-size: 46vw; top: 30%; }
  .menu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .credits { grid-template-columns: 1fr; }
  .scroll-hint { display: none; }
  .stage__caption { font-size: 20px; }
  /* filter is no longer animated per frame on these on mobile (see app.js `lowPower`); dropping it
     from will-change avoids promoting them to a dedicated GPU layer for a hint that's now unused. */
  .layer, .v-box, .v-tree { will-change: transform, opacity; }
}

@media (max-width: 380px) {
  .nav__cta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .scroll-hint span { animation: none; }
}

/* ---------- Venezuela: tricolor light ---------- */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60vmax 45vmax at 8% -10%, rgba(255, 204, 0, 0.16), transparent 70%),
    radial-gradient(60vmax 45vmax at 100% 110%, rgba(207, 20, 43, 0.2), transparent 70%),
    radial-gradient(70vmax 50vmax at 60% 50%, rgba(0, 36, 125, 0.35), transparent 75%);
}
.credits::before {
  content: ""; position: absolute; left: 0; top: -1px; width: 180px; height: 3px;
  background: linear-gradient(90deg, var(--ve-yellow) 0 33.3%, var(--ve-blue) 33.3% 66.6%, var(--ve-red) 66.6%);
}

/* ---------- hero background: Salto Ángel ---------- */
.hero__bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; transform-origin: 12% 18%; filter: blur(1.5px); will-change: transform; }
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 19, 58, 0.72) 0%, rgba(8, 19, 58, 0.35) 34%, rgba(8, 19, 58, 0) 58%),
    linear-gradient(180deg, rgba(8, 19, 58, 0.25) 0%, rgba(8, 19, 58, 0) 22%, rgba(8, 19, 58, 0) 70%, #08133a 100%);
}
.scene--hero .sticky { isolation: isolate; }
@media (max-width: 860px) {
  .hero__bg::after { background: linear-gradient(180deg, rgba(8, 19, 58, 0.3) 0%, rgba(8, 19, 58, 0.55) 55%, #08133a 100%); }
}

/* ---------- viaje del turpial ---------- */
.v-sticky { display: block; padding: 0; background: #8ec5ea; }
.v-tree { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; will-change: transform, filter; }
.v-box { position: absolute; left: 50%; top: 50%; width: max(100vw, 177.78vh); aspect-ratio: 16 / 9; translate: -50% -50%; will-change: transform, filter, opacity; pointer-events: none; }
.v-rama { width: 100%; height: 100%; display: block; }
.v-bird { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 3; will-change: transform; }
.v-bird img { position: absolute; display: block; max-width: none; height: auto; opacity: 0; filter: drop-shadow(0 10px 14px rgba(20, 40, 70, .25)); }
.v-bird img.is-on { opacity: 1; }
.v-copy { position: absolute; left: clamp(20px, 6vw, 110px); bottom: 14vh; z-index: 4; max-width: 560px; }
.v-copy .eyebrow { color: #fff; text-shadow: 0 1px 12px rgba(0, 30, 70, .45); }
.v-title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(44px, 6.4vw, 96px); line-height: .98; letter-spacing: -0.03em; color: #fff; text-shadow: 0 2px 30px rgba(0, 30, 70, .35); }
.v-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.v-title .line > span { display: inline-block; }
.v-title em { color: var(--ve-yellow); font-style: italic; }
.v-caption { position: absolute; right: clamp(20px, 6vw, 110px); bottom: 8vh; z-index: 4; margin: 0; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: #fff; opacity: 0; text-shadow: 0 1px 10px rgba(0, 30, 70, .5); }
.v-fade { position: absolute; inset: 0; z-index: 5; background: radial-gradient(ellipse at 50% 55%, #fff4dc 0%, #f6d28a 60%, #e9b35c 100%); opacity: 0; pointer-events: none; }
.v-hint { z-index: 4; color: #fff; }
@media (max-width: 700px) { .v-caption { left: 20px; right: 20px; text-align: right; } .v-copy { bottom: 16vh; } }
.v-lid { position: absolute; display: none; border-radius: 50%; background: radial-gradient(circle at 50% 25%, #24222a, #141318 75%); box-shadow: 0 0 2px 1px rgba(20,19,24,.7); border-bottom: 1px solid #070709; transform-origin: 50% 0; transform: scaleY(0); }
.v-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; will-change: transform; }
.v-box { z-index: 1; }
.v-clouds { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.v-cloud { position: absolute; left: 0; top: 0; width: 55vw; max-width: none; height: auto; opacity: 0; will-change: transform, opacity; }
.v-haze { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, #fffaf3 0%, #f3f1f5 55%, #e4ecf6 100%); opacity: 0; }
/* start button / skip */
html.is-locked { scrollbar-width: none; }
html.is-locked::-webkit-scrollbar { display: none; }
.v-start {
  margin-top: 28px; display: inline-flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 15px 26px 15px 28px; border: 0; border-radius: 99px;
  background: var(--ve-yellow); color: #08133a; font: 600 16px/1 var(--font-body, Inter, sans-serif); letter-spacing: .02em;
  box-shadow: 0 10px 30px rgba(0, 30, 70, .35); transition: background .2s, box-shadow .2s, scale .2s;
}
.v-start i { font-style: normal; font-size: 11px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #08133a; color: var(--ve-yellow); padding-left: 2px; }
.v-start:hover { scale: 1.04; box-shadow: 0 14px 36px rgba(0, 30, 70, .45); }
.v-start:focus-visible, .v-skip:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
html.is-playing .v-start { pointer-events: none; }
html.is-locked:not(.is-playing) .v-skip { opacity: 1; pointer-events: auto; }
.v-skip {
  position: absolute; left: clamp(20px, 4vw, 56px); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 6;
  padding: 9px 16px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .7); background: rgba(8, 19, 58, .28);
  color: #fff; font-size: 13px; letter-spacing: .04em; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .4s;
  backdrop-filter: blur(6px);
}
html.is-playing .v-skip { opacity: 1; pointer-events: auto; }
