:root {
  --bg: #0d0d0d;
  --bg-2: #151515;
  --line: #262626;
  --text: #f2f2ef;
  --muted: #8d8d88;
  --red: #e10600;
  --red-hi: #ff2a1f;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.55 var(--body);
  overflow-x: hidden;
}
a { color: inherit; }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.red { color: var(--red); }

h1, h2, .btn, .kicker, .facts b, .mark, .corners, .tag, .done-title, .tips-title {
  font-family: var(--display); text-transform: uppercase; font-style: italic;
}
h2 { font-weight: 800; font-size: clamp(34px, 5.5vw, 60px); line-height: .95; margin: 0 0 20px; letter-spacing: .005em; }

/* ---------- Top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  background: rgba(13,13,13,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: .03em; }
.mark b { font-weight: 900; }
.mark-flag {
  width: 22px; height: 16px; transform: skewX(-12deg);
  background: conic-gradient(var(--text) 25%, transparent 0 50%, var(--text) 0 75%, transparent 0) 0 0 / 8px 8px;
  border: 1px solid var(--text);
}
.lang select {
  font: 700 15px var(--display); letter-spacing: .06em; color: var(--text);
  background: transparent; border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; cursor: pointer;
}
.lang option { background: var(--bg); }

/* ---------- Buttons ---------- */
.btn {
  --c: var(--red);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 800; font-size: 20px; letter-spacing: .04em; text-decoration: none;
  padding: 14px 28px; border: 2px solid var(--c); border-radius: 0; cursor: pointer;
  color: var(--text); background: transparent;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  transition: background .15s, color .15s, transform .15s;
}
.btn-red { background: var(--red); border-color: var(--red); }
.btn-red:hover { background: var(--red-hi); border-color: var(--red-hi); }
.btn-ghost { --c: #444; }
.btn-ghost:hover { --c: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: progress; }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--red-hi); outline-offset: 3px; }
.count-pill { background: var(--text); color: var(--bg); font-size: 15px; padding: 1px 8px; font-style: normal; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center;
  padding: clamp(40px, 8vw, 96px) var(--gutter) clamp(40px, 6vw, 72px);
}
.kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-weight: 700; font-size: 18px; letter-spacing: .08em; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(225,6,0,.22); }
h1 {
  margin: 0; font-weight: 900; line-height: .84; letter-spacing: -.005em;
  font-size: clamp(64px, 12.5vw, 168px);
}
h1 span { display: block; }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: #cfcfca; max-width: 34em; margin: 26px 0 32px; }
.ctas { display: flex; flex-wrap: wrap; gap: 14px; }

