:root {
  --night: #07090c;
  --line: #eef2ea;
  --ink: #12141a;
  --paper: #f4f5f1;
  --mute: #5e646f;
  --ball: #d2ff1a;
  --signal: #1f4bff;
  --cage: #00d7c2;
  --danger: #d12c32;
  --font-display: 'Big Shoulders Display', 'Barlow Condensed', Impact, sans-serif;
  --font-ui: 'Titillium Web', 'Trebuchet MS', ui-sans-serif, sans-serif;
  --ease-serve: cubic-bezier(0.12, 0.72, 0.18, 1);
  --ease-snap: cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: var(--font-ui);
  color: var(--line);
  background: var(--night);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--night); }
body { margin: 0; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; }

/* Cursore pallina tennis — solo puntatore fine (desktop) */
@media (hover: hover) and (pointer: fine) {
  html,
  body {
    cursor: url('/assets/cursor-ball.svg') 16 16, auto;
  }
  a,
  button,
  .button,
  label,
  summary,
  [role='button'],
  input[type='submit'],
  input[type='button'],
  select {
    cursor: url('/assets/cursor-ball.svg') 16 16, pointer;
  }
  input,
  textarea {
    cursor: text;
  }
}
:focus-visible { outline: 3px solid var(--ball); outline-offset: 4px; }
::selection { background: var(--ball); color: var(--ink); }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 120;
  background: var(--ball);
  color: var(--ink);
  padding: 12px 16px;
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* —— Intro curtain —— */
.intro {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
}
.intro:not([hidden]) { pointer-events: auto; }
.intro-flood {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 18%, rgba(255, 236, 180, 0.16), transparent 62%),
    radial-gradient(ellipse 50% 40% at 80% 0%, rgba(210, 255, 26, 0.08), transparent 55%),
    var(--night);
  transform-origin: 50% 42%;
}
.intro-flash {
  position: absolute;
  inset: 0;
  background: var(--ball);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
.intro-live {
  position: absolute;
  left: 40px;
  bottom: 36px;
  margin: 0;
  z-index: 2;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #eef2ea9e;
}
.intro-skip {
  position: fixed;
  top: 22px;
  right: 40px;
  z-index: 110;
  min-height: 44px;
  padding: 0 18px;
  background: transparent;
  color: var(--line);
  border: 1px solid #eef2ea55;
  border-radius: 2px;
  font-size: 13px;
  font-weight: 700;
}
html.skip-intro .intro-skip,
body.is-ready .intro-skip { display: none; }
@media (hover: hover) {
  .intro-skip:hover {
    border-color: var(--ball);
    color: var(--ball);
  }
}

body.is-intro { overflow: hidden; }
body.is-intro .site-header,
body.is-intro .hero-brand,
body.is-intro .hero-copy,
body.is-intro .umpire {
  opacity: 0;
}

/* —— Signature ball (CSS only, no SVG court) —— */
.serve-ball {
  position: fixed;
  left: 50%;
  top: 42%;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  z-index: 90;
  pointer-events: none;
  transform: scale(0.08) translate3d(-12vw, -38vh, 0);
  will-change: transform, filter;
  filter: blur(1.5px);
}
.serve-ball__core,
.serve-ball__seam {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: block;
}
.serve-ball__core {
  background:
    radial-gradient(circle at 30% 26%, #f7ffc4 0 10%, transparent 34%),
    radial-gradient(circle at 74% 78%, rgba(50, 62, 0, 0.55) 0 18%, transparent 46%),
    radial-gradient(circle at 50% 46%, #d2ff1a 0 52%, #b4e000 72%, #6d8608 100%);
  box-shadow:
    inset -16px -18px 24px rgba(32, 42, 0, 0.5),
    inset 12px 14px 18px rgba(255, 255, 230, 0.22),
    0 28px 50px rgba(0, 0, 0, 0.5);
}
.serve-ball__seam {
  inset: 7%;
  background: transparent;
  border: 3px solid transparent;
  border-left-color: #f4f7ea;
  border-right-color: #f4f7ea;
  transform: rotate(-28deg) scaleX(0.7);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

html.skip-intro body,
body.is-ready {
  overflow: auto;
}
html.skip-intro .intro,
body.is-ready .intro { display: none !important; }
html.skip-intro .site-header,
html.skip-intro .hero-brand,
html.skip-intro .hero-copy,
html.skip-intro .umpire,
body.is-ready .site-header,
body.is-ready .hero-brand,
body.is-ready .hero-copy,
body.is-ready .umpire {
  opacity: 1;
}
html.skip-intro .serve-ball,
body.is-ready .serve-ball,
.serve-ball.is-rest {
  position: absolute;
  left: auto;
  right: 7vw;
  top: auto;
  bottom: 11vh;
  margin: 0;
  transform: none;
  filter: none;
  z-index: 3;
}

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 72px;
  padding: 0 40px;
}
.brand {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  line-height: 1;
}
.brand span { color: var(--ball); }
.site-header nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}
.site-header nav a {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: #eef2eaa6;
  position: relative;
}
.site-header nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--ball);
  transform: scaleX(0);
  transform-origin: left;
}
@media (hover: hover) {
  .site-header nav a:hover { color: var(--line); }
  .site-header nav a:hover::after { transform: scaleX(1); }
}
.site-header nav a:focus-visible::after { transform: scaleX(1); }
.ghost {
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #eef2ea55;
  padding: 8px 14px;
  border-radius: 2px;
}
@media (hover: hover) {
  .ghost:hover { border-color: var(--ball); color: var(--ball); }
}

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  color: var(--line);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: 72px 1fr auto auto;
  padding: 0 40px 56px;
}
.hero-atmosphere {
  position: absolute;
  inset: 0;
  background: var(--night);
  pointer-events: none;
}
.flood {
  position: absolute;
  pointer-events: none;
}
.flood-l {
  width: 78vw;
  height: 78vh;
  left: -18vw;
  top: -22vh;
  background: radial-gradient(ellipse at center, rgba(255, 236, 186, 0.2) 0%, transparent 64%);
}
.flood-r {
  width: 62vw;
  height: 70vh;
  right: -14vw;
  top: -18vh;
  background: radial-gradient(ellipse at center, rgba(210, 255, 26, 0.1) 0%, transparent 60%);
}
.haze {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background: linear-gradient(to top, rgba(28, 38, 12, 0.42), transparent 70%);
}

