:root {
  --bg: #070a0f;
  --surface: #0d1219;
  --surface-2: #111923;
  --surface-3: #16212d;
  --border: #24303e;
  --border-strong: #34475a;
  --text: #f2f6fa;
  --soft: #c9d4df;
  --muted: #91a0af;
  --accent: #52d6b8;
  --accent-strong: #7fe7cf;
  --accent-ink: #052019;
  --blue: #66b8ff;
  --warning: #f3c969;
  --danger: #ff8792;
  --success: #69d7a4;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 46px rgba(0, 0, 0, .22);
  --max: 1240px;
  --measure: 72ch;
  --header-height: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { max-width: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 1rem); overflow-x: clip; }
body {
  margin: 0;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: clip;
  max-width: 100%;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% -10%, rgba(82, 214, 184, .09), transparent 30rem),
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
  background-size: auto, 56px 56px, 56px 56px;
  mask-image: linear-gradient(#000 0%, transparent 76%);
}
a { color: inherit; }
img { max-width: 100%; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
button, input, select, textarea { font: inherit; }
button { min-height: 44px; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--warning); outline-offset: 3px; }
::selection { background: rgba(82, 214, 184, .28); }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 1000;
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }
.site-shell { min-height: 100vh; }
.container { width: min(calc(100% - 2.5rem), var(--max)); margin-inline: auto; }
.measure { max-width: var(--measure); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(52, 71, 90, .75);
  background: rgba(7, 10, 15, .9);
  backdrop-filter: blur(16px);
}
.site-nav {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  position: relative;
  top: auto;
  z-index: auto;
}
.brand { display: inline-flex; flex-direction: column; min-width: max-content; text-decoration: none; line-height: 1.05; }
.brand strong { font-family: "Syne", system-ui, sans-serif; font-size: 1.08rem; letter-spacing: .06em; text-transform: uppercase; }
.brand span { margin-top: .25rem; color: var(--muted); font: 500 .62rem/1 "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.nav-main { display: flex; align-items: center; gap: .2rem; margin-left: auto; }
.nav-item { position: relative; }
.nav-link, .nav-trigger, .language-trigger, .menu-toggle {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: 0 .78rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--soft);
  font-size: .88rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.nav-link:hover, .nav-trigger:hover, .language-trigger:hover { background: var(--surface-2); color: var(--text); }
.nav-trigger::after, .language-trigger::after { content: ""; width: .38rem; height: .38rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.nav-menu {
  position: absolute;
  top: calc(100% + .45rem);
  left: 0;
  min-width: 230px;
  display: none;
  padding: .45rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #0b1118;
  box-shadow: var(--shadow);
}
.nav-item.open > .nav-menu, .language.open > .language-menu { display: grid; }
.nav-menu a { display: grid; gap: .1rem; padding: .7rem .75rem; border-radius: 7px; text-decoration: none; }
.nav-menu a:hover { background: var(--surface-2); }
.nav-menu strong { font-size: .84rem; }
.nav-menu span { color: var(--muted); font-size: .72rem; }
.language { position: relative; z-index: 110; }
.language-trigger { padding-inline: .7rem; }
.language-trigger svg { width: 18px; height: 18px; }
.language-menu { right: 0; left: auto; z-index: 120; min-width: 250px; max-height: min(520px, calc(100vh - 90px)); overflow-y: auto; }
.language-menu a { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: .7rem; min-height: 44px; }
.language-menu a[aria-current="page"] { background: rgba(82, 214, 184, .1); box-shadow: inset 3px 0 0 var(--accent); }
.language-menu .language-name { overflow: hidden; color: var(--text); font-size: .82rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.language-flag { width: 24px; height: 16px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.language-flag img { width: 100%; height: 100%; display: block; object-fit: contain; }
.language-menu small { color: var(--muted); font: 500 .67rem "DM Mono", monospace; text-transform: uppercase; }
.menu-toggle { display: none; border: 1px solid var(--border); }
.menu-toggle svg { width: 20px; height: 20px; }

.page-main { width: min(calc(100% - 2.5rem), var(--max)); margin-inline: auto; padding: clamp(3.5rem, 7vw, 6.5rem) 0 3rem; }
.eyebrow, .kicker {
  margin: 0 0 .8rem;
  color: var(--accent);
  font: 600 .72rem/1.4 "DM Mono", monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
}
h1, h2, h3 { font-family: "Syne", system-ui, sans-serif; letter-spacing: -.02em; }
h1 { margin: 0; font-size: clamp(2.7rem, 6vw, 5.4rem); line-height: .98; }
h2 { margin: 0; font-size: clamp(1.75rem, 3.5vw, 2.8rem); line-height: 1.1; }
h3 { margin: 0; font-size: 1.05rem; line-height: 1.25; }
.lead { max-width: 720px; margin: 1.25rem 0 0; color: var(--soft); font-size: clamp(1.02rem, 1.8vw, 1.18rem); }
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section + .section { border-top: 1px solid rgba(36, 48, 62, .72); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.6rem; }
.section-head p { max-width: 640px; margin: .55rem 0 0; color: var(--muted); }
.section-link { color: var(--accent); font-weight: 700; text-decoration: none; white-space: nowrap; }
.section-link:hover { text-decoration: underline; text-underline-offset: .25em; }

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .72rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--accent-strong); }
.button.secondary { border-color: var(--border-strong); background: transparent; color: var(--text); }
.button.secondary:hover { border-color: var(--accent); background: rgba(82, 214, 184, .06); }
.button.tertiary { padding-inline: .7rem; background: transparent; color: var(--muted); }
.button:disabled { opacity: .55; cursor: not-allowed; }
.button-row { display: flex; flex-wrap: wrap; gap: .7rem; }
.text-link { color: var(--accent); font-weight: 700; text-decoration: none; }

.card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(17, 25, 35, .96), rgba(13, 18, 25, .96));
  box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
}
.card-interactive { transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.card-interactive:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.icon-box { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(82, 214, 184, .22); border-radius: 11px; background: rgba(82, 214, 184, .08); color: var(--accent); }
.icon-box svg { width: 22px; height: 22px; }
.badge { min-height: 26px; display: inline-flex; align-items: center; padding: .2rem .55rem; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--soft); font: 650 .68rem "DM Mono", monospace; letter-spacing: .05em; text-transform: uppercase; }
.badge.live { border-color: rgba(105, 215, 164, .35); background: rgba(105, 215, 164, .08); color: var(--success); }
.badge.ended { border-color: rgba(145, 160, 175, .35); background: rgba(145, 160, 175, .08); color: var(--muted); }
.badge.updated { border-color: rgba(102, 184, 255, .35); background: rgba(102, 184, 255, .08); color: var(--blue); }
.muted { color: var(--muted); }
.mono { font-family: "DM Mono", monospace; }

