/* Captain Lotto — marketing site.
   Palette is the app's, from the mockup CSS / docs/CONSTANTS.md § 7. */

@font-face {
  font-family: "Queency";
  src: url("assets/queency.otf") format("opentype");
  font-display: swap;
}

:root {
  --ocean-deep: #07263f;
  --ocean-band: #1a5c8c;
  --yellow: #ede243;
  --red: #c0453d;
  --gold: #f5b700;
  --sea-green: #3ba776;

  --ink: #f4f7fa;
  --ink-dim: rgba(244, 247, 250, 0.72);
  --ink-faint: rgba(244, 247, 250, 0.5);
  --rule: rgba(244, 247, 250, 0.14);
  --card: rgba(255, 255, 255, 0.05);

  --measure: 68ch;
  --wrap: 1180px;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-card: 20px;
  --header-h: 72px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(1100px 560px at 50% -8%, #0d3c62 0%, transparent 68%),
    radial-gradient(700px 420px at 88% 12%, rgba(245, 183, 0, 0.08), transparent 55%),
    var(--ocean-deep);
  background-attachment: fixed;
  min-height: 100%;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--gold); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 100;
  background: var(--gold);
  color: var(--ocean-deep);
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
}
.skip:focus { top: 12px; }

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

/* ── Wordmark ───────────────────────────────────────────────────────────
   Yellow Queency, oblique, red offset shadow — same treatment as the app. */

.wordmark {
  font-family: "Queency", Georgia, serif;
  font-style: oblique;
  font-weight: 400;
  color: var(--yellow);
  text-shadow: -3px 3px 0 var(--red);
  letter-spacing: 0.01em;
  line-height: 1.05;
  margin: 0;
}

/* ── Glyphs (nautical SVGs as gold/green masks) ───────────────────────── */

.glyph {
  display: inline-block;
  width: 40px;
  height: 40px;
  background: var(--gold);
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
  flex-shrink: 0;
}
.glyph.lg { width: 56px; height: 56px; }
.glyph.sm { width: 28px; height: 28px; }
.glyph.green { background: var(--sea-green); }
.glyph.yellow { background: var(--yellow); }
.glyph.red { background: var(--red); }

/* ── Header ───────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 38, 63, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--rule);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.site-header.is-compact {
  background: rgba(7, 38, 63, 0.92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
  transition: min-height 0.2s ease;
}

.site-header.is-compact .wrap { min-height: 56px; }

.site-header .mark {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  margin-right: auto;
}

.site-header .mark img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.site-header .wordmark {
  font-size: 22px;
  text-shadow: -2px 2px 0 var(--red);
}

nav.links {
  display: flex;
  gap: 26px;
  align-items: center;
}

nav.links a {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

nav.links a:hover,
nav.links a[aria-current="page"] { color: var(--gold); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  position: relative;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  margin: 5px auto;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-header.is-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.site-header.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.is-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.store-badge {
  display: inline-flex;
  line-height: 0;
  text-decoration: none;
}
.store-badge img {
  height: 48px;
  width: auto;
  display: block;
}
.store-badge[aria-disabled="true"] {
  opacity: 1;
  pointer-events: none;
  cursor: default;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  line-height: 1.2;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: var(--gold);
  color: var(--ocean-deep);
  box-shadow: 0 8px 22px rgba(245, 183, 0, 0.22);
}
.btn-primary:hover { background: #ffc933; }

.btn-ghost {
  border-color: rgba(244, 247, 250, 0.45);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.btn[aria-disabled="true"] { opacity: 0.58; pointer-events: none; }

.btn[disabled] {
  opacity: 0.65;
  cursor: wait;
}

.soon {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ocean-deep);
  background: var(--yellow);
  border-radius: 4px;
  padding: 2px 6px;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  padding: 72px 0 28px;
  overflow: hidden;
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.75fr);
  gap: 40px 36px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-copy { min-width: 0; }

.hero h1.fit-line {
  font-size: 1rem;
  margin: 0 0 22px;
  white-space: nowrap;
  max-width: 100%;
}

.hero .lede {
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--ink-dim);
  max-width: none;
  margin: 0 0 32px;
}

.hero-visual {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hero-atmosphere {
  position: absolute;
  inset: -40px -20px 0;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  width: 72px;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.35));
  animation: drift 8s ease-in-out infinite;
}
.orb-a { width: 86px; top: 8%; right: 6%; animation-duration: 9s; }
.orb-b { width: 54px; top: 42%; right: 78%; animation-duration: 7s; animation-delay: -2s; }
.orb-c { width: 40px; top: 18%; left: 8%; animation-duration: 11s; animation-delay: -4s; opacity: 0.85; }
.orb-d { width: 32px; bottom: 18%; right: 12%; animation-duration: 10s; animation-delay: -1s; }

.hero-captain {
  position: absolute;
  left: -6%;
  bottom: 0;
  height: min(560px, 78vw);
  width: auto;
  z-index: 2;
  filter: drop-shadow(0 28px 36px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.hero-visual .phone-stage {
  position: relative;
  z-index: 1;
  margin-left: 22%;
}

.wave {
  display: block;
  width: 100%;
  height: 48px;
  color: rgba(26, 92, 140, 0.28);
  margin-top: -8px;
}
.wave svg { width: 100%; height: 100%; display: block; }

@keyframes drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(10px, -18px) rotate(12deg); }
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ── CSS phone frame ──────────────────────────────────────────────────── */

