/* =========================================================
   231 AI — Sito vetrina (landing)
   Stile "heritage legale": carta avorio + inchiostro + oro/ottone,
   serif display (Playfair, self-hosted) + IBM Plex Sans, line-art a incisione.
   ========================================================= */

@font-face {
  font-family: 'Playfair Display'; font-style: normal; font-weight: 600;
  font-display: swap; src: url('/assets/fonts/PlayfairDisplay-600.ttf') format('truetype');
}
@font-face {
  font-family: 'Playfair Display'; font-style: normal; font-weight: 700;
  font-display: swap; src: url('/assets/fonts/PlayfairDisplay-700.ttf') format('truetype');
}
@font-face {
  font-family: 'Plex'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('/assets/fonts/IBMPlexSans-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Plex'; font-style: normal; font-weight: 500;
  font-display: swap; src: url('/assets/fonts/IBMPlexSans-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Plex'; font-style: normal; font-weight: 700;
  font-display: swap; src: url('/assets/fonts/IBMPlexSans-Bold.woff2') format('woff2');
}

:root {
  --paper: #f4eee1;
  --paper-2: #efe7d6;
  --panel: #fbf7ee;
  --ink: #221f1a;
  --ink-soft: #5b5446;
  --ink-faint: #938b78;
  --line: #ddd2bc;
  --line-strong: #c9bda3;
  --gold: #9b7d3e;
  --gold-2: #b9933f;
  --gold-soft: #cdb074;
  --radius: 4px;
  --serif: 'Playfair Display', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans: 'Plex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* grana di carta sottilissima */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
/* griglia tecnica leggera (carta da disegno), sfuma ai bordi */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(34,31,26,.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(34,31,26,.04) 1px, transparent 1px);
  background-size: 88px 88px;
  -webkit-mask-image: radial-gradient(circle at 50% 26%, #000, transparent 86%);
  mask-image: radial-gradient(circle at 50% 26%, #000, transparent 86%);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; margin: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 14.5px; font-weight: 600; letter-spacing: .01em;
  padding: 12px 22px; border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; transition: all .25s var(--ease); white-space: nowrap; }
.btn-lg { padding: 15px 30px; font-size: 15.5px; }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: #000; transform: translateY(-1px); box-shadow: 0 10px 24px -12px rgba(34,31,26,.5); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); background: rgba(34,31,26,.03); }

/* ---------- Navbar ---------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .3s var(--ease), border-color .3s, box-shadow .3s; border-bottom: 1px solid transparent; }
.nav.scrolled { background: rgba(244,238,225,.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); box-shadow: 0 1px 20px -12px rgba(34,31,26,.4); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 74px; }
.brand img { height: 34px; width: auto; }
.nav-links { display: flex; gap: 30px; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--ink-soft); position: relative; padding: 4px 0; }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 1px; background: var(--gold); transition: width .3s var(--ease); }
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.nav-cta { display: flex; align-items: center; gap: 12px; }
.nav-install { font-size: 13px; }
.nav-toggle { display: none; background: none; border: 0; font-size: 22px; color: var(--ink); cursor: pointer; }

/* ---------- Hero ---------- */
.hero { position: relative; z-index: 1; padding: 150px 0 86px; min-height: 92vh; display: flex; align-items: center; }
.hero-grid { display: grid; grid-template-columns: 1.04fr .96fr; gap: 56px; align-items: center; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 26px; }
.hero-eyebrow .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 rgba(155,125,62,.5); animation: pulse 2.4s infinite; }
.hero h1 { font-size: clamp(31px, 6.2vw, 70px); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 24px; }
.hero h1 .em { font-style: italic; font-weight: 600; }
.hero h1 .underline {
  background-image: linear-gradient(rgba(185,147,63,.34), rgba(185,147,63,.34));
  background-size: 100% .24em; background-position: 0 92%; background-repeat: no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.hero p.lead { font-size: clamp(16px, 1.9vw, 18.5px); color: var(--ink-soft); max-width: 540px; margin: 0 0 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; margin-top: 48px; flex-wrap: wrap; padding-top: 26px; border-top: 1px solid var(--line); }
.hero-stats .s b { display: block; font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1; }
.hero-stats .s span { font-size: 12.5px; color: var(--ink-faint); }

/* illustrazione line-art */
.hero-visual { position: relative; display: flex; align-items: center; justify-content: center; }
.hero-art { width: min(440px, 92%); height: auto; }
.hero-art .stroke { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.hero-art .thin { stroke-width: .9; }
.hero-art .gold { stroke: var(--gold-2); }
.hero-art .fillgold { fill: var(--gold-2); stroke: none; }
.hero-art .fillink { fill: var(--ink); stroke: none; }
.hero-halo { position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(185,147,63,.16), transparent 66%); z-index: -1; }
/* disegno progressivo dei tratti */
.draw .stroke { stroke-dasharray: var(--len, 1200); stroke-dashoffset: var(--len, 1200); animation: draw 2.4s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.scroll-hint { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-faint); display: flex; align-items: center; gap: 8px; }
.scroll-hint::after { content: ""; width: 28px; height: 1px; background: var(--line-strong); display: inline-block; animation: hintline 2s var(--ease) infinite; transform-origin: left; }

/* ---------- Sections ---------- */
.section { position: relative; z-index: 1; padding: 96px 0; }
.section.alt { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 60px; }
.section-tag { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.section-tag::before { content: "—"; margin-right: 8px; color: var(--gold-soft); }
.section-head h2 { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.12; margin: 16px 0 14px; }
.section-head p { color: var(--ink-soft); font-size: 17px; margin: 0; }
.divider-mark { display: block; width: 46px; height: 1px; background: var(--gold); margin: 18px auto 0; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.step { padding: 30px 24px; border-top: 2px solid var(--ink); background: transparent; }
.step .num { font-family: var(--serif); font-size: 15px; color: var(--gold); letter-spacing: .1em; margin-bottom: 18px; }
.step h3 { font-size: 21px; margin: 0 0 10px; }
.step p { color: var(--ink-soft); font-size: 14.5px; margin: 0; }

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.feature { padding: 34px 30px; background: var(--panel); transition: background .25s var(--ease); }
.feature:hover { background: #fff; }
.feature .mk { width: 26px; height: 1px; background: var(--gold); margin-bottom: 18px; }
.feature h3 { font-size: 20px; margin: 0 0 10px; }
.feature p { color: var(--ink-soft); font-size: 14.5px; margin: 0; }

/* ---------- Pricing ---------- */
.pricing-toggle { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 44px; font-size: 14px; font-weight: 500; color: var(--ink-faint); }
.pricing-toggle .active { color: var(--ink); }
.switch { width: 52px; height: 28px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line-strong); position: relative; cursor: pointer; transition: background .3s; }
.switch i { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); transition: transform .3s var(--ease); }
.switch.on { background: #efe3c8; }
.switch.on i { transform: translateX(24px); }
.save-badge { color: var(--gold); font-weight: 600; font-size: 12px; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
.plan { padding: 34px 28px; border: 1px solid var(--line-strong); background: var(--panel); display: flex; flex-direction: column; position: relative; transition: transform .35s var(--ease), box-shadow .35s, border-color .35s; }
.plan:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -30px rgba(34,31,26,.4); }
.plan.featured { border-color: var(--gold); background: #fff; box-shadow: 0 24px 60px -34px rgba(155,125,62,.6); }
.plan .pop { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--gold); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 5px 14px; border-radius: 999px; }
.plan h3 { font-size: 24px; margin: 0 0 6px; }
.plan .desc { font-size: 13px; color: var(--ink-faint); margin-bottom: 18px; }
.plan .price { display: flex; align-items: baseline; gap: 4px; }
.plan .price .amount { font-family: var(--serif); font-size: 42px; font-weight: 700; }
.plan .price .per { font-size: 14px; color: var(--ink-faint); }
.plan .price-note { font-size: 12.5px; color: var(--ink-faint); margin: 4px 0 20px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 26px; flex: 1; }
.plan ul li { font-size: 14px; color: var(--ink-soft); padding: 8px 0 8px 24px; position: relative; border-bottom: 1px solid var(--line); }
.plan ul li:last-child { border-bottom: 0; }
.plan ul li::before { content: ""; position: absolute; left: 0; top: 14px; width: 9px; height: 9px; border: 1px solid var(--gold); transform: rotate(45deg); }
.plan ul li b { color: var(--ink); }
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 30px; }
.pack { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; border: 1px solid var(--line); background: var(--panel); }
.pack b { font-family: var(--serif); font-size: 16px; }
.pack span { font-size: 12.5px; color: var(--ink-faint); }
.pack .p { font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--gold); white-space: nowrap; }

/* ---------- Sicurezza ---------- */
.sec-grid { display: grid; grid-template-columns: .95fr 1.05fr; gap: 56px; align-items: center; }
.sec-art { display: flex; align-items: center; justify-content: center; }
.sec-art svg { width: min(360px, 80%); height: auto; }
.sec-copy .section-tag { display: block; }
.sec-copy h2 { font-size: clamp(26px, 3.4vw, 40px); margin: 14px 0 14px; }
.sec-copy p { color: var(--ink-soft); font-size: 16.5px; margin: 0; }
.band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; margin-top: 60px; }
.band .b { border-top: 1px solid var(--line-strong); padding-top: 18px; }
.band .b .mk { width: 8px; height: 8px; border: 1px solid var(--gold); transform: rotate(45deg); margin-bottom: 14px; }
.band .b h4 { font-size: 17px; margin: 0 0 6px; }
.band .b p { font-size: 13.5px; color: var(--ink-soft); margin: 0; }

/* ---------- FAQ ---------- */
.faq { max-width: 800px; margin: 0 auto; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 40px 22px 0; font-family: var(--serif); font-size: 19px; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 18px; font-family: var(--sans); font-size: 24px; color: var(--gold); font-weight: 400; transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-soft); font-size: 15px; margin: 0 0 22px; max-width: 92%; }

/* ---------- Contatti ---------- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
.contact-info h2 { font-size: clamp(26px, 3.4vw, 40px); margin: 14px 0 14px; }
.contact-info p { color: var(--ink-soft); margin: 0 0 26px; }
.contact-info .li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--ink-soft); padding: 11px 0; border-bottom: 1px solid var(--line); }
.contact-info .li .dot { width: 7px; height: 7px; background: var(--gold); border-radius: 50%; flex: none; }
.lead-form { background: var(--panel); border: 1px solid var(--line-strong); padding: 34px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: .03em; color: var(--ink-soft); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  font-family: var(--sans); font-size: 14.5px; border-radius: var(--radius); transition: border-color .2s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); }
.field textarea { min-height: 110px; resize: vertical; }
.hp { position: absolute; left: -9999px; }
.form-msg { margin-top: 14px; font-size: 14px; text-align: center; }
.form-msg.ok { color: #2f7a3f; }
.form-msg.err { color: #b4452e; }

/* ---------- Footer ---------- */
.footer { background: var(--paper-2); border-top: 1px solid var(--line); padding: 56px 0 40px; position: relative; z-index: 1; }
.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer .brand img { height: 32px; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.footer-links a { font-size: 13.5px; color: var(--ink-soft); }
.footer-links a:hover { color: var(--gold); }
.muted { color: var(--ink-faint); font-size: 13px; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; } .reveal.d4 { transition-delay: .32s; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(155,125,62,.5); } 70% { box-shadow: 0 0 0 9px rgba(155,125,62,0); } 100% { box-shadow: 0 0 0 0 rgba(155,125,62,0); } }
@keyframes hintline { 0%,100% { transform: scaleX(.4); opacity:.5; } 50% { transform: scaleX(1); opacity:1; } }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .sec-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; }
  .hero-art { width: min(320px, 70%); }
  .steps, .features, .band { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; position: absolute; top: 74px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 10px 28px; }
  .nav-links.open a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: inline-block; }
  .nav-install, .nav-cta .btn-ghost { display: none; }
}
@media (max-width: 560px) {
  .steps, .features, .band { grid-template-columns: 1fr; }
  .features { border: 1px solid var(--line); }
  .hero { padding-top: 120px; }
  .lead-form { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .draw .stroke { stroke-dashoffset: 0; }
}