.referral-card { padding: clamp(1.25rem, 3vw, 1.8rem); border-color: rgba(82, 214, 184, .35); }
.referral-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.referral-label { display: block; color: var(--muted); font: 650 .7rem "DM Mono", monospace; letter-spacing: .12em; text-transform: uppercase; }
.referral-code { display: block; margin-top: .45rem; color: var(--text); font: 700 clamp(1.28rem, 3vw, 1.9rem)/1.2 "DM Mono", monospace; letter-spacing: .08em; overflow-wrap: anywhere; }
.referral-card p { margin: 1rem 0 0; color: var(--muted); font-size: .9rem; }
.referral-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.copy-status { min-height: 1.3rem; margin-top: .65rem; color: var(--success); font-size: .82rem; }
.disclosure { padding-top: 1rem; border-top: 1px solid var(--border); }

.site-footer { margin-top: 3rem; padding: 0; border-top: 1px solid var(--border); background: rgba(13, 18, 25, .65); color: inherit; text-align: left; font-size: inherit; }
.footer-grid { display: grid; grid-template-columns: minmax(260px, 1.2fr) repeat(2, minmax(150px, .55fr)); gap: 2rem; padding: 3rem 0 2rem; }
.footer-brand p { max-width: 470px; margin: .8rem 0 0; color: var(--muted); }
.footer-col h2 { margin: 0 0 .75rem; color: var(--soft); font: 650 .72rem "DM Mono", monospace; letter-spacing: .12em; text-transform: uppercase; }
.footer-col a { display: block; width: fit-content; margin-top: .45rem; color: var(--muted); font-size: .9rem; text-decoration: none; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { padding: 1.15rem 0 calc(1.15rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); color: var(--muted); font-size: .78rem; }

.sticky-referral { display: none; }
.noscript { margin: 1rem auto; padding: .8rem 1rem; border: 1px solid var(--warning); border-radius: var(--radius-sm); color: var(--soft); }

@media (max-width: 960px) {
  :root { --header-height: 64px; }
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .nav-main {
    position: fixed;
    inset: var(--header-height) 0 auto 0;
    max-height: calc(100vh - var(--header-height));
    display: none;
    overflow-y: auto;
    padding: .75rem 1.25rem calc(1.2rem + env(safe-area-inset-bottom));
    border-bottom: 1px solid var(--border-strong);
    background: #090e14;
    box-shadow: var(--shadow);
  }
  .nav-main.open { display: grid; }
  .nav-item, .language { width: 100%; }
  .nav-link, .nav-trigger, .language-trigger { width: 100%; justify-content: space-between; min-height: 48px; padding-inline: .85rem; }
  .nav-menu { position: static; min-width: 0; margin: .2rem 0 .6rem; box-shadow: none; }
  .language { z-index: auto; }
  .language-menu { max-height: none; overflow: visible; }
  .brand span { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  input, select, textarea { font-size: 16px !important; }
  .container, .page-main { width: min(calc(100% - 2rem), var(--max)); }
  .page-main { padding-top: 3.25rem; }
  h1 { font-size: clamp(2.45rem, 13vw, 3.55rem); }
  .section { padding-block: 3rem; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .button-row, .referral-actions { display: grid; grid-template-columns: 1fr; }
  .button { width: 100%; min-height: 48px; }
  .referral-top { display: block; }
  .referral-code { font-size: clamp(1.15rem, 7vw, 1.5rem); }
  .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .footer-brand { grid-column: auto; }
  body.has-sticky-referral { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .sticky-referral {
    position: fixed;
    z-index: 90;
    left: .6rem;
    right: .6rem;
    bottom: calc(.55rem + env(safe-area-inset-bottom));
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem .5rem .45rem .8rem;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: rgba(13, 18, 25, .96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
  }
  .sticky-referral[hidden] { display: none; }
  .sticky-referral-label { min-width: 0; flex: 1; color: var(--muted); font-size: .68rem; line-height: 1.2; }
  .sticky-referral-label strong { display: block; color: var(--text); font: 650 .84rem "DM Mono", monospace; letter-spacing: .04em; }
  .sticky-copy { width: auto; min-width: 62px; min-height: 44px; flex: 0 0 auto; padding: .55rem .7rem; }
  .sticky-dismiss { width: 44px; min-width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
