/* BubbleNotes — sito ufficiale.
   Palette dal marchio dell'app (kprimo #6F1520). Font self-hosted: nessuna
   richiesta a terzi, quindi nessun consenso da chiedere. */

@font-face {
  font-family: "Unbounded";
  src: url("/fonts/unbounded-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson";
  src: url("/fonts/atkinson-hyperlegible-next-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson";
  src: url("/fonts/atkinson-hyperlegible-next-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --wine: #6f1520;
  --wine-deep: #4a0c14;
  --wine-soft: #8e2a36;
  --rose: #f8eced;
  --paper: #ffffff;
  --ink: #2a1418;
  --muted: #6d5559;
  --line: #ead5d7;
  --marker: #ffe36e;
  --ok: #1f6f43;
  --err: #a3121f;

  --display: "Unbounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  --text: "Atkinson", system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 64ch;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b0d10;
    --rose: #26141a;
    --ink: #f6e9ea;
    --muted: #c9aeb2;
    --line: #3b2228;
    --ok: #6fd39b;
    --err: #ff8a93;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1em; }

:focus-visible {
  outline: 3px solid var(--marker);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute; left: 12px; top: -60px;
  background: var(--marker); color: #2a1418;
  padding: 10px 14px; border-radius: 10px; z-index: 10;
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- marchio ---------- */
.mark { width: auto; height: 100%; }
.mark .h { stroke: var(--logo-bg, var(--wine)); stroke-width: 96; }
.mark .f { stroke: var(--logo-fg, #fff); stroke-width: 48; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 600; font-size: 1.05rem;
  letter-spacing: -0.01em; text-decoration: none;
}
.brand .mark { height: 40px; }
/* A 40px il tratto del marchio scende sotto il pixel: lo ispessiamo. */
.brand .mark .f { stroke-width: 86; }
.brand .mark .h { stroke-width: 150; }

/* ---------- header ---------- */
.site-head {
  --logo-bg: var(--wine); --logo-fg: #fff;
  background: var(--wine); color: #fff;
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 72px;
}
.site-nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); }
.site-nav a { text-decoration: none; font-weight: 700; opacity: .88; }
.site-nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 5px; }
.site-nav .nav-link { display: none; }
@media (min-width: 760px) { .site-nav .nav-link { display: inline; } }

/* ---------- bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 700 1rem/1 var(--text); text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: background-color .15s, color .15s, border-color .15s;
}
.btn-light { background: #fff; color: var(--wine); }
.btn-light:hover { background: var(--marker); color: #2a1418; }
.btn-ghost { border-color: rgba(255,255,255,.55); color: #fff; background: transparent; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.btn-wine { background: var(--wine); color: #fff; }
.btn-wine:hover { background: var(--wine-deep); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.site-nav .btn { min-height: 40px; padding: 0 16px; font-size: .95rem; }

/* ---------- hero ---------- */
.hero {
  --logo-bg: var(--wine);
  background: var(--wine); color: #fff;
  padding: clamp(28px, 6vw, 72px) 0 clamp(56px, 8vw, 104px);
  position: relative; overflow: hidden;
}
.hero-grid {
  display: grid; gap: clamp(28px, 5vw, 56px);
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); } }

.hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.1rem, 5vw, 3.7rem); line-height: 1.04;
  letter-spacing: -0.035em; margin: 0 0 .5em; max-width: 16ch;
  text-wrap: balance;
}
.hero .lede { font-size: clamp(1.08rem, 1.6vw, 1.25rem); max-width: 42ch; color: #f6dfe1; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-note { margin-top: 18px; font-size: .95rem; color: #eccbcf; }

/* La mappa di bolle: il pezzo memorabile della pagina. */
.bubbles {
  position: relative; width: 100%; max-width: 620px; margin-inline: auto;
  aspect-ratio: 1 / 0.92;
}
.bubbles svg.links { position: absolute; inset: 0; width: 100%; height: 100%; }
.bubbles .links line { stroke: rgba(255,255,255,.4); stroke-width: 2px; stroke-dasharray: 2px 8px; stroke-linecap: round; vector-effect: non-scaling-stroke; }

.bub {
  position: absolute; transform: translate(-50%, -50%);
  display: grid; place-items: center; text-align: center;
  border-radius: 50%; border: 3px solid #fff; background: var(--wine);
  color: #fff; font: 700 clamp(.72rem, 1.6vw, .95rem)/1.15 var(--text);
  cursor: pointer; padding: 6px;
  transition: background-color .18s, color .18s, transform .18s;
}
.bub:hover { background: var(--wine-soft); }
.bub[aria-pressed="true"] { background: #fff; color: var(--wine); }
.bub.core {
  cursor: default; border-width: 4px;
  font: 600 clamp(.72rem, 1.5vw, .92rem)/1.25 var(--display);
  letter-spacing: -0.01em;
}
.bub.core small { display: block; font: 400 .78em/1.3 var(--text); opacity: .85; margin-top: 4px; letter-spacing: 0; }
@media (prefers-reduced-motion: no-preference) {
  .bub:not(.core):active { transform: translate(-50%, -50%) scale(.95); }
}

.demo-panel {
  margin-top: 18px; background: #fff; color: var(--ink);
  border-radius: 22px; padding: 20px 22px; min-height: 176px;
  box-shadow: 0 18px 50px -20px rgba(20, 0, 5, .55);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .demo-panel { color: #2a1418; } }
.demo-panel h2 { font: 600 1rem/1.3 var(--display); margin: 0 0 10px; letter-spacing: -0.01em; }
.demo-panel p { margin: 0 0 .6em; }
.demo-panel .tag { font-size: .85rem; color: #6d5559; margin: 0 0 6px; }
.demo-panel mark { background: var(--marker); color: inherit; padding: 0 .15em; border-radius: 3px; }
.quiz-opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.quiz-opts button {
  font: 700 .95rem var(--text); min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 2px solid #ead5d7; background: #fff; color: #2a1418; cursor: pointer;
}
.quiz-opts button:hover { border-color: var(--wine); }
.quiz-opts button.right { background: #e3f4ea; border-color: #1f6f43; }
.quiz-opts button.wrong { background: #fbe4e6; border-color: #a3121f; }
.flip {
  width: 100%; min-height: 96px; border-radius: 16px; border: 2px dashed #ead5d7;
  background: #fff9f9; color: #2a1418; font: 400 1rem/1.45 var(--text); padding: 14px 16px; cursor: pointer; text-align: left;
}
.flip strong { font-family: var(--display); font-weight: 600; }
.tree { margin: 0; padding-left: 1.1em; }
.tree ul { padding-left: 1.1em; margin: 2px 0 6px; }
.wave { display: flex; align-items: center; gap: 3px; height: 40px; margin: 6px 0 10px; }
.wave i { display: block; width: 5px; border-radius: 3px; background: var(--wine); opacity: .8; }
.voice { display: grid; gap: 8px; }
.voice p { margin: 0; padding: 10px 14px; border-radius: 16px; background: #f8eced; max-width: 92%; }
.voice p.me { justify-self: end; background: #fff4c2; }

/* ---------- sezioni ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-alt { background: var(--rose); }
.section h2 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.5rem); line-height: 1.1;
  letter-spacing: -0.03em; margin: 0 0 .6em; max-width: 22ch; text-wrap: balance;
}
.section .intro { max-width: var(--measure); color: var(--muted); font-size: 1.12rem; }

.steps {
  list-style: none; margin: 48px 0 0; padding: 0;
  display: grid; gap: 28px; counter-reset: step;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.steps li { counter-increment: step; position: relative; padding-top: 72px; }
.steps li::before {
  content: counter(step);
  position: absolute; top: 0; left: 0;
  width: 52px; height: 52px; border-radius: 50%;
  border: 3px solid var(--wine); color: var(--wine);
  display: grid; place-items: center;
  font: 700 1.2rem/1 var(--display);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .steps li::before { border-color: var(--ink); color: var(--ink); } }
.steps h3, .split h3 { font: 600 1.15rem/1.3 var(--display); margin: 0 0 8px; letter-spacing: -0.01em; }
.steps p { color: var(--muted); max-width: 38ch; }

.split { display: grid; gap: clamp(32px, 5vw, 64px); align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }

.facts { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 18px; }
.facts li { padding-left: 34px; position: relative; max-width: 52ch; }
.facts li::before {
  content: ""; position: absolute; left: 0; top: .3em;
  width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--wine);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .facts li::before { border-color: var(--ink); } }

/* anteprima filtro marketplace */
.market-mock {
  background: var(--paper); border: 1px solid var(--line); border-radius: 24px;
  padding: clamp(18px, 3vw, 28px);
}
.fake-search {
  display: flex; align-items: center; gap: 10px;
  border: 2px solid var(--line); border-radius: 999px; padding: 10px 16px;
  color: var(--muted); font-weight: 700;
}
.fake-search svg { width: 18px; height: 18px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.chip { border: 2px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: .9rem; font-weight: 700; }
.chip.on { background: var(--wine); border-color: var(--wine); color: #fff; }
.note-row {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.note-row .ico { width: 44px; height: 44px; border-radius: 50%; background: var(--rose); display: grid; place-items: center; font-weight: 800; color: var(--wine); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .note-row .ico { color: var(--ink); } }
.note-row b { display: block; line-height: 1.25; }
.note-row span { color: var(--muted); font-size: .9rem; }
.price { font-weight: 800; white-space: nowrap; }
.mock-caption { font-size: .85rem; color: var(--muted); margin: 12px 0 0; }

/* ---------- prezzi ---------- */
.table-wrap { overflow-x: auto; margin-top: 40px; border-radius: 20px; border: 1px solid var(--line); background: var(--paper); }
table.plans { width: 100%; border-collapse: collapse; min-width: 620px; font-variant-numeric: tabular-nums; }
.plans caption { text-align: left; padding: 0; }
.plans th, .plans td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.plans thead th { font: 600 1.05rem/1.2 var(--display); letter-spacing: -0.01em; }
.plans thead th small { display: block; font: 700 1.35rem/1.2 var(--text); margin-top: 6px; }
.plans thead th small span { font-size: .8rem; font-weight: 400; color: var(--muted); }
.plans tbody th { font-weight: 700; color: var(--muted); width: 28%; }
.plans tbody tr:last-child th, .plans tbody tr:last-child td { border-bottom: 0; }
.plans .pick { background: var(--rose); }
.packs { margin-top: 20px; color: var(--muted); max-width: var(--measure); }

/* ---------- download ---------- */
.get {
  --logo-bg: var(--wine-deep);
  background: var(--wine-deep); color: #fff; padding: clamp(56px, 8vw, 100px) 0;
}
.get .wrap { display: grid; gap: 28px; align-items: center; }
@media (min-width: 860px) { .get .wrap { grid-template-columns: 1.2fr 1fr; } }
.get h2 { font: 700 clamp(1.6rem, 3.4vw, 2.4rem)/1.1 var(--display); letter-spacing: -0.03em; margin: 0 0 .5em; }
.get p { color: #f0d5d8; max-width: 46ch; }
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex; flex-direction: column; justify-content: center;
  min-height: 56px; padding: 8px 18px; border-radius: 14px;
  border: 2px solid rgba(255,255,255,.35); color: #fff; min-width: 180px;
}
.store small { font-size: .78rem; color: #eccbcf; }
.store b { font-size: 1.05rem; }

/* ---------- footer ---------- */
.site-foot { padding: 40px 0 56px; font-size: .95rem; color: var(--muted); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-foot a { text-decoration: none; font-weight: 700; color: var(--ink); }
.site-foot a:hover { text-decoration: underline; }

/* ---------- pagine semplici (auth, legal, 404) ---------- */
.plain-main { padding: clamp(40px, 8vw, 96px) 0; }
.card {
  width: min(480px, 100%); margin-inline: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: 26px;
  padding: clamp(24px, 5vw, 40px);
}
.card h1, .doc h1 { font: 700 clamp(1.5rem, 3.6vw, 2rem)/1.15 var(--display); letter-spacing: -0.03em; margin: 0 0 .6em; }
.card p { color: var(--muted); }
.card .btn { width: 100%; margin-top: 8px; }
.field { display: grid; gap: 6px; margin: 16px 0; }
.field label { font-weight: 700; }
.field input {
  font: 400 1.05rem var(--text); min-height: 50px; padding: 0 14px;
  border: 2px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink);
}
.field input:focus { border-color: var(--wine); outline: none; box-shadow: 0 0 0 3px var(--marker); }
.field .hint { font-size: .9rem; color: var(--muted); }
.msg { border-radius: 14px; padding: 12px 14px; margin: 12px 0; font-weight: 700; }
.msg.err { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }
.msg.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.links-row { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; font-weight: 700; }
[hidden] { display: none !important; }

.doc { max-width: 72ch; margin-inline: auto; }
.doc h2 { font: 600 1.2rem/1.3 var(--display); margin: 2em 0 .6em; letter-spacing: -0.01em; }
.doc p, .doc li { color: var(--ink); }
.doc .notice { background: var(--rose); border-radius: 18px; padding: 18px 20px; }

.simple-head { background: var(--wine); color: #fff; --logo-bg: var(--wine); }
.simple-head .wrap { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.simple-head a:not(.brand) { font-weight: 700; text-decoration: none; }
.simple-head a:not(.brand):hover { text-decoration: underline; }

/* posizioni delle bolle (in % del riquadro; niente style inline per la CSP) */
.bub[data-pos="p0"] { left: 50%; top: 50%; width: 36%; aspect-ratio: 1; }
.bub[data-pos="p1"] { left: 17%; top: 20%; width: 22%; aspect-ratio: 1; }
.bub[data-pos="p2"] { left: 52%; top: 12%; width: 18%; aspect-ratio: 1; }
.bub[data-pos="p3"] { left: 85%; top: 26%; width: 21%; aspect-ratio: 1; }
.bub[data-pos="p4"] { left: 86%; top: 70%; width: 19%; aspect-ratio: 1; }
.bub[data-pos="p5"] { left: 55%; top: 88%; width: 20%; aspect-ratio: 1; }
.bub[data-pos="p6"] { left: 17%; top: 76%; width: 25%; aspect-ratio: 1; }

/* Tabella prezzi su telefono: la colonna delle voci resta ferma mentre si scorre. */
@media (max-width: 700px) {
  .plans tbody th, .plans thead td { position: sticky; left: 0; background: var(--paper); z-index: 1; }
  .plans th, .plans td { padding: 14px 12px; }
  .scroll-hint { display: block; }
}
.scroll-hint { display: none; margin-top: 10px; font-size: .9rem; color: var(--muted); }
