/* Stile condiviso da index.html (it) ed en/index.html (en). I percorsi url() sono relativi a questo file. */
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --flour: #f5ecdc;
  --paper: #fbf6ec;
  --ink: #2e2018;
  --muted: #6b5a4b;
  --wood: #8a5f3c;
  --wood-dark: #3a271a;
  --terracotta: #c0623b;
  --tomato: #a33b24;
  --olive: #5f6a3a;
  --line: rgba(46, 32, 24, .18);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 62ch;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(1rem, .95rem + .25vw, 1.125rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--flour);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
em { font-style: italic; }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.chapter {
  display: inline-block;
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 1rem;
}
.section h2 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.6rem); margin-bottom: 1.5rem; }
.lead { font-family: var(--serif); font-size: clamp(1.2rem, 1.05rem + .6vw, 1.5rem); line-height: 1.5; max-width: var(--measure); }

/* ---------- Hero: spianatoia infarinata ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem 1.25rem 5rem;
  color: var(--ink);
  background:
    radial-gradient(ellipse 55% 45% at 50% 48%, rgba(255, 252, 245, .96), rgba(255, 252, 245, .75) 45%, rgba(255, 252, 245, 0) 75%),
    radial-gradient(ellipse 30% 22% at 22% 30%, rgba(255, 252, 245, .55), transparent 70%),
    radial-gradient(ellipse 28% 20% at 80% 72%, rgba(255, 252, 245, .5), transparent 70%),
    repeating-linear-gradient(92deg, rgba(58, 39, 26, .08) 0 2px, transparent 2px 9px, rgba(58, 39, 26, .05) 9px 10px, transparent 10px 23px),
    linear-gradient(180deg, #b78656, #9a6b42 60%, #855a37);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 -.45'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .55;
  mix-blend-mode: screen;
}
.hero > * { position: relative; z-index: 1; }
.hero nav {
  position: absolute;
  top: 1.25rem;
  left: 50%;
  translate: -50% 0;
  display: flex;
  width: calc(100% - 2rem);
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem clamp(.9rem, 3vw, 2.2rem);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero nav a { white-space: nowrap; color: var(--paper); text-decoration: none; opacity: .9; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.hero nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.hero nav a[hreflang] { border-left: 1px solid rgba(251, 246, 236, .55); padding-left: clamp(.9rem, 3vw, 2.2rem); }
.hero .kicker { font-size: .8rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--wood-dark); margin-bottom: 1.5rem; }
.hero h1 { font-size: clamp(3.2rem, 1.5rem + 8vw, 8rem); font-weight: 500; color: #3b2416; line-height: .98; }
.hero h1 span { display: block; }
.hero .sub { font-family: var(--serif); font-style: italic; font-size: clamp(1.25rem, 1rem + 1vw, 1.9rem); margin-top: 1.5rem; color: #4a3020; }
.drop-mark { width: 26px; margin: 2rem auto 0; color: var(--terracotta); }
.scroll-cue {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  translate: -50% 0;
  font-size: .75rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--paper);
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.scroll-cue::after { content: "↓"; display: block; font-size: 1.1rem; margin-top: .25rem; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }

/* ---------- I. Origini ---------- */
.origins { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.origins figure { margin: 0; }
.origins img { border-radius: 4px; box-shadow: 0 18px 40px -20px rgba(58, 39, 26, .5); }
.facts { list-style: none; padding: 0; margin: 2.25rem 0 0; display: grid; gap: 1rem; }
.facts li {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--terracotta);
  padding: 1.1rem 1.35rem;
  border-radius: 2px;
}
.facts h3 { font-size: 1.35rem; margin-bottom: .3rem; }
.facts p { margin: 0; color: var(--muted); }

/* ---------- II. Cucina povera ---------- */
.povera { background: var(--paper); border-block: 1px solid var(--line); text-align: center; }
.povera .lead { margin-inline: auto; }
.equation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
  margin-top: 2.5rem;
  font-family: var(--serif);
}
.equation figure { margin: 0; display: grid; justify-items: center; gap: .6rem; }
.equation svg { width: clamp(56px, 9vw, 84px); height: auto; color: var(--wood-dark); }
.equation figcaption { font-size: 1.35rem; }
.equation .op { font-size: 2.4rem; color: var(--terracotta); line-height: 1; padding-bottom: 2.2rem; }

/* ---------- III. Leggenda ---------- */
.legend { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.legend-photo { margin: 0; position: relative; }
.legend-photo::before {
  content: "";
  position: absolute;
  inset: -1.25rem 25% -1.25rem -1.25rem;
  background: var(--terracotta);
  z-index: -1;
  border-radius: 2px;
}
.legend-photo img { width: 100%; max-width: 600px; aspect-ratio: 5 / 2; object-fit: cover; border-radius: 2px; }
.legend-photo figcaption { font-size: .9rem; color: var(--paper); margin-top: .6rem; }
.legend blockquote {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.25rem, 1.05rem + .8vw, 1.65rem);
  line-height: 1.45;
  border-left: 2px solid var(--terracotta);
  padding-left: 1.5rem;
}
.legend blockquote footer { font-family: var(--sans); font-style: normal; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 1rem; }

