/* ==========================================================================
   Chiedi alla Olga! — single page temporanea
   Font self-hosted (SIL Open Font License): Bodoni Moda, Jost
   ========================================================================== */

@font-face {
  font-family: "Bodoni Moda";
  src: url("../fonts/bodoni-moda.woff2") format("woff2-variations"),
       url("../fonts/bodoni-moda.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bodoni Moda";
  src: url("../fonts/bodoni-moda-italic.woff2") format("woff2-variations"),
       url("../fonts/bodoni-moda-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("../fonts/jost.woff2") format("woff2-variations"),
       url("../fonts/jost.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Palette: parte dal blu del logo */
  --petrol: #0C314B;
  --petrol-deep: #08243A;
  --ivory: #F9F7F3;
  --paper: #FFFDF9;
  --beige: #E6DAD0;
  --sage: #8A9F99;
  --sage-ink: #4F6660;     /* salvia scurita: testo piccolo, contrasto AA */
  --ink: #1F2D38;          /* testo corrente */
  --ink-soft: #4A5864;

  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;

  --wrap: 1180px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section: clamp(4.5rem, 10vw, 8rem);
  --radius: 3px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
a { color: var(--petrol); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--petrol); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--petrol);
  margin: 0;
  line-height: 1.12;
  letter-spacing: -0.005em;
  font-optical-sizing: auto;
}
p { margin: 0 0 1em; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.narrow { max-width: 820px; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--petrol); color: var(--ivory); padding: .7rem 1rem; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.prose p { max-width: 62ch; }
.prose em { font-family: var(--serif); font-style: italic; font-size: 1.05em; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: .75rem 1.6rem;
  font-family: var(--sans); font-size: .98rem; font-weight: 500; letter-spacing: .02em;
  text-decoration: none; border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--petrol); color: var(--ivory); }
.btn-primary:hover { background: var(--petrol-deep); }
.btn-quiet { color: var(--petrol); border-color: rgba(12, 49, 75, .3); }
.btn-quiet:hover { border-color: var(--petrol); }
.btn-light { background: var(--ivory); color: var(--petrol); }
.btn-light:hover { background: var(--beige); }
.btn-outline-light { color: var(--ivory); border-color: rgba(249, 247, 243, .45); }
.btn-outline-light:hover { border-color: var(--ivory); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(249, 247, 243, .94);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid rgba(230, 218, 208, .8);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 5rem; }
.brand img { width: 96px; height: auto; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(1rem, 2.4vw, 2.25rem); }
.site-nav a {
  display: inline-block; padding: .5rem 0;
  font-size: .98rem; font-weight: 450; color: var(--ink); text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, color .2s ease;
}
.site-nav a:hover, .site-nav a[aria-current="true"] { color: var(--petrol); border-bottom-color: var(--sage); }

.nav-toggle {
  display: none; align-items: center; gap: .6rem;
  background: none; border: 1px solid rgba(12, 49, 75, .25); border-radius: var(--radius);
  padding: .55rem .85rem; font: 500 .95rem var(--sans); color: var(--petrol); cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 18px; height: 1.5px; background: currentColor; position: relative;
  transition: transform .25s ease, background-color .25s ease;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3.5rem, 8vw, 6.5rem); }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(2rem, 6vw, 5.5rem); align-items: center;
}
.hero-hello {
  font-family: var(--serif); font-style: italic; font-size: clamp(1.3rem, 2vw, 1.6rem);
  color: var(--sage-ink); margin-bottom: 1.1rem;
}
.hero h1 {
  font-size: clamp(2.35rem, 5.2vw, 4.4rem);
  line-height: 1.06;
  font-weight: 500;
  letter-spacing: -0.015em;
  text-wrap: balance;
  max-width: 13em;
}
.hero-lead { margin-top: 1.75rem; max-width: 34em; font-size: 1.125rem; color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2.25rem; }

.hero-photo { position: relative; }
.hero-photo::before {
  /* cornice offset in beige: richiama il passe-partout di una rivista */
  content: ""; position: absolute; inset: 1.5rem -1.5rem -1.5rem 1.5rem;
  border: 1px solid var(--beige); background: var(--beige); opacity: .55; z-index: -1;
}
.hero-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }

