/* SyncPop! product pages — follows the game's own world:
   cream porcelain panels on a sky canvas, ink outlines, gold for the one action,
   teal for progress, navy for the Circuit stage. Lilita One + Fredoka (OFL, self-hosted). */

@font-face {
  font-family: "Lilita One";
  src: url("/syncpop/fonts/LilitaOne-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("/syncpop/fonts/Fredoka-Variable.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #17324b;
  --ink-soft: #3a5470;
  --cream: #fffdf0;
  --cream-deep: #f6efd5;
  --sky: #dcefff;
  --sky-deep: #bcdcf7;
  --gold: #ffba22;
  --gold-hi: #ffd45a;
  --gold-deep: #9a6400;
  --orange: #ff9e32;
  --teal: #138879;
  --teal-ink: #0d6b5f;
  --navy: #13284d;
  --night: #0b1830;
  --on-navy: #eaf4ff;
  --on-navy-soft: #b9cde4;
  --cyan: #a8f0ff;
  --m-circle: #148dcc;
  --m-diamond: #e85860;
  --m-square: #7960cc;
  --m-triangle: #138879;
  --line: rgba(23, 50, 75, 0.16);
  --radius: 22px;
  --radius-s: 14px;
  --display: "Lilita One", "Fredoka", system-ui, sans-serif;
  --body: "Fredoka", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky) 0, #eaf5ff 520px, var(--sky) 100%);
  font: 450 1.0625rem/1.6 var(--body);
  font-variation-settings: "wght" 450;
}
::selection { background: var(--gold-hi); color: var(--ink); }
img { display: block; max-width: 100%; height: auto; }

a { color: var(--teal-ink); text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 2.5px; }
:focus-visible { outline: 3px solid var(--m-circle); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.05; letter-spacing: 0; text-wrap: balance; margin: 0; }
p { margin: 0 0 1em; }
strong { font-weight: 600; }

.wrap { width: min(1080px, calc(100% - 32px)); margin-inline: auto; }

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 50;
  padding: 10px 16px; border-radius: 12px;
  background: var(--ink); color: var(--cream); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 8px; }

/* Language blocks: hidden only once the script has chosen a language. */
html[data-lang="it"] [data-l="en"],
html[data-lang="en"] [data-l="it"] { display: none !important; }

/* ---------- Header ---------- */
.top { padding: 14px 0; }
.nav { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { width: 112px; }
.brand span { font-size: 0.82rem; color: var(--ink-soft); font-weight: 500; }
.links { display: flex; gap: 4px 18px; flex-wrap: wrap; font-weight: 550; }
.links a { color: var(--ink); text-decoration: none; padding: 6px 0; }
.links a:hover, .links a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2.5px; text-decoration-color: var(--gold); }

