/* Create by Coding
   Un solo elemento audace: il cielo sopra il borgo, che segue l'ora di chi visita.
   Tutto il resto è calmo: calce, inchiostro, pietra. L'ambra delle finestre è l'unico accento. */


/* Sui dispositivi Apple il carattere è quello di sistema (SF Pro); altrove Inter, ospitato qui. */
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
:root {
  --calce: #eef0ec;      /* sfondo: calce, non crema */
  --inchiostro: #1d2430; /* testo */
  --pietra: #5b5f5a;     /* testo secondario */
  --notte: #141b2d;
  --lanterna: #f2b544;   /* finestre accese, solo su fondo scuro */
  --ambra-scura: #8a5a00;/* ambra leggibile su fondo chiaro */
  --linea: rgba(29, 36, 48, 0.14);

  /* Tema: la pagina segue l'ora. sky.js imposta --page e data-theme; qui i valori senza JavaScript. */
  --page: #eef0ec;
  --ink: #1d2430;
  --ink-2: #5b5f5a;
  --panel: var(--panel);
  --field: #ffffff;
  --field-line: #9aa19a;
  --accent-ink: #8a5a00;

  /* Valori di partenza del cielo (giorno). sky.js li sovrascrive con l'ora reale. */
  --sky-space: #0a1428; --sky-space2: #1d3a63; --sky-zenith: #3a6fa6; --sky-top: #4f95d8; --sky-bottom: #d6ecf6; --sky-end: 100%;
  --b-far: #a9bccb; --b-mid: #7f9a8f; --b-hill: #6f8455; --b-grass: #8fa35f; --b-road: #c7bda5; --b-olive: #9aa86f; --b-olived: #4e5e37; --b-cypress: #2f4a32; --b-stonel: #d9cfb6; --b-stonem: #b8ad93; --b-stoned: #8c8371; --b-roofl: #b9765a; --b-roofd: #8e543f; --b-ivy: #5e7343; --b-hole: #3a3532; --b-stem: #5f7a3c; --b-fred: #d9473c; --b-fyel: #f2c230; --b-fwhite: #f4efe4; --b-fviolet: #9a7ad6; --b-fpink: #e0609a;
  --win: 0; --stars: 0;
  --body-x: 50%; --body-y: 14%;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --serif: var(--sans);
  --measure: 36rem;
  --wide: 76rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; font-size: clamp(100%, 0.45vw + 0.6rem, 118.75%); }
body {
  margin: 0;
  /* La pagina è il cielo sopra il borgo: zenit in cima, orizzonte dove comincia il paese. */
  /* In cima lo spazio profondo, poi l'atmosfera che si schiarisce fino all'orizzonte dietro il borgo. */
  background:
    linear-gradient(to bottom,
      var(--sky-space) 0,
      var(--sky-space2) calc(var(--sky-end) * 0.1),
      var(--sky-zenith) calc(var(--sky-end) * 0.24),
      var(--sky-top) calc(var(--sky-end) * 0.6),
      var(--sky-bottom) var(--sky-end)) no-repeat,
    var(--sky-bottom);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  letter-spacing: -0.003em;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
}
img, svg, video { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--sans); font-weight: 600; line-height: 1.08; letter-spacing: -0.022em; margin: 0 0 0.6em; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--calce); padding: 0.6rem 1rem; z-index: 10; font-family: var(--sans); }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Il cielo ---------- */
.sky {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(to bottom, var(--sky-top), var(--sky-bottom));
  color: var(--ink);
}
[data-sky="dark"] .sky { color: var(--calce); }
[data-sky="dark"] .sky :focus-visible { outline-color: var(--lanterna); }
.stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; fill: #fff; opacity: calc(var(--stars) * 0.75); }
.stars .big { opacity: 1; }
.sky-body {
  position: absolute; z-index: -1;
  left: var(--body-x); top: var(--body-y);
  width: clamp(28px, 4vw, 52px); aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: #fff3cf;
  box-shadow: 0 0 0 10px rgba(255, 243, 207, 0.18), 0 0 60px 24px rgba(255, 220, 160, 0.35);
}
[data-body="moon"] .sky-body {
  background: #e9edf5;
  box-shadow: inset -9px -4px 0 0 #c9d0de, 0 0 40px 10px rgba(233, 237, 245, 0.15);
}
.borgo { position: absolute; left: 0; bottom: -1px; width: 100%; z-index: -1; }
.b-far { fill: var(--b-far); }
.b-mid { fill: var(--b-mid); }
.b-hill { fill: var(--b-hill); }
.b-grass { fill: var(--b-grass); }
.b-road { fill: var(--b-road); }
.b-olive { fill: var(--b-olive); }
.b-olived { fill: var(--b-olived); }
.b-cypress { fill: var(--b-cypress); }
.b-stonel { fill: var(--b-stonel); }
.b-stonem { fill: var(--b-stonem); }
.b-stoned { fill: var(--b-stoned); }
.b-roofl { fill: var(--b-roofl); }
.b-roofd { fill: var(--b-roofd); }
.b-ivy { fill: var(--b-ivy); }
.b-hole { fill: var(--b-hole); }
.b-stem { fill: var(--b-stem); } .b-fred { fill: var(--b-fred); } .b-fyel { fill: var(--b-fyel); } .b-fwhite { fill: var(--b-fwhite); } .b-fviolet { fill: var(--b-fviolet); } .b-fpink { fill: var(--b-fpink); }
/* Finestre: buie di giorno, accese di sera. Le aperture del castello restano buie: è un rudere. */
.b-win { fill: color-mix(in oklab, var(--lanterna) calc(var(--win) * 100%), var(--b-hole)); }