.hero-brand {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: end;
  z-index: 2;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(72px, 16.4vw, 208px);
  letter-spacing: -0.035em;
  line-height: 0.76;
  text-transform: lowercase;
}
.hero-brand .slash { color: var(--ball); }

.umpire {
  grid-column: 10 / -1;
  grid-row: 2;
  align-self: start;
  justify-self: end;
  z-index: 2;
  text-align: right;
  margin-top: 8px;
}
.umpire span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #eef2ea9e;
}
.umpire time {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.hero-copy {
  grid-column: 1 / 8;
  grid-row: 3;
  position: relative;
  z-index: 2;
  max-width: 920px;
  padding-top: 28px;
}
.hero-copy h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 5.6vw, 76px);
  letter-spacing: -0.03em;
  line-height: 0.9;
  margin: 0 0 20px;
  max-width: 14ch;
}
.support {
  font-size: 20px;
  line-height: 1.45;
  max-width: 38ch;
  margin: 0 0 28px;
  color: #eef2ead4;
}
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  background: var(--ball);
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  border: 0;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.cta span { position: relative; z-index: 1; }
.cta::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  transform: translateX(-101%);
  opacity: 0.18;
}
@media (hover: hover) {
  .cta:hover::after { transform: translateX(0); }
}
.cta:focus-visible::after { transform: translateX(0); }
.cta:active { transform: translateY(1px); }

.price {
  background: var(--ball);
  color: var(--ink);
  padding: 32px 40px;
}
.price dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 40px;
  max-width: 1360px;
}
.price dt {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.price dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.protocol {
  background: var(--paper);
  color: var(--ink);
  padding: 88px 40px 96px;
}
.protocol h2 {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 68px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.92;
  margin: 0 0 48px;
  max-width: 16ch;
}
.protocol ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  max-width: 1360px;
  border-top: 2px solid var(--ink);
}
.protocol li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid #c9cdc6;
}
.protocol li span {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--signal);
  line-height: 1;
}
.protocol li p { margin: 0; font-size: 18px; line-height: 1.5; max-width: 62ch; }
.protocol li strong { font-weight: 700; }