.founder { margin: 0; }
.frame {
  position: relative; aspect-ratio: 9 / 16; max-height: 76vh; margin-left: auto;
  background: var(--bg-2); border: 1px solid var(--line); overflow: hidden;
}
.frame::before { /* angolo rosso tipo numero di gara */
  content: ""; position: absolute; z-index: 2; top: 0; left: 0; width: 44%; height: 6px; background: var(--red);
}
.frame video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.frame-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  font: italic 700 22px var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  background: repeating-linear-gradient(-55deg, transparent 0 18px, rgba(255,255,255,.025) 18px 36px);
}
.founder { display: flex; flex-direction: column; align-items: flex-end; }
.founder .frame { width: min(100%, calc(76vh * 9 / 16)); }
/* sotto il video: foto rotonda, nome e il testo del messaggio */
.founder-note { width: min(100%, calc(76vh * 9 / 16)); margin-top: 18px; color: #cfcfca; font-size: 16px; line-height: 1.5; }
.founder-who { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.founder-who b { display: block; color: var(--text); font-size: 17px; line-height: 1.2; }
.founder-who b + span { color: var(--muted); font-size: 14px; }
.avatar { flex: none; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; border: 2px solid var(--red); background: var(--bg-2); display: grid; place-items: center; }
.avatar::before { content: "G"; grid-area: 1 / 1; font: italic 800 22px var(--display); color: var(--muted); }
.avatar img { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: cover; position: relative; }
.founder-note p { margin: 0 0 .7em; }
.founder-note p:last-child { margin-bottom: 0; color: var(--text); font-weight: 600; }

/* ---------- Foto del circuito dietro hero e numeri ---------- */
.hero-bg {
  background:
    linear-gradient(180deg, rgba(13,13,13,.78) 0%, rgba(13,13,13,.66) 45%, rgba(13,13,13,.86) 88%, var(--bg) 100%),
    url(img/circuit.jpg) 85% 40% / cover no-repeat;
}
@media (max-width: 860px) { .hero-bg { background-image: linear-gradient(180deg, rgba(13,13,13,.8) 0%, rgba(13,13,13,.7) 45%, rgba(13,13,13,.88) 88%, var(--bg) 100%), url(img/circuit-m.jpg); } }
.foot .credit { font-size: 12px; }

/* ---------- Facts ---------- */
.facts {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.facts div { padding: 26px 18px 28px 0; border-right: 1px solid var(--line); padding-left: 18px; }
.facts div:first-child { padding-left: 0; }
.facts div:last-child { border-right: 0; }
.facts b { display: block; font-weight: 900; font-size: clamp(40px, 5vw, 64px); line-height: 1; }
.facts small { font-size: .45em; margin-left: 4px; color: var(--muted); }
.facts span { display: block; margin-top: 6px; color: var(--muted); font-size: 15px; }

.corners { border-block: 1px solid var(--line); overflow: hidden; background: var(--bg-2); }
.corners-track { display: flex; width: max-content; animation: slide 60s linear infinite; }
.corners span { padding: 14px 28px; font-weight: 700; font-size: 20px; letter-spacing: .08em; color: #5d5d59; white-space: nowrap; }
.corners span::after { content: "/"; margin-left: 56px; color: var(--red); }
@keyframes slide { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .corners-track { animation: none; } }

/* ---------- Manifesto ---------- */
.manifesto { max-width: 860px; margin: 0 auto; padding: clamp(64px, 10vw, 120px) var(--gutter); text-align: center; }
.manifesto h2 { font-size: clamp(44px, 8vw, 96px); }
.manifesto p { font-size: clamp(18px, 2vw, 22px); color: #cfcfca; margin: 0; }

/* ---------- Recorder ---------- */
.record {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(64px, 9vw, 112px);
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: start;
}
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 32px; }
.steps li { counter-increment: s; display: flex; gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 18px; }
.steps li::before {
  content: counter(s); font: italic 900 30px/1 var(--display); color: var(--red); min-width: 22px;
}
.tips { background: var(--bg-2); border-left: 4px solid var(--red); padding: 18px 22px; }
.tips-title { margin: 0 0 6px; font-weight: 800; font-size: 20px; letter-spacing: .03em; }
.tips ul { margin: 0; padding-left: 18px; color: #cfcfca; }

.studio { position: relative; }
.screen {
  position: relative; aspect-ratio: 9 / 16; max-height: 78vh; width: 100%; max-width: 420px; margin: 0 auto;
  background: var(--bg-2); border: 1px solid var(--line); overflow: hidden;
}
.screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; display: none; }
#cam { transform: scaleX(-1); }
.screen-idle {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center;
  background: repeating-linear-gradient(-55deg, transparent 0 18px, rgba(255,255,255,.02) 18px 36px);
}
.link-btn { color: var(--muted); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; font-size: 16px; }
.link-btn:hover { color: var(--text); }
.hint { color: #ffb4ae; font-size: 15px; max-width: 26em; margin: 0; }

.countdown {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  font: italic 900 180px/1 var(--display); color: var(--text); text-shadow: 0 4px 30px rgba(0,0,0,.6);
}
.rec-badge {
  position: absolute; top: 14px; left: 14px; display: none; align-items: center; gap: 8px;
  background: rgba(0,0,0,.6); padding: 6px 12px; font: 700 17px var(--display); letter-spacing: .05em; font-variant-numeric: tabular-nums;
}
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--red); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.rec-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: rgba(255,255,255,.12); display: none; }
.rec-bar i { display: block; height: 100%; width: 0; background: var(--red); }

.controls { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }
.controls-live, .controls-rec, .send, .done { display: none; }

/* stati dello studio */
.studio[data-state="live"] #cam, .studio[data-state="countdown"] #cam, .studio[data-state="recording"] #cam { display: block; }
.studio[data-state="live"] .screen-idle, .studio[data-state="countdown"] .screen-idle, .studio[data-state="recording"] .screen-idle,
.studio[data-state="review"] .screen-idle, .studio[data-state="sending"] .screen-idle, .studio[data-state="done"] .screen-idle { display: none; }
.studio[data-state="live"] .controls-live { display: flex; }
.studio[data-state="countdown"] .countdown { display: flex; }
.studio[data-state="recording"] .rec-badge { display: flex; }
.studio[data-state="recording"] .rec-bar { display: block; }
.studio[data-state="recording"] .controls-rec { display: flex; }
.studio[data-state="review"] #review, .studio[data-state="sending"] #review, .studio[data-state="done"] #review { display: block; }
.studio[data-state="review"] .send, .studio[data-state="sending"] .send { display: block; }
.studio[data-state="done"] .done { display: block; }
.studio[data-state="done"] .screen { max-height: 40vh; }

.send { margin: 20px auto 0; max-width: 520px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.send label > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.send input:not([type="checkbox"]) {
  width: 100%; font: inherit; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 0; padding: 12px 14px;
}
.send input:not([type="checkbox"]):focus { border-color: #555; }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 10px 0; font-size: 14px; color: #bdbdb8; cursor: pointer; }
.check span { margin: 0 !important; color: inherit !important; font-size: 14px !important; }
.check input { accent-color: var(--red); width: 18px; height: 18px; margin-top: 2px; flex: none; }
.hp { position: absolute; left: -9999px; }
.form-error { color: #ffb4ae; margin: 10px 0 0; font-size: 15px; }
.progress { position: relative; height: 34px; margin-top: 16px; background: var(--bg-2); border: 1px solid var(--line); }
.progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--red); transition: width .2s; }
.progress span { position: relative; display: flex; height: 100%; align-items: center; justify-content: center; font: italic 700 16px var(--display); text-transform: uppercase; letter-spacing: .06em; }

.done { margin-top: 20px; text-align: center; }
.done-title { font-weight: 900; font-size: 34px; margin: 0 0 6px; }
.done p { color: #cfcfca; }

/* ---------- Wall ---------- */
.wall { max-width: var(--max); margin: 0 auto; padding: clamp(56px, 8vw, 96px) var(--gutter); border-top: 1px solid var(--line); }
.wall-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 28px; }
.wall-head h2 { margin: 0; }
.wall-count { margin: 0; color: var(--muted); }
.wall-count b { font: italic 900 34px var(--display); color: var(--text); margin-right: 4px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.card { position: relative; aspect-ratio: 9 / 16; background: var(--bg-2); overflow: hidden; cursor: pointer; border: 0; padding: 0; color: var(--text); text-align: left; font: inherit; }
.card img, .card video { width: 100%; height: 100%; object-fit: cover; }
.card .who {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 12px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
}
.card .who b { display: block; font: italic 800 21px/1.05 var(--display); text-transform: uppercase; }
.card .who small { color: #c9c9c4; font-size: 13px; }
.card .lng { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.6); font: 700 13px var(--display); letter-spacing: .08em; padding: 2px 7px; }
.card .play {
  position: absolute; top: 50%; left: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px;
  background: var(--red); clip-path: polygon(30% 20%, 30% 80%, 80% 50%); opacity: .92; transition: transform .15s;
}
.card:hover .play { transform: scale(1.12); }
.card.playing .play, .card.playing .who { display: none; }
.wall-empty { color: var(--muted); font-size: 18px; }
#more { display: flex; margin: 30px auto 0; }

/* ---------- Share ---------- */
.spread { text-align: center; padding: 0 var(--gutter) clamp(64px, 9vw, 112px); }
.share { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 16px 0; }
.share a, .share button { font-size: 17px; padding: 10px 20px; }
.tag { font-weight: 800; font-size: clamp(26px, 4vw, 40px); color: var(--red); margin: 14px 0 0; }

/* ---------- Footer ---------- */
.foot { text-align: center; color: var(--muted); font-size: 14px; padding: 0 var(--gutter) 40px; }
.checker {
  height: 24px; margin: 0 calc(-1 * var(--gutter)) 28px;
  background: conic-gradient(#1f1f1f 25%, var(--bg) 0 50%, #1f1f1f 0 75%, var(--bg) 0) 0 0 / 24px 24px;
}
.foot a { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero, .record { grid-template-columns: 1fr; }
  .frame { margin: 0 auto; max-width: 340px; }
  .founder { align-items: center; }
  .founder-note { max-width: 340px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div { padding-left: 0 !important; border-right: 0; border-bottom: 1px solid var(--line); }
  .facts div:nth-child(odd) { border-right: 1px solid var(--line); padding-right: 14px; }
  .facts div:nth-child(even) { padding-left: 14px !important; }
  .screen { max-height: 72vh; max-width: 420px; }
}
@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ctas .btn { flex: 1 1 100%; }
  .mark { font-size: 17px; }
}
h1 .gp { color: var(--text); }
