/* ──────────────────────────────────────────────────────────────
   Família Finati — editorial tasting-menu styling
   ────────────────────────────────────────────────────────────── */

:root {
  --white: #F7F7F7;
  --site-bg: #F7F7F7;          /* matched to video's warm-white background */
  --ink:   #0A0A0A;
  --ink-soft: #1f1f1f;
  --gold:        #C9A961;
  --gold-light:  #E5C97B;
  --gold-faint:  rgba(201, 169, 97, 0.18);
  --rose:        #E8B4B8;
  --rose-deep:   #D4919A;
  --bone:        #FAFAF8;

  --display: "Cormorant Garamond", "Cormorant", "Playfair Display", Georgia, serif;
  --body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --bezier: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: #F7F7F7;
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
}

/* ── Desktop frame wrapper ─────────────────────────────────── */
.ff-deviceWrap {
  display: flex; flex-direction: column; align-items: center;
  gap: 22px; padding: 40px 20px;
}
.ff-deviceWrap__caption,
.ff-deviceWrap__hint {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #7a7368;
}
.ff-deviceWrap__caption { display: flex; gap: 10px; align-items: center; }
.ff-deviceWrap__sep { color: var(--gold); }
.ff-deviceWrap__hint { opacity: 0.65; }

/* On mobile the device wrap goes away; App sits full-bleed */
@media (max-width: 540px) {
  body { display: block; background: #F7F7F7; }
}

/* ──────────────────────────────────────────────────────────────
   Stage — fills its container (iPhone frame OR mobile viewport)
   ────────────────────────────────────────────────────────────── */
.ff-stage {
  position: relative;
  width: 100%; height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: #F7F7F7;
  overflow: hidden;
  isolation: isolate;
}
/* Inside the iPhone frame, the parent has fixed height — make us match */
.ff-deviceWrap .ff-stage { min-height: 0; height: 100%; }

/* ──────────────────────────────────────────────────────────────
   Particles
   ────────────────────────────────────────────────────────────── */
.ff-particles {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 1;
}
.ff-particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-light) 0%, var(--gold) 60%, transparent 100%);
  filter: blur(0.3px);
  animation: ff-float ease-in-out infinite alternate;
  will-change: transform, opacity;
}
@keyframes ff-float {
  0%   { transform: translate(0, 0) scale(0.85); opacity: 0.15; }
  50%  { opacity: 0.55; }
  100% { transform: translate(var(--drift), -28px) scale(1); opacity: 0.25; }
}

/* ──────────────────────────────────────────────────────────────
   Gold hairline
   ────────────────────────────────────────────────────────────── */
.ff-hairline {
  position: relative;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--gold) 30%,
    var(--gold-light) 50%,
    var(--gold) 70%,
    transparent 100%);
  opacity: 0.9;
}
.ff-hairline__diamond {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 8px;
  color: var(--gold);
  background: #F7F7F7;
  padding: 0 7px;
  letter-spacing: 0;
}

/* ──────────────────────────────────────────────────────────────
   Splash
   ────────────────────────────────────────────────────────────── */
.ff-splash {
  position: absolute; inset: 0; z-index: 5;
  background: #F7F7F7;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  padding: 100px 32px 140px;
  transition: transform 900ms cubic-bezier(0.8, 0, 0.2, 1);
}
.ff-splash--leaving { transform: translateY(-100%); pointer-events: none; }

.ff-splash__inner {
  display: flex; flex-direction: column;
  align-items: center; gap: 24px;
  margin-top: 28px;
}

.ff-wordmark {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 42px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  line-height: 1.05;
  text-align: center;
}

.ff-eyebrow {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.4em;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}

.ff-splash__meta {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  text-align: center;
  font-family: var(--body);
  font-weight: 300;
  font-size: 13px;
  color: var(--ink);
  margin-top: 8px;
}
.ff-splash__metaSub {
  color: #555;
  font-size: 12px;
}

