/* ============================================================
   Cardine — landing di pre-lancio
   Sistema visivo ereditato dall'app: carta, inchiostro, grafite,
   pietra. Colore solo per il significato. (cfr. app/globals.css)
   ============================================================ */

:root {
  /* superfici (carta) */
  --paper: oklch(0.972 0.006 84);
  --paper-2: oklch(0.988 0.005 84);
  --paper-sunk: oklch(0.955 0.007 82);
  --paper-rail: oklch(0.945 0.008 80);

  /* inchiostro / testo */
  --ink: oklch(0.265 0.012 60);
  --ink-soft: oklch(0.4 0.011 60);
  --graphite: oklch(0.52 0.01 62);
  --stone: oklch(0.63 0.009 66);
  --stone-faint: oklch(0.72 0.008 70);

  /* linee */
  --hair: oklch(0.885 0.006 80);
  --hair-strong: oklch(0.83 0.007 78);
  --hair-faint: oklch(0.925 0.005 82);

  /* accenti che portano significato */
  --amber: oklch(0.7 0.115 62);
  --amber-ink: oklch(0.46 0.09 58);
  --amber-wash: oklch(0.93 0.045 76);
  --amber-line: oklch(0.8 0.09 68);

  --sage: oklch(0.58 0.052 152);
  --sage-ink: oklch(0.44 0.05 152);
  --sage-wash: oklch(0.93 0.028 150);

  --slate: oklch(0.47 0.066 248);
  --slate-ink: oklch(0.4 0.07 248);
  --slate-wash: oklch(0.92 0.03 250);

  /* tipografia */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;

  --radius: 4px;
  --shadow-card:
    0 1px 2px oklch(0.4 0.02 60 / 0.04),
    0 1px 0 oklch(1 0 0 / 0.6) inset;
  --shadow-lift:
    0 1px 2px oklch(0.4 0.02 60 / 0.05),
    0 12px 36px oklch(0.4 0.02 60 / 0.07);

  --maxw: 1120px;
}

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

html {
  background: var(--paper);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings:
    "cv05" 1,
    "ss01" 1;
}

::selection {
  background: var(--slate-wash);
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--slate);
  outline-offset: 2px;
  border-radius: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}

button {
  font: inherit;
  cursor: pointer;
}

/* ---- tipi riusabili ---- */
.serif {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.mono {
  font-family: var(--mono);
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone);
}
.eyebrow.num::before {
  content: attr(data-num);
  color: var(--stone-faint);
  margin-right: 0.9em;
}
.metaline {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--graphite);
}

/* ---- layout ---- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: 32px;
}

.section {
  padding-block: 104px;
  border-top: 1px solid var(--hair);
}
.section--narrow .wrap {
  max-width: 760px;
}
.section--sunk {
  background: var(--paper-sunk);
}

.section-head {
  max-width: 64ch;
  margin-bottom: 48px;
}
.section-title {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.08;
  margin: 14px 0 0;
  color: var(--ink);
}
.section-lead {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 16px 0 0;
  max-width: 60ch;
  text-wrap: pretty;
}

/* skip link */
.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper-2);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  transition: top 0.15s;
}
.skip-link:focus {
  top: 16px;
}

