:root {
  --bg: #0D2129;
  --bg-2: #0F2831;
  --panel: #13333D;
  --line: #24505B;
  --ink: #E6EEF0;
  --muted: #95B1B8;
  --trace: #2E8C7C;
  --mask: #0C3A3A;
  --pad: #B5C4C8;
  --net: #F5C34B;
  --net-ink: #1C1503;
  --paper: #EAF1F2;
  --paper-ink: #1F3F49;
  --radius-s: 6px;
  --radius-m: 12px;
  --wrap: 1180px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

:lang(hi) { --font: "Noto Sans Devanagari", "IBM Plex Sans", "Nirmala UI", sans-serif; }
:lang(zh) { --font: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
:lang(ja) { --font: "IBM Plex Sans", "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", sans-serif; }

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--net); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--net); color: var(--net-ink); padding: 8px 14px; border-radius: var(--radius-s); }

/* Header */
.top { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.top__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 1.06rem; }
.top__nav { display: flex; align-items: center; gap: 22px; font-size: 0.94rem; }
.top__nav > a { text-decoration: none; color: var(--muted); }
.top__nav > a:hover { color: var(--ink); }
.lang { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.lang select {
  font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 5px 8px; cursor: pointer;
}
@media (max-width: 600px) { .top__nav > a { display: none; } }

/* Hero */
.hero { padding: 72px 0 64px; }
.hero h1 {
  font-size: clamp(2.3rem, 5.4vw, 4.3rem);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.025em;
  max-width: 17ch;
  margin: 0 0 24px;
  text-wrap: balance;
}
:lang(zh) .hero h1, :lang(ja) .hero h1 { letter-spacing: 0; line-height: 1.2; max-width: 14em; }
:lang(hi) .hero h1 { line-height: 1.3; letter-spacing: 0; }
.lead { font-size: 1.18rem; color: var(--muted); max-width: 60ch; margin: 0 0 32px; }

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; min-height: 56px; }
.cta__meta { color: var(--muted); font-size: 0.9rem; }
.cta__note { color: var(--ink); max-width: 52ch; margin: 0; }
.cta__link { color: var(--muted); font-size: 0.95rem; text-underline-offset: 3px; }
.cta__link:hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: var(--radius-s);
  background: var(--net); color: var(--net-ink);
  font-weight: 600; font-size: 1.02rem; text-decoration: none;
  border: 0; cursor: pointer;
  transition: background-color .15s ease;
}
.btn:hover { background: #FFD46A; }
.btn svg { width: 20px; height: 20px; }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--panel); }
.btn--small { padding: 9px 16px; font-size: 0.94rem; }

/* Demo */
.demo { margin-top: 56px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: start; }
.demo figcaption { grid-column: 1 / -1; color: var(--muted); font-size: 0.92rem; margin-top: 4px; }
.demo__pane { border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; background: var(--bg-2); }
.demo__bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 9px 14px; font-size: 0.85rem; color: var(--muted);
  border-bottom: 1px solid var(--line); background: var(--panel);
}
.demo__net { color: var(--net); font-weight: 500; min-height: 1em; }
.demo__canvas svg { width: 100%; height: auto; }
.demo__pane--schem .demo__canvas { background: var(--paper); }
@media (max-width: 820px) {
  .demo { grid-template-columns: 1fr; }
  .hero { padding-top: 48px; }
}

