/* ==========================================================================
   Trattoria Aurelio — Design System
   Type scale: golden ratio (φ = 1.618), base 1rem
   Spacing scale: Fibonacci, in px — 8 13 21 34 55 89 144 233
   ========================================================================== */

:root {
  /* ---- Color tokens: candlelit dark ground, terracotta/amber accents ---- */
  --ink:        #1b120d;   /* primary background — near-black warm umber */
  --char:       #241811;   /* secondary surface, cards, nav */
  --char-2:     #2f2018;   /* tertiary surface, hover states */
  --line:       #4a382c;   /* hairline borders on dark */
  --cream:      #f4ead9;   /* primary text on dark */
  --cream-dim:  #cdbca8;   /* secondary text on dark */
  --terracotta: #c1602f;   /* primary accent — burnt terracotta */
  --terracotta-deep: #9c4a22;
  --amber:      #e0a458;   /* warm amber — CTAs, highlights */
  --amber-bright: #f0bd7a;
  --wine:       #6d2430;   /* deep wine red — cta band, small accents */
  --wine-deep:  #4c1720;

  /* ---- Type scale: golden ratio, φ = 1.618 ---- */
  --fs-xs:  0.618rem;
  --fs-sm:  1rem;
  --fs-md:  clamp(1rem, 0.92rem + 0.4vw, 1.618rem);
  --fs-lg:  clamp(1.618rem, 1.3rem + 1.2vw, 2.618rem);
  --fs-xl:  clamp(2.2rem, 1.6rem + 2.6vw, 4.236rem);
  --fs-xxl: clamp(2.618rem, 1.7rem + 4.6vw, 6.854rem);

  /* ---- Spacing scale: Fibonacci (px) ---- */
  --sp-1: 8px;
  --sp-2: 13px;
  --sp-3: 21px;
  --sp-4: 34px;
  --sp-5: 55px;
  --sp-6: 89px;
  --sp-7: 144px;
  --sp-8: 233px;

  /* ---- Type families ---- */
  --font-display: "Iowan Old Style", "Sitka Text", "Palatino Linotype", "URW Palladio L", P052, "Noto Serif", Georgia, serif;
  --font-body: Optima, Candara, "Noto Sans", "Segoe UI", "Trebuchet MS", sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1420px;
}

/* ==========================================================================
   Reset
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

p { margin: 0 0 var(--sp-3); }
p:last-child { margin-bottom: 0; }

ul { list-style: none; margin: 0; padding: 0; }

/* ---- Focus states ---- */
a:focus-visible,
button:focus-visible,
video:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--amber);
  color: var(--ink);
  padding: var(--sp-2) var(--sp-3);
  z-index: 1000;
  font-family: var(--font-body);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus {
  left: var(--sp-2);
  top: var(--sp-2);
}

/* ==========================================================================
   Shared utility classes
   ========================================================================== */

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 700;
  margin: 0 0 var(--sp-2);
}
.eyebrow-light { color: var(--amber-bright); }

.section-title {
  font-size: var(--fs-lg);
  color: var(--cream);
  margin-bottom: var(--sp-4);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--fs-sm);
  letter-spacing: 0.01em;
  padding: var(--sp-2) var(--sp-4);
  border-radius: 3px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.35s var(--ease-out), background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--amber);
  color: var(--ink);
  border-color: var(--amber);
}
.btn-primary:hover {
  background: var(--amber-bright);
  border-color: var(--amber-bright);
}

.btn-ghost {
  background: transparent;
  color: var(--cream);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--amber);
  color: var(--amber-bright);
}
.btn-ghost-light {
  border-color: rgba(244, 234, 217, 0.35);
}
.btn-ghost-light:hover {
  border-color: var(--amber-bright);
  color: var(--amber-bright);
}

.btn-outline {
  background: transparent;
  color: var(--terracotta);
  border-color: var(--terracotta);
}
.btn-outline:hover {
  background: var(--terracotta);
  color: var(--cream);
}

.btn-large {
  padding: var(--sp-3) var(--sp-5);
  font-size: var(--fs-md);
}

.btn-nav {
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-xs);
}

/* ==========================================================================
   Nav
   ========================================================================== */

.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  padding: var(--sp-2) 0;
  transition: background-color 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.site-nav.is-scrolled {
  background: rgba(27, 18, 13, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  color: var(--cream);
  margin-right: auto;
}
.nav-logo-mark { color: var(--amber); display: flex; }
.nav-logo-text {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: var(--sp-5);
}
.nav-links a {
  text-decoration: none;
  font-size: var(--fs-xs);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--cream-dim);
  position: relative;
  padding-bottom: 4px;
  transition: color 0.25s var(--ease-out);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--amber);
  transition: right 0.3s var(--ease-out);
}
.nav-links a:hover { color: var(--cream); }
.nav-links a:hover::after { right: 0; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  background: var(--cream);
  transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--ink);
}