/* ---- bottoni ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  padding: 11px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--hair-strong);
  background: var(--paper-2);
  color: var(--ink);
  transition:
    background 0.14s,
    border-color 0.14s,
    transform 0.05s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--paper-sunk);
  border-color: var(--graphite);
}
.btn:active {
  transform: translateY(0.5px);
}
.btn-primary {
  background: var(--ink);
  color: var(--paper-2);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: oklch(0.2 0.012 60);
  border-color: oklch(0.2 0.012 60);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover {
  background: var(--paper-sunk);
  border-color: var(--hair);
}
.btn-sm {
  padding: 8px 13px;
  font-size: 13px;
}

/* ---- pill di stato ---- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 2px 9px 3px;
  border-radius: 100px;
  border: 1px solid var(--hair-strong);
  color: var(--graphite);
  background: var(--paper-2);
  white-space: nowrap;
}
.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill-warn {
  color: var(--amber-ink);
  border-color: var(--amber-line);
  background: var(--amber-wash);
}
.pill-ok {
  color: var(--sage-ink);
  border-color: oklch(0.78 0.04 150);
  background: var(--sage-wash);
}
.pill-nav {
  color: var(--slate-ink);
  border-color: oklch(0.8 0.04 250);
  background: var(--slate-wash);
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: oklch(0.972 0.006 84 / 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  display: inline-flex;
}
.brand-word {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--ink);
}
.header-nav {
  display: flex;
  gap: 26px;
  margin-left: 28px;
}
.header-nav a {
  font-size: 14px;
  color: var(--ink-soft);
  transition: color 0.14s;
}
.header-nav a:hover {
  color: var(--ink);
}
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 12px;
}
.lang-btn {
  border: 0;
  background: transparent;
  color: var(--stone);
  padding: 4px 4px;
  letter-spacing: 0.06em;
  transition: color 0.14s;
}
.lang-btn:hover {
  color: var(--ink-soft);
}
.lang-btn.is-active {
  color: var(--ink);
  font-weight: 500;
}
.lang-sep {
  color: var(--stone-faint);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding-block: clamp(56px, 9vw, 104px);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}
.hero-title {
  font-size: clamp(40px, 6.4vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.018em;
  margin: 18px 0 0;
  color: var(--ink);
  text-wrap: balance;
}
.hero-lead {
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 22px 0 0;
  max-width: 52ch;
  text-wrap: pretty;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.hero-note {
  margin-top: 18px;
  color: var(--stone);
  font-size: 12px;
}

/* onion */
.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.onion {
  width: 100%;
  max-width: 460px;
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 40px oklch(0.4 0.02 60 / 0.08));
}
.onion-label {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  fill: var(--ink);
}
.onion-label--slate {
  fill: var(--slate-ink);
}
.onion-hub-kicker {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  fill: var(--stone-faint);
}
.onion-hub-name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  fill: var(--paper-2);
}
.onion-arc {
  stroke-dasharray: 1400;
  stroke-dashoffset: 0;
}
.onion-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  justify-content: center;
}
.onion-legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--graphite);
}
.swatch {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  border: 1px solid var(--hair-strong);
  flex: none;
}
.swatch-az {
  background: oklch(0.945 0.008 80);
}
.swatch-pr {
  background: oklch(0.915 0.028 250);
}
.swatch-risk {
  background: var(--amber);
  border-radius: 50%;
  border-color: var(--amber-line);
}

/* ============================================================
   Problema / statement editoriale
   ============================================================ */
.statement {
  font-size: clamp(24px, 3.2vw, 33px);
  line-height: 1.34;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 24px 0 0;
  text-wrap: pretty;
}
.statement-after {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 26px 0 0;
  max-width: 56ch;
}

/* ============================================================
   Card grid (tre movimenti)
   ============================================================ */
.card-grid {
  display: grid;
  gap: 20px;
}
.card-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}
.card {
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 28px 26px 30px;
}
.card-index {
  display: inline-block;
  font-size: 13px;
  color: var(--stone);
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--hair);
  padding-bottom: 12px;
  margin-bottom: 14px;
  width: 100%;
}
.card-title {
  font-size: 24px;
  font-weight: 500;
  margin: 0 0 10px;
  color: var(--ink);
}
.card-body {
  font-size: 15.5px;
  color: var(--ink-soft);
  margin: 0;
  text-wrap: pretty;
}

/* ============================================================
   Quattro livelli (onion stratificata)
   ============================================================ */
.layers {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 760px;
}
.layer {
  --pad: clamp(0px, 4vw, 38px);
  margin-inline: calc(var(--inset) * var(--pad));
  margin-top: -1px;
  padding: 18px 22px;
  border: 1px solid var(--hair-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.layer:first-child {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}
.layer--az {
  background: oklch(0.965 0.006 82);
}
.layer--az:first-child {
  background: oklch(0.945 0.008 80);
}
.layer--pr {
  background: oklch(0.945 0.018 248);
}
.layer--pr:last-of-type {
  background: oklch(0.915 0.028 250);
}
.layer-main {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.layer-name {
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}
.layer-out {
  color: var(--graphite);
}
.layer--hub {
  background: var(--ink);
  border-color: var(--ink);
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  justify-content: center;
  padding-block: 13px;
}
.layer-hub-kicker {
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: var(--stone-faint);
}

/* ============================================================
   Scheda decisione (mock)
   ============================================================ */
.decisione-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.05fr);
  gap: clamp(40px, 5vw, 72px);
  align-items: start;
}
.decisione-copy {
  position: sticky;
  top: 96px;
}
.key-list {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.key-list li {
  position: relative;
  padding-left: 22px;
  font-size: 15px;
  color: var(--ink-soft);
}
.key-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--slate);
}