.langs {
  display: inline-flex; padding: 3px; border-radius: 999px;
  background: var(--cream); box-shadow: inset 0 0 0 2px var(--line);
}
.langs button {
  font: 600 0.85rem var(--body); letter-spacing: 0.04em;
  min-width: 44px; min-height: 36px; padding: 0 12px;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft); cursor: pointer;
}
.langs button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
html:not([data-lang]) .langs { display: none; }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px;
  font: 400 1.15rem var(--display); color: var(--ink); text-decoration: none;
  border: 3px solid var(--ink);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.btn-gold {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--orange));
  box-shadow: inset 0 -4px 0 rgba(154, 100, 0, 0.45), 0 6px 14px rgba(23, 50, 75, 0.22);
}
.btn-plain { background: var(--cream); box-shadow: inset 0 -3px 0 rgba(23, 50, 75, 0.12), 0 4px 10px rgba(23, 50, 75, 0.12); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-small { min-height: 44px; padding: 0 18px; font-size: 1rem; border-width: 2.5px; }

/* ---------- Home: hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 40px; align-items: center; padding: 28px 0 72px; }
.hero h1 { font-size: clamp(2.7rem, 6.4vw, 4.6rem); max-width: 12ch; }
.hero h1 em { font-style: normal; color: var(--teal); }
.hero .logo { width: min(360px, 78%); margin: 0 0 22px -8px; }
.lead { font-size: 1.22rem; color: var(--ink-soft); max-width: 34rem; margin-top: 18px; }
.status { margin-top: 16px; font-size: 0.95rem; color: var(--ink-soft); max-width: 34rem; }
.status::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); margin-right: 8px; vertical-align: 1px; }

.phone {
  position: relative; justify-self: center;
  width: min(300px, 78vw); aspect-ratio: 540 / 1170;
  border-radius: 38px; padding: 10px; background: var(--ink);
  box-shadow: 0 24px 50px rgba(23, 50, 75, 0.3), inset 0 0 0 2px #2e4d6c;
  rotate: 2.5deg;
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 29px; }

/* ---------- Home: loop ---------- */
.band { padding: 72px 0; }
.band h2 { font-size: clamp(2rem, 4.6vw, 3.1rem); max-width: 18ch; }
.band > .wrap > p.intro { max-width: 40rem; color: var(--ink-soft); font-size: 1.12rem; margin-top: 14px; }

.loop { position: relative; list-style: none; padding: 0; margin: 44px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.loop::before {
  content: ""; position: absolute; left: 22px; right: 22px; top: 21px; height: 8px; border-radius: 8px;
  background: linear-gradient(90deg, var(--gold-hi), var(--orange));
  box-shadow: inset 0 -2px 0 rgba(154, 100, 0, 0.35);
}
.loop li { position: relative; padding-top: 66px; }
.loop .marble {
  position: absolute; top: 0; left: 0; width: 50px; height: 50px; border-radius: 50%;
  border: 3px solid var(--ink);
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.85) 0 13%, transparent 15%), var(--c);
  animation: roll 1.1s var(--ease) both;
}
.loop li:nth-child(1) .marble { --c: var(--m-circle); animation-delay: 0.1s; }
.loop li:nth-child(2) .marble { --c: var(--m-diamond); animation-delay: 0.25s; }
.loop li:nth-child(3) .marble { --c: var(--m-square); animation-delay: 0.4s; }
@keyframes roll { from { transform: translateX(-70px) rotate(-200deg); } to { transform: none; } }
.loop h3 { font-size: 1.6rem; margin-bottom: 8px; }
.loop p { color: var(--ink-soft); margin: 0; max-width: 30ch; }

/* ---------- Home: stage (navy band) ---------- */
.stage { background: var(--navy); color: var(--on-navy); padding: 80px 0; margin-top: 24px; }
.stage-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; align-items: center; }
.stage h2 { font-size: clamp(2rem, 4.6vw, 3.1rem); color: var(--cream); }
.stage p { color: var(--on-navy-soft); }
.stage .phone { rotate: -2deg; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 0 0 2px #35577c; }
.facts { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 0; }
.facts li { display: grid; grid-template-columns: 9rem 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid rgba(234, 244, 255, 0.16); }
.facts li:last-child { border-bottom: 1px solid rgba(234, 244, 255, 0.16); }
.facts b { font: 400 1.5rem/1.1 var(--display); color: var(--gold-hi); }
.facts span { color: var(--on-navy); }
.worlds { color: var(--on-navy-soft); font-size: 0.98rem; }

/* ---------- Home: money, honestly ---------- */
.deal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 36px; }
.panel {
  background: var(--cream); border-radius: var(--radius); padding: 28px 30px 30px;
  box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 7px var(--cream), inset 0 0 0 9px rgba(255, 186, 34, 0.55), 0 10px 24px rgba(23, 50, 75, 0.12);
}
.panel h3 { font-size: 1.7rem; margin-bottom: 12px; }
.panel ul { margin: 0; padding-left: 1.1em; }
.panel li { margin: 0.35em 0; color: var(--ink-soft); }
.panel li::marker { color: var(--teal); }
.panel.pro h3 { color: var(--gold-deep); }
.fine { font-size: 0.95rem; color: var(--ink-soft); margin-top: 18px; max-width: 46rem; }

.help { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; padding: 30px 32px; border-radius: var(--radius); background: var(--cream-deep); }
.help h2 { font-size: 1.8rem; }
.help p { margin: 6px 0 0; color: var(--ink-soft); }
.help .actions { margin: 0; }