.hero-video-frame {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 13, 9, 0.55) 0%, rgba(20, 13, 9, 0.25) 30%, rgba(15, 9, 6, 0.55) 68%, rgba(12, 8, 5, 0.94) 100%),
    radial-gradient(ellipse at 30% 100%, rgba(224, 164, 88, 0.16), transparent 55%);
}

.hero-grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-4) var(--sp-7);
}

.hero-eyebrow {
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber-bright);
  font-weight: 700;
  margin: 0 0 var(--sp-3);
}

.hero-title {
  font-size: var(--fs-xxl);
  color: var(--cream);
  max-width: 16ch;
  text-shadow: 0 4px 40px rgba(0,0,0,0.4);
}

.hero-sub {
  font-size: var(--fs-md);
  color: var(--cream-dim);
  max-width: 42ch;
  margin: var(--sp-4) 0 0;
  font-family: var(--font-body);
}

.hero-actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-5);
}

.hero-badge {
  position: absolute;
  top: var(--sp-6);
  right: var(--sp-4);
  z-index: 2;
  color: var(--cream);
  opacity: 0.85;
  animation: spin-slow 40s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .hero-badge { animation: none; }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.scroll-cue {
  position: absolute;
  bottom: var(--sp-4);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  text-decoration: none;
  color: var(--cream-dim);
  font-size: var(--fs-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.scroll-cue-line {
  width: 1px;
  height: 34px;
  background: linear-gradient(180deg, var(--amber), transparent);
}

/* ==========================================================================
   Reveal-on-scroll
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ==========================================================================
   Story section — 61.8 / 38.2 split
   ========================================================================== */

.story {
  padding: var(--sp-8) var(--sp-4);
  background: var(--ink);
}

.story-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.618fr 0.382fr;
  gap: var(--sp-6);
}

/* Grid items default to min-width:auto, which sizes to their content's
   min-content and can overflow a percentage-based track. Reset to 0 so
   long unbroken strings (prices, headings) wrap within their column
   instead of pushing the layout wider than the viewport. */
.story-main, .story-side,
.menu-intro, .menu-list,
.location-main, .location-side {
  min-width: 0;
}

.story-lead { font-size: var(--fs-md); color: var(--cream); }

.drop-cap {
  float: left;
  font-family: var(--font-display);
  font-size: 3.6em;
  line-height: 0.78;
  padding: 0.03em 0.08em 0 0;
  color: var(--terracotta);
}

.story p { color: var(--cream-dim); font-size: var(--fs-sm); }

.story-side {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding-left: var(--sp-5);
  border-left: 1px solid var(--line);
}

.fact-block {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
}
.fact-num {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  color: var(--amber);
  min-width: 2.2ch;
}
.fact-label {
  font-size: var(--fs-xs);
  color: var(--cream-dim);
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.story-quote {
  margin: var(--sp-3) 0 0;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-md);
  color: var(--cream);
  line-height: 1.4;
}
.story-quote cite {
  display: block;
  margin-top: var(--sp-3);
  font-family: var(--font-body);
  font-style: normal;
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--terracotta);
}

/* ==========================================================================
   Menu section — 38.2 / 61.8 split
   ========================================================================== */

.menu {
  padding: var(--sp-8) var(--sp-4);
  background: var(--char);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.menu-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.382fr 0.618fr;
  gap: var(--sp-6);
}

.menu-intro {
  position: sticky;
  top: var(--sp-8);
  align-self: start;
}
.menu-intro p { color: var(--cream-dim); }
.menu-cta { margin-top: var(--sp-4); }

.menu-list {
  display: flex;
  flex-direction: column;
}

.menu-item {
  padding: var(--sp-5) 0;
  border-top: 1px solid var(--line);
  transition: transform 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}
.menu-item:last-child { padding-bottom: 0; }
.menu-item:hover,
.menu-item:focus-within {
  transform: translateX(13px);
  border-color: var(--amber);
}

.menu-item-head {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: var(--sp-3);
  align-items: baseline;
}

.menu-tag {
  grid-column: 1 / -1;
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 700;
  margin: 0 0 var(--sp-1);
}

.menu-name {
  font-size: var(--fs-md);
  color: var(--cream);
  font-weight: 600;
}

.menu-price {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--amber);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.menu-desc {
  margin-top: var(--sp-2);
  color: var(--cream-dim);
  max-width: 62ch;
}

/* ==========================================================================
   Reservation CTA band
   ========================================================================== */

.cta-band {
  position: relative;
  padding: var(--sp-8) var(--sp-4);
  background: linear-gradient(160deg, var(--wine) 0%, var(--wine-deep) 100%);
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 85% 20%, rgba(224, 164, 88, 0.18), transparent 55%);
  pointer-events: none;
}

