/* Fantuzzi Clinio · bozza Home
   Palette: carta, inchiostro, rosso pomodoro, oliva, kraft. */

:root {
  --paper: #f4efe6;
  --paper-2: #ebe3d4;
  --card: #fbf8f2;
  --ink: #1f1b16;
  --ink-2: #4a4238;
  --muted: #6b6155;
  --line: #d8ccb6;
  --red: #a8291f;
  --red-dark: #861f17;
  --olive: #3d4a2c;
  --dark: #1d1e18;
  --note-bg: #fff2a8;
  --note-ink: #4d3f00;

  --f-display: "Fraunces", Georgia, serif;
  --f-body: "Instrument Sans", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius);
}
.skip:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

/* ---------- Note di bozza ---------- */
.draft-banner {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: center;
  padding: 8px var(--gutter);
  background: var(--note-bg); color: var(--note-ink);
  font-size: 0.875rem; text-align: center;
}
.draft-toggle {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid currentColor; background: transparent; color: inherit;
  padding: 6px 14px; border-radius: 999px;
}
.note {
  display: inline-block; margin-top: 10px;
  background: var(--note-bg); color: var(--note-ink);
  font-family: var(--f-mono); font-size: 0.75rem; line-height: 1.4;
  padding: 8px 12px; border-radius: 2px;
}
.note::before { content: "Nota bozza · "; font-weight: 500; }
body.hide-notes .note { display: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }

.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--f-display); font-weight: 700; font-size: 1.6rem;
  letter-spacing: -0.02em; color: var(--ink);
}
.brand-tag {
  margin-top: 6px;
  font-family: var(--f-mono); font-size: 0.6875rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--red);
}

.nav { display: flex; align-items: center; gap: 28px; }
.nav ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav ul a { text-decoration: none; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav ul a:hover { border-bottom-color: var(--red); }

.nav-toggle { display: none; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 22px;
  background: var(--red); color: #fff;
  font-family: var(--f-body); font-weight: 600; font-size: 1rem;
  text-decoration: none; border: 2px solid var(--red); border-radius: var(--radius);
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-small { min-height: 40px; padding: 8px 16px; font-family: var(--f-mono); font-weight: 500; font-size: 0.9375rem; }

.link-arrow {
  font-weight: 600; text-decoration: none; color: var(--red);
  border-bottom: 2px solid currentColor; padding-bottom: 2px;
}
.link-arrow::after { content: " →"; }
.link-arrow:hover { color: var(--red-dark); }
.link-arrow-light { color: #f0c9a8; }
.link-arrow-light:hover { color: #fff; }

.eyebrow {
  font-family: var(--f-mono); font-size: 0.8125rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--red); margin-bottom: 14px;
}

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 7vw, 96px) 0 clamp(56px, 8vw, 110px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.6rem); max-width: 12ch; }
.lead { font-size: clamp(1.0625rem, 1.5vw, 1.25rem); color: var(--ink-2); max-width: 46ch; margin: 24px 0 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-media { position: relative; margin: 0; }
.hero-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }

/* Cartellino stile bolla di consegna */
.docket {
  position: absolute; left: -28px; bottom: -28px;
  width: min(300px, 80%);
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgb(31 27 22 / 0.12);
  padding: 16px 18px 12px;
  font-family: var(--f-mono); font-size: 0.8125rem;
}
.docket-head {
  display: block; padding-bottom: 8px; margin-bottom: 4px;
  border-bottom: 1px dashed var(--line);
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--red);
}
.docket dl { margin: 0; }
.docket dl div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.docket dl div:last-child { border-bottom: 0; }
.docket dt { color: var(--muted); }
.docket dd { margin: 0; text-align: right; color: var(--ink); }

/* ---------- Sezioni ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-paper { background: var(--paper-2); }
.section-head { margin-bottom: clamp(32px, 4vw, 52px); max-width: 680px; }
.section-head h2 { font-size: clamp(2rem, 4vw, 3.1rem); }
.section-intro { margin-top: 18px; color: var(--ink-2); font-size: 1.125rem; }
.section-cta { margin-top: 36px; }

/* Per chi lavoriamo */
.clients { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 36px); }
.client img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); margin-bottom: 18px; }
.client h3 { font-size: 1.6rem; margin-bottom: 8px; }
.client p { color: var(--ink-2); margin: 0; }

.limits {
  margin-top: clamp(40px, 5vw, 64px);
  display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: baseline;
  padding: 24px 0 0; border-top: 2px solid var(--ink);
}
.limits h3 { font-size: 1.3rem; }
.limits p { margin: 0; max-width: 62ch; color: var(--ink-2); }

/* Prodotti */
.families { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.4vw, 28px); }
.family { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.family img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.family h3 { font-size: 1.3rem; padding: 16px 18px 18px; }
.family-empty { display: flex; flex-direction: column; }
.family-placeholder {
  aspect-ratio: 16 / 10; display: grid; place-items: center;
  font-family: var(--f-display); font-size: 4rem; color: var(--muted);
  background: repeating-linear-gradient(-45deg, transparent 0 10px, rgb(216 204 182 / 0.35) 10px 11px);
}
.family-empty .note { margin: 0 18px 18px; align-self: flex-start; }

.brands { margin-top: clamp(48px, 6vw, 72px); }
.brands h3 { font-size: 1.5rem; margin-bottom: 20px; }
.brand-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.brand-grid li {
  background: var(--card); min-height: 96px; display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 0.8125rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase;
}

/* Servizi */
.servizi-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 22px 0 22px 64px; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before {
  content: "0" counter(step);
  position: absolute; left: 0; top: 24px;
  font-family: var(--f-mono); font-size: 0.875rem; color: var(--red);
}
.steps h3 { font-size: 1.35rem; margin-bottom: 6px; }
.steps p { margin: 0; color: var(--ink-2); max-width: 52ch; }
.servizi-media { margin: 0; }
.servizi-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }

