/* ══════════════════════════════════════
   CASA PERNIA — design tokens (light / ivory)
══════════════════════════════════════ */
:root {
  --paper:   #f4efe6;   /* main background: warm ivory, not pure white */
  --paper-2: #ece5d9;   /* deeper parchment for alternating sections */
  --card:    #faf7f1;   /* cards & inputs */
  --ink:     #1b1815;   /* main text: warm near-black */
  --ink-soft:#3d3731;
  --muted:   #6c645a;   /* secondary text (AA on paper) */
  --brass:   #84653a;   /* accent on light backgrounds (AA) */
  --brass-l: #cdb184;   /* accent on dark photos */
  --ivory:   #f4efe6;   /* text on dark (hero, intro) */
  --line:    rgba(27, 24, 21, 0.14);
  --line-2:  rgba(27, 24, 21, 0.28);

  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans:  'Jost', 'Helvetica Neue', Arial, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(1.25rem, 4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: var(--ink); color: var(--paper); }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.05; letter-spacing: -0.01em; }
em { font-style: italic; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 var(--pad); }
section[id] { scroll-margin-top: 64px; } /* nav links land below the fixed bar */
.section { padding: clamp(5rem, 11vw, 9rem) 0; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 1.4rem;
}
.eyebrow--dark { color: var(--brass); }