/* ---------- Banda: la tempesta ---------- */
.storm {
  position: relative;
  min-height: clamp(420px, 70vh, 680px);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--wood-dark);
}
.storm img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; opacity: .78; }
.storm p {
  position: relative;
  margin: 0;
  width: 100%;
  padding: clamp(1.5rem, 4vw, 2.75rem) 1.25rem;
  background: rgba(30, 22, 16, .78);
  color: #fbf1dc;
  text-align: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 1rem + 2.8vw, 3.4rem);
  line-height: 1.15;
}
.storm p span { display: block; max-width: 22ch; margin-inline: auto; }

/* ---------- IV. Scarpinata ---------- */
.scarpinata { text-align: center; }
.scarpinata .lead { margin-inline: auto; }
.scarpinata h2 em { font-weight: 400; }
.climb { display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; margin-top: 3rem; text-align: center; }
.climb .card {
  background: var(--paper);
  border: 1px solid #b7a98a;
  outline: 1px solid #b7a98a;
  outline-offset: 5px;
  border-radius: 28px;
  padding: 2rem 1.75rem;
}
.climb h3 { font-size: 1.6rem; margin-bottom: .75rem; }
.climb p { margin: 0; color: var(--muted); }
.climb svg { width: clamp(150px, 20vw, 230px); height: auto; color: var(--olive); }

/* ---------- V. Evoluzione ---------- */
.evolution { background: var(--paper); border-block: 1px solid var(--line); }
.evolution header { text-align: center; }
.evolution .lead { margin-inline: auto; }
.sauces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 2rem); margin-top: 3rem; list-style: none; padding: 0; counter-reset: sauce; }
.sauces li {
  position: relative;
  border: 2px solid var(--olive);
  border-radius: 24px;
  padding: 2.25rem 1.75rem 2rem;
  background: var(--flour);
  text-align: center;
}
.sauces li::before {
  counter-increment: sauce;
  content: counter(sauce, upper-roman);
  position: absolute;
  top: -1rem;
  left: 50%;
  translate: -50% 0;
  background: inherit;
  border: 2px solid var(--olive);
  border-radius: 999px;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: .95rem;
}
.sauces li.red { background: var(--tomato); color: #fbf1dc; border-color: var(--tomato); }
.sauces li.red::before { border-color: var(--tomato); background: var(--tomato); }
.sauces h3 { font-size: 1.55rem; }
.sauces .tag { display: block; font-family: var(--serif); font-style: italic; font-size: 1.05rem; margin: .2rem 0 1.25rem; opacity: .8; }
.sauces dl { margin: 0; }
.sauces dt { font-weight: 700; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; margin-top: 1rem; }
.sauces dd { margin: .25rem 0 0; }

/* ---------- VI. Nel piatto ---------- */
.plate h2 { text-align: center; }
.plate-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(1.25rem, 3vw, 2.5rem); align-items: center; margin-top: 2.5rem; }
.plate-photo { margin: 0; background: #fff; padding: 12px; box-shadow: 0 22px 45px -22px rgba(58, 39, 26, .55); rotate: -1.2deg; }
.plate-photo img { width: min(420px, 78vw); }
.note h3 { font-size: 1.35rem; font-weight: 600; }
.note p { margin: .35rem 0 0; color: var(--muted); }
.note.left { text-align: right; }
.note .arrow { display: inline-block; margin-top: .5rem; color: var(--terracotta); font-size: 2.2rem; line-height: 1; }
.closing { text-align: center; font-family: var(--serif); font-weight: 600; font-size: clamp(1.8rem, 1.2rem + 2.5vw, 3rem); margin-top: clamp(3rem, 6vw, 4.5rem); }

/* ---------- VII. Ricetta ---------- */
.recipe { background: var(--paper); border-block: 1px solid var(--line); }
.recipe header { text-align: center; }
.recipe .lead { margin-inline: auto; }
.recipe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 2rem); margin-top: 2.5rem; }
.recipe-grid section { background: var(--flour); border: 1px solid var(--line); border-top: 3px solid var(--terracotta); padding: 1.5rem 1.75rem; border-radius: 2px; }
.recipe-grid h3 { font-size: 1.45rem; margin-bottom: .75rem; }
.recipe-grid ul { margin: 0; padding-left: 1.1rem; }
.recipe .pending { text-align: center; font-family: var(--serif); font-style: italic; color: var(--muted); margin-top: 2rem; }

/* ---------- Footer ---------- */
footer.site {
  background: var(--wood-dark);
  color: #e9dcc4;
  text-align: center;
  padding: 3rem 1.25rem;
  font-size: .9rem;
}
footer.site .name { font-family: var(--serif); font-size: 1.5rem; color: #fbf1dc; }
footer.site p { margin: .4rem 0 0; opacity: .8; }

/* ---------- Comparsa allo scroll (solo con JS attivo) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue::after { animation: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .origins, .legend, .recipe-grid { grid-template-columns: 1fr; }
  .origins figure { max-width: 460px; margin-inline: auto; }
  .legend-photo { margin: 1rem 1rem 0; }
  .legend-photo::before { inset: -1rem; }
  .climb { grid-template-columns: 1fr; }
  .climb svg { order: -1; margin-inline: auto; }
  .sauces { grid-template-columns: 1fr; gap: 2rem; }
  .plate-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .plate-photo { order: -1; }
  .note.left { text-align: center; }
  .note .arrow { display: none; }
  .hero nav { font-size: .7rem; gap: .4rem .9rem; }
  .hero nav a[hreflang] { padding-left: .9rem; }
}