/* Unico momento di movimento: ingresso della hero */
@media (prefers-reduced-motion: no-preference) {
  .hero-text > * { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-text > :nth-child(2) { animation-delay: .08s; }
  .hero-text > :nth-child(3) { animation-delay: .16s; }
  .hero-text > :nth-child(4) { animation-delay: .24s; }
  .hero-photo { animation: fade 1.1s ease .1s both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Sezioni ---------- */
.section { padding-block: var(--section); }
.section-head { max-width: 640px; margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.section-head h2 { font-size: clamp(2rem, 3.6vw, 2.9rem); text-wrap: balance; }
.section-head p { margin-top: 1rem; color: var(--ink-soft); }

/* Il progetto */
.progetto { background: var(--paper); border-block: 1px solid var(--beige); }
.progetto-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 7vw, 6.5rem); align-items: start;
}
.progetto-statement {
  font-size: clamp(1.9rem, 3.4vw, 2.85rem); line-height: 1.18; font-weight: 400; font-style: italic;
  padding-left: clamp(1.25rem, 2.5vw, 2rem); border-left: 1px solid var(--sage);
  text-wrap: balance;
}
.progetto-body { padding-top: .35rem; }

/* Argomenti */
.topic-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.25rem;
}
.topic {
  grid-column: span 2;
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--beige);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 2.6vw, 2.25rem);
  min-height: 15rem;
}
.topic:nth-child(4), .topic:nth-child(5) { grid-column: span 3; }
.topic h3 { font-size: clamp(1.45rem, 2vw, 1.75rem); margin-bottom: .85rem; }
.topic p { color: var(--ink-soft); font-size: 1rem; max-width: 38ch; }
.topic-link {
  margin-top: auto; padding-top: 1.1rem; border-top: 1px solid var(--beige);
  font-size: .92rem; color: var(--sage-ink); text-decoration: none;
}
.topic-link span { color: var(--petrol); font-family: var(--serif); font-style: italic; font-size: 1.05rem; }
.topic-link:hover span { text-decoration: underline; text-underline-offset: .2em; }

/* Approfondimenti */
.approfondimenti { padding-top: 0; }
.approf-grid {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr);
  gap: clamp(2rem, 6vw, 5rem); align-items: start;
}
.approf-grid .section-head { position: sticky; top: 7rem; margin-bottom: 0; }
.article-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--beige); }
.article { padding-block: 2rem; border-bottom: 1px solid var(--beige); scroll-margin-top: 6.5rem; }
.article:target { background: linear-gradient(90deg, rgba(230, 218, 208, .45), transparent 70%); }
.article-meta { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; font-size: .9rem; color: var(--sage-ink); margin-bottom: .6rem; }
.article-cat { color: var(--petrol); font-weight: 500; }
.article h3 { font-size: clamp(1.4rem, 2.3vw, 1.85rem); line-height: 1.2; margin-bottom: .7rem; text-wrap: balance; }
.article p:last-child { margin: 0; color: var(--ink-soft); max-width: 62ch; }

/* Chi sono */
.chi-sono { background: var(--beige); }
.chi-grid {
  display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 7vw, 6rem); align-items: center;
}
.chi-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
.chi-text h2 { font-size: clamp(2.2rem, 4vw, 3.2rem); margin-bottom: 1.75rem; }
.chi-text h3 { font-size: 1.3rem; font-style: italic; font-weight: 500; margin: 1.6rem 0 .5rem; }
.chi-text h2 + h3 { margin-top: 0; }
.chi-text p { color: var(--ink); }

/* Contatti */
.contatti { background: var(--petrol); color: var(--ivory); padding-block: var(--section); text-align: center; }
.contatti-inner { max-width: 760px; }
.contatti h2 { color: var(--ivory); font-size: clamp(2rem, 4.2vw, 3.3rem); text-wrap: balance; }
.contatti p { color: rgba(249, 247, 243, .85); margin-top: 1.1rem; }
.contatti-email { margin-top: 2rem !important; }
.contatti-email a {
  font-family: var(--serif); font-style: italic; font-size: clamp(1.35rem, 3.4vw, 2.1rem);
  color: var(--ivory); text-decoration-color: rgba(249, 247, 243, .4); overflow-wrap: anywhere;
}
.contatti-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .85rem; margin-top: 2rem; }
.contatti :focus-visible, .site-footer :focus-visible { outline-color: var(--ivory); }

/* Footer */
.site-footer { background: var(--petrol-deep); color: rgba(249, 247, 243, .78); padding-block: 3rem; font-size: .95rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer-logo { width: 110px; }
.footer-info { text-align: right; }
.footer-info p { margin: 0 0 .4rem; }
.footer-info a { color: var(--ivory); }
.footer-note { font-family: var(--serif); font-style: italic; color: var(--ivory); font-size: 1.05rem; }
.footer-copy { opacity: .75; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .topic, .topic:nth-child(4), .topic:nth-child(5) { grid-column: span 3; }
  .topic:nth-child(5) { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--ivory); border-bottom: 1px solid var(--beige);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: .5rem var(--gutter) 1.25rem; }
  .site-nav a { display: block; padding: .85rem 0; font-size: 1.1rem; border-bottom: 1px solid var(--beige); }
  .site-nav li:last-child a { border-bottom: 0; }

  .hero-grid, .progetto-grid, .chi-grid, .approf-grid { grid-template-columns: 1fr; }
  .approf-grid .section-head { position: static; }
  .hero { padding-top: 1.5rem; }
  .hero-photo { order: -1; max-width: 520px; margin-right: 1rem; }
  .hero-photo::before { inset: 1rem -1rem -1rem 1rem; }
  .hero-photo img { aspect-ratio: 5 / 4; object-position: 50% 22%; }
  .hero h1 { max-width: none; }
  .chi-photo { max-width: 420px; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .header-inner { min-height: 4.25rem; }
  .brand img { width: 74px; }
  .topic-grid { grid-template-columns: 1fr; }
  .topic, .topic:nth-child(4), .topic:nth-child(5) { grid-column: auto; min-height: 0; }
  .hero-actions .btn, .contatti-actions .btn { width: 100%; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-info { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .hero-actions, .contatti-actions { display: none; }
  body { background: #fff; }
}
