/* ============================================================
   TRAM TRAM — Trattoria romana, Milano Porta Venezia
   Palette: la livrea del tram (giallo Milano, crema, lavagna)
   ============================================================ */

:root {
  --crema:      #F5EFE0;   /* fondo principale */
  --crema-scura:#ECE3CD;   /* sezioni alternate */
  --lavagna:    #1B1B1B;   /* cartelli di linea e footer */
  --giallo:     #E9A820;   /* giallo tram: CTA e accenti */
  --giallo-chiaro: #F2BC4B;
  --rosso-sugo: #A83226;   /* accento amatriciana */
  --inchiostro: #211D18;   /* testo */
  --grigio-caldo:#6E6455;  /* testo secondario */

  --f-board: "Oswald", "Arial Narrow", sans-serif;
  --f-body: "Source Serif 4", "Georgia", serif;

  --maxw: 1120px;
  --pad: clamp(20px, 5vw, 64px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-padding-top: 70px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--f-body);
  font-size: 17.5px;
  line-height: 1.65;
  background: var(--crema);
  color: var(--inchiostro);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--giallo); color: var(--lavagna); }

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

:focus-visible {
  outline: 2px solid var(--inchiostro);
  outline-offset: 3px;
  border-radius: 2px;
}
.footer :focus-visible,
.board :focus-visible { outline-color: var(--giallo); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -60px; left: 16px;
  z-index: 200;
  background: var(--lavagna);
  color: var(--giallo);
  padding: 10px 18px;
  font-family: var(--f-board);
  font-weight: 500;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ============ INTRO "IL CAPOLINEA" ============ */

.intro {
  position: fixed;
  inset: 0;
  z-index: 300;
}

body.intro-lock { overflow: hidden; }

.intro-door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc(50% + 1px);
  background: var(--lavagna);
  transition: transform 0.7s cubic-bezier(0.7, 0, 0.2, 1);
}
.intro-door-l { left: 0; border-right: 1px solid rgba(233, 168, 32, 0.35); }
.intro-door-r { right: 0; }

.intro--open .intro-door-l { transform: translateX(-102%); }
.intro--open .intro-door-r { transform: translateX(102%); }

.intro-board {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  perspective: 700px;
  transition: opacity 0.25s;
}
.intro--open .intro-board { opacity: 0; }

.intro-flaps {
  display: flex;
  gap: 6px;
}

.flap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(32px, 7vw, 72px);
  height: clamp(46px, 10vw, 100px);
  background: #101010;
  border-radius: 6px;
  font-family: var(--f-board);
  font-size: clamp(28px, 6.2vw, 64px);
  font-weight: 600;
  color: var(--giallo);
  transform: rotateX(-92deg);
  opacity: 0;
  animation: flap-in 0.42s cubic-bezier(0.3, 0.9, 0.4, 1.08) forwards;
}
.flap::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 2px;
  background: rgba(0, 0, 0, 0.6);
}
.flap-space { background: transparent; }
.flap-space::after { display: none; }

.flap:nth-child(1) { animation-delay: 0.12s; }
.flap:nth-child(2) { animation-delay: 0.20s; }
.flap:nth-child(3) { animation-delay: 0.28s; }
.flap:nth-child(4) { animation-delay: 0.36s; }
.flap:nth-child(5) { animation-delay: 0.44s; }
.flap:nth-child(6) { animation-delay: 0.52s; }
.flap:nth-child(7) { animation-delay: 0.60s; }
.flap:nth-child(8) { animation-delay: 0.68s; }
.flap:nth-child(9) { animation-delay: 0.76s; }

@keyframes flap-in {
  to { transform: rotateX(0); opacity: 1; }
}

.intro-dest {
  font-family: var(--f-board);
  font-size: clamp(13px, 2vw, 18px);
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--giallo);
  opacity: 0;
  animation: dest-in 0.4s ease 1.05s forwards;
}
@keyframes dest-in {
  to { opacity: 0.95; }
}

/* ingresso hero orchestrato con la fine dell'intro */
.has-intro .hero-inner {
  opacity: 0;
  transform: translateY(16px);
}
.intro-done .hero-inner {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease 0.2s, transform 0.7s ease 0.2s;
}

@media (prefers-reduced-motion: reduce) {
  .intro { display: none; }
  .has-intro .hero-inner { opacity: 1; transform: none; }
}