.phone-stage { display: inline-block; }

.phone {
  --phone-w: 268px;
  width: var(--phone-w);
  aspect-ratio: 1206 / 2622;
  position: relative;
  padding: 11px 10px;
  background: linear-gradient(160deg, #24394c 0%, #0b1722 55%, #081018 100%);
  border-radius: 38px;
  box-shadow:
    0 0 0 1px rgba(245, 183, 0, 0.32),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 28px 50px rgba(0, 0, 0, 0.5),
    0 8px 16px rgba(0, 0, 0, 0.35);
}

.phone::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 86px;
  width: 3px;
  height: 42px;
  background: #1a2c3c;
  border-radius: 2px 0 0 2px;
}

.phone::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 110px;
  width: 3px;
  height: 64px;
  background: #1a2c3c;
  border-radius: 0 2px 2px 0;
}

.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: var(--ocean-deep);
}

.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.tilt-cw { transform: rotate(3.5deg); }
.tilt-ccw { transform: rotate(-3.5deg); }

.phone-hero { --phone-w: 280px; }

/* ── Sections ─────────────────────────────────────────────────────────── */

section.band {
  padding: 80px 0;
  border-top: 1px solid var(--rule);
  position: relative;
}

h2.section-title {
  font-family: "Queency", Georgia, serif;
  font-style: oblique;
  font-weight: 400;
  color: var(--yellow);
  text-shadow: -2px 2px 0 var(--red);
  font-size: clamp(32px, 4.6vw, 46px);
  margin: 0 0 12px;
  line-height: 1.1;
}

.section-lede {
  color: var(--ink-dim);
  max-width: 60ch;
  margin: 0 0 48px;
  font-size: 18px;
}

.section-head { margin-bottom: 8px; }

/* ── Features: alternating rows ───────────────────────────────────────── */

.features { display: flex; flex-direction: column; gap: 72px; }

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.82fr);
  gap: 40px 56px;
  align-items: center;
}

.feature.is-flip {
  grid-template-columns: minmax(240px, 0.82fr) minmax(0, 1fr);
}

.feature.is-flip .feature-copy { order: 2; }
.feature.is-flip .feature-visual { order: 1; }

.feature-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.feature-copy h3 {
  margin: 0 0 12px;
  font-size: clamp(22px, 2.4vw, 28px);
  color: var(--gold);
  letter-spacing: -0.01em;
}

.feature-copy p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 16.5px;
  max-width: 46ch;
}

.feature-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 320px;
}

.feature-visual .phone { --phone-w: 250px; }

.dual-phones {
  position: relative;
  width: min(360px, 100%);
  height: 420px;
}

.dual-phones .phone {
  --phone-w: 210px;
  position: absolute;
}