/* Board SVG */
.b-mask { fill: var(--mask); stroke: #1D5C57; stroke-width: 2; }
.b-silk { fill: none; stroke: #CFE0E2; stroke-width: 1.2; opacity: .7; }
.b-label { fill: #CFE0E2; font: 500 11px var(--font); opacity: .8; pointer-events: none; }
.b-trace { fill: none; stroke: var(--trace); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; cursor: pointer; transition: stroke .2s ease; }
.b-trace-hit { fill: none; stroke: transparent; stroke-width: 16; cursor: pointer; }
.b-pad { fill: var(--pad); cursor: pointer; transition: fill .2s ease; }
.b-pad--nc { fill: #6F8589; cursor: default; }
.is-net .b-trace { stroke: var(--net); filter: drop-shadow(0 0 4px rgba(245, 195, 75, .7)); }
.is-net .b-pad, .b-pad.is-net { fill: var(--net); }
.dim .b-trace:not(.is-on) { opacity: .45; }

/* Schematic SVG */
.s-wire { fill: none; stroke: var(--paper-ink); stroke-width: 1.6; transition: stroke .2s ease, stroke-width .2s ease; cursor: pointer; }
.s-hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; }
.s-part { fill: none; stroke: var(--paper-ink); stroke-width: 1.6; }
.s-fill { fill: var(--paper-ink); }
.s-text { fill: var(--paper-ink); font: 500 11px var(--font); }
.s-ref { fill: #4B6B74; font: 400 10px var(--font); }
.s-netlabel { fill: var(--paper-ink); font: 600 11px var(--font); transition: fill .2s ease; }
.is-net .s-wire { stroke: #D9940B; stroke-width: 3; }
.is-net .s-netlabel { fill: #B87600; }

/* Features */
.features { padding: 96px 0; border-top: 1px solid var(--line); }
.features__grid { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; align-items: start; }
.features h2, .download h2, .faq h2 {
  font-size: clamp(1.7rem, 3vw, 2.35rem); line-height: 1.15; font-weight: 600;
  letter-spacing: -0.015em; margin: 0; text-wrap: balance;
}
.features h2 { position: sticky; top: 96px; max-width: 12ch; }
:lang(zh) .features h2, :lang(ja) .features h2 { max-width: none; letter-spacing: 0; }
.features__list { margin: 0; }
.features__list > div {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 8px 32px;
  padding: 24px 0; border-top: 1px solid var(--line);
}
.features__list > div:first-child { border-top: 0; padding-top: 4px; }
.features__list dt { font-weight: 600; font-size: 1.05rem; }
.features__list dd { margin: 0; color: var(--muted); max-width: 60ch; }
@media (max-width: 820px) {
  .features { padding: 64px 0; }
  .features__grid { grid-template-columns: 1fr; gap: 28px; }
  .features h2 { position: static; max-width: none; }
  .features__list > div { grid-template-columns: 1fr; }
}

/* Download */
.download { padding: 96px 0; background: var(--bg-2); border-top: 1px solid var(--line); }
.download__lead { color: var(--muted); margin: 12px 0 36px; }
.platforms { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.platform {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 18px;
  padding: 20px 22px; border-top: 1px solid var(--line); background: var(--bg);
}
.platform:first-child { border-top: 0; }
.platform.is-detected { background: var(--panel); box-shadow: inset 3px 0 0 var(--net); }
.platform__icon { width: 32px; height: 32px; color: var(--ink); }
.platform__name { font-weight: 600; font-size: 1.08rem; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.platform__tag { font-size: 0.78rem; font-weight: 500; color: var(--net-ink); background: var(--net); border-radius: 999px; padding: 1px 9px; }
.platform__req { color: var(--muted); font-size: 0.92rem; }
.platform__action { display: flex; align-items: center; gap: 16px; justify-content: flex-end; }
.platform__ver { color: var(--muted); font-size: 0.88rem; white-space: nowrap; }
.platform__ver a { color: var(--muted); text-underline-offset: 3px; }
.platform__soon { color: var(--muted); font-size: 0.94rem; border: 1px dashed var(--line); border-radius: var(--radius-s); padding: 8px 14px; white-space: nowrap; }
.download__mobile { color: var(--muted); font-size: 0.92rem; margin: 20px 0 0; }
@media (max-width: 640px) {
  .download { padding: 64px 0; }
  .platform { grid-template-columns: 32px minmax(0, 1fr); padding: 18px 16px; }
  .platform__action { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
}

/* Domande frequenti */
.faq { padding: 96px 0; border-top: 1px solid var(--line); }
.faq__list { margin-top: 32px; border-top: 1px solid var(--line); max-width: 860px; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
  cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative;
  font-weight: 600; font-size: 1.05rem;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px; margin-top: -7px;
  border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted); transform: rotate(45deg);
  transition: transform .2s;
}
.faq__item[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq__item summary:focus-visible { outline: 2px solid var(--net); outline-offset: 2px; border-radius: var(--radius-s); }
.faq__item p { margin: 0 0 22px; color: var(--muted); max-width: 70ch; }
@media (max-width: 640px) { .faq { padding: 64px 0; } }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--muted); font-size: 0.88rem; }
.foot__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; }
.foot p { margin: 0; }
.foot__langs { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 20px; }
.foot__langs a { color: var(--muted); text-decoration: none; }
.foot__langs a:hover, .foot__langs a[aria-current] { color: var(--ink); }
.foot__langs a[aria-current] { text-decoration: underline; text-underline-offset: 4px; }

/* Modalità manutenzione */
[hidden] { display: none !important; }
.maint { min-height: calc(100vh - 65px); display: flex; align-items: center; padding: 64px 0; }
.maint__inner { max-width: 640px; }
.maint img { margin-bottom: 28px; }
.maint h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.1; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 18px; }
:lang(zh) .maint h1, :lang(ja) .maint h1, :lang(hi) .maint h1 { letter-spacing: 0; line-height: 1.3; }
.maint p { color: var(--muted); font-size: 1.12rem; margin: 0 0 12px; max-width: 56ch; }
.maint .maint__until { color: var(--net); font-size: 1rem; }
.maint__until:empty { display: none; }
.is-maint #main, .is-maint .foot, .is-maint .top__nav > a, .is-maint .skip { display: none; }

/* Schermate */
.screens { padding: 96px 0; border-top: 1px solid var(--line); }
.screens__note { color: var(--muted); margin: 12px 0 40px; max-width: 60ch; }
.screens__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 28px; align-items: start; }
.shot { margin: 0; }
.shot--wide { grid-column: 1 / -1; }
.shot__open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--radius-m); }
.shot img { width: 100%; height: auto; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .45)); }
.shot figcaption { color: var(--muted); font-size: 0.92rem; margin-top: 14px; max-width: 60ch; }
.shot--wide figcaption { font-size: 1rem; }
@media (max-width: 820px) {
  .screens { padding: 64px 0; }
  .screens__grid { grid-template-columns: 1fr; gap: 32px; }
}