/* ---------- Navigazione ---------- */
.nav {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem;
  max-width: var(--wide); margin: 0 auto; width: 100%;
  padding: 1.25rem var(--gutter);
  font-family: var(--sans); font-size: 1.05rem;
}
.nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.4rem; list-style: none; margin: 0; padding: 0; align-items: baseline; }
.nav a { text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: inherit; text-decoration: underline; text-decoration-thickness: 2px; }
.nav-home { font-weight: 700; letter-spacing: 0.01em; }
.nav-cta { padding: 0.2em 0.8em; border: 1.5px solid currentColor; border-radius: 999px; }
.nav-cta:hover { text-decoration: none !important; background: rgba(255, 255, 255, 0.18); }

/* ---------- Contenitori ---------- */
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--measure); }
.prose h2 { font-size: 1.85rem; margin-top: 2.2em; }
.prose h2.section-title { font-size: clamp(2rem, 3.6vw, 2.9rem); margin-top: 0; }
.prose h3 { font-size: 1.35rem; margin-top: 1.8em; margin-bottom: 0.4em; }
.prose ul { padding-left: 1.1em; }
.prose li { margin-bottom: 0.45em; }
.lede { font-size: 1.4rem; line-height: 1.5; }
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section-title { font-size: clamp(2rem, 3.6vw, 2.9rem); margin-bottom: 0.35em; }
.section-intro { max-width: var(--measure); color: var(--ink-2); font-size: 1.25rem; }

/* ---------- Le app in home ---------- */
.apps { padding-top: clamp(3.5rem, 8vw, 6.5rem); }
.app-row {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 6vw, 5.5rem);
  align-items: center;
  padding: clamp(3rem, 7vw, 5.5rem) 0;
  border-top: 1px solid var(--linea);
}
.app-row:nth-of-type(even) .app-motif { order: -1; }
.app-row h3 { font-size: clamp(2.4rem, 4.6vw, 3.6rem); letter-spacing: -0.015em; margin-bottom: 0.2em; }
.app-row h3 a { text-decoration: none; }
.app-row h3 a:hover { color: inherit; text-decoration: underline; text-decoration-thickness: 3px; }
.app-tagline { font-style: italic; font-size: 1.45rem; margin-bottom: 0.9em; }
.app-meta { font-family: var(--sans); color: var(--ink-2); font-size: 1.02rem; }
.app-more { font-family: var(--sans); font-weight: 500; }

/* ---------- Motivi delle app ---------- */
.motif { margin: 0; }
.motif figcaption { font-family: var(--sans); font-size: 0.98rem; color: var(--ink-2); margin-top: 0.9rem; max-width: 30rem; }