.dual-phones .phone:first-child {
  left: 0;
  top: 24px;
  z-index: 1;
}

.dual-phones .phone:last-child {
  right: 0;
  top: 0;
  z-index: 2;
}

.platform-pills {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--ink-dim);
  font-size: 13px;
  font-weight: 600;
  background: var(--card);
}

.prize-stage {
  position: relative;
  width: min(340px, 100%);
  height: 420px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.prize-captain {
  height: 380px;
  width: auto;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 22px 28px rgba(0, 0, 0, 0.4));
  animation: floaty 6s ease-in-out infinite;
}

.prize-ball {
  position: absolute;
  z-index: 3;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35));
  animation: drift 7s ease-in-out infinite;
}
.prize-ball.gold { width: 78px; right: 8px; top: 36px; }
.prize-ball.red { width: 56px; left: 12px; top: 88px; animation-delay: -2.5s; }
.prize-ball.white { width: 40px; right: 48px; bottom: 70px; animation-delay: -1s; }

.prize-chest {
  position: absolute;
  width: 72px;
  height: 72px;
  left: 18px;
  bottom: 28px;
  z-index: 1;
  background: var(--gold);
  -webkit-mask: url("assets/icons/treasure_chest_clean.svg") center / contain no-repeat;
  mask: url("assets/icons/treasure_chest_clean.svg") center / contain no-repeat;
  opacity: 0.9;
}

.scan-ticket-art {
  position: absolute;
  width: 88px;
  right: -8px;
  bottom: 24px;
  z-index: 3;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
  pointer-events: none;
}

/* ── Privacy ──────────────────────────────────────────────────────────── */

.band-privacy {
  background:
    radial-gradient(900px 420px at 10% 0%, rgba(59, 167, 118, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(26, 92, 140, 0.22), rgba(7, 38, 63, 0));
}

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  padding: 24px 22px 26px;
}

.card h3 {
  margin: 12px 0 8px;
  font-size: 18px;
  color: var(--gold);
}

.card p { margin: 0; color: var(--ink-dim); font-size: 15.5px; }

.card.privacy {
  border-color: rgba(59, 167, 118, 0.42);
  background: rgba(59, 167, 118, 0.07);
}
.card.privacy h3 { color: var(--sea-green); }

.privacy-actions { margin-top: 32px; }

/* ── Responsible play ─────────────────────────────────────────────────── */

.band-responsible .wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px 36px;
  align-items: start;
}

.responsible-mark {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(59, 167, 118, 0.12);
  border: 1px solid rgba(59, 167, 118, 0.35);
}

.helpline {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* ── Footer ───────────────────────────────────────────────────────────── */

footer.site-footer {
  border-top: 1px solid var(--rule);
  padding: 34px 0 48px;
  color: var(--ink-faint);
  font-size: 14px;
}

footer.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: center;
}

footer.site-footer a { color: var(--ink-dim); text-decoration: none; }
footer.site-footer a:hover { color: var(--gold); }
footer.site-footer .spacer { margin-left: auto; }
footer.site-footer .credit {
  width: 100%;
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 4px;
}

/* ── Doc pages ────────────────────────────────────────────────────────── */

.doc { padding: 56px 0 88px; }
.doc .wrap { max-width: var(--measure); }
.doc h1 { font-size: clamp(36px, 5.6vw, 58px); margin: 0 0 8px; }

.doc .updated {
  color: var(--ink-faint);
  font-size: 14px;
  margin: 0 0 36px;
}

.doc h2 {
  font-size: 21px;
  color: var(--gold);
  margin: 44px 0 10px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.doc h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 28px; }
.doc h3 { font-size: 17px; margin: 26px 0 6px; color: var(--ink); }
.doc p, .doc li { color: var(--ink-dim); }
.doc li { margin-bottom: 8px; }
.doc a { color: var(--gold); }
.doc strong { color: var(--ink); }

.callout {
  background: rgba(59, 167, 118, 0.1);
  border: 1px solid rgba(59, 167, 118, 0.35);
  border-radius: 14px;
  padding: 20px 24px;
  margin: 28px 0 8px;
}
.callout p { margin: 0; color: var(--ink); }

