/* Trascrizioni JW — sito di presentazione.
   Idea: dal sottotitolo sullo schermo scuro alla pagina da leggere.
   Colori ripresi dall'app (blu, giallo dei sottotitoli); titoli in Literata, testo nei caratteri di sistema. */
@font-face { font-family: "Literata"; src: url("/assets/literata.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --ink: #151D2B;
  --muted: #56627A;
  --line: #D9DFE9;
  --accent: #2A4B9E;
  --accent-ink: #FFFFFF;
  --accent-soft: #E6EDFA;
  --screen: #121822;
  --screen-2: #2A3448;
  --screen-ink: #E9ECF2;
  --caption: #F2C230;
  --hl: rgba(242, 194, 48, .42);
  --font-display: "Literata", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --r: 14px;
  --wrap: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1117;
    --surface: #151B25;
    --ink: #E7EAF0;
    --muted: #9AA4B5;
    --line: #283040;
    --accent: #97AEF0;
    --accent-ink: #0D1117;
    --accent-soft: #1C2640;
    --screen: #080B10;
    --screen-2: #222C3E;
    --hl: rgba(242, 194, 48, .30);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--font-ui); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code, kbd { font: .86em var(--font-mono); background: var(--accent-soft); border-radius: 5px; padding: .08em .38em; overflow-wrap: anywhere; }
kbd { border: 1px solid var(--line); background: var(--surface); box-shadow: 0 1px 0 var(--line); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 650; letter-spacing: -.012em; line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.6rem); font-optical-sizing: auto; }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.5vw, 2.25rem); }
h3 { font-size: 1.2rem; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.eyebrow { font: 650 .74rem/1 var(--font-ui); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Barra in alto */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 650 1.15rem/1 var(--font-display); white-space: nowrap; }
.logo img { width: 32px; height: 32px; border-radius: 8px; }
.bar nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 4px; }
.bar nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 8px 10px; border-radius: 8px; }
.bar nav a:hover { background: var(--accent-soft); }
.bar nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* Pulsanti */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; padding: 0 1.25em; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 650 1rem/1.1 var(--font-ui); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn-caption { background: var(--caption); border-color: var(--caption); color: #121822; }
.btn-caption:hover { filter: brightness(1.05); border-color: var(--caption); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.small { font-size: .9rem; color: var(--muted); }

/* Hero: dal sottotitolo alla pagina */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; padding-block: 64px 72px; }
.hero > div:first-child { display: grid; gap: 22px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: .93rem; }
.facts li { display: inline-flex; align-items: center; gap: 8px; }
.facts li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--caption); box-shadow: 0 0 0 3px color-mix(in srgb, var(--caption) 25%, transparent); }
.scene { position: relative; display: grid; gap: 0; }
.frame { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: radial-gradient(120% 100% at 25% 15%, var(--screen-2) 0%, var(--screen) 64%); box-shadow: 0 24px 60px -30px rgba(10, 16, 30, .65); }
.frame .tc { position: absolute; top: 14px; left: 16px; font: 500 .8rem var(--font-mono); color: var(--caption); opacity: .75; }
.frame .play { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); width: 0; height: 0; border-left: 30px solid var(--caption); border-top: 19px solid transparent; border-bottom: 19px solid transparent; opacity: .16; }
.frame .cap { position: absolute; left: 6%; right: 6%; bottom: 24%; text-align: center; font: 650 clamp(.95rem, .7rem + .9vw, 1.25rem)/1.7 var(--font-ui); }
.frame .cap span { background: var(--screen); color: var(--caption); padding: .14em .5em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.page { position: relative; margin: -34px 18px 0 46px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px 20px; box-shadow: 0 18px 40px -26px rgba(10, 16, 30, .45); display: grid; gap: 12px; }
.page p { font: 1.06rem/1.7 var(--font-display); }
.page mark { background: var(--hl); color: inherit; border-radius: 3px; box-shadow: 0 0 0 2px var(--hl); }
.page .chip { justify-self: start; display: inline-flex; align-items: center; gap: 8px; font: 650 .88rem/1 var(--font-ui); background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 7px 12px 7px 7px; font-variant-numeric: tabular-nums; }
.page .chip i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--screen); }
.page .chip i::before { content: ""; border-left: 7px solid var(--caption); border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; margin-left: 2px; }

/* Sezioni */
.section { padding-block: 72px; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 10px; margin-bottom: 34px; max-width: 64ch; }
.section-head p { color: var(--muted); }

.steps3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps3 li { counter-increment: s; display: grid; gap: 8px; align-content: start; }
.steps3 li::before { content: counter(s); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--screen); color: var(--caption); font: 700 1.05rem var(--font-display); margin-bottom: 4px; }
.steps3 p { color: var(--muted); }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 34px; }
.feature { display: grid; gap: 6px; align-content: start; padding-top: 16px; border-top: 2px solid var(--ink); }
.feature p { color: var(--muted); }

.formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.format { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.format .eyebrow { color: var(--accent); }
.format pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: .98rem/1.65 var(--font-display); }
.format pre b { font: 600 .82em var(--font-mono); color: var(--muted); }

.window { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 30px 70px -40px rgba(10, 16, 30, .6); }
.window-bar { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; background: color-mix(in srgb, var(--surface) 70%, var(--bg)); border-bottom: 1px solid var(--line); font: 600 .82rem var(--font-ui); color: var(--muted); }
.window-bar i { width: 12px; height: 12px; border-radius: 50%; background: #FF5F57; }
.window-bar i:nth-child(2) { background: #FEBC2E; }
.window-bar i:nth-child(3) { background: #28C840; }
.window-bar span { margin-left: 10px; }
figure { margin: 0 auto; display: grid; gap: 12px; max-width: 860px; }
figcaption { color: var(--muted); font-size: .92rem; }

.mac-band { background: var(--screen); color: var(--screen-ink); }
.mac-band .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-block: 72px; }
.mac-band h2 { color: #fff; }
.mac-band p, .mac-band li { color: #B9C2D3; }
.mac-band ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.mac-band .stack { display: grid; gap: 18px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; margin: 0; font-size: .95rem; }
.keys dt { white-space: nowrap; }
.keys dd { margin: 0; color: #B9C2D3; }
.keys kbd { background: #1E2738; border-color: #354158; box-shadow: 0 1px 0 #354158; color: #fff; }

/* FAQ */
.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 20px; }
.faq summary { cursor: pointer; font-weight: 650; padding: 16px 0; list-style-position: outside; }
.faq details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.faq details p { padding-bottom: 16px; color: var(--muted); }

/* Donazione */
.give { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px 36px; margin-block: 24px 72px; }
.give p { color: var(--muted); margin-top: 8px; max-width: 60ch; }
.give-side { display: grid; gap: 8px; justify-items: center; }
.give-note { font-size: .85rem; color: var(--muted); }

/* Pagine interne */
.page-head { padding-block: 56px 8px; display: grid; gap: 14px; }
.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 48px; padding-block: 36px 24px; align-items: start; }
.toc { position: sticky; top: 88px; display: grid; gap: 2px; font-size: .92rem; }
.toc a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); background: var(--accent-soft); }
.prose { max-width: 72ch; min-width: 0; }
.prose > * + * { margin-top: 14px; }
.prose h2 { margin-top: 52px; padding-top: 4px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 28px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 6px; }
.note { background: var(--accent-soft); border-radius: 12px; padding: 14px 18px; }
.steps { list-style: none; counter-reset: st; padding: 0 !important; display: grid; gap: 14px; }
.steps > li { counter-increment: st; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; align-items: start; margin: 0 !important; }
.steps > li::before { content: counter(st); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--screen); color: var(--caption); font: 700 .9rem var(--font-display); }
.path { display: inline; font-weight: 650; }
.path span + span::before { content: " › "; color: var(--muted); font-weight: 400; }
.copy { display: flex; align-items: center; gap: 8px; margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 6px 12px; }
.copy code { background: none; padding: 0; flex: 1; min-width: 0; }
.copy button { font: 600 .85rem var(--font-ui); border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 8px; padding: 7px 12px; cursor: pointer; flex: none; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
td:first-child { white-space: nowrap; }
.download { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 24px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px 28px; }
.download img { width: 88px; height: 88px; }
.download .meta { display: grid; gap: 4px; }
.download .cta { grid-column: 1 / -1; }

/* Piè di pagina */
footer { border-top: 1px solid var(--line); padding-block: 36px max(40px, env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: .9rem; }
footer .wrap { display: grid; gap: 14px; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer nav a { color: var(--ink); text-decoration: none; font-weight: 600; }
footer nav a:hover { text-decoration: underline; }
footer details summary { cursor: pointer; }
footer ul { margin: 8px 0 0; padding-left: 1.2em; }

.toast { position: fixed; left: 50%; bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 16px)); transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: .92rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-block: 40px 56px; }
  .features, .formats, .steps3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mac-band .wrap { grid-template-columns: minmax(0, 1fr); }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .toc a { border: 1px solid var(--line); background: var(--surface); }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .features, .formats, .steps3 { grid-template-columns: minmax(0, 1fr); }
  .page { margin: -24px 8px 0 18px; padding: 18px; }
  .give { grid-template-columns: minmax(0, 1fr); padding: 24px; }
  .give-side { justify-items: start; }
  .bar .wrap { flex-wrap: wrap; padding-block: 8px; }
  .bar nav { justify-content: flex-start; }
  .only-wide { display: none; }
  .section { padding-block: 56px; }
  .download { grid-template-columns: minmax(0, 1fr); }
  .cta .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