.stage {
  background: var(--night);
  color: var(--line);
  padding: 88px 40px 100px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 64px;
  align-items: end;
}
.stage h2 {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.9;
  margin: 0 0 20px;
}
.stage-copy p {
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
  max-width: 42ch;
  color: #eef2eac2;
}
.board {
  border: 4px solid var(--line);
  padding: 28px 32px 24px;
}
.board-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #eef2ea9e;
}
.board-top strong {
  font-family: var(--font-display);
  font-size: clamp(36px, 4.5vw, 56px);
  letter-spacing: -0.03em;
  color: var(--line);
  font-weight: 800;
}
.board-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 28px 0 18px;
}
.board-slots span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  border: 1px solid #eef2ea55;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.board-slots .on {
  background: var(--ball);
  color: var(--ink);
  border-color: var(--ball);
}
.board-note { margin: 0; font-size: 13px; color: #eef2ea9e; }

.split {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  min-height: 420px;
}
.for-club, .for-player { padding: 72px 40px; }
.for-club { background: var(--signal); color: var(--line); }
.for-player { background: var(--paper); color: var(--ink); }
.split h2 {
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.92;
  margin: 0 0 18px;
}
.split p {
  font-size: 18px;
  line-height: 1.5;
  max-width: 42ch;
  margin: 0 0 28px;
}
.split a {
  font-weight: 700;
  text-underline-offset: 5px;
}

.demo {
  background: var(--paper);
  color: var(--ink);
  padding: 88px 40px 100px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
  align-items: start;
}
.demo h2 {
  font-family: var(--font-display);
  font-size: clamp(44px, 5vw, 76px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.9;
  margin: 0 0 18px;
}
.demo-intro p {
  font-size: 18px;
  line-height: 1.5;
  max-width: 42ch;
  color: var(--mute);
}
#demo-form { display: grid; gap: 18px; }
#demo-form label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}
#demo-form input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #b8bdb6;
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
}
#demo-form input:focus {
  outline: 3px solid var(--signal);
  outline-offset: 2px;
  border-color: var(--signal);
}
.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 14px;
  min-height: 1.2em;
}
.form-ok {
  margin: 0;
  background: var(--ball);
  color: var(--ink);
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
}
.fine {
  margin: 0;
  font-size: 13px;
  color: var(--mute);
  line-height: 1.5;
  max-width: 56ch;
}

footer {
  background: var(--night);
  color: #eef2eac2;
  padding: 48px 40px 56px;
  display: grid;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
}
footer .brand {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--line);
  margin: 0;
}
footer .brand span { color: var(--ball); }
footer a { color: var(--ball); }

@media (max-width: 960px) {
  .site-header { padding: 0 16px; gap: 16px; }
  .site-header nav { display: none; }
  .hero { padding: 0 16px 96px; grid-template-rows: 72px auto 1fr auto; }
  .hero-brand { font-size: clamp(64px, 22vw, 120px); grid-row: 2; padding-top: 24px; }
  .umpire { grid-column: 1 / -1; grid-row: 2; justify-self: end; }
  .hero-copy { grid-column: 1 / -1; grid-row: 3; align-self: end; }
  .intro-live { left: 16px; bottom: 20px; }
  .intro-skip { right: 16px; }
  .price, .protocol, .stage, .for-club, .for-player, .demo, footer { padding-left: 16px; padding-right: 16px; }
  .price dl, .stage, .demo, .split { grid-template-columns: 1fr; }
  .protocol li { grid-template-columns: 56px 1fr; }
  .board-slots { grid-template-columns: repeat(2, 1fr); }
  html.skip-intro .serve-ball,
  body.is-ready .serve-ball,
  .serve-ball.is-rest {
    right: 16px;
    bottom: 24px;
    width: 64px;
    height: 64px;
  }
}