/* ── Support form ─────────────────────────────────────────────────────── */

.support-form {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 28px 26px 26px;
  margin: 8px 0 40px;
}

.form-lede {
  margin: 0 0 22px;
  color: var(--ink-dim);
  font-size: 15.5px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.optional {
  font-weight: 500;
  color: var(--ink-faint);
}

.field input,
.field textarea {
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: rgba(7, 38, 63, 0.55);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px 14px;
  width: 100%;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 183, 0, 0.22);
}

.field textarea { min-height: 140px; resize: vertical; }

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
}

.form-status {
  font-size: 14px;
  min-height: 1.3em;
  color: var(--ink-dim);
}
.form-status.is-error { color: #f0a29c; }
.form-status.is-info { color: var(--gold); }

.form-success {
  background: rgba(59, 167, 118, 0.12);
  border: 1px solid rgba(59, 167, 118, 0.4);
  border-radius: 18px;
  padding: 32px 28px;
  margin: 8px 0 40px;
}
.form-success h2 {
  margin: 12px 0 8px;
  border: 0;
  padding: 0;
  color: var(--sea-green);
  font-size: 22px;
}
.form-success p { margin: 0; }

/* ── Narrow screens ───────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .privacy-grid { grid-template-columns: 1fr 1fr; }
  .feature,
  .feature.is-flip {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .feature.is-flip .feature-copy,
  .feature.is-flip .feature-visual { order: unset; }
  .feature-visual { min-height: 0; }
}

@media (max-width: 760px) {
  :root { --header-h: 64px; }

  .nav-toggle { display: block; }

  nav.links {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(7, 38, 63, 0.96);
    border-bottom: 1px solid var(--rule);
    padding: 8px 24px 16px;
  }

  .site-header.is-open nav.links { display: flex; }

  nav.links a { padding: 12px 0; font-size: 16px; }

  .hero { padding: 36px 0 8px; }
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .hero-visual {
    order: -1;
    min-height: 380px;
  }
  .hero-captain {
    height: min(340px, 70vw);
    left: -4%;
  }
  .hero-visual .phone-stage { margin-left: 28%; }
  .phone-hero { --phone-w: 200px; }
  .hero .lede { max-width: none; }
    .hero h1.fit-line { white-space: nowrap; }

  section.band { padding: 56px 0; }
  .features { gap: 56px; }

  .band-responsible .wrap { grid-template-columns: 1fr; }

  .privacy-grid { grid-template-columns: 1fr; }

  .form-grid { grid-template-columns: 1fr; }

  .site-header .wordmark { font-size: 19px; }

  footer.site-footer .spacer { margin-left: 0; width: 100%; height: 0; }
}

@media (max-width: 400px) {
  .hero-visual { min-height: 320px; }
  .hero-captain { height: 280px; }
  .phone-hero { --phone-w: 168px; }
  .cta-row .btn { width: 100%; }
  .store-badge img { height: 44px; }
}

@media (min-width: 1440px) {
  .phone-hero { --phone-w: 300px; }
  .hero-captain { height: 600px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orb, .prize-captain, .prize-ball { animation: none; }
  [data-parallax] { transform: none !important; }
}

/* ── Polish ───────────────────────────────────────────────────────────── */

.wordmark, h2.section-title { font-synthesis: none; }

.glyph {
  -webkit-mask-size: contain;
  mask-mode: alpha;
}

.btn-primary .soon {
  background: var(--ocean-deep);
  color: var(--yellow);
}

main { overflow-x: hidden; }

.scan-ticket-art {
  width: 150px;
  right: -28px;
  bottom: 18px;
}

@media (max-width: 760px) {
  .dual-phones {
    width: min(300px, 100%);
    height: 360px;
  }
  .dual-phones .phone { --phone-w: 172px; }
  .feature-visual .phone { --phone-w: 220px; }
  .scan-ticket-art { width: 110px; right: -10px; }
  .prize-stage { height: 360px; }
  .prize-captain { height: 320px; }
}