.md-page {
  background: #faf9fd;
  border-radius: 6px 18px 18px 6px;
  padding: 1.8rem 2rem 1.8rem 3rem;
  box-shadow: 0 1px 0 rgba(75, 58, 120, 0.12), 0 18px 40px -24px rgba(42, 33, 69, 0.45);
  background-image: linear-gradient(to right, transparent 1.9rem, rgba(217, 84, 153, 0.35) 1.9rem, rgba(217, 84, 153, 0.35) calc(1.9rem + 1px), transparent calc(1.9rem + 1px));
}
.md-label { font-family: var(--sans); font-size: 0.92rem; color: #6c6386; margin-bottom: 0.25em; }
.md-entry { font-family: var(--sans); font-size: 1.12rem; color: #3b3650; margin-bottom: 1.4em; }
.md-tale { font-style: italic; font-size: 1.42rem; line-height: 1.45; color: #3a2b66; margin: 0; }

.motif-pd svg { background: #1f3b28; border-radius: 22px; padding: 1.4rem 1.4rem 0.6rem; width: 100%; }
.pd-time { font-family: var(--sans); font-size: 22px; font-weight: 500; fill: #eef0ec; font-variant-numeric: tabular-nums; }

.bs-shelf {
  display: flex; align-items: flex-end; gap: 4px;
  min-height: 170px; padding: 0 1.4rem;
  border-bottom: 10px solid #0b4f69; border-radius: 0 0 4px 4px;
}
.bs-shelf span { width: var(--w); height: var(--h); background: var(--c); border-radius: 3px 3px 0 0; box-shadow: inset -3px 0 0 rgba(0, 0, 0, 0.12); }
.bs-shelf .bs-reading { translate: 0 -14px; }
.bs-shelf .bs-lean { rotate: 14deg; transform-origin: bottom left; margin-left: 2px; }
.bs-timer { font-family: var(--sans); font-size: 1.05rem; margin: 1rem 0 0; font-variant-numeric: tabular-nums; }
.bs-timer span { color: #e2263a; font-weight: 700; margin-right: 0.35em; }

.kpc-panel { background: var(--notte); border-radius: 18px; padding: 1.6rem 1.4rem 1rem; color: var(--calce); }
.kpc-bars { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; align-items: end; height: 150px; }
.kpc-bars span {
  height: max(3px, calc(var(--v) * 1%));
  background: color-mix(in oklab, var(--lanterna) calc(var(--v) * 1%), #3e5c99);
  border-radius: 2px 2px 0 0;
}
.kpc-marks { position: relative; list-style: none; margin: 0.7rem 0 0; padding: 0; height: 2.6rem; font-family: var(--sans); font-size: 0.85rem; }
.kpc-marks li { position: absolute; left: calc(var(--at) / 24 * 100%); white-space: nowrap; padding-left: 0.4rem; border-left: 1px solid rgba(238, 240, 236, 0.4); line-height: 1.2; }
.kpc-marks li:nth-child(even) { top: 1.25rem; }
.kpc-marks li:last-child { translate: -100% 0; border-left: 0; border-right: 1px solid rgba(238, 240, 236, 0.4); padding: 0 0.4rem 0 0; }

/* ---------- Pagina di un'app ---------- */
.app-hero { color: var(--calce); background: var(--app, var(--notte)); padding: clamp(3.5rem, 8vw, 6rem) 0; overflow: hidden; }
.app-hero :focus-visible { outline-color: var(--lanterna); }
.app-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.app-hero h1 { font-size: clamp(2.8rem, 6vw, 5rem); letter-spacing: -0.02em; margin-bottom: 0.15em; }
.app-hero .app-tagline { font-size: clamp(1.4rem, 2.2vw, 1.8rem); }
.app-hero .app-meta { color: rgba(238, 240, 236, 0.78); }
.app-hero .motif figcaption { color: rgba(238, 240, 236, 0.75); }
.app-hero .motif-pd svg { background: rgba(0, 0, 0, 0.22); }
.app-hero .kpc-panel { background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px rgba(238, 240, 236, 0.12); }
.app-hero .bs-timer { color: var(--calce); }
.app-hero .bs-timer span { color: #ff8a98; }
.app-hero .bs-shelf { border-bottom-color: #87cede; }
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem 1.4rem; align-items: center; margin-top: 1.6rem; font-family: var(--sans); }
.button {
  display: inline-block; text-decoration: none; font-weight: 700; font-size: 1.08rem;
  background: var(--lanterna); color: var(--ink);
  padding: 0.7em 1.3em; border-radius: 999px;
}
.button:hover { color: var(--ink); background: #ffc95e; }
.app-hero .actions a:not(.button):hover { color: var(--lanterna); }
.app-video { width: 100%; border-radius: 22px; }

.app-body { display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); }
.trust { align-self: start; position: sticky; top: 2rem; background: var(--panel); border-radius: 14px; padding: 1.6rem 1.7rem; font-family: var(--sans); font-size: 1.05rem; }
.trust h2 { font-family: var(--serif); font-size: 1.45rem; }
.trust ul { margin: 0; padding-left: 1.1em; }
.trust li { margin-bottom: 0.6em; }
.prose .techniques { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1.2rem 2rem; margin: 1.2rem 0 1.6rem; padding: 0; list-style: none; }
.techniques li { margin: 0; }
.techniques strong { display: block; font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: 1.3rem; }
.techniques span { color: var(--ink-2); font-size: 1.05rem; }

.made { background: transparent; }
.made-grid { display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); }
.other-apps { display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; font-size: 1.45rem; list-style: none; padding: 0; margin: 0; }
.other-apps a { text-decoration: none; font-weight: 700; }
.other-apps a:hover { text-decoration: underline; }

/* ---------- Iscrizione ---------- */
.subscribe h2 { font-size: 1.7rem; margin-bottom: 0.3em; }
.subscribe-promise { color: var(--ink-2); }
.subscribe-form { font-family: var(--sans); max-width: 32rem; }
.field label { display: block; font-weight: 500; margin-bottom: 0.35rem; }
.field-row { display: flex; gap: 0.5rem; }
.field-row input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.08rem;
  padding: 0.7em 0.9em; border: 1.5px solid var(--field-line); border-radius: 10px; background: var(--field); color: var(--ink);
}
.field-row input:focus-visible { outline-offset: 1px; }
.field-row button {
  font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer;
  padding: 0.7em 1.2em; border: 0; border-radius: 10px; background: var(--ink); color: var(--page);
}
.field-row button:hover { background: #2e3a4f; }
.consent { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0.9rem 0 0.4rem; font-size: 0.98rem; line-height: 1.45; }
.consent input { margin-top: 0.22em; width: 1.05rem; height: 1.05rem; flex: none; accent-color: var(--ink); }
.subscribe-fine { font-size: 0.92rem; color: var(--ink-2); margin: 0; }
.subscribe-status:not(:empty) { margin: 0.8rem 0 0; font-weight: 500; }

/* ---------- Writing ---------- */
.post-list { list-style: none; padding: 0; margin: 2rem 0 0; max-width: var(--measure); }
.post-list li { padding: 1.4rem 0; border-top: 1px solid var(--linea); }
.post-list a { font-size: 1.6rem; font-weight: 700; text-decoration: none; }
.post-list a:hover { text-decoration: underline; }
.post-list p { margin: 0.3rem 0 0; color: var(--ink-2); }
.post-meta { font-family: var(--sans); color: var(--ink-2); font-size: 1rem; }
.empty { max-width: var(--measure); background: var(--panel); border-radius: 14px; padding: 1.8rem 2rem; margin-top: 2rem; }
.empty h2 { font-size: 1.6rem; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.portrait { border-radius: 16px; width: 100%; max-width: 22rem; height: auto; }

/* ---------- Footer ---------- */
.footer { --footer-ground: color-mix(in oklab, var(--b-hill) 38%, #0b1120); background: linear-gradient(to bottom, transparent 0, transparent var(--footer-sky, 0px), var(--footer-ground) var(--footer-sky, 0px)); color: var(--calce); padding: 0 0 2rem; font-family: var(--sans); font-size: 1.02rem; }
.footer a:hover { color: var(--lanterna); }
.footer :focus-visible { outline-color: var(--lanterna); }
.footer-inner { max-width: var(--wide); margin: 0 auto; padding: 3rem var(--gutter) 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 2rem; }
.footer-title { font-weight: 700; margin-bottom: 0.6em; color: var(--lanterna); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 0.45em; overflow-wrap: anywhere; }
.footer-legal { max-width: var(--wide); margin: 3rem auto 0; padding: 0 var(--gutter); color: rgba(238, 240, 236, 0.7); font-size: 0.95rem; }

/* ---------- Schermi stretti ---------- */
@media (max-width: 52rem) {
  .app-row, .app-hero-grid, .app-body, .made-grid, .about-grid { grid-template-columns: minmax(0, 1fr); }
  .app-row:nth-of-type(even) .app-motif { order: 0; }
  .trust { position: static; }
  .stars { opacity: calc(var(--stars) * 0.45); }
  .field-row { flex-direction: column; }
}
@media (max-width: 30rem) {
  .md-page { padding: 1.4rem 1.2rem 1.4rem 2.4rem; background-image: linear-gradient(to right, transparent 1.4rem, rgba(217, 84, 153, 0.35) 1.4rem, rgba(217, 84, 153, 0.35) calc(1.4rem + 1px), transparent calc(1.4rem + 1px)); }
  .kpc-marks { font-size: 0.75rem; }
  .bs-shelf span { width: calc(var(--w) * 0.75); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Ritocchi dopo la verifica ---------- */
.prose > :first-child { margin-top: 0; }

/* ---------- Hero: la persona prima di tutto ---------- */
.nav { color: var(--ink); }
.nav-cta:hover { background: rgba(29, 36, 48, 0.06); }
.hero { padding: clamp(1rem, 3vw, 2.5rem) 0 clamp(3.5rem, 8vw, 6rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 6vw, 5.5rem); align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 5.4vw, 4.8rem); letter-spacing: -0.02em; max-width: 13ch; margin-bottom: 0.4em; }
.hero-sub { font-size: clamp(1.2rem, 1.7vw, 1.45rem); line-height: 1.5; max-width: 32rem; }
.hero-apps { list-style: none; padding: 0; margin: 2rem 0 1.5rem; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.hero-app {
  display: inline-block; text-decoration: none; color: var(--calce); background: var(--app);
  font-family: var(--sans); font-weight: 700; font-size: 1.05rem;
  padding: 0.55em 1.05em; border-radius: 999px;
}
.hero-app:hover { color: var(--calce); text-decoration: underline; text-decoration-thickness: 2px; }
.hero-links { font-family: var(--sans); display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; }
.hero-photo { margin: 0; }
.hero-photo img { width: 100%; height: auto; border-radius: 28px; box-shadow: 0 34px 60px -34px rgba(29, 36, 48, 0.55); }
.hero-photo figcaption { font-family: var(--sans); color: var(--ink-2); font-size: 1rem; margin-top: 0.9rem; }

/* ---------- Il borgo, in chiusura ---------- */
.sky--footer { min-height: clamp(15rem, 30vw, 23rem); }
.sky--footer .borgo { height: clamp(11rem, 23vw, 18rem); }
.sky-caption { position: relative; max-width: var(--wide); margin: 0 auto; padding: 2rem var(--gutter) 0; font-family: var(--sans); font-size: 1.02rem; }
.sky-caption { max-width: min(var(--wide), 100%); }
.footer .sky :focus-visible { outline-color: var(--lanterna); }

@media (max-width: 52rem) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-photo { order: -1; max-width: 17rem; }
  .stars { opacity: calc(var(--stars) * 0.6); }
}

/* ---------- Hero: chi sono e cosa garantisco ---------- */
.hero-name { font-family: var(--sans); font-size: 1.2rem; font-weight: 500; color: var(--ink-2); margin-bottom: 0.5em; }
.hero h1 { max-width: 11ch; font-size: clamp(3rem, 6.6vw, 5.8rem); line-height: 1.02; }
.hero-cred { font-family: var(--sans); font-size: 1.05rem; color: var(--ink-2); max-width: 34rem; border-left: 3px solid var(--lanterna); padding-left: 0.9rem; margin-top: 1.4rem; }

/* ---------- Le app come casi: cosa sanno e dove lo tengono ---------- */
.cases { padding-top: clamp(3.5rem, 8vw, 6rem); }
.cases-intro { padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.cases-intro .section-title { max-width: 18ch; }
.case { background: var(--app); color: var(--calce); overflow: hidden; }
.case :focus-visible { outline-color: var(--lanterna); }
.case a:hover { color: var(--lanterna); }
.case-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; padding-top: clamp(3rem, 7vw, 5rem); }
.case-text { padding-bottom: clamp(3rem, 7vw, 5rem); }
.case-platform { font-family: var(--sans); font-size: 1rem; color: rgba(238, 240, 236, 0.72); margin-bottom: 0.2em; }
.case h3 { font-size: clamp(2.4rem, 4.6vw, 3.6rem); letter-spacing: -0.015em; margin-bottom: 0.15em; }
.case h3 a { text-decoration: none; }
.case-tagline { font-style: italic; font-size: 1.45rem; margin-bottom: 0.8em; }
.case-summary { max-width: 34rem; }
.case .button:hover { color: var(--ink); }

.ledger { margin: 1.6rem 0 1.8rem; max-width: 36rem; }
.ledger-row { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.4rem 1.2rem; padding: 0.75rem 0; border-top: 1px solid rgba(238, 240, 236, 0.22); }
.ledger-row:last-child { border-bottom: 1px solid rgba(238, 240, 236, 0.22); }
.ledger dt { font-family: var(--sans); font-weight: 700; font-size: 0.98rem; color: var(--lanterna); padding-top: 0.15em; }
.ledger dd { margin: 0; font-size: 1.05rem; line-height: 1.5; }
.trust .ledger { margin: 0.4rem 0 0; }
.trust .ledger-row { grid-template-columns: minmax(0, 1fr); border-color: rgba(29, 36, 48, 0.16); }
.trust .ledger dt { color: var(--accent-ink); }
.trust .ledger dd { font-family: var(--serif); }

/* Schermate: i telefoni salgono dal bordo inferiore della fascia */
.case-shots { align-self: end; }
.shots--phone { display: flex; justify-content: center; align-items: flex-end; }
.shots--phone img { width: 34%; height: auto; border-radius: 13% / 6%; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.55); }
.shots--phone img:nth-child(1) { translate: 12% 8%; z-index: 1; }
.shots--phone img:nth-child(2) { z-index: 2; width: 38%; }
.shots--phone img:nth-child(3) { translate: -12% 8%; z-index: 1; }
.case .shots--phone img { margin-bottom: -12%; }
.shots--mac { position: relative; }
.shots--mac img { width: 100%; height: auto; border-radius: 12px; box-shadow: 0 0 0 1px rgba(238, 240, 236, 0.12), 0 24px 50px -20px rgba(0, 0, 0, 0.6); }
.shots--mac img:nth-child(2) { width: 62%; position: absolute; right: -6%; bottom: 0; }
.case .motif { padding-bottom: clamp(3rem, 7vw, 5rem); }
.case .motif-pd svg { background: rgba(0, 0, 0, 0.22); }
.case .motif figcaption { color: rgba(238, 240, 236, 0.75); }
.app-hero .shots--phone img { margin-bottom: 0; }

/* ---------- Lo scaffale ---------- */
.shelf {
  list-style: none; margin: 2.2rem 0 1.4rem; padding: 0 0.6rem;
  display: flex; align-items: flex-end; gap: 3px;
  overflow-x: auto; scrollbar-width: thin;
  border-bottom: 12px solid #c9a46b; box-shadow: 0 12px 0 0 #a8844f;
}
.spine {
  flex: none; width: 2.35rem; height: calc(var(--h) * 2.6px);
  background: var(--c); color: var(--t);
  border-radius: 3px 3px 0 0;
  box-shadow: inset -3px 0 0 rgba(0, 0, 0, 0.14), inset 2px 0 0 rgba(255, 255, 255, 0.18);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.spine span {
  writing-mode: vertical-rl; font-family: var(--sans); font-weight: 700; font-size: 0.72rem; line-height: 1.1;
  max-height: calc(100% - 1rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.spine--first { outline: 2px solid var(--lanterna); outline-offset: 2px; }
.shelf-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.6rem 3rem; margin-top: 2.5rem; }
.shelf-lists h3 { font-size: 1.25rem; margin-bottom: 0.4em; }
.shelf-lists ul { list-style: none; padding: 0; margin: 0; }
.shelf-lists li { font-size: 1.02rem; margin-bottom: 0.35em; color: var(--ink-2); }
.shelf-lists cite { font-style: italic; color: var(--ink); }

@media (max-width: 52rem) {
  .case-grid { grid-template-columns: minmax(0, 1fr); }
  .case-text { padding-bottom: 0; }
  .ledger-row { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }
  .shots--phone img { width: 30%; }
  .shots--phone img:nth-child(2) { width: 34%; }
}
/* Telefoni più grandi nelle fasce della home */
.case .shots--phone img { width: 41%; margin-bottom: -22%; }
.case .shots--phone img:nth-child(2) { width: 47%; }
.case .shots--phone img:nth-child(1) { translate: 16% 10%; }
.case .shots--phone img:nth-child(3) { translate: -16% 10%; }
@media (max-width: 52rem) {
  .case-shots { margin-top: 1rem; }
  .case .shots--phone img { width: 36%; margin-bottom: -28%; }
  .case .shots--phone img:nth-child(2) { width: 42%; }
}
/* Lo scaffale completo scorre in orizzontale: la sfumatura a destra lo segnala */
#shelf .shelf { -webkit-mask-image: linear-gradient(to right, #000 90%, transparent); mask-image: linear-gradient(to right, #000 90%, transparent); padding-right: 4rem; }
/* I ritagli hanno lo sfondo trasparente: niente angoli finti, l'ombra segue la sagoma del telefono */
.shots--phone img { border-radius: 0; box-shadow: none; filter: drop-shadow(0 22px 28px rgba(0, 0, 0, 0.45)); }

/* ---------- L'approccio ---------- */
.approach { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.approach-list { list-style: none; margin: 2rem 0 0; padding: 0; }
.approach-list li { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0.6rem clamp(2rem, 5vw, 4rem); padding: 1.8rem 0; border-top: 1px solid var(--linea); }
.approach-list li:last-child { border-bottom: 1px solid var(--linea); }
.approach-list h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin: 0; }
.approach-list p { margin: 0; max-width: 38rem; font-size: 1.12rem; }
@media (max-width: 52rem) { .approach-list li { grid-template-columns: minmax(0, 1fr); } }
/* Il borgo nel footer mostra sempre tutta la sua altezza; sugli schermi stretti si tagliano i lati, non il paese */
.sky--footer { min-height: 0; }
.sky--footer .borgo { position: relative; display: block; bottom: auto; width: 100%; height: auto; min-height: 13rem; margin-top: 0.5rem; }

/* ---------- Foto più contenuta: il titolo resta il protagonista ---------- */
.hero-grid { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.hero-photo { max-width: 19rem; justify-self: end; }
@media (max-width: 52rem) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-photo { order: -1; max-width: 9rem; justify-self: start; }
  .hero-photo img { border-radius: 18px; }
  .hero-photo figcaption { font-size: 0.9rem; }
}

/* ---------- Galleria delle schermate nelle pagine delle app ---------- */
.gallery-section { padding-bottom: clamp(2rem, 5vw, 3rem); }
.gallery {
  list-style: none; margin: 1.5rem 0 0; padding: 0.5rem max(var(--gutter), calc((100% - var(--wide)) / 2 + var(--gutter))) 1.5rem;
  display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
}
.gallery li { flex: none; scroll-snap-align: start; }
.gallery img { width: clamp(11rem, 22vw, 15rem); height: auto; border-radius: 14px; box-shadow: 0 14px 30px -18px rgba(29, 36, 48, 0.5); }
.gallery--mac img { width: clamp(18rem, 44vw, 30rem); }
.gallery:focus-visible { outline-offset: -3px; }

/* ---------- Invito finale verso sito e App Store ---------- */
.detail-cta { background: var(--app); color: var(--calce); padding: clamp(2.5rem, 6vw, 4rem) 0; }
.detail-cta :focus-visible { outline-color: var(--lanterna); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 1.5rem 4rem; align-items: center; }
.detail-cta h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 0.3em; }
.detail-cta p { margin: 0; max-width: 34rem; color: rgba(238, 240, 236, 0.85); }
.detail-cta .actions { margin-top: 0; justify-content: flex-end; }
.button--ghost { background: transparent; color: var(--calce); box-shadow: inset 0 0 0 1.5px currentColor; }
.button--ghost:hover { background: rgba(255, 255, 255, 0.1); color: var(--calce); }
@media (max-width: 52rem) { .detail-grid { grid-template-columns: minmax(0, 1fr); } .detail-cta .actions { justify-content: flex-start; } }

/* ---------- Le app senza fasce colorate: il colore sta solo dentro la cornice ---------- */
.case { background: transparent; color: var(--ink); padding-bottom: clamp(4rem, 9vw, 7rem); }
.case :focus-visible { outline-color: var(--ink); }
.case a:hover { color: var(--accent-ink); }
.case .button:hover { color: var(--ink); }
.case-stage {
  position: relative; overflow: hidden; border-radius: 28px;
  background: color-mix(in oklab, var(--app) 16%, var(--page));
  min-height: clamp(20rem, 38vw, 30rem);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 2.5rem 1.5rem 0;
}
.case-stage .shots--phone { width: 100%; max-width: 46rem; }
.case .case-stage .shots--phone img, .app-hero .case-stage .shots--phone img { width: 30%; margin-bottom: -10%; }
.case .case-stage .shots--phone img:nth-child(2), .app-hero .case-stage .shots--phone img:nth-child(2) { width: 34%; }
.case-stage--video { background: var(--app); padding: 0; min-height: 0; display: block; }
.stage-video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--app); }
.case-stage--motif { align-items: center; padding: 2.5rem; }
.case-stage--motif .motif { width: min(100%, 26rem); padding: 0; }
.case-stage--motif .motif-pd svg { background: var(--app); }
.case-stage--motif .motif figcaption { color: var(--ink-2); }
.case-body { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 1.5rem clamp(2rem, 6vw, 5rem); margin-top: clamp(1.8rem, 4vw, 2.6rem); }
.case-text, .case-ledger { padding: 0; }
.case-platform { color: var(--ink-2); }
.case h3 { color: var(--ink); }
.case-ledger-title { font-family: var(--sans); font-weight: 700; margin: 0.4rem 0 0; }
.case .ledger { margin-top: 0.6rem; }
.case .ledger-row { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; border-color: var(--linea); }
.case .ledger-row:last-child { border-color: var(--linea); }
.case .ledger dt { color: var(--accent-ink); }
@media (max-width: 52rem) {
  .case-body { grid-template-columns: minmax(0, 1fr); }
  .case-stage { min-height: 17rem; padding: 1.8rem 0.8rem 0; border-radius: 20px; }
}

/* Pagina app: stesso principio, testo su fondo chiaro e media nella cornice */
.app-hero { background: transparent; color: var(--ink); padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 6vw, 4.5rem); }
.app-hero .app-meta { color: var(--ink-2); }
.app-hero .actions a:not(.button):hover { color: var(--accent-ink); }
.app-hero :focus-visible { outline-color: var(--ink); }
.app-hero .case-stage { min-height: clamp(18rem, 32vw, 26rem); }
.app-hero .case-stage--video { min-height: 0; }

/* Invito finale: una cornice tinta, non una fascia */
.detail-cta { background: transparent; color: var(--ink); padding: clamp(2rem, 5vw, 3.5rem) 0; }
.detail-cta .detail-grid { background: color-mix(in oklab, var(--app) 16%, var(--page)); border-radius: 24px; padding: clamp(1.6rem, 4vw, 2.6rem); }
.detail-cta p { color: var(--ink); }
.detail-cta :focus-visible { outline-color: var(--ink); }
.button--ghost { color: var(--ink); box-shadow: inset 0 0 0 1.5px currentColor; }
.button--ghost:hover { background: rgba(29, 36, 48, 0.06); color: var(--ink); }

/* ---------- La pagina segue l'ora ---------- */
[data-theme="dark"] {
  --page: #10182f;
  --ink: #e9ecf2;
  --ink-2: #a9b0bd;
  --panel: color-mix(in oklab, var(--page) 90%, #ffffff);
  --field: #1b2440;
  --field-line: #4a5672;
  --accent-ink: #f2b544;
  --linea: rgba(233, 236, 242, 0.16);
}
/* Il testo dei pulsanti ambra resta scuro con qualsiasi tema */
.button, .button:hover, .case .button:hover { color: #1d2430; }
.field-row button:hover { background: var(--ink-2); }
[data-theme="dark"] .md-page { box-shadow: none; }
[data-theme="dark"] .hero-photo img, [data-theme="dark"] .gallery img { box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7); }
[data-theme="dark"] .button--ghost:hover { background: rgba(255, 255, 255, 0.08); }
/* In fondo, la pagina sfuma nel cielo del borgo */
.sky--footer { background: transparent; }
.sky-caption { color: var(--ink); }
[data-theme="dark"] .hero-app { box-shadow: inset 0 0 0 1.5px rgba(233, 236, 242, 0.28); }

/* ---------- La pagina è il cielo: ogni blocco ha il tono del cielo che ha dietro ---------- */
[data-theme="light"] {
  --ink: #1d2430;
  --field: #ffffff;
  --field-line: #7d857d;
  --accent-ink: #4a3000;
  --linea: rgba(29, 36, 48, 0.18);
}
[data-theme="light"], [data-theme="dark"] {
  /* Il testo secondario si mescola col cielo di quel punto, così il contrasto regge a ogni ora. */
  --ink-2: color-mix(in oklab, var(--ink) 78%, var(--page));
  --panel: color-mix(in oklab, var(--page) 86%, var(--ink));
  color: var(--ink);
}

/* ---------- Pomodrop: il timer vero, sullo sfondo verde e rosso dell'app ---------- */
.case-stage--still {
  align-items: center; padding: clamp(1.5rem, 4vw, 2.5rem);
  background: linear-gradient(to bottom, #0d301d 0%, #0d301d 16%, #1e2f1c 26%, #3a2415 41%, #541411 55%, #440e11 100%);
}
.stage-still { width: auto; height: clamp(16rem, 30vw, 24rem); max-width: 100%; }
.app-video { padding-top: 0; }
.app-video .case-stage--video { max-width: 64rem; margin: 0 auto; }
/* Galleria di mockup con la cornice del telefono: niente angoli né ombra rettangolare, l'ombra segue la cornice. */
.gallery--phones img, [data-theme="dark"] .gallery--phones img { border-radius: 0; box-shadow: none; filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.35)); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ---------- Revisione stile Apple, misurato ---------- */
/* Niente corsivi: i sottotitoli sono testo pieno, un po' più grande. */
.app-tagline, .case-tagline, .md-tale { font-style: normal; font-weight: 500; letter-spacing: -0.01em; }
.hero h1 { letter-spacing: -0.035em; line-height: 1.0; }
.case h3, .app-row h3, .app-hero h1 { letter-spacing: -0.03em; }
/* Etichette di "Where your data goes": colore del testo, non marrone, per il contrasto sul cielo. */
.ledger dt, .case .ledger dt, .trust .ledger dt { color: var(--ink); font-weight: 600; opacity: 0.8; }
.ledger dd { font-size: 1rem; }
/* Meno vuoto tra l'apertura e le app. */
.hero { padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.cases { padding-top: clamp(1.5rem, 4vw, 3rem); }
@media (min-width: 52.01rem) { .hero-photo { max-width: 20rem; justify-self: end; } }
/* Meno cielo vuoto prima del borgo: la frase sta subito sopra le colline. */
.sky--footer { min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.sky-caption { padding-top: clamp(1rem, 3vw, 2rem); padding-bottom: 0.5rem; }
.sky--footer .sky-caption { width: 100%; align-self: stretch; }

/* ---------- Ombre: solo dove aiutano a leggere o a staccare un oggetto dal cielo ---------- */
/* Testo chiaro sul cielo: un'ombra corta e morbida, appena percepibile, che regge anche sui toni medi. */
[data-theme="dark"] { text-shadow: 0 1px 2px rgba(6, 12, 30, 0.22); }
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3 { text-shadow: 0 2px 14px rgba(6, 12, 30, 0.22), 0 1px 2px rgba(6, 12, 30, 0.2); }
/* Dentro bottoni, campi e pannelli il testo resta pulito. */
button, input, .button, .hero-app, .case-stage, .footer, .gallery { text-shadow: none; }
/* I riquadri con i telefoni e la foto si staccano dal cielo come oggetti appoggiati sopra. */
.case-stage { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 34px 60px -36px rgba(6, 12, 30, 0.45); }
.hero-photo img { box-shadow: 0 2px 6px rgba(6, 12, 30, 0.18), 0 34px 60px -30px rgba(6, 12, 30, 0.55); }
/* Pillole delle app e pulsanti: un rilievo minimo, come i controlli di sistema. */
.hero-app { box-shadow: 0 6px 14px -8px rgba(6, 12, 30, 0.55); }
.button:not(.button--ghost), .subscribe-form button { box-shadow: 0 8px 18px -10px rgba(6, 12, 30, 0.5); }
.note { display: block; margin-top: 0.4em; font-size: 0.9rem; color: var(--ink-2); }

/* ---------- Now ---------- */
.now { padding: clamp(1rem, 3vw, 2rem) 0 clamp(2.5rem, 6vw, 4rem); }
.now-card {
  max-width: 44rem; padding: clamp(1.4rem, 3vw, 2rem) clamp(1.4rem, 3vw, 2.2rem);
  border-radius: 22px; background: color-mix(in oklab, var(--page) 82%, #ffffff);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 24px 50px -32px rgba(6, 12, 30, 0.45);
  text-shadow: none;
}
[data-theme="dark"] .now-card { background: color-mix(in oklab, var(--page) 86%, #ffffff); }
.now-title { font-size: 1.35rem; margin: 0 0 0.8rem; display: flex; align-items: baseline; gap: 0.7rem; }
.now-date { font-size: 0.9rem; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.now-list { margin: 0; display: grid; gap: 0.7rem; }
.now-list > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem; }
.now-list dt { font-weight: 600; color: var(--ink-2); }
.now-list dd { margin: 0; }
@media (max-width: 30rem) { .now-list > div { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; } }
[data-theme="light"], [data-theme="light"] h1, [data-theme="light"] h2, [data-theme="light"] h3 { text-shadow: none; }
.about-grid .portrait { position: sticky; top: 2rem; }
.press-title { font-size: clamp(1.5rem, 2.4vw, 2rem); margin-top: clamp(3rem, 6vw, 4.5rem); }
.press-list { list-style: none; padding: 0; margin: 0; max-width: 44rem; }
.press-list li { padding: 1rem 0; border-top: 1px solid var(--linea); }
.press-list a { font-weight: 600; }
.press-list .post-meta { margin: 0.3rem 0 0; font-size: 0.92rem; color: var(--ink-2); }
.highlights { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 1.1rem; }
.highlights li { display: grid; gap: 0.2rem; padding-left: 1rem; border-left: 2px solid color-mix(in oklab, var(--ink) 30%, transparent); }
.highlights strong { font-weight: 600; }
.highlights span { color: var(--ink-2); }
.consent input[type="checkbox"] { width: 1.25rem; height: 1.25rem; flex: none; }
.detail-cta h2, .detail-cta p { color: var(--ink); text-shadow: none; }
.button.button--ghost, .button.button--ghost:hover { color: var(--ink); }
