/* ==========================================================================
   Papiedo — pizzeria storica, terza generazione (Barcellona Pozzo di Gotto)
   Direction: editorial "heritage che si rinnova". Warm travertine-stone canvas,
   espresso ink, ONE accent = deep amethyst (their violet interior LED + the
   melanzana of their Norma). Vollkorn (heritage serif) + Space Grotesk
   (contemporary sans). Radius 2px. Hairline "cornice" motif. Mobile-first @390px.
   ========================================================================== */

:root {
  --canvas:   #e7e4de;   /* warm greige travertine */
  --surface:  #f3f1ec;   /* cards / raised */
  --band:     #dcd8cf;   /* alternating band / hero tint */
  --hair:     #cdc7bb;   /* hairlines */
  --dark:     #221b26;   /* plum-espresso grounding blocks */
  --ink:      #201c19;   /* headings / body */
  --muted:    #5e574d;   /* secondary text (AA on every surface) */
  --accent:   #5b3a82;   /* deep amethyst — the only accent */
  --accent-h: #4a2e6a;   /* hover */
  --on-dark:      #ece9e3;
  --on-dark-mut:  #a99fb0;
  --accent-lite:  #c3a9e0; /* amethyst on dark blocks */

  --display: "Vollkorn", Georgia, "Times New Roman", serif;
  --body: "Space Grotesk", -apple-system, "Segoe UI", system-ui, sans-serif;
  --radius: 2px;
  --maxw: 1120px;
  --measure: 63ch;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-h); }

h1, h2, h3 { font-family: var(--display); line-height: 1.08; letter-spacing: -0.01em; font-weight: 700; }
h2 { font-size: clamp(1.7rem, 5.2vw, 2.5rem); letter-spacing: -0.02em; }
h3 { font-size: 1.15rem; }

p { max-width: var(--measure); }

/* Safety net: any content figure image stays landscape on mobile (iron rule). */
@media (max-width: 640px) {
  figure img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: 1.25rem; }
.section { padding-block: clamp(3rem, 8vw, 5.5rem); }

/* small "cornice" eyebrow: short rule + wide-tracked label */
.eyebrow {
  font-size: 0.75rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.2em; color: var(--muted);
  display: flex; align-items: center; gap: 0.7rem;
}
.eyebrow::before {
  content: ""; width: 2rem; height: 1px; background: var(--accent); flex: none;
}