.section-head { max-width: 760px; margin-bottom: clamp(3rem, 6vw, 5rem); }
.section-head--row { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; }
.section-title { font-size: clamp(2.4rem, 5.4vw, 4.4rem); color: var(--ink); }
.section-title em { color: var(--brass); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 2rem;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-light { background: var(--ivory); color: var(--ink); }
.btn-light:hover { background: #fff; }
.btn-ghost { border: 1px solid rgba(244, 239, 230, 0.5); color: var(--ivory); }
.btn-ghost:hover { border-color: var(--ivory); background: rgba(244, 239, 230, 0.1); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: var(--ink-soft); }
.btn-full { width: 100%; }
.btn-wa { border: 1px solid var(--ink); color: var(--ink); }
.btn-wa:hover { background: var(--ink); color: var(--paper); }
.btn[hidden] { display: none; }

/* ── Reveal ── */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* ══════════════════════════════════════
   INTRO — black screen, only the mark (stays dark on purpose)
══════════════════════════════════════ */
.intro {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #000;
  display: grid;
  place-items: center;
  transition: opacity 0.9s var(--ease), visibility 0.9s;
}
.intro.is-done { opacity: 0; visibility: hidden; }
.intro-mark { display: flex; flex-direction: column; align-items: center; gap: 1.4rem; }
.intro-monogram {
  font-family: var(--serif);
  font-size: clamp(3rem, 9vw, 5.5rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--ivory);
  opacity: 0;
  transform: scale(0.96);
  animation: introIn 1.4s var(--ease) 0.2s forwards;
}
.intro-amp { color: var(--brass-l); font-style: italic; }
.intro-line {
  width: 0;
  height: 1px;
  background: var(--brass-l);
  animation: introLine 1s var(--ease) 0.9s forwards;
}
.intro-word {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.45em;
  padding-left: 0.45em;
  text-transform: uppercase;
  color: #9a9184;
  opacity: 0;
  animation: introFade 1s var(--ease) 1.3s forwards;
}
@keyframes introIn { to { opacity: 1; transform: none; } }
@keyframes introLine { to { width: 88px; } }
@keyframes introFade { to { opacity: 1; } }

/* ══════════════════════════════════════
   NAV — ivory over the hero film, ink once scrolled onto paper
══════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  color: var(--ivory);
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), color 0.5s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(244, 239, 230, 0.82);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom-color: var(--line);
  color: var(--ink);
}
.nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.nav-links { display: flex; align-items: center; gap: 2.4rem; }
.nav-links a {
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.78;
  transition: opacity 0.3s;
}
.nav-links a:hover { opacity: 1; }
.nav-links .nav-cta {
  opacity: 1;
  color: var(--ink);
  background: var(--ivory);
  padding: 0.55rem 1.3rem;
  border-radius: 999px;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
.nav.scrolled .nav-links .nav-cta { background: var(--ink); color: var(--paper); }
.nav-toggle { display: none; width: 44px; height: 44px; position: relative; color: inherit; }
.nav-toggle span {
  position: absolute; left: 11px; right: 11px; height: 1px; background: currentColor;
  transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}
.nav-toggle span:first-child { top: 18px; }
.nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded="true"] { color: var(--ink); }
.nav-toggle[aria-expanded="true"] span:first-child { top: 22px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 22px; transform: rotate(-45deg); }

/* ══════════════════════════════════════
   HERO — full-bleed film (stays dark so photos glow)
══════════════════════════════════════ */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #0d0b09;
  color: var(--ivory);
}
.hero-media { position: absolute; inset: 0; }
.hero-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}
.hero.has-video .hero-video { opacity: 1; }
.hero.has-video .hero-reel { opacity: 0; }
.hero-reel { position: absolute; inset: 0; transition: opacity 1.2s var(--ease); }
.reel-slide {
  position: absolute; inset: -2%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.12);
  transition: opacity 2s ease, transform 7.5s linear;
}
.reel-slide.is-active { opacity: 1; transform: scale(1); }
.hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13, 11, 9, 0.88) 0%, rgba(13, 11, 9, 0.3) 45%, rgba(13, 11, 9, 0.5) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--pad) clamp(5rem, 12vh, 8rem);
}
.hero-eyebrow { color: var(--brass-l); }
.hero-title {
  font-size: clamp(3.4rem, 10vw, 8.5rem);
  font-weight: 300;
  line-height: 0.95;
  margin-bottom: 2.6rem;
  color: var(--ivory);
}
.hero-title em { color: #e9e0d0; }
.hero-ctas { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.hero-eyebrow, .hero-title, .hero-ctas { opacity: 0; transform: translateY(24px); transition: opacity 1.4s var(--ease), transform 1.4s var(--ease); }
body.is-ready .hero-eyebrow { opacity: 1; transform: none; transition-delay: 0.15s; }
body.is-ready .hero-title   { opacity: 1; transform: none; transition-delay: 0.3s; }
body.is-ready .hero-ctas    { opacity: 1; transform: none; transition-delay: 0.5s; }

.hero-scroll {
  position: absolute;
  right: var(--pad);
  bottom: clamp(5rem, 12vh, 8rem);
  z-index: 1;
  width: 44px; height: 88px;
  display: flex; justify-content: center;
}
.hero-scroll-line {
  width: 1px; height: 100%;
  background: linear-gradient(to bottom, transparent, var(--ivory));
  animation: scrollLine 2.4s ease-in-out infinite;
  transform-origin: top;
}
@keyframes scrollLine {
  0% { transform: scaleY(0); opacity: 0; }
  40% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ══════════════════════════════════════
   STATEMENT — word-by-word reveal
══════════════════════════════════════ */
.statement {
  min-height: 140vh;
  padding: 0 var(--pad);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.statement-text {
  position: sticky;
  top: 22vh;
  max-width: 1100px;
  margin: 18vh auto 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4.6vw, 3.9rem);
  font-weight: 300;
  line-height: 1.18;
  text-align: center;
  color: var(--ink);
}
.statement-text .w { color: rgba(27, 24, 21, 0.14); transition: color 0.35s linear; }
.statement-text .w.on { color: var(--ink); }

/* ══════════════════════════════════════
   EXPERIENCES + PROCESS (parchment band)
══════════════════════════════════════ */
.section-light { background: var(--paper-2); }
.exp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.exp-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.exp-card:hover { transform: translateY(-6px); box-shadow: 0 24px 50px -28px rgba(27, 24, 21, 0.35); }
.exp-img {
  aspect-ratio: 4 / 3.4;
  background-size: cover;
  background-position: center;
  transition: transform 1.2s var(--ease);
}
.exp-card:hover .exp-img { transform: scale(1.04); }
.exp-body { padding: 2.6rem 2.2rem 2.4rem; min-height: 320px; display: flex; flex-direction: column; gap: 0.8rem; flex: 1; position: relative; background: var(--card); }
.exp-num { font-size: 0.72rem; letter-spacing: 0.3em; color: var(--brass); }
.exp-body h3 { font-size: 2rem; }
.exp-body p { color: var(--muted); font-size: 0.98rem; flex: 1; }
.exp-tag {
  align-self: flex-start;
  margin-top: 0.6rem;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
}

/* ── Process ── */
.process-wrap { padding-top: 0; }
.process { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.process li { padding: 2.4rem 1.6rem 0 0; }
.process-n { display: block; font-family: var(--serif); font-size: 3.2rem; font-weight: 300; color: var(--brass); line-height: 1; margin-bottom: 1.4rem; }
.process h3 { font-size: 1.6rem; margin-bottom: 0.6rem; }
.process p { color: var(--muted); font-size: 0.95rem; }

/* ══════════════════════════════════════
   CHEF
══════════════════════════════════════ */
.chef-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(3rem, 7vw, 7rem); align-items: center; }
.chef-photo { border-radius: 22px; overflow: hidden; aspect-ratio: 4 / 5; }
.chef-photo img { width: 100%; height: 100%; object-fit: cover; }
.chef-text .section-title { margin-bottom: 2rem; }
.chef-text p { color: var(--muted); margin-bottom: 1.2rem; max-width: 520px; }

/* ══════════════════════════════════════
   WORK — horizontal strip
══════════════════════════════════════ */
.work { padding-bottom: clamp(5rem, 9vw, 8rem); }
.work .section-head { margin-bottom: 2.5rem; }
.work-hint { font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }
.work-strip {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  --edge: max(var(--pad), calc((100vw - 1240px) / 2 + var(--pad)));
  padding: 0 var(--edge) 1.2rem;
  scroll-padding-inline: var(--edge);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.work-strip:focus-visible { outline: 1px solid var(--brass); outline-offset: 4px; }
.work-item { flex: 0 0 clamp(260px, 32vw, 420px); scroll-snap-align: start; }
.work-item img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 18px; }
.work-item figcaption { margin-top: 1rem; font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--ink-soft); }

/* ══════════════════════════════════════
   MENU — parchment card
══════════════════════════════════════ */
.section-ivory { background: var(--paper-2); color: var(--ink); }
.menu-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(3rem, 8vw, 8rem); align-items: start; }
.menu-intro p { color: var(--muted); max-width: 440px; margin-top: 1.6rem; }
.menu-intro .btn { margin-top: 2.2rem; }
.menu-card { border-top: 1px solid var(--line-2); }
.course { padding: 2rem 0; border-bottom: 1px solid var(--line-2); }
.course-label { display: block; font-size: 0.7rem; font-weight: 500; letter-spacing: 0.3em; text-transform: uppercase; color: var(--brass); margin-bottom: 1rem; }
.dish { font-family: var(--serif); font-size: 1.65rem; line-height: 1.25; }
.dish-note { font-size: 0.92rem; color: var(--muted); margin-bottom: 0.9rem; }
.dish-note:last-child { margin-bottom: 0; }

/* ══════════════════════════════════════
   BOOK
══════════════════════════════════════ */
.book-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(3rem, 8vw, 8rem); align-items: start; }
.book-text p { color: var(--muted); margin: 1.6rem 0 2.2rem; max-width: 420px; }
.book-phone { font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.2rem); border-bottom: 1px solid var(--line-2); padding-bottom: 0.3rem; transition: border-color 0.3s; }
.book-phone:hover { border-color: var(--brass); }
.book-ig { display: block; margin-top: 1.4rem; font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); transition: color 0.3s; }
.book-ig:hover { color: var(--brass); }
.footer-tag a { text-decoration: underline; text-underline-offset: 3px; }
.book-form { display: flex; flex-direction: column; gap: 1.4rem; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4rem; }
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field label { font-size: 0.7rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 300;
  padding: 0.7rem 0;
  border-radius: 0;
  outline: none;
  transition: border-color 0.3s;
  color-scheme: light;
}
.field select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.field select option { background: var(--card); color: var(--ink); }
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus { border-bottom-color: var(--brass); }
.field input::placeholder, .field textarea::placeholder { color: #9b9387; }
.field.invalid input { border-bottom-color: #b5523f; }
.form-note { font-size: 0.82rem; color: var(--muted); text-align: center; }

/* ── Footer ── */
.footer { border-top: 1px solid var(--line); padding: 2.6rem 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer-logo { font-family: var(--serif); font-size: 1.4rem; }
.footer-tag, .footer-copy { font-size: 0.78rem; letter-spacing: 0.08em; color: var(--muted); }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 960px) {
  .nav-toggle { display: block; z-index: 1001; }
  .nav-links {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    background: rgba(244, 239, 230, 0.98);
    color: var(--ink);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s var(--ease), visibility 0.5s;
  }
  .nav-links.open { opacity: 1; visibility: visible; }
  .nav-links a { font-size: 0.9rem; }
  .nav-links .nav-cta { background: var(--ink); color: var(--paper); }
  .exp-grid { grid-template-columns: minmax(0, 1fr); }
  .exp-body { min-height: 0; }
  .process { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chef-grid, .menu-grid, .book-grid { grid-template-columns: minmax(0, 1fr); }
  .chef-photo { max-width: 520px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .process { grid-template-columns: minmax(0, 1fr); }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .section-head--row { flex-direction: column; align-items: flex-start; }
  .hero-ctas .btn { flex: 1 1 auto; }
  .hero-scroll { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .statement { min-height: auto; padding: 8rem var(--pad); }
  .statement-text { position: static; margin: 0 auto; }
  .statement-text .w { color: var(--ink); }
}