/* ============ TOPBAR ============ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 12px var(--pad);
  background: rgba(245, 239, 224, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--lavagna);
}

.wordmark {
  font-family: var(--f-board);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--inchiostro);
  white-space: nowrap;
}

.nav { margin-right: auto; }
.nav-toggle { display: none; }

.nav-menu {
  display: flex;
  gap: 26px;
  list-style: none;
}
.nav-menu a {
  font-family: var(--f-board);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--grigio-caldo);
  transition: color 0.15s;
}
.nav-menu a:hover { color: var(--inchiostro); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: var(--f-board);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  background: none;
  border: none;
  color: var(--grigio-caldo);
  font: inherit;
  cursor: pointer;
  padding: 6px 8px;
}
.lang-btn.is-active { color: var(--rosso-sugo); }
.lang-btn:hover { color: var(--inchiostro); }
.lang-sep { color: rgba(33, 29, 24, 0.3); }

/* ============ BOTTONI ============ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 15px 28px;
  font-family: var(--f-board);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  transition: transform 0.15s, background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn:active { transform: scale(0.98); }

.btn-giallo {
  background: var(--giallo);
  color: var(--lavagna);
}
.btn-giallo:hover { background: var(--giallo-chiaro); }

.btn-ghost {
  border: 2px solid rgba(33, 29, 24, 0.35);
  color: var(--inchiostro);
}
.btn-ghost:hover { border-color: var(--inchiostro); }

.btn-small { padding: 8px 16px; font-size: 14px; }

/* ============ CARTELLO DI LINEA (firma visiva) ============ */

.board {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--lavagna);
  padding: 14px var(--pad);
  overflow: hidden;
  white-space: nowrap;
}

.board-arrow,
.board-text {
  font-family: var(--f-board);
  font-size: clamp(14px, 1.8vw, 19px);
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--giallo);
}

.board-divider { justify-content: center; }
.board-divider .board-text { font-size: clamp(12px, 1.5vw, 15px); opacity: 0.9; }

/* ============ HERO ============ */

.hero {
  min-height: calc(100vh - 55px);
  min-height: calc(100svh - 55px);
  display: flex;
  flex-direction: column;
}

.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(48px, 8vw, 90px) var(--pad);
}

.hero-title {
  font-family: var(--f-board);
  font-size: clamp(64px, 13vw, 176px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--inchiostro);
}

.hero-sub {
  font-family: var(--f-board);
  font-size: clamp(16px, 2.2vw, 24px);
  font-weight: 400;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--rosso-sugo);
  margin: 14px 0 30px;
}

.hero-lead {
  max-width: 620px;
  font-size: clamp(18px, 2.1vw, 21px);
  color: var(--grigio-caldo);
  margin-bottom: 38px;
}
.hero-lead em {
  font-style: italic;
  font-weight: 600;
  color: var(--inchiostro);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.hero-proof {
  font-family: var(--f-board);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grigio-caldo);
}

/* ============ SEZIONI ============ */

.section { padding: clamp(72px, 10vw, 130px) var(--pad); }

.section-crema { background: var(--crema-scura); }

.section > * {
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: clamp(36px, 5vw, 64px);
}

.section-no {
  font-family: var(--f-board);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--crema);
  background: var(--rosso-sugo);
  border-radius: 4px;
  padding: 5px 12px;
  white-space: nowrap;
}

.section-head h2 {
  font-family: var(--f-board);
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.05;
}

/* split */

.split {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: clamp(36px, 6vw, 90px);
  align-items: start;
}
.split-even { grid-template-columns: 1fr 1fr; }

.split-main p + p { margin-top: 1.2em; }

.pull {
  font-size: clamp(23px, 3vw, 32px);
  font-weight: 600;
  line-height: 1.35;
  color: var(--inchiostro);
  margin-bottom: 1.1em;
}
.split-main > p:not(.pull) { color: var(--grigio-caldo); }

/* stats */

.split-side { display: grid; gap: 28px; }

.stat {
  border-top: 2px solid rgba(33, 29, 24, 0.15);
  padding-top: 18px;
}
.stat-num {
  display: block;
  font-family: var(--f-board);
  font-size: clamp(40px, 5vw, 62px);
  font-weight: 600;
  line-height: 1;
  color: var(--rosso-sugo);
}
.stat-label {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  color: var(--grigio-caldo);
}

/* ============ MENÙ ============ */

.ledger { list-style: none; }

.ledger-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(33, 29, 24, 0.2);
}
.ledger-row:first-child { border-top: 1px solid rgba(33, 29, 24, 0.2); }

.ledger-name {
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 600;
}

.ledger-dots {
  flex: 1;
  border-bottom: 2px dotted rgba(33, 29, 24, 0.3);
  transform: translateY(-4px);
  min-width: 40px;
}

.ledger-price {
  font-family: var(--f-board);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 500;
  white-space: nowrap;
}

.ledger-note {
  margin-top: 26px;
  font-size: 15px;
  font-style: italic;
  color: var(--grigio-caldo);
}

/* ============ IN TAVOLA ============ */

.dish { margin: 0; }

