/* wordspace — getwordspace.com
   Nessun font esterno, nessun CDN: lo stack di sistema è il carattere dell'app
   (gli utenti Mac vedono New York e San Francisco, gli stessi dell'editor).
   È una scelta di design, di velocità e di privacy insieme. */

:root {
  color-scheme: light dark;

  /* Tipografia — lo stack Apple, con ripieghi solidi altrove. */
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  /* Neutri caldi, scelti — non un grigio medio qualunque. */
  --paper: #f5f4f1;
  --surface: #fbfaf8;
  --surface-sunken: #eeece6;
  --ink: #1c1d22;
  --ink-soft: #55565e;
  --ink-faint: #83848c;
  --line: #e0ddd5;
  --line-strong: #cfcbc0;

  /* Petrolio: la banda dell'hero, dalle schermate App Store reali. */
  --petrol: #1f3a40;
  --petrol-2: #26474e;
  --on-petrol: #eef2f1;
  --on-petrol-soft: #a9bcbb;

  /* Ambra: l'accento unico dell'app (scurito per il contrasto su carta). */
  --accent: #8f6414;
  --accent-strong: #714f0f;
  --accent-on-dark: #e0a458;

  /* Colori-pillola dei blocchi: solo nella sezione editor, come nell'app. */
  --pill-h: #6e5fa0;
  --pill-p: #5b6570;
  --pill-quote: #2c7a7a;
  --pill-list: #2e7d54;
  --pill-code: #b0801e;

  --ok: #2e7d54;

  --maxw: 1080px;
  --prose: 40rem;
  --radius: 14px;
  --radius-sm: 9px;

  --shadow: 0 1px 2px rgba(20, 20, 24, .04), 0 10px 34px rgba(20, 20, 24, .07);
  --shadow-soft: 0 1px 2px rgba(20, 20, 24, .04), 0 4px 14px rgba(20, 20, 24, .05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1e1f24;         /* «Notte», il tema di default dell'app */
    --surface: #24262c;
    --surface-sunken: #17181c;
    --ink: #d7d3cb;
    --ink-soft: #9a968e;
    --ink-faint: #6f6c65;
    --line: #2c2e35;
    --line-strong: #3a3c44;

    --petrol: #16292e;
    --petrol-2: #1d3940;
    --on-petrol: #e7ecec;
    --on-petrol-soft: #93a5a4;

    --accent: #e0a458;
    --accent-strong: #eab876;
    --accent-on-dark: #e0a458;

    --pill-h: #a99adb;
    --pill-p: #8b95a1;
    --pill-quote: #62b6b6;
    --pill-list: #6cc48c;
    --pill-code: #e0a458;

    --ok: #6cc48c;

    --line-strong: #3a3c44;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 40px rgba(0, 0, 0, .4);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, .25), 0 6px 18px rgba(0, 0, 0, .3);
  }
}

/* Il toggle del visualizzatore deve vincere in entrambe le direzioni. */
:root[data-theme="light"] {
  --paper: #f5f4f1; --surface: #fbfaf8; --surface-sunken: #eeece6;
  --ink: #1c1d22; --ink-soft: #55565e; --ink-faint: #83848c;
  --line: #e0ddd5; --line-strong: #cfcbc0;
  --petrol: #1f3a40; --petrol-2: #26474e; --on-petrol: #eef2f1; --on-petrol-soft: #a9bcbb;
  --accent: #8f6414; --accent-strong: #714f0f; --accent-on-dark: #e0a458;
  --pill-h: #6e5fa0; --pill-p: #5b6570; --pill-quote: #2c7a7a; --pill-list: #2e7d54; --pill-code: #b0801e;
  --ok: #2e7d54;
}
:root[data-theme="dark"] {
  --paper: #1e1f24; --surface: #24262c; --surface-sunken: #17181c;
  --ink: #d7d3cb; --ink-soft: #9a968e; --ink-faint: #6f6c65;
  --line: #2c2e35; --line-strong: #3a3c44;
  --petrol: #16292e; --petrol-2: #1d3940; --on-petrol: #e7ecec; --on-petrol-soft: #93a5a4;
  --accent: #e0a458; --accent-strong: #eab876; --accent-on-dark: #e0a458;
  --pill-h: #a99adb; --pill-p: #8b95a1; --pill-quote: #62b6b6; --pill-list: #6cc48c; --pill-code: #e0a458;
  --ok: #6cc48c;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 640; line-height: 1.12; text-wrap: balance; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }

:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.25rem, 5vw, 2.5rem); }
.prose { max-width: var(--prose); }