.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; overflow: visible; }
.lightbox::backdrop { background: rgba(4, 14, 18, .88); }
.lightbox img { display: block; max-width: 96vw; max-height: 90vh; width: auto; height: auto; }
.lightbox__close {
  position: fixed; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer;
  display: grid; place-items: center;
}

/* Primo rilascio (pagina di attesa) */
.is-launch .top__nav > a, .is-launch .skip { display: none; }
.launch { padding: 72px 0 96px; overflow: hidden; }
.launch__head { max-width: 760px; }
.launch__eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--net);
}
:lang(zh) .launch__eyebrow, :lang(ja) .launch__eyebrow, :lang(hi) .launch__eyebrow { letter-spacing: 0.04em; }
.launch__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--net); box-shadow: 0 0 0 0 rgba(245, 195, 75, .6); animation: launch-pulse 2.2s ease-out infinite; }
@keyframes launch-pulse { 0% { box-shadow: 0 0 0 0 rgba(245, 195, 75, .55); } 70%, 100% { box-shadow: 0 0 0 12px rgba(245, 195, 75, 0); } }
.launch h1 {
  font-size: clamp(2.3rem, 5.4vw, 4.3rem); line-height: 1.04; font-weight: 600;
  letter-spacing: -0.025em; max-width: 16ch; margin: 0 0 24px; text-wrap: balance;
}
:lang(zh) .launch h1, :lang(ja) .launch h1 { letter-spacing: 0; line-height: 1.2; max-width: 14em; }
:lang(hi) .launch h1 { line-height: 1.3; letter-spacing: 0; }
.launch__body { font-size: 1.18rem; color: var(--muted); max-width: 58ch; margin: 0 0 32px; }
.launch__when { color: var(--muted); font-size: 0.95rem; margin: 14px 0 0; }
.launch__when:empty { display: none; }

.countdown { display: flex; flex-wrap: wrap; gap: 12px; }
.countdown__cell {
  min-width: 92px; padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: var(--radius-m);
  background: var(--bg-2); display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
}
.countdown__num { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 600; line-height: 1; color: var(--net); font-variant-numeric: tabular-nums; }
.countdown__unit { font-size: 0.8rem; color: var(--muted); }
.countdown__now { margin: 0; font-weight: 600; color: var(--net); font-size: 1.12rem; }
@media (max-width: 480px) { .countdown__cell { min-width: 0; flex: 1 1 0; padding: 12px 10px 10px; } }

.peek { margin: 64px 0 0; }
.peek__stage {
  --x: 62%; --y: 42%; --r: clamp(64px, 12vw, 132px); --zoom: 1.7;
  position: relative; overflow: hidden; border-radius: var(--radius-m);
  border: 1px solid var(--line); background: #071419; cursor: none; touch-action: none;
  aspect-ratio: 1200 / 714;
}
.peek__stage img { position: absolute; inset: 0; width: 100%; height: 100%; }
.peek__base { filter: blur(16px) saturate(.5) brightness(.5); transform: scale(1.06); }
.peek__sharp {
  clip-path: circle(calc(var(--r) / var(--zoom)) at var(--x) var(--y));
  transform: scale(var(--zoom)); transform-origin: var(--x) var(--y);
}
.peek__ring {
  position: absolute; left: var(--x); top: var(--y); width: calc(var(--r) * 2); height: calc(var(--r) * 2);
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  border: 3px solid #DCE6EA; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 14px 40px rgba(0, 0, 0, .55), inset 0 0 18px rgba(0, 0, 0, .35);
}
.peek__stage:focus-visible { outline-offset: 4px; border-radius: var(--radius-m); }
.peek figcaption { color: var(--muted); font-size: 0.92rem; margin-top: 14px; }
@media (hover: none) { .peek__stage { cursor: default; } }

.clues { margin-top: 80px; border-top: 1px solid var(--line); padding-top: 40px; }
.clues h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); font-weight: 600; letter-spacing: -0.01em; margin: 0 0 28px; }
.clues__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.clues__list li { display: flex; flex-direction: column; gap: 10px; font-size: 1.08rem; line-height: 1.45; }
.clues__n { font-size: 0.8rem; font-weight: 600; color: var(--net); letter-spacing: 0.1em; font-variant-numeric: tabular-nums; }
@media (max-width: 820px) {
  .launch { padding: 48px 0 64px; }
  .peek { margin-top: 48px; }
  .clues { margin-top: 56px; }
  .clues__list { grid-template-columns: 1fr; gap: 22px; }
}
@media (prefers-reduced-motion: reduce) { .launch__dot { animation: none; } }