@media (max-width: 520px) {
  .brand { font-size: 28px; }
  .hero-copy h1 { font-size: 40px; }
  .support { font-size: 17px; }
  .cta { width: 100%; }
  .hero-brand .word:first-child { display: block; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .site-header nav a::after,
  .cta::after {
    transition: transform 0.16s var(--ease-snap);
  }
  .intro-skip {
    transition: border-color 0.16s var(--ease-snap), color 0.16s var(--ease-snap);
  }

  .intro[data-phase='toss'] .intro-flood {
    animation: flood-in 0.28s var(--ease-snap) both;
  }
  body.is-intro[data-phase='toss'] .serve-ball {
    animation: toss 0.28s var(--ease-snap) forwards;
  }
  body.is-intro[data-phase='serve'] .serve-ball {
    animation: approach 1.1s var(--ease-serve) forwards;
  }
  .intro[data-phase='impact'] .intro-flash {
    animation: flash 0.22s ease-out forwards;
  }
  body.is-intro[data-phase='impact'] .serve-ball:not(.is-rest) {
    animation: hit 0.22s var(--ease-snap) forwards;
  }
  .intro[data-phase='reveal'] .intro-flood {
    animation: hole 0.7s var(--ease-serve) forwards;
  }
  body.is-revealing .site-header {
    animation: slam 0.5s var(--ease-serve) 0.04s both;
  }
  body.is-revealing .hero-brand {
    animation: slam 0.62s var(--ease-serve) 0.08s both;
  }
  body.is-revealing .umpire {
    animation: slam 0.5s var(--ease-serve) 0.16s both;
  }
  body.is-revealing .hero-copy {
    animation: slam 0.55s var(--ease-serve) 0.2s both;
  }
  .serve-ball.is-rest,
  html.skip-intro .serve-ball,
  body.is-ready .serve-ball {
    animation: rest-spin 9s linear infinite;
  }

  .flood-l { animation: idle-flood 8s ease-in-out infinite alternate; }
  .flood-r { animation: idle-flood 9.5s ease-in-out 0.6s infinite alternate; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .intro { display: none !important; }
  .serve-ball {
    position: absolute;
    left: auto;
    right: 7vw;
    top: auto;
    bottom: 11vh;
    margin: 0;
    transform: none;
    filter: none;
  }
  body.is-intro .site-header,
  body.is-intro .hero-brand,
  body.is-intro .hero-copy,
  body.is-intro .umpire {
    opacity: 1;
  }
}

@keyframes toss {
  from { transform: scale(0.06) translate3d(-10vw, -20vh, 0); filter: blur(2px); }
  to { transform: scale(0.1) translate3d(-8vw, -36vh, 0); filter: blur(1.5px); }
}
@keyframes approach {
  0% { transform: scale(0.1) translate3d(-8vw, -36vh, 0); filter: blur(1.5px); }
  42% { transform: scale(0.55) translate3d(7vw, -6vh, 0); filter: blur(0.4px); }
  100% { transform: scale(24) translate3d(0, 6vh, 0); filter: blur(0); }
}
@keyframes hit {
  0% { transform: scale(24) translate3d(0, 6vh, 0); }
  55% { transform: scale(28) translate3d(0, 8vh, 0); }
  100% { transform: scale(1) translate3d(32vw, 28vh, 0); filter: blur(0); }
}
@keyframes flash {
  0% { opacity: 0.92; }
  100% { opacity: 0; }
}
@keyframes hole {
  from { clip-path: circle(140% at 50% 42%); }
  to { clip-path: circle(0% at 50% 42%); }
}
@keyframes flood-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slam {
  from { opacity: 0; transform: scale(1.08); filter: blur(8px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}
@keyframes rest-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes idle-flood {
  from { opacity: 0.85; transform: scale(1); }
  to { opacity: 1; transform: scale(1.06); }
}


/* Orchestratore: durante intro Nico la palla hero resta nascosta */
html.tp-intro-pending [data-signature-ball],
html.tp-intro-active [data-signature-ball] {
  opacity: 0 !important;
  pointer-events: none !important;
}
html.tp-intro-pending body > :not(script),
html.tp-intro-active .site-header {
  /* cover handled by Nico ::before / overlay */
}
