/* ===========================================================
   Casa Aurelia — Design Tokens
   =========================================================== */
:root {
  /* Color */
  --verde-notte: #0B1A13;
  --verde-fondo: #12271C;
  --verde-linea: #24402F;
  --oro: #C8A24A;
  --oro-chiaro: #E3C77E;
  --crema: #EFE9DC;
  --salvia: #93A695;

  /* Type */
  --font-display: "Cinzel", serif;
  --font-serif: "Cormorant Garamond", serif;
  --font-sans: "Jost", sans-serif;

  /* Scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
  --space-7: 9rem;

  --radius: 2px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===========================================================
   Reset
   =========================================================== */
*, *::before, *::after { box-sizing: border-box; }
/* Lenis drives real window scrolling every rAF tick; native CSS smoothing
   fights it into a rubber-banding mess. Lenis stamps a `lenis` class onto
   <html> once it initialises, so: native smooth scroll whenever Lenis is
   NOT running (JS disabled, library failed to load, reduced motion), hard
   `auto` when it is. */
html { scroll-behavior: auto; }
html:not(.lenis) { scroll-behavior: smooth; }
body, h1, h2, h3, p, figure { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: none; cursor: pointer; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }

body {
  background: var(--verde-notte);
  color: var(--crema);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.6;
  /* overflow-x:hidden would compute overflow-y to auto, turning <body> into
     a scroll container — that breaks position:sticky (it would stick to
     body's scrollport, not the viewport) and confuses Lenis's height
     measurement. overflow-x:clip clips identically without creating one. */
  overflow-x: clip;
}

/* ===========================================================
   Lenis (base rules only — NOT lenis.css's iframe{pointer-events:none}
   rule, which would permanently break the Google Maps embed below.
   .prenotazione__map carries data-lenis-prevent instead.)
   =========================================================== */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--oro);
  margin-bottom: var(--space-2);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--crema);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.2;
  margin-bottom: var(--space-3);
}
h2 em { font-style: normal; color: var(--oro-chiaro); }

.prose {
  font-size: 1.15rem;
  color: var(--salvia);
  max-width: 42ch;
  margin-bottom: var(--space-2);
}

/* Focus visibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--oro-chiaro);
  outline-offset: 3px;
}

/* Skip to content — visible only when focused */
.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  z-index: 200;
  background: var(--oro);
  color: var(--verde-notte);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.8rem 1.4rem;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ===========================================================
   Buttons
   =========================================================== */
.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 1rem 2.2rem;
  border-radius: var(--radius);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn--ghost {
  border: 1px solid var(--oro);
  color: var(--crema);
}
.btn--ghost:hover { background: var(--oro); color: var(--verde-notte); }

.btn--solid {
  background: var(--oro);
  color: var(--verde-notte);
}
.btn--solid:hover { background: var(--oro-chiaro); }

.btn--outline {
  border: 1px solid var(--verde-linea);
  color: var(--crema);
}
.btn--outline:hover { border-color: var(--oro); color: var(--oro-chiaro); }

/* ===========================================================
   Photo blocks
   =========================================================== */
.ph--strip {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--verde-linea);
}
.strip__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===========================================================
   Nav
   =========================================================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem var(--space-5);
  background: transparent;
  transition: background 0.35s var(--ease), padding 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.nav.is-scrolled {
  background: rgba(11,26,19,0.92);
  backdrop-filter: blur(8px);
  padding: 0.9rem var(--space-5);
  box-shadow: 0 1px 0 var(--verde-linea);
}
.nav__brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  color: var(--crema);
}
.nav__links {
  display: flex;
  gap: var(--space-4);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.nav__links a { position: relative; padding-bottom: 4px; }
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--oro);
  transition: width 0.25s var(--ease);
}
.nav__links a:hover::after { width: 100%; }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--salvia);
}
.lang-switch a { transition: color 0.2s var(--ease); }
.lang-switch a:hover,
.lang-switch a[aria-current="true"] { color: var(--oro); }
.lang-switch--mobile {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--verde-linea);
  text-transform: none;
  letter-spacing: 0.08em;
}

.nav__toggle {
  display: none;
  position: relative;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
/* Expand the touch target to 44px without changing the visual size */
.nav__toggle::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
}
.nav__toggle span {
  width: 22px; height: 1px;
  background: var(--crema);
}

.nav-mobile {
  position: fixed;
  top: 0; right: -100%;
  width: min(78vw, 320px);
  height: 100vh;
  height: 100dvh;
  background: var(--verde-fondo);
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 7rem var(--space-4) var(--space-4);
  font-family: var(--font-sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.95rem;
  /* visibility keeps the closed drawer out of the keyboard tab order */
  visibility: hidden;
  transition: right 0.4s var(--ease), visibility 0s linear 0.4s;
  border-left: 1px solid var(--verde-linea);
}
.nav-mobile.is-open {
  right: 0;
  visibility: visible;
  transition: right 0.4s var(--ease), visibility 0s;
}
.nav-mobile a { padding: 0.6rem 0; }

/* ===========================================================
   Hero — autoplaying background video
   =========================================================== */
/* DEFAULT is the safe state: the flat brand colour on .hero__video. Video
   attributes (autoplay muted loop playsinline) do the rest natively, so it
   still plays even if hero-video.js never runs. no-JS, video error and
   reduced-motion all degrade to this same static one-screen hero. */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
}