/* CTA pill (glass + subtle gold gradient) */
.ff-cta {
  position: relative;
  appearance: none; border: none;
  padding: 0 30px;
  height: 52px;
  white-space: nowrap;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 12px;
  font-family: var(--display);
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: #4a3a18;
  background:
    linear-gradient(135deg, rgba(229,201,123,0.18) 0%, rgba(201,169,97,0.12) 100%),
    rgba(255,255,255,0.65);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    0 8px 32px rgba(201, 169, 97, 0.25),
    inset 0 0 0 1px rgba(201, 169, 97, 0.55);
  cursor: pointer;
  transition: transform 150ms var(--bezier), box-shadow 250ms var(--bezier);
}
.ff-cta:hover { box-shadow: 0 12px 40px rgba(201,169,97,0.32), inset 0 0 0 1px rgba(201,169,97,0.7); }
.ff-cta:active { transform: scale(0.96); }
.ff-cta--breathe { animation: ff-breathe 2.5s ease-in-out infinite; }
@keyframes ff-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.025); }
}

/* Curtain transition: a hairline opens from center */
.ff-curtain {
  position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-light) 50%, transparent);
  transform-origin: center; transform: scaleX(0);
  animation: ff-curtain 900ms var(--bezier) forwards;
  z-index: 100;
  pointer-events: none;
}
@keyframes ff-curtain {
  0%   { transform: scaleX(0); opacity: 1; }
  45%  { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

/* Entry: transition-based reveal (more robust than CSS animations in some iframe contexts) */
.ff-reveal {
  opacity: 0;
  transform: translateY(0);
  transition: opacity 800ms var(--bezier) var(--d, 0ms),
              transform 800ms var(--bezier) var(--d, 0ms);
}
.ff-reveal--rise { transform: translateY(20px); }
.ff-reveal--draw {
  transform: scaleX(0);
  transform-origin: left center;
  transition: opacity 800ms var(--bezier) var(--d, 0ms),
              transform 700ms var(--bezier) var(--d, 0ms);
}
.ff-splash.is-loaded .ff-reveal {
  opacity: 1;
  transform: translateY(0) scaleX(1);
}

/* ──────────────────────────────────────────────────────────────
   Top bar
   ────────────────────────────────────────────────────────────── */
.ff-topbar {
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  left: 0; right: 0;
  height: 52px; z-index: 20;
  display: flex; align-items: center;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 0.5px solid var(--gold-faint);
  opacity: 0; transform: translateY(-6px);
  transition: opacity 600ms var(--bezier) 200ms, transform 600ms var(--bezier) 200ms;
}
.ff-topbar:not(.ff-topbar--hidden) { opacity: 1; transform: translateY(0); }

/* When wrapped inside the iPhone device frame, push below the iOS status bar */
.ff-deviceWrap .ff-topbar { top: 54px; }

.ff-topbar__left,
.ff-topbar__center,
.ff-toggle { display: flex; align-items: center; }
.ff-topbar__left { flex: 0 0 60px; }

.ff-topbar__center {
  flex: 1; justify-content: center;
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 9.5px;
  letter-spacing: 0.42em;
  color: var(--ink);
  opacity: 0.7;
}

/* FR/PT toggle */
.ff-toggle {
  position: relative;
  flex: 0 0 86px; height: 30px;
  background: rgba(255,255,255,0.6);
  border-radius: 999px;
  border: 0.5px solid var(--gold-faint);
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.6);
  overflow: hidden;
}
.ff-toggle__pill {
  position: absolute; top: 3px;
  width: 38px; height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--rose) 0%, var(--rose-deep) 100%);
  box-shadow: 0 2px 6px rgba(212, 145, 154, 0.35);
  transition: left 350ms var(--bezier);
}
.ff-toggle__pill.is-fr { left: 3px; }
.ff-toggle__pill.is-pt { left: 45px; }