.eyebrow {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__in { display: flex; align-items: center; gap: 1.5rem; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--serif); font-size: 1.2rem; font-weight: 640; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand .glyph { width: 26px; height: 26px; border-radius: 7px; flex: none; }
.nav__spacer { flex: 1; }
.nav__links { display: flex; gap: 1.4rem; align-items: center; }
.nav__links a { color: var(--ink-soft); text-decoration: none; font-size: .95rem; }
.nav__links a:hover { color: var(--ink); }
@media (max-width: 720px) { .nav__links a.hide-sm { display: none; } }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(160deg, var(--petrol), var(--petrol-2)); color: var(--on-petrol); position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 88% -10%, color-mix(in srgb, var(--accent-on-dark) 20%, transparent), transparent 55%);
  pointer-events: none;
}
.hero__in { position: relative; z-index: 1; padding-block: clamp(3.5rem, 9vw, 6.5rem); display: grid; gap: 2.75rem; }
.hero .eyebrow { color: var(--on-petrol-soft); }
.hero h1 { font-size: clamp(2.5rem, 6.4vw, 4.4rem); color: #fff; max-width: 15ch; margin-block: .55rem .2rem; }
.hero__lead { font-size: clamp(1.15rem, 2.4vw, 1.4rem); color: var(--on-petrol); max-width: 40ch; line-height: 1.5; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .9rem 1.1rem; align-items: center; }

.badge {
  display: inline-flex; align-items: center; gap: .6rem;
  background: #fff; color: #111;
  padding: .7rem 1.15rem; border-radius: 12px; font-weight: 600; font-size: 1rem;
  text-decoration: none; box-shadow: var(--shadow-soft);
  transition: transform .18s ease;
}
.badge:hover { transform: translateY(-1px); color: #111; }
.badge svg { width: 20px; height: 20px; }
.badge--soon { background: rgba(255,255,255,.12); color: var(--on-petrol); box-shadow: none; border: 1px solid rgba(255,255,255,.24); cursor: default; }
.badge--soon:hover { transform: none; color: var(--on-petrol); }
.badge--soon .tag { font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.linkghost { color: var(--on-petrol); text-decoration: none; font-size: .98rem; border-bottom: 1px solid rgba(255,255,255,.35); padding-bottom: 2px; }
.linkghost:hover { color: #fff; border-color: #fff; }

/* finestra-mockup dell'editor nell'hero */
.mock {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line); overflow: hidden; color: var(--ink);
}
.mock__bar { display: flex; align-items: center; gap: .45rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #ec6a5e; } .dot.y { background: #f4bf4f; } .dot.g { background: #61c554; }
.mock__body { padding: 1.4rem 1.5rem 1.75rem; display: grid; gap: .9rem; }
.mock__title { font-family: var(--serif); font-size: 1.5rem; font-weight: 640; }
.mock__sub { color: var(--ink-faint); font-size: .9rem; margin-top: -.55rem; }
.line { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: .7rem; }
.pill {
  font-family: var(--mono); font-size: .68rem; font-weight: 600;
  padding: .16rem .42rem; border-radius: 6px; line-height: 1.3; color: #fff; white-space: nowrap; margin-top: .15rem;
}
.pill--h { background: var(--pill-h); } .pill--p { background: var(--pill-p); }
.pill--quote { background: var(--pill-quote); } .pill--list { background: var(--pill-list); }
.tag-word { color: var(--accent); } .at-word { color: var(--pill-quote); }
.mock__text b { font-weight: 660; }

@media (min-width: 900px) {
  .hero__in { grid-template-columns: 1.05fr .95fr; align-items: center; gap: 3.5rem; }
}

/* ---------- sezioni ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section--sunken { background: var(--surface-sunken); border-block: 1px solid var(--line); }
.section__head { display: grid; gap: .7rem; margin-bottom: 2.5rem; max-width: 46ch; }
.section__head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.section__head p { color: var(--ink-soft); font-size: 1.1rem; }

/* trust strip */
.trust { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .trust { grid-template-columns: repeat(4, 1fr); } }
.trust__cell { background: var(--surface); padding: 1.2rem 1.25rem; display: grid; gap: .3rem; }
.trust__k { font-family: var(--serif); font-size: 1.5rem; font-weight: 640; color: var(--ink); }
.trust__v { color: var(--ink-soft); font-size: .92rem; }

/* feature rows */
.feat { display: grid; gap: 1rem 3rem; padding-block: 2.25rem; border-top: 1px solid var(--line); align-items: start; }
.feat:first-of-type { border-top: 0; }
@media (min-width: 820px) { .feat { grid-template-columns: 8rem 1fr 1fr; } }
.feat__no { font-family: var(--mono); font-size: .8rem; color: var(--ink-faint); letter-spacing: .1em; padding-top: .4rem; }
.feat__h { font-size: 1.5rem; margin-bottom: .5rem; }
.feat__b { color: var(--ink-soft); max-width: 44ch; }
.feat__aside { color: var(--ink-soft); font-size: .96rem; }
.feat__aside .chip { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--mono); font-size: .74rem; background: var(--surface-sunken); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .6rem; margin: .2rem .3rem .2rem 0; color: var(--ink-soft); }

/* ---------- privacy: il registro ---------- */
.ledger { border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.ledger__row { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: 1rem 1.35rem; border-top: 1px solid var(--line); align-items: baseline; }
.ledger__row:first-child { border-top: 0; }
.ledger__k { color: var(--ink); font-weight: 500; }
.ledger__k small { display: block; color: var(--ink-faint); font-weight: 400; font-size: .86rem; margin-top: .15rem; }
.ledger__v { font-family: var(--mono); font-size: .82rem; letter-spacing: .02em; color: var(--ok); text-transform: uppercase; white-space: nowrap; }
.ledger__v.none { color: var(--ink-faint); }
.ledger__foot { padding: 1rem 1.35rem; border-top: 2px solid var(--line-strong); background: var(--surface-sunken); font-size: .92rem; color: var(--ink-soft); }

.callout { border-left: 3px solid var(--accent); padding: .3rem 0 .3rem 1.25rem; color: var(--ink); font-family: var(--serif); font-size: 1.35rem; line-height: 1.4; max-width: 34ch; }

/* ---------- legale / prosa lunga ---------- */
.legal h2 { font-size: 1.5rem; margin-top: 2.5rem; margin-bottom: .6rem; }
.legal h3 { font-family: var(--sans); font-size: 1.02rem; font-weight: 660; margin-top: 1.4rem; margin-bottom: .3rem; color: var(--ink); }
.legal p, .legal li { color: var(--ink-soft); }
.legal p { margin-bottom: .9rem; max-width: var(--prose); }
.legal ul { max-width: var(--prose); padding-left: 1.15rem; margin: 0 0 .9rem; }
.legal li { margin-bottom: .35rem; }
.legal .updated { font-family: var(--mono); font-size: .8rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .08em; }
.legal .todo { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border: 1px dashed var(--accent); border-radius: var(--radius-sm); padding: .2rem .45rem; color: var(--accent-strong); font-family: var(--mono); font-size: .85rem; }

.section__lead { max-width: var(--prose); color: var(--ink-soft); font-size: 1.12rem; margin-bottom: 1.5rem; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); background: var(--surface); padding-block: 2.75rem 2rem; margin-top: 1rem; }
.foot__grid { display: grid; gap: 1.75rem; }
@media (min-width: 720px) { .foot__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot h4 { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-faint); margin: 0 0 .7rem; font-weight: 600; }
.foot a { color: var(--ink-soft); text-decoration: none; display: block; margin-bottom: .4rem; font-size: .95rem; }
.foot a:hover { color: var(--ink); }
.foot__note { color: var(--ink-soft); font-size: .95rem; max-width: 34ch; }
.foot__claim { margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; align-items: center; justify-content: space-between; }
.foot__claim .verify { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .8rem; color: var(--ink-soft); }
.foot__claim .verify::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.foot__copy { color: var(--ink-faint); font-size: .88rem; }

/* language switcher */
.langs { display: inline-flex; gap: .2rem; flex-wrap: wrap; }
.langs a { display: inline-block; padding: .2rem .5rem; margin: 0; border-radius: 6px; font-family: var(--mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.langs a[aria-current="true"] { background: var(--ink); color: var(--paper); }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 50; }
.skip:focus { left: 0; }

/* ---------- selettore dei temi (colori veri dell’app) ---------- */
.swatches { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
@media (min-width: 560px) { .swatches { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 820px) { .swatches { grid-template-columns: repeat(4, 1fr); } }
.swatch {
  display: grid; gap: .55rem; padding: .55rem; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; font: inherit; color: var(--ink);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.swatch:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.swatch[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.swatch__prev {
  position: relative; height: 62px; border-radius: 7px; overflow: hidden;
  background: var(--sw-bg); border: 1px solid rgba(128,128,128,.18);
  display: flex; align-items: center; padding: 0 .7rem;
}
.swatch__aa { font-family: var(--serif); font-size: 1.35rem; font-weight: 640; color: var(--sw-fg); }
.swatch__bar { position: absolute; left: .7rem; bottom: .7rem; width: 34%; height: 6px; border-radius: 3px; background: var(--sw-el); }
.swatch__dot { position: absolute; right: .6rem; bottom: .6rem; width: 12px; height: 12px; border-radius: 50%; background: var(--sw-ac); }
.swatch__prev--sys { background: linear-gradient(120deg, #1e1f24 50%, #f5f4f1 50%); }
.swatch__prev--sys .swatch__aa { color: #888; mix-blend-mode: difference; }
.swatch__name { font-size: .86rem; color: var(--ink-soft); padding-left: .15rem; }
:root { transition: background-color .35s ease, color .35s ease; }
@media (prefers-reduced-motion: reduce) { :root, .swatch { transition: none; } }