.cta-band-inner {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.cta-title {
  font-size: var(--fs-xl);
  color: var(--cream);
}

.cta-sub {
  font-size: var(--fs-md);
  color: rgba(244, 234, 217, 0.82);
  max-width: 46ch;
  margin: var(--sp-4) auto 0;
}

.cta-actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--sp-5);
}

/* ==========================================================================
   Location / contact — 61.8 / 38.2 split
   ========================================================================== */

.location {
  padding: var(--sp-8) var(--sp-4);
  background: var(--ink);
}

.location-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.618fr 0.382fr;
  gap: var(--sp-6);
  align-items: center;
}

.location-address {
  font-style: normal;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  color: var(--cream);
  margin: 0 0 var(--sp-4);
  line-height: 1.5;
}

.location-details {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}
.location-details li {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--cream-dim);
}
.location-details svg { color: var(--terracotta); flex-shrink: 0; }
.location-details a { text-decoration: none; }
.location-details a:hover { color: var(--amber-bright); }

.location-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  color: var(--terracotta);
  opacity: 0.9;
}
.location-mark { max-width: 160px; }
.location-note {
  font-size: var(--fs-xs);
  text-align: center;
  color: var(--cream-dim);
  letter-spacing: 0.03em;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--char);
  border-top: 1px solid var(--line);
  padding: var(--sp-7) var(--sp-4) var(--sp-4);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--sp-5);
}

.footer-badge-svg { color: var(--amber); }

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.footer-brand p {
  color: var(--cream-dim);
  font-size: var(--fs-xs);
  max-width: 20ch;
}

.footer-links {
  display: flex;
  gap: var(--sp-4);
}
.footer-links a {
  text-decoration: none;
  color: var(--cream-dim);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer-links a:hover { color: var(--amber-bright); }

.footer-social {
  display: flex;
  gap: var(--sp-3);
}
.footer-social a {
  display: flex;
  color: var(--cream-dim);
}
.footer-social a:hover { color: var(--amber-bright); }

.footer-bottom {
  max-width: var(--container);
  margin: 0 auto;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
}
.footer-bottom p {
  color: var(--cream-dim);
  opacity: 0.6;
  font-size: var(--fs-xs);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 980px) {
  .nav-toggle { display: flex; }
  .btn-nav { display: none; }

  /* Base panel state: always laid out (so GSAP can animate it), hidden via
     opacity/visibility rather than display so autoAlpha can transition it
     smoothly instead of snapping. JS toggles .nav-open and drives the tween;
     these declarations are also the resting/closed state if JS is absent. */
  .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: rgba(20, 13, 9, 0.98);
    padding: var(--sp-4);
    gap: var(--sp-3);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .site-nav.nav-open .nav-links {
    pointer-events: auto;
  }
  /* No-JS / pre-animation fallback: if script.js hasn't run yet or GSAP
     failed to load, .nav-open alone still reveals the panel instantly. */
  .site-nav.nav-open .nav-links:not([style]) {
    opacity: 1;
    visibility: visible;
  }

  .story-inner,
  .menu-inner,
  .location-inner {
    grid-template-columns: 1fr;
  }
  .story-side {
    border-left: none;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: var(--sp-4);
  }
  .menu-intro { position: static; }
  .location-inner { text-align: left; }
  .location-side { align-items: flex-start; }
}

@media (max-width: 640px) {
  .hero-content { padding: 0 var(--sp-3) var(--sp-6); }
  .hero-title { max-width: 100%; }
  .hero-badge { display: none; }
  .story, .menu, .location, .cta-band { padding: var(--sp-6) var(--sp-3); }
  .site-footer { padding: var(--sp-5) var(--sp-3) var(--sp-3); }
  .menu-item-head { grid-template-columns: 1fr; row-gap: var(--sp-1); }
  .menu-price { order: -1; }
  .footer-inner { flex-direction: column; align-items: flex-start; text-align: left; }
  .cta-actions { flex-direction: column; align-items: stretch; }
  .cta-actions .btn { justify-content: center; }
}