.scheda {
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: 6px;
  box-shadow: var(--shadow-lift);
  padding: 26px 26px 22px;
}
.scheda-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.scheda-enunciato {
  font-size: 22px;
  line-height: 1.35;
  color: var(--ink);
  margin: 16px 0 0;
}
.scheda-link {
  margin: 10px 0 0;
  color: var(--slate-ink);
}
.scheda-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--hair);
}
.scheda-col-h {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--stone);
  margin: 0 0 12px;
}
.scheda-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.scheda-col li {
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.45;
}
.scheda-col--contro li {
  padding: 11px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--hair);
  background: var(--paper);
}
.contro {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.contro--uncovered {
  border-color: var(--amber-line) !important;
  background: var(--amber-wash) !important;
}
.guardrail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--sage-ink);
  border-left: 2px solid var(--sage);
  padding-left: 10px;
}
.guardrail-tag {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--sage);
}
.guardrail--missing {
  color: var(--amber-ink);
  border-left-color: var(--amber);
}
.guardrail--missing .guardrail-tag {
  color: var(--amber-ink);
}
.scheda-foot {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.scheda-meta {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.scheda-meta-k {
  flex: none;
  width: 76px;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--stone);
}

/* ============================================================
   Manifesto
   ============================================================ */
.manifesto {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.manifesto-item h3 {
  font-size: 21px;
  font-weight: 500;
  margin: 0 0 10px;
  color: var(--ink);
}
.manifesto-item p {
  font-size: 15.5px;
  color: var(--ink-soft);
  margin: 0;
}

/* ============================================================
   Iscrizione
   ============================================================ */
.signup-inner {
  max-width: 680px;
  margin-inline: auto;
  text-align: center;
}
.signup-title {
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.06;
  margin: 14px 0 0;
  color: var(--ink);
}
.signup-lead {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 16px auto 0;
  max-width: 52ch;
  text-wrap: pretty;
}
.signup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 32px;
  text-align: left;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
  padding-left: 2px;
}
.field-input {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--hair-strong);
  background: var(--paper-2);
  color: var(--ink);
  font-size: 15px;
  transition:
    border-color 0.14s,
    box-shadow 0.14s;
}
.field-input::placeholder {
  color: var(--stone-faint);
}
.field-input:focus {
  outline: none;
  border-color: var(--slate);
  box-shadow: 0 0 0 3px var(--slate-wash);
}
.field-input[aria-invalid="true"] {
  border-color: var(--amber-line);
  box-shadow: 0 0 0 3px var(--amber-wash);
}
.signup-submit {
  height: 44px;
  justify-content: center;
}
.signup-submit[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.form-status {
  min-height: 1.4em;
  margin: 16px 0 0;
  font-size: 14px;
  text-align: center;
}
.form-status.is-error {
  color: var(--amber-ink);
}
.form-status.is-success {
  color: var(--sage-ink);
}
.signup-fine {
  margin: 8px 0 0;
  color: var(--stone);
  font-size: 12px;
  text-align: center;
}

/* ============================================================
   FAQ
   ============================================================ */
.faq {
  margin: 36px 0 0;
}
.faq-item {
  padding: 22px 0;
  border-top: 1px solid var(--hair);
}
.faq-item:last-child {
  border-bottom: 1px solid var(--hair);
}
.faq-item dt {
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}
.faq-item dd {
  margin: 0;
  font-size: 15.5px;
  color: var(--ink-soft);
  max-width: 64ch;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--hair);
  background: var(--paper-rail);
  padding-block: 40px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
}
.footer-tag {
  color: var(--ink-soft);
  font-style: normal;
}
.footer-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--graphite);
}
.footer-contact-label {
  color: var(--stone);
}
.footer-contact a {
  color: var(--graphite);
  border-bottom: 1px solid var(--hair-strong);
  padding-bottom: 1px;
  transition:
    color 0.14s,
    border-color 0.14s;
}
.footer-contact a:hover {
  color: var(--ink);
  border-color: var(--graphite);
}
.footer-copy {
  margin-left: auto;
  color: var(--stone);
}

/* ============================================================
   Reveal on scroll
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.6s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    order: -1;
  }
  .onion {
    max-width: 360px;
  }
  .decisione-grid {
    grid-template-columns: 1fr;
  }
  .decisione-copy {
    position: static;
  }
  .card-grid--3,
  .manifesto {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .wrap {
    padding-inline: 22px;
  }
  .section {
    padding-block: 72px;
  }
  .header-nav {
    display: none;
  }
  .card-grid--3,
  .manifesto {
    grid-template-columns: 1fr;
  }
  .scheda-cols {
    grid-template-columns: 1fr;
  }
  .signup-form {
    grid-template-columns: 1fr;
  }
  .footer-copy {
    margin-left: 0;
  }
}