.ff-toggle__opt {
  position: relative; z-index: 2;
  flex: 1; height: 100%;
  appearance: none; background: none; border: none;
  font-family: var(--body);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: #6b6b6b;
  cursor: pointer;
  transition: color 350ms var(--bezier);
}
.ff-toggle__opt.is-active { color: #fff; }

/* ──────────────────────────────────────────────────────────────
   Menu scroller
   ────────────────────────────────────────────────────────────── */
.ff-menu {
  position: absolute; inset: 0;
  background: #F7F7F7;
}

.ff-menu__scroller {
  position: absolute; inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.ff-menu__scroller::-webkit-scrollbar { display: none; }
.ff-menu__scroller { scrollbar-width: none; }

/* ──────────────────────────────────────────────────────────────
   Welcome panel — first snap target, editorial introduction
   ────────────────────────────────────────────────────────────── */
.ff-welcome {
  position: relative;
  min-height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 22px;
  padding: 96px 32px 56px;
  text-align: center;
}
.ff-deviceWrap .ff-welcome { padding-top: 124px; }

.ff-welcome__eyebrow {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.45em;
  color: var(--rose-deep);
  white-space: nowrap;
}
.ff-welcome__title {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 36px;
  line-height: 1.1;
  color: var(--ink);
  margin: 4px 0 6px;
  max-width: 16ch;
  text-wrap: pretty;
}
.ff-welcome__intro {
  font-family: var(--body);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  opacity: 0.85;
  max-width: 30ch;
  margin: 0 0 8px;
}

.ff-welcome__index {
  display: flex; flex-direction: column;
  width: 78%;
  border-top: 0.5px solid var(--gold-faint);
  margin: 6px 0 2px;
}
.ff-welcome__indexRow {
  display: flex; align-items: baseline;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 0.5px solid var(--gold-faint);
  text-align: left;
}
.ff-welcome__num {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--gold);
  min-width: 28px;
}
.ff-welcome__step {
  font-family: var(--display);
  font-style: italic;
  font-size: 17px;
  color: var(--ink);
}

.ff-welcome__hint {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold);
  animation: ff-bounce 2s ease-in-out infinite;
}
.ff-welcome__hintArrow { display: inline-block; }
@keyframes ff-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50%      { transform: translateY(4px); opacity: 1; }
}

/* ──────────────────────────────────────────────────────────────
   Course
   ────────────────────────────────────────────────────────────── */
.ff-course-wrap {
  min-height: 100%;
}

.ff-course {
  position: relative;
  min-height: 100%;
  display: flex; flex-direction: column;
  align-items: center;
  /* No horizontal padding here — dish bleeds full width */
  padding: 72px 0 32px;
  text-align: center;
  overflow: hidden;
  background: #F7F7F7;
}
.ff-deviceWrap .ff-course { padding-top: 100px; }

/* Soft rose halo behind the title — animates in on enter */
.ff-course__halo {
  position: absolute;
  top: 20%; left: 50%;
  transform: translate(-50%, -50%);
  width: 380px; height: 380px;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(232,180,184,0.10), transparent 70%);
  opacity: 0;
  transition: opacity 2000ms var(--bezier);
}
.ff-course.is-in .ff-course__halo { opacity: 1; }

.ff-course__badge {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 9.5px;
  letter-spacing: 0.5em;
  color: var(--rose-deep);
  margin-bottom: 14px;
}
.ff-course__badgeNum {
  font-family: var(--display);
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--rose-deep);
}
.ff-course__badgeDash {
  width: 24px; height: 0.5px;
  background: var(--gold);
}
.ff-course__badgeLabel {
  color: var(--ink);
  opacity: 0.85;
}

/* Dish stage — full video, no cropping, seamless with #F7F7F7 background */
.ff-dish {
  position: relative;
  width: 100%;
  /* 9:16 matches the portrait video's native ratio */
  aspect-ratio: 9 / 16;
  /* Push the video down and remove the extra space from the flow */
  margin: 30px 0 -30px;
  flex-shrink: 0;
}
/* Use a pseudo-element gradient instead of mask-image for massive mobile performance boost */
.ff-dish::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, #F7F7F7 0%, transparent 15%, transparent 80%, #F7F7F7 98%);
  z-index: 2;
}
/* Specific override for Ossobuco to push the dish closer to the title */
.ff-course[data-screen-label="Course 02"] .ff-dish {
  margin: 80px 0 -80px;
}
.ff-dish__video,
.ff-dish__poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  /* contain = show full video, background color fills the remainder seamlessly */
  object-fit: contain;
  z-index: 1;
}
.ff-dish__video {
  opacity: 0;
  transition: opacity 500ms var(--bezier);
}
.ff-dish__video.is-ready { opacity: 1; }
.ff-dish__video.is-ready + .ff-dish__poster { opacity: 0; }
.ff-dish__poster { transition: opacity 500ms var(--bezier); }