.hero__stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  background: var(--verde-notte); /* flat colour behind/before the video, never an image */
}

.hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,26,19,0.72) 0%, rgba(11,26,19,0.6) 40%, rgba(11,26,19,0.94) 100%);
  z-index: 1;
}

/* Light loading state — solid brand colour + a gold pulse. Never a poster. */
.hero__loading {
  position: absolute; inset: 0;
  z-index: 3;
  background: var(--verde-notte);
  display: grid;
  place-items: center;
  opacity: 1;
  transition: opacity 0.7s var(--ease);
  pointer-events: none;
}
.hero__loading span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--oro);
  animation: heroPulse 1.4s ease-in-out infinite;
}
@keyframes heroPulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}
.hero.is-ready .hero__loading { opacity: 0; }

.hero__content {
  position: relative;
  z-index: 2;
  padding: 0 var(--space-3);
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
  will-change: opacity, transform;
}
.hero__title {
  font-size: clamp(3rem, 9vw, 6.5rem);
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
}
.hero__tagline {
  font-size: 1.3rem;
  color: var(--salvia);
  margin-bottom: var(--space-4);
}
.hero__tagline em { font-style: italic; }

.hero__scrolldown {
  position: absolute;
  bottom: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 1px;
  height: 50px;
  background: rgba(239,233,220,0.25);
  opacity: 1;
  transition: opacity 0.5s var(--ease);
  will-change: opacity;
}
.hero__scrolldown.is-hidden { opacity: 0; }
.hero__scrolldown span {
  position: absolute;
  top: 0; left: -1.5px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--oro);
  animation: scrolldown 2.2s ease-in-out infinite;
}
@keyframes scrolldown {
  0% { top: 0; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ===========================================================
   Split layout (La Casa / Lo Chef)
   =========================================================== */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: clamp(480px, 90vh, 760px);
}
.split--reverse .split__media { order: 2; }
.split--reverse .split__text { order: 1; }

.split__media { min-height: 420px; overflow: hidden; }
.split__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.split__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-6);
}

/* ===========================================================
   Menu section (signature)
   =========================================================== */
.menu-section {
  padding: var(--space-7) var(--space-5);
  background: var(--verde-fondo);
  border-top: 1px solid var(--verde-linea);
  border-bottom: 1px solid var(--verde-linea);
}
.menu-section__head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-6);
}
.menu-section__head h2 { margin-bottom: 0; }

.menu-layout {
  display: grid;
  grid-template-columns: 64px 1fr 1fr;
  gap: var(--space-4);
  max-width: 1200px;
  margin: 0 auto;
  align-items: stretch;
}

.menu-tabs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  border-right: 1px solid var(--verde-linea);
  padding-right: var(--space-2);
}
.menu-tab {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--salvia);
  padding: var(--space-1) 0;
  transition: color 0.25s var(--ease);
}
.menu-tab:hover { color: var(--crema); }
.menu-tab.is-active { color: var(--oro); }

.menu-panel { min-height: 420px; }
.menu-list { display: none; flex-direction: column; gap: var(--space-3); }
.menu-list.is-active { display: flex; }

.dish__row {
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
}
.dish__name {
  font-size: 1.3rem;
  color: var(--oro-chiaro);
  white-space: nowrap;
}
.dish__row::after {
  content: "";
  flex: 1;
  border-bottom: 1px dotted var(--verde-linea);
  margin-bottom: 5px;
}
.dish__price {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--crema);
  white-space: nowrap;
}
.dish__desc {
  color: var(--salvia);
  font-size: 1rem;
  font-style: italic;
  max-width: 46ch;
}

.menu-photo { position: relative; align-self: start; aspect-ratio: 3 / 4; min-height: 420px; }
.ph--menu {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  aspect-ratio: auto;
}
.ph--menu.is-active { opacity: 1; position: relative; }
.menu-photo__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===========================================================
   La Sala
   =========================================================== */
.la-sala {
  padding: var(--space-7) var(--space-5);
  text-align: center;
}
.la-sala__head { max-width: 640px; margin: 0 auto var(--space-5); }
.la-sala__strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  max-width: 1200px;
  margin: 0 auto;
}

/* ===========================================================
   Prenotazione
   =========================================================== */
.prenotazione {
  background: var(--verde-fondo);
  border-top: 1px solid var(--verde-linea);
  padding: var(--space-7) var(--space-5);
}
.prenotazione__inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.prenotazione__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  align-items: start;
  margin-top: var(--space-5);
  text-align: left;
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  text-align: left;
}
.info-block h3 {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--oro);
  margin-bottom: var(--space-1);
}
.info-block p {
  color: var(--salvia);
  font-size: 1.05rem;
}
.info-link {
  display: inline-block;
  padding: 0.25rem 0;
  color: var(--crema);
  border-bottom: 1px solid var(--verde-linea);
}
.info-link:hover { color: var(--oro-chiaro); border-color: var(--oro); }