/* -- buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; text-decoration: none; font-family: var(--body);
  font-weight: 500; font-size: 0.98rem; line-height: 1;
  padding: 0.8rem 1.35rem; border-radius: var(--radius);
  border: 1px solid var(--ink); color: var(--ink); background: transparent;
  transition: transform .15s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); border-color: var(--accent-h); color: #fff; }
.btn svg { width: 1.05em; height: 1.05em; }

/* on dark blocks */
.on-dark .btn { color: var(--on-dark); border-color: color-mix(in srgb, var(--on-dark) 45%, transparent); }
.on-dark .btn-primary { background: var(--accent-lite); border-color: var(--accent-lite); color: var(--dark); }
.on-dark .btn-primary:hover { background: #d4bff0; border-color: #d4bff0; color: var(--dark); }

/* -- topbar ---------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--canvas) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0.7rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { font-family: var(--display); font-weight: 900; font-size: 1.35rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.topbar .btn { padding: 0.5rem 1rem; font-size: 0.9rem; }

/* -- hero (typographic masthead) ------------------------------------------- */
.hero { padding-top: clamp(3rem, 9vw, 5rem); padding-bottom: clamp(2.5rem, 7vw, 4rem); }
.hero .eyebrow { margin-bottom: 1.4rem; }
.hero h1 {
  font-size: clamp(4.2rem, 22vw, 11rem);
  font-weight: 900; letter-spacing: -0.04em; line-height: 0.9;
  margin-bottom: 1.1rem;
}
.hero-sub {
  font-size: clamp(1.05rem, 2.7vw, 1.4rem); color: var(--muted);
  max-width: 34ch; margin-bottom: 2rem; line-height: 1.45;
}
.hero-sub strong { color: var(--ink); font-weight: 500; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* -- full-width showcase band ---------------------------------------------- */
.showcase { }
.showcase-figure { margin: 0; }
.showcase-figure img {
  width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover;
  object-position: center 46%; max-height: 78vh;
}
.showcase-cap {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.25rem;
  padding: 1rem 1.25rem 0; max-width: var(--maxw); margin: 0 auto;
}
.showcase-cap .lead { font-family: var(--display); font-size: 1.15rem; font-weight: 600; color: var(--ink); }
.showcase-cap .rating { font-size: 0.9rem; color: var(--muted); font-weight: 500; }
.showcase-cap .star { color: var(--accent); }

/* -- heritage -------------------------------------------------------------- */
.heritage h2 { margin: 0.9rem 0 1.1rem; max-width: 18ch; }
.heritage p + p { margin-top: 1rem; }
.timeline {
  list-style: none; padding: 0; margin: 2.25rem 0 0;
  display: grid; gap: 0; border-top: 1px solid var(--hair);
}
.timeline li {
  padding: 1rem 0; border-bottom: 1px solid var(--hair);
  display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; row-gap: 0.15rem; align-items: baseline;
}
.timeline .gen { grid-column: 2; font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.timeline .role { grid-column: 2; color: var(--muted); font-size: 0.95rem; }
.timeline .idx { grid-column: 1; grid-row: 1 / 3; align-self: start; font-size: 0.8rem; color: var(--accent); font-weight: 500; font-variant-numeric: tabular-nums; }

blockquote.pull {
  margin: 2.5rem 0 0; padding: 0 0 0 1.25rem; border-left: 2px solid var(--accent);
  max-width: 52ch;
}
blockquote.pull p { font-family: var(--display); font-size: clamp(1.25rem, 3vw, 1.6rem); font-weight: 600; line-height: 1.3; color: var(--ink); }
blockquote.pull cite { display: block; margin-top: 0.75rem; font-style: normal; font-size: 0.85rem; color: var(--muted); letter-spacing: 0.02em; }

/* -- pizze grid ------------------------------------------------------------ */
.pizze .intro { color: var(--muted); margin: 0.9rem 0 2rem; max-width: 56ch; }
.pizze .intro strong { color: var(--ink); font-weight: 500; }
.pizza-grid { display: grid; gap: 1.5rem 1.25rem; grid-template-columns: 1fr; }
.pizza-grid figure { margin: 0; }
.pizza-grid img {
  width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--hair);
}
.pizza-grid figcaption { margin-top: 0.7rem; font-size: 1rem; }
.pizza-grid .name { font-family: var(--display); font-weight: 600; }

/* -- crostino (dark grounding block) --------------------------------------- */
.crostino { background: var(--dark); color: var(--on-dark); }
.crostino h2 { color: var(--on-dark); max-width: 16ch; }
.crostino p { color: var(--on-dark-mut); margin-top: 1.1rem; }
.crostino .quoted { color: var(--accent-lite); font-style: italic; }
.crostino .aside { margin-top: 1.5rem; font-size: 0.9rem; color: var(--on-dark); letter-spacing: 0.02em; }

/* -- sala (the single split) ----------------------------------------------- */
.sala .split { display: grid; gap: 2rem; align-items: center; }
.sala h2 { margin-bottom: 1.1rem; }
.sala p { color: var(--muted); }
.sala p strong { color: var(--ink); font-weight: 500; }
.sala-figure { margin: 0; }
.sala-figure img {
  width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover;
  object-position: center 34%; border-radius: var(--radius); border: 1px solid var(--hair);
}

/* -- orari & dove ---------------------------------------------------------- */
.dove .info { display: grid; gap: 2.5rem; margin-top: 1.75rem; }
.hours { width: 100%; border-collapse: collapse; max-width: 24rem; }
.hours th { text-align: left; font-family: var(--display); font-size: 1.1rem; font-weight: 700; padding-bottom: 0.6rem; }
.hours td { padding: 0.5rem 0; border-top: 1px solid var(--hair); font-size: 0.98rem; }
.hours td:first-child { color: var(--ink); font-weight: 500; }
.hours td:last-child { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.hours tr.today td { color: var(--accent); font-weight: 500; }
.hours tr.today td:last-child { color: var(--accent); }
.hours-note { margin-top: 0.9rem; font-size: 0.88rem; color: var(--muted); }

.contact h3 { font-family: var(--display); font-size: 1.1rem; margin-bottom: 0.8rem; }
.contact address { font-style: normal; color: var(--ink); line-height: 1.7; margin-bottom: 1.25rem; }
.contact address a { font-weight: 500; }

/* -- footer ---------------------------------------------------------------- */
.footer { background: var(--dark); color: var(--on-dark-mut); padding-block: 3rem 3.5rem; }
.footer .brand { color: var(--on-dark); display: inline-block; margin-bottom: 0.5rem; }
.footer .f-tag { color: var(--accent-lite); font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 1.25rem; }
.footer address { font-style: normal; line-height: 1.7; margin-bottom: 1rem; }
.footer address a { color: var(--on-dark); }
.footer .copy { font-size: 0.85rem; opacity: 0.75; }
.demo-note { margin-top: 0.75rem; font-size: 0.8rem; opacity: 0.6; }

/* -- responsive ------------------------------------------------------------ */
@media (min-width: 640px) {
  .pizza-grid { grid-template-columns: repeat(3, 1fr); }
  .dove .info { grid-template-columns: 1.1fr 1fr; gap: 3rem; }
}
@media (min-width: 900px) {
  .sala .split { grid-template-columns: 1fr 1fr; gap: 3.5rem; }
  .sala-figure img { aspect-ratio: 4 / 5; object-position: center 30%; }
  .timeline { grid-template-columns: repeat(3, 1fr); gap: 0 2rem; border-top: none; }
  .timeline li { border-bottom: none; border-top: 2px solid var(--accent); padding: 0.9rem 1.5rem 0 0; display: block; }
  .timeline .idx { display: block; margin-bottom: 0.6rem; }
  .timeline .gen { display: block; }
  .timeline .role { display: block; margin-top: 0.25rem; }
  .showcase-figure img { aspect-ratio: 16 / 7; object-position: center 42%; }
}

/* -- motion (dial 3): reveal on scroll + hero load, CSS only, gated --------- */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal { opacity: 0; transform: translateY(18px); }
  html.js .reveal.in {
    opacity: 1; transform: none;
    transition: opacity .7s ease, transform .7s cubic-bezier(.16,1,.3,1);
  }
  html.js .hero-anim { opacity: 0; transform: translateY(14px); animation: fadeUp .8s cubic-bezier(.16,1,.3,1) forwards; }
  html.js .hero-anim.d1 { animation-delay: .08s; }
  html.js .hero-anim.d2 { animation-delay: .18s; }
  html.js .hero-anim.d3 { animation-delay: .28s; }
  @keyframes fadeUp { to { opacity: 1; transform: none; } }
}