/* Name — split-text reveal, pulled up over the bottom of the video */
.ff-course__name {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.18;
  color: var(--ink);
  letter-spacing: -0.005em;
  /* pull the title up over the bottom portion of the video */
  margin: -110px 28px 16px;
  max-width: 22ch;
  text-wrap: pretty;
  position: relative;
  z-index: 3;
}
.ff-course__word {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 600ms var(--bezier), transform 600ms var(--bezier);
}
.ff-course.is-in .ff-course__word {
  opacity: 1;
  transform: translateY(0);
  transition-delay: var(--d, 0ms);
  animation: ff-wordRise 700ms var(--bezier) both;
}
@keyframes ff-wordRise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Description */
.ff-course__desc {
  font-family: var(--body);
  font-weight: 300;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink);
  max-width: 30ch;
  padding: 0 28px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 700ms var(--bezier) 300ms, transform 700ms var(--bezier) 300ms;
  margin: 0 0 24px;
  position: relative; z-index: 3;
}
.ff-course.is-in .ff-course__desc { opacity: 1; transform: translateY(0); }

/* Pairing line */
.ff-course__pairing {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  opacity: 0;
  transition: opacity 700ms var(--bezier) 500ms;
  margin-bottom: 22px;
  position: relative; z-index: 3;
}
.ff-course.is-in .ff-course__pairing { opacity: 1; }
.ff-course__pairingLabel {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}
.ff-course__pairingValue {
  font-family: var(--display);
  font-style: italic;
  font-size: 14px;
  color: var(--ink);
  opacity: 0.8;
}

.ff-course__divider { display: flex; align-items: center; justify-content: center; margin-top: auto; padding-top: 12px; }

/* ──────────────────────────────────────────────────────────────
   Closing
   ────────────────────────────────────────────────────────────── */
.ff-closing {
  position: relative;
  min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 80px 32px 40px;
  background: #F7F7F7;
}
.ff-closing__inner {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  text-align: center;
}
.ff-closing__blessing {
  font-family: var(--display);
  font-style: italic;
  font-size: 44px;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 6px;
}
.ff-closing__sig {
  font-family: var(--body);
  font-weight: 300;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--ink);
  opacity: 0.85;
  margin-top: 4px;
}
.ff-closing__year {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.4em;
  color: var(--gold);
  margin-top: 12px;
}
.ff-shimmer {
  position: absolute;
  inset: auto -40px;
  bottom: -8px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-light) 50%, transparent);
  opacity: 0;
  animation: ff-shimmer 8s ease-in-out infinite;
}
@keyframes ff-shimmer {
  0%, 80%, 100% { opacity: 0; transform: translateX(-30%); }
  85%           { opacity: 1; transform: translateX(0%); }
  90%           { opacity: 1; transform: translateX(20%); }
  95%           { opacity: 0; transform: translateX(40%); }
}

/* ──────────────────────────────────────────────────────────────
   Progress rail
   ────────────────────────────────────────────────────────────── */
.ff-rail {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  z-index: 18;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  opacity: 0;
  transition: opacity 700ms var(--bezier) 400ms;
}
.ff-rail:not(.ff-rail--hidden) { opacity: 1; }
.ff-rail__line {
  position: absolute;
  top: -16px; bottom: -16px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold-faint), var(--gold-faint), transparent);
}
.ff-rail__dot {
  position: relative;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold-faint);
  transition: background 400ms var(--bezier), transform 400ms var(--bezier), box-shadow 400ms var(--bezier);
}
.ff-rail__dot.is-past   { background: var(--gold); }
.ff-rail__dot.is-active {
  background: var(--rose);
  transform: scale(1.6);
  box-shadow: 0 0 0 3px rgba(232, 180, 184, 0.18);
}

/* ──────────────────────────────────────────────────────────────
   Reduced motion
   ────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 200ms !important;
  }
  .ff-particle { display: none; }
  .ff-cta--breathe { animation: none; }
}
