/* flavioperrone.it — v2 design system */
@font-face { font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/instrument-serif.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap; src: url('../fonts/instrument-serif-italic.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('../fonts/inter.woff2') format('woff2'); }

:root {
  --ink: #141414;
  --ink-2: #4a4a4a;
  --ink-3: #666666;
  --paper: #faf8f4;
  --paper-2: #f1ede6;
  --line: #ddd8cf;
  --accent: #1f3d5a;
  --accent-ink: #ffffff;
  --dark: #141414;
  --dark-2: #1f1f1f;
  --dark-line: #333;
  --dark-text: #e8e4dc;
  --dark-muted: #a09a90;

  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --max: 1180px;
  --gutter: clamp(20px, 4vw, 48px);
  --section: clamp(80px, 12vw, 140px);
  --radius: 4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, textarea { font: inherit; color: inherit; }

/* ---------- typography ---------- */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(46px, 5vw, 76px); line-height: 1.04; hanging-punctuation: first; }
h2 { font-size: clamp(38px, 5vw, 68px); }
h3 { font-size: clamp(26px, 2.6vw, 32px); }
.lead { font-size: clamp(18px, 1.5vw, 21px); color: var(--ink-2); max-width: 56ch; }
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 20px;
}
.muted { color: var(--ink-3); }
em { font-style: italic; }

/* ---------- layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
section { padding: var(--section) 0; }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: 64px; }
.section-head .lead { max-width: 44ch; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.grid-3 > * { background: var(--paper); padding: 40px 32px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 26px;
  border-radius: var(--radius);
  font-weight: 500; font-size: 15px;
  border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper);
  transition: background .2s, color .2s;
  cursor: pointer;
}
.btn:hover { background: #2b2b2b; border-color: #2b2b2b; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }
.link { border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.link:hover { color: var(--accent); }

/* ---------- header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { font-family: var(--font-display); font-size: 24px; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 10px; }
.brand img { height: 30px; width: auto; }
.nav ul { display: flex; gap: 32px; }
.nav a { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.nav a:hover { color: var(--ink); }
.nav a.btn { padding: 10px 18px; font-size: 14px; color: var(--paper); }
.nav a.btn:hover { color: var(--paper); }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--ink); margin: 5px auto; transition: transform .2s, opacity .2s; }

/* ---------- hero ---------- */
.hero { padding: clamp(40px, 5vw, 72px) 0 0; overflow: hidden; }
.nowrap { white-space: nowrap; }
.hero .wrap { display: grid; grid-template-columns: 7fr 5fr; gap: 48px; align-items: end; }
.hero .wrap > div:first-child { padding-bottom: clamp(56px, 7vw, 96px); }
.hero-meta { margin-top: 40px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.hero h1 { margin-bottom: 24px; }
.hero h1 em { color: var(--accent); }
.hero .lead { margin-bottom: 32px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
/* ritratto: scontorno in duotono blu, fuori scala, in piedi sul filetto; cognome in filigrana dietro */
.hero-portrait { position: relative; margin: 0; align-self: end; width: 118%; margin-left: -9%; }
.hero-portrait img { width: 100%; display: block; filter: url(#duotone); -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%); }
.hero-portrait .watermark {
  position: absolute; left: -12%; bottom: 6%; z-index: -1;
  font-family: var(--font-display); font-style: italic; font-size: clamp(120px, 22vw, 320px); line-height: 1;
  color: transparent; -webkit-text-stroke: 1px var(--line); letter-spacing: -0.02em; white-space: nowrap; user-select: none;
}

/* ---------- facts strip ---------- */
.facts { padding: 0 0 var(--section); }
.facts ul { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.facts li { padding: 28px 24px 0 0; border-top: 1px solid var(--ink); margin-top: -1px; }
.facts strong { display: block; font-family: var(--font-display); font-size: clamp(44px, 4.4vw, 60px); line-height: 1; margin-bottom: 8px; }
.facts span { font-size: 14px; color: var(--ink-2); }

/* ---------- services (indice a righe) ---------- */
.service-list { border-top: 1px solid var(--ink); }
.service { display: grid; grid-template-columns: 1fr 6fr 5fr; gap: 48px; padding: 44px 0; border-bottom: 1px solid var(--line); align-items: start; }
.service:last-child { border-bottom: 1px solid var(--ink); }
.service .num { font-family: var(--font-display); font-style: italic; font-size: clamp(36px, 3.6vw, 52px); line-height: 1; color: var(--ink-3); transition: color .3s; }
.service:hover .num { color: var(--accent); }
.service h3 { margin-bottom: 12px; font-size: clamp(28px, 3vw, 38px); }
.service p { color: var(--ink-2); max-width: 44ch; }
.service ul li { font-size: 15px; color: var(--ink-2); padding: 9px 0; border-top: 1px solid var(--line); }
.service ul li:first-child { border-top: 0; padding-top: 4px; }

/* ---------- cases (dark) ---------- */
.cases { background: var(--dark); color: var(--dark-text); }
.cases .eyebrow { color: var(--dark-muted); }
.cases .lead { color: var(--dark-muted); }
.case-list { display: grid; gap: 1px; background: var(--dark-line); border-top: 1px solid var(--dark-line); border-bottom: 1px solid var(--dark-line); }
.case { background: var(--dark); display: grid; grid-template-columns: 2fr 5fr 3fr; gap: 40px; padding: 48px 0; }
.case .tag { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--dark-muted); }
.case h3 { margin-bottom: 14px; color: #fff; }
.case p { color: var(--dark-muted); font-size: 16px; }
.case .result { border-left: 1px solid var(--dark-line); padding-left: 32px; }
.case .result strong { display: block; font-family: var(--font-display); font-size: clamp(56px, 5.4vw, 76px); line-height: 1; color: #fff; margin-bottom: 8px; }
.case .result span { font-size: 14px; color: var(--dark-muted); }
.case .stack { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.case .stack li { font-size: 12px; padding: 4px 10px; border: 1px solid var(--dark-line); border-radius: 999px; color: var(--dark-muted); }

/* ---------- process ---------- */
.process ol { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; counter-reset: step; }
.process li { border-top: 1px solid var(--ink); padding-top: 24px; }
.process li::before { counter-increment: step; content: "0" counter(step); display: block; font-family: var(--font-display); font-style: italic; font-size: 48px; line-height: 1; color: var(--accent); margin-bottom: 24px; }
.process h3 { font-size: 24px; margin-bottom: 12px; }
.process p { font-size: 15px; color: var(--ink-2); }

/* ---------- about ---------- */
.about { background: var(--paper-2); }
.about .grid-2 { grid-template-columns: 5fr 7fr; }
.about p { margin-bottom: 20px; color: var(--ink-2); }
.about p.pull { font-family: var(--font-display); font-size: clamp(26px, 2.4vw, 32px); line-height: 1.25; color: var(--ink); margin-bottom: 28px; }
.about dl { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 32px; margin-top: 40px; }
.about dt { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.about dd { font-size: 15px; }
.about-portrait { margin-top: 40px; max-width: 380px; border-bottom: 1px solid var(--ink); }
.about-portrait img { width: 100%; display: block; filter: url(#duotone); -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12%, #000 88%, transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 12%, #000 88%, transparent 100%); }

/* ---------- faq ---------- */
.faq-list { border-top: 1px solid var(--ink); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:last-child { border-bottom: 1px solid var(--ink); }
.faq-list summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 24px 0; font-family: var(--font-display); font-size: clamp(24px, 2.4vw, 30px); line-height: 1.15; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font-family: var(--font-display); font-style: italic; font-size: 1.1em; color: var(--ink-3); transition: transform .3s, color .3s; }
.faq-list details[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.faq-list summary:hover::after { color: var(--accent); }
.faq-list details p { color: var(--ink-2); max-width: 60ch; padding: 0 0 28px; }

/* ---------- contact ---------- */
.contact .grid-2 { grid-template-columns: 5fr 6fr; }
.contact h2 { margin-bottom: 24px; }
.contact .lead { margin-bottom: 40px; }
.contact-lines li { padding: 16px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; font-size: 15px; }
.contact-lines li span:first-child { color: var(--ink-3); }
.form { display: grid; gap: 20px; }
.form label { display: grid; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.form input, .form textarea {
  width: 100%; padding: 12px 0;
  background: transparent; border: 0; border-bottom: 1px solid var(--ink-3); border-radius: 0;
  font-size: 17px; transition: border-color .2s, box-shadow .2s;
}
.form input:focus, .form textarea:focus { outline: none; border-bottom-color: var(--ink); box-shadow: 0 1px 0 0 var(--ink); }
.form input::placeholder, .form textarea::placeholder { color: var(--ink-3); }
.form label { text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }
.form textarea { min-height: 140px; resize: vertical; }
.form .btn { justify-self: start; }
.form .hp { position: absolute; left: -9999px; }
.form-note { font-size: 13px; color: var(--ink-3); }
.form-msg { font-size: 14px; padding: 12px 16px; border-radius: var(--radius); display: none; }
.form-msg.ok { display: block; background: #e8f3ea; color: #1e5a2b; }
.form-msg.err { display: block; background: #f7e6e4; color: #8a2a22; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 48px 0; font-size: 14px; color: var(--ink-2); }
.footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer .brand { color: var(--ink); margin-bottom: 12px; }
.footer .foot-h { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; font-weight: 500; }
.footer li { margin-bottom: 8px; }
.footer a:hover { color: var(--ink); }
.footer .colophon { flex-basis: 100%; font-family: var(--font-display); font-style: italic; font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.footer .legal { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 24px; margin-top: 16px; font-size: 13px; color: var(--ink-3); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---------- products page ---------- */
.crumbs { display: flex; gap: 10px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 28px; }
.crumbs a:hover { color: var(--ink); }
.page-head { padding: clamp(64px, 9vw, 120px) 0 64px; }
.page-head h1 { font-size: clamp(40px, 5vw, 64px); max-width: 18ch; }
.product { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.product-card { background: var(--paper); padding: 40px 32px; display: flex; flex-direction: column; }
.product-card h3 { margin-bottom: 8px; }
.product-card .tagline { color: var(--ink-2); margin-bottom: 24px; }
.product-card ul { flex: 1; margin-bottom: 28px; }
.product-card .btn { align-self: flex-start; }
.product-card li { font-size: 15px; color: var(--ink-2); padding: 8px 0; border-top: 1px solid var(--line); }
.product-card li:first-child { border-top: 0; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- hero entrance: righe che salgono da sotto il filo ---------- */
.hero .eyebrow, .hero h1, .hero .lead, .hero-actions { animation: rise .9s cubic-bezier(.16, 1, .3, 1) both; }
.hero h1 { animation-delay: .08s; }
.hero .lead { animation-delay: .22s; }
.hero-actions { animation-delay: .32s; }
.hero-portrait img { animation: unveil 1.1s cubic-bezier(.16, 1, .3, 1) .15s both; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes unveil { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero .eyebrow, .hero h1, .hero .lead, .hero-actions, .hero-portrait img { animation: none; }
}

/* ---------- a11y ---------- */
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 10px 14px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 24px; }
  .hero .wrap > div:first-child { padding-bottom: 0; }
  .hero-portrait { width: 100%; margin-left: 0; max-width: 460px; justify-self: center; }
  .facts ul { grid-template-columns: 1fr 1fr; }
  .facts li { padding-bottom: 24px; }
  .grid-3, .product { grid-template-columns: 1fr; }
  .service { grid-template-columns: 1fr; gap: 16px; padding: 36px 0; }
  .service .num { font-size: 32px; }
  .grid-2, .about .grid-2, .contact .grid-2 { grid-template-columns: 1fr; gap: 40px; }
  .section-head { grid-template-columns: 1fr; gap: 16px; margin-bottom: 48px; }
  .case { grid-template-columns: 1fr; gap: 20px; }
  .case .result { border-left: 0; padding-left: 0; border-top: 1px solid var(--dark-line); padding-top: 20px; }
  .process ol { grid-template-columns: 1fr 1fr; }
  .footer .wrap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .header { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--paper); }
  .nav { position: fixed; inset: 72px 0 0 0; background: var(--paper); padding: 24px var(--gutter); transform: translateX(100%); transition: transform .25s; }
  .nav.open { transform: none; }
  .nav ul { flex-direction: column; gap: 4px; }
  .nav a { display: block; padding: 14px 0; font-size: 20px; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: 16px; display: inline-flex; border: 1px solid var(--ink); }
  .nav-toggle { display: block; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  .hero-portrait .watermark { display: none; }
  .process ol { grid-template-columns: 1fr; }
  .footer .wrap { grid-template-columns: 1fr; }
  .case .result strong { font-size: 44px; }
}