/* ---------- Legal and support pages ---------- */
.doc { padding: 20px 0 80px; }
.doc-head { max-width: 46rem; }
.doc-head h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); }
.meta { color: var(--ink-soft); margin-top: 10px; font-size: 0.98rem; }
.sheet {
  background: var(--cream); border-radius: var(--radius); margin-top: 28px;
  padding: clamp(24px, 5vw, 52px);
  box-shadow: inset 0 0 0 3px var(--ink), 0 14px 30px rgba(23, 50, 75, 0.12);
}
.sheet > * { max-width: 44rem; }
.sheet h2 { font-size: 1.65rem; margin: 2.2em 0 0.55em; scroll-margin-top: 20px; }
.sheet h2:first-child, .sheet .summary + h2 { margin-top: 1.4em; }
.sheet h3 { font: 600 1.12rem/1.35 var(--body); margin: 1.6em 0 0.4em; scroll-margin-top: 20px; }
.sheet p, .sheet li { color: var(--ink-soft); }
.sheet strong { color: var(--ink); }
.sheet ul { padding-left: 1.2em; margin: 0 0 1em; }
.sheet li { margin: 0.4em 0; }
.sheet li::marker { color: var(--teal); }
.summary { background: #eef8f4; border-radius: var(--radius-s); padding: 20px 24px; box-shadow: inset 0 0 0 2px rgba(19, 136, 121, 0.35); }
.summary p:last-child, .summary ul:last-child { margin-bottom: 0; }
.summary h2 { margin: 0 0 8px; font-size: 1.35rem; }
.toc { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 18px 0 0; padding: 0; list-style: none; font-weight: 550; font-size: 0.98rem; }
.path { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }

.table-wrap { overflow-x: auto; margin: 0 0 1.2em; max-width: 100%; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
th { color: var(--ink); font-weight: 600; background: var(--cream-deep); }
td:first-child { color: var(--ink); font-weight: 550; }

.faq details { border-top: 1px solid var(--line); padding: 4px 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); padding: 14px 32px 14px 0; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font: 400 1.5rem var(--display); color: var(--teal); transition: rotate 0.2s var(--ease); }
.faq details[open] summary::after { rotate: 45deg; }
.faq details > *:not(summary) { margin-bottom: 14px; }

/* ---------- Footer ---------- */
footer { padding: 34px 0 44px; font-size: 0.95rem; color: var(--ink-soft); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 28px; border-top: 2px solid var(--line); padding-top: 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot a { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero, .stage-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 12px; gap: 44px; }
  .stage-grid .phone { order: 2; }
  .deal { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .links { order: 3; width: 100%; }
  .loop { grid-template-columns: 1fr; gap: 26px; }
  .loop::before { left: 21px; right: auto; top: 22px; bottom: 22px; width: 8px; height: auto; background: linear-gradient(180deg, var(--gold-hi), var(--orange)); }
  .loop li { padding: 4px 0 0 72px; min-height: 50px; }
  .loop .marble { animation-name: drop; }
  .facts li { grid-template-columns: 1fr; gap: 2px; }
  .help { padding: 24px; }
  .panel { padding: 24px 22px 26px; }
  .brand img { width: 96px; }
  .sheet { padding: 22px 18px 28px; border-radius: 18px; }
  .summary { padding: 16px 16px 18px; }
  .sheet ul { padding-left: 1.05em; }
  table { min-width: 0; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  td { display: grid; grid-template-columns: 6.5rem 1fr; gap: 10px; padding: 3px 0; border: 0; }
  td::before { content: attr(data-label); font-weight: 600; color: var(--ink); }
  td:first-child { font-family: var(--display); font-weight: 400; font-size: 1.1rem; }
  td:first-child::before { display: none; }
  td:first-child { display: block; }
}
@keyframes drop { from { transform: translateY(-40px) rotate(-160deg); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .loop .marble { animation: none; }
  .btn { transition: none; }
  .btn:hover, .btn:active { transform: none; }
  .faq summary::after { transition: none; }
}
@media print {
  .top .links, .langs, .actions, .skip { display: none !important; }
  .sheet { box-shadow: none; padding: 0; }
  html[data-lang] [data-l] { display: block !important; }
}