.prenotazione__cta {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-start;
  flex-wrap: wrap;
}

.prenotazione__map {
  position: relative;
  min-height: 360px;
  border: 1px solid var(--verde-linea);
  overflow: hidden;
}
.prenotazione__map iframe {
  width: 100%;
  height: 100%;
  min-height: 360px;
  border: 0;
  display: block;
  filter: invert(88%) hue-rotate(180deg) brightness(0.95) contrast(0.9);
}

/* ===========================================================
   Reservation Form
   =========================================================== */
.reservation-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
.form-row--three { grid-template-columns: 1fr 1fr 1fr; }

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-field label {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--salvia);
}
.form-field input,
.form-field select {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--crema);
  background: var(--verde-notte);
  border: 1px solid var(--verde-linea);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  transition: border-color 0.25s var(--ease);
}
.form-field input::placeholder { color: var(--salvia); opacity: 0.6; }
.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--oro);
}
.form-field select { appearance: auto; }

.form-error {
  color: #e08585;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}
.form-feedback {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  min-height: 1.2em;
}
.form-feedback.is-success { color: var(--oro-chiaro); }
.form-feedback.is-error { color: #e08585; }

.reservation-fallback {
  border-top: 1px solid var(--verde-linea);
  padding-top: var(--space-3);
}
.reservation-fallback__label {
  color: var(--salvia);
  font-size: 0.9rem;
  margin-bottom: var(--space-2);
}

/* ===========================================================
   Footer
   =========================================================== */
.footer {
  padding: var(--space-4) var(--space-5) calc(var(--space-4) + 2rem);
  text-align: center;
  border-top: 1px solid var(--verde-linea);
}
.footer__brand {
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  margin-bottom: var(--space-1);
}
.footer__note {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--salvia);
}

/* ===========================================================
   Sticky reservation button
   =========================================================== */
.sticky-cta {
  position: fixed;
  bottom: var(--space-3);
  right: var(--space-3);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--oro);
  color: var(--verde-notte);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.9rem 1.3rem;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.sticky-cta:hover { background: var(--oro-chiaro); transform: translateY(-2px); }

/* ===========================================================
   Scroll reveal
   =========================================================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
.hero [data-reveal] {
  transition-delay: calc(var(--i, 0) * 0.12s);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero__scrolldown span { animation: none; opacity: 0.6; top: 40%; }
  .hero__loading span { animation: none; opacity: 0.6; }
  html { scroll-behavior: auto; }
}

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 1024px) {
  .nav { padding: 1.2rem var(--space-3); }
  .nav.is-scrolled { padding: 0.8rem var(--space-3); }
  .split__text { padding: var(--space-5) var(--space-3); }
  .menu-section { padding: var(--space-6) var(--space-3); }
  .la-sala, .prenotazione { padding: var(--space-6) var(--space-3); }
}

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__toggle { display: flex; }

  .split { grid-template-columns: 1fr; }
  .split__media { min-height: 320px; }
  .split--reverse .split__media { order: 1; }
  .split--reverse .split__text { order: 2; }

  .menu-layout {
    grid-template-columns: 1fr;
  }
  /* Grid items default to min-width:auto, which lets wide content push the
     track past the viewport. Pin them to 0 so 1fr really means "fit". */
  .menu-tabs, .menu-panel, .menu-photo { min-width: 0; }

  .menu-tabs {
    flex-direction: row;
    flex-wrap: wrap;
    writing-mode: horizontal-tb;
    border-right: none;
    border-bottom: none;
    padding-right: 0;
    padding-bottom: var(--space-2);
    justify-content: center;
    gap: 0.5rem;
  }
  .menu-tab {
    writing-mode: horizontal-tb;
    transform: none;
    white-space: nowrap;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--verde-linea);
    border-radius: 999px;
    background: transparent;
  }
  .menu-tab.is-active {
    background: var(--oro);
    border-color: var(--oro);
    color: var(--verde-notte);
  }
  /* min-height must be reset, not just omitted: the base rule's 420px
     combined with aspect-ratio forces a 560px minimum width here. */
  .menu-photo { min-height: 0; aspect-ratio: 4/3; }

  .info-grid { grid-template-columns: 1fr; text-align: center; }
  .la-sala__strip { grid-template-columns: 1fr 1fr; }

  .prenotazione__layout { grid-template-columns: 1fr; text-align: center; }
  .prenotazione__cta { justify-content: center; margin-top: var(--space-4); }
  .prenotazione__map { min-height: 280px; }
  .prenotazione__map iframe { min-height: 280px; }

  .reservation-form { text-align: left; }
  .form-row,
  .form-row--three { grid-template-columns: 1fr; }
  .reservation-fallback { text-align: center; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .la-sala__strip { grid-template-columns: 1fr; }
  .prenotazione__cta { flex-direction: column; }
  .btn { text-align: center; }
  /* Long names ("Gnocchi di Patate al Gorgonzola") must wrap here,
     otherwise the row pushes the price off-screen. */
  .dish__name { white-space: normal; }
  .eyebrow { letter-spacing: 0.18em; }
}