/* Chi siamo */
.section-dark { background: var(--dark); color: #ece4d6; }
.section-dark .eyebrow { color: #f0c9a8; }
.section-dark h2 { font-size: clamp(2rem, 4vw, 3.1rem); color: #fff; margin-bottom: 24px; }
.section-dark p { color: #d6ccbc; max-width: 54ch; font-size: 1.125rem; }
.family-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.portrait {
  aspect-ratio: 4 / 5; border: 1px solid #3b3a32; border-radius: var(--radius);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; padding: 24px;
  background:
    radial-gradient(120% 80% at 30% 20%, #34352c 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 22px, rgb(255 255 255 / 0.03) 22px 23px),
    #25261f;
}
.portrait-year {
  font-family: var(--f-display); font-weight: 700; font-size: clamp(4rem, 9vw, 7rem);
  line-height: 0.9; color: #f0c9a8; letter-spacing: -0.03em;
}

/* Contatti */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.phone-big {
  display: inline-block; text-decoration: none;
  font-family: var(--f-display); font-weight: 700; font-size: clamp(2.4rem, 5vw, 3.6rem);
  color: var(--red); letter-spacing: -0.02em; line-height: 1;
  border-bottom: 3px solid currentColor; padding-bottom: 6px; margin-bottom: 28px;
}
.phone-big:hover { color: var(--red-dark); }
.contact-list { margin: 0; }
.contact-list div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.contact-list dt { font-family: var(--f-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding-top: 3px; }
.contact-list dd { margin: 0; }

.map { margin-top: 24px; }
.map iframe { width: 100%; height: 260px; border: 1px solid var(--line); border-radius: var(--radius); display: block; }
.map-link { display: inline-block; margin-top: 8px; font-size: 0.9375rem; color: var(--ink-2); }

.catalog-form {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(22px, 3vw, 36px);
}
.catalog-form h3 { font-size: 1.7rem; margin-bottom: 6px; }
.form-intro { color: var(--ink-2); margin-bottom: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { font-weight: 600; font-size: 0.9375rem; }
.optional { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink); width: 100%;
  background: #fff; border: 1px solid #b9ad98; border-radius: var(--radius);
  padding: 11px 12px; min-height: 48px;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgb(168 41 31 / 0.25); border-color: var(--red); }
.field [aria-invalid="true"] { border-color: var(--red); background: #fff6f4; }
.field-check { flex-direction: row; align-items: flex-start; gap: 10px; }
.field-check input { width: 22px; height: 22px; min-height: 0; margin: 2px 0 0; accent-color: var(--red); flex: none; }
.field-check label { font-weight: 400; }
.form-error { color: var(--red-dark); font-weight: 600; margin: 4px 0 14px; }
.catalog-form .btn { width: 100%; margin-top: 4px; }
.catalog-form .note { display: block; }

/* Footer */
.site-footer { background: var(--ink); color: #cfc5b5; padding: 56px 0 48px; font-size: 0.9375rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 32px; }
.footer-brand { font-family: var(--f-display); font-weight: 700; font-size: 1.5rem; color: #fff; margin-bottom: 10px; }
.site-footer a { color: #fff; }
.site-footer nav { display: flex; flex-direction: column; gap: 8px; }

.mobile-bar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .servizi-grid, .family-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-media { max-width: 560px; }
  .hero-media img, .servizi-media img { aspect-ratio: 3 / 2; }
  .docket { left: 16px; bottom: -36px; }
  .hero { padding-bottom: 88px; }
  .portrait { aspect-ratio: 16 / 10; }
  .clients { grid-template-columns: 1fr 1fr; }
  .families { grid-template-columns: 1fr 1fr; }
  .brand-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .site-footer nav { grid-column: 1 / -1; flex-direction: row; gap: 20px; }

  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--card); cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 20px; height: 2px; background: var(--ink); position: relative; content: "";
    transition: transform .2s, background-color .2s;
  }
  .nav-toggle-bars::before { position: absolute; top: -6px; }
  .nav-toggle-bars::after { position: absolute; 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); }

  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
  }
  .nav.is-open { display: flex; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav ul a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.125rem; }
  .nav .btn { margin-top: 16px; }
  .header-inner { position: relative; }
}

@media (max-width: 640px) {
  body { padding-bottom: 64px; }
  .brand-name { font-size: 1.35rem; }
  .brand-tag { font-size: 0.6875rem; letter-spacing: 0.03em; }
  .clients, .families { grid-template-columns: 1fr; }
  .limits { grid-template-columns: 1fr; gap: 10px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .contact-list div { grid-template-columns: 1fr; gap: 2px; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
  .hero { padding-bottom: 56px; }
  .docket { position: relative; left: auto; bottom: auto; width: auto; margin: -28px 12px 0; }

  .mobile-bar {
    display: grid; grid-template-columns: 1fr 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--ink); border-top: 1px solid #000;
  }
  .mobile-bar a {
    display: flex; align-items: center; justify-content: center; min-height: 56px;
    color: #fff; text-decoration: none; font-weight: 600;
  }
  .mobile-bar a:first-child { background: var(--red); }
}

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