.dish img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 6px;
  border: 3px solid var(--lavagna);
}

.dish-caption {
  margin-top: 12px;
  font-size: 14.5px;
  font-style: italic;
  color: var(--grigio-caldo);
}

.gallery-attesa {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
}

.g-slot {
  aspect-ratio: 3 / 2;
  border: 2px dashed rgba(33, 29, 24, 0.3);
  border-radius: 6px;
  background:
    repeating-linear-gradient(90deg,
      rgba(33, 29, 24, 0.04) 0 2px,
      transparent 2px 18px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.g-fork {
  font-family: var(--f-board);
  font-size: 26px;
  color: rgba(33, 29, 24, 0.3);
}

.gallery-note {
  margin-top: 14px;
  font-size: 14.5px;
  font-style: italic;
  color: var(--grigio-caldo);
}

/* ============ ORARI E DOVE ============ */

.hours-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 17px;
}
.hours-table th,
.hours-table td {
  text-align: left;
  padding: 15px 0;
  border-bottom: 1px solid rgba(33, 29, 24, 0.2);
  font-weight: 400;
}
.hours-table tr:first-child th,
.hours-table tr:first-child td { border-top: 1px solid rgba(33, 29, 24, 0.2); }
.hours-table td {
  text-align: right;
  font-family: var(--f-board);
  font-weight: 500;
}
.hours-table .hours-sub { font-style: italic; color: var(--grigio-caldo); }

.hours-note {
  margin-top: 18px;
  font-size: 15px;
  font-style: italic;
  color: var(--grigio-caldo);
}

.where-address {
  font-family: var(--f-board);
  font-style: normal;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.3;
  margin-bottom: 18px;
}

.where-metro {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  margin-bottom: 28px;
  color: var(--grigio-caldo);
}
.metro-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #D9241D; /* rosso della M1 */
  flex: none;
}

/* ============ FOOTER ============ */

.footer {
  background: var(--lavagna);
  color: var(--crema);
  padding: clamp(60px, 8vw, 100px) var(--pad) 40px;
  border-top: 6px solid var(--giallo);
}

.footer > * {
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
}

.footer-wordmark {
  font-family: var(--f-board);
  font-size: clamp(52px, 9vw, 116px);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1;
  color: rgba(245, 239, 224, 0.14);
  margin-bottom: clamp(40px, 6vw, 70px);
  user-select: none;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 56px;
}

.footer-cols h3 {
  font-family: var(--f-board);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--giallo);
  margin-bottom: 14px;
}

.footer-cols p {
  font-size: 16px;
  color: rgba(245, 239, 224, 0.8);
}
.footer-cols a {
  color: var(--crema);
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 239, 224, 0.35);
  transition: border-color 0.15s;
}
.footer-cols a:hover { border-color: var(--giallo); }

.footer-legal {
  font-family: var(--f-board);
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(245, 239, 224, 0.75);
  border-top: 1px solid rgba(245, 239, 224, 0.14);
  padding-top: 22px;
}

/* ============ REVEAL ============ */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ============ RESPONSIVE ============ */

@media (max-width: 900px) {
  .topbar { gap: 18px; }
  .nav-menu { gap: 16px; }
  .nav-menu a { font-size: 13px; }

  .split,
  .split-even { grid-template-columns: 1fr; }
  .split-side {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
  .where { margin-top: 8px; }
}

@media (max-width: 860px) {
  html { scroll-padding-top: 130px; }

  .topbar { gap: 16px; flex-wrap: wrap; }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 2px solid rgba(33, 29, 24, 0.35);
    border-radius: 4px;
    color: var(--inchiostro);
    font: 500 13px var(--f-board);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 8px 14px;
    cursor: pointer;
  }
  .nav-toggle-bar {
    width: 14px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 -4px 0 currentColor, 0 4px 0 currentColor;
  }

  .nav { order: 3; width: 100%; margin: 0; }
  .nav-menu {
    display: none;
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding: 6px 0 10px;
  }
  .nav.is-open .nav-menu { display: flex; }
  .nav-menu a {
    display: block;
    padding: 12px 2px;
    font-size: 15px;
    border-bottom: 1px solid rgba(33, 29, 24, 0.1);
  }

  .topbar-actions { margin-left: auto; }

  .hero-cta .btn { width: 100%; }

  .split-side { grid-template-columns: 1fr; }

  .section-head { flex-direction: column; gap: 12px; align-items: flex-start; }

  .board { padding: 12px var(--pad); }
  .board-text { letter-spacing: 0.1em; }

  .gallery-attesa { grid-template-columns: 1fr; }
  .g-slot { aspect-ratio: 21 / 9; }

  .footer-cols { grid-template-columns: 1fr; }
}
