:root {
  --bg: #050505;
  --fg: #f4f4f5;
  --muted: #9a9aa3;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #34D2CD;
  --accent-soft: rgba(52, 210, 205, 0.14);
  --accent-strong: rgba(52, 210, 205, 0.28);
  --danger: #ff6b7a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box }
html, body { min-height: 100%; min-height: 100dvh }
body {
  margin: 0;
  color: var(--fg);
  font-family: Manrope, system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(900px 480px at 50% -10%, rgba(52, 210, 205, 0.16), transparent 58%),
    radial-gradient(600px 320px at 0% 40%, rgba(52, 210, 205, 0.06), transparent 50%),
    linear-gradient(180deg, #070707 0%, var(--bg) 45%, #030303 100%);
  background-attachment: fixed;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

a { color: inherit; text-decoration: none }
button { font: inherit; color: inherit; cursor: pointer }

.page {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: calc(28px + var(--safe-top)) 20px calc(40px + var(--safe-bottom));
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.back {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
}
.back:hover { color: var(--accent) }

/* Corner mark: no glow; black square blends into page */
.brand-mark {
  width: 42px;
  height: auto;
  display: block;
  filter: none;
  background: transparent;
}

.site-footer {
  margin: 28px 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}
.site-footer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer a:hover { color: var(--accent) }

/* Thanks */
.thanks {
  display: none;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  padding: 28px 20px 24px;
}
.thanks.show { display: block; }
.thanks .check {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-strong);
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 800;
  box-shadow: 0 0 24px rgba(52, 210, 205, 0.2);
}
.thanks h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.thanks p {
  margin: 12px auto 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}
.thanks a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.thanks .back-home {
  display: inline-flex;
  margin-top: 20px;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(180deg, #4aefe9 0%, #34d2cd 42%, #1fa8a3 100%);
  color: #031414;
  font-weight: 800;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.28) inset,
    0 -2px 0 rgba(0,0,0,0.22) inset,
    0 0 18px rgba(52, 210, 205, 0.28);
}

/* Legal */
.legal-page { width: min(640px, 100%); }
.legal-hero { text-align: center; margin-bottom: 18px; }
.legal-hero h1 {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2rem);
  letter-spacing: -0.03em;
}
.legal-hero p {
  margin: 8px auto 0;
  color: var(--muted);
  max-width: 40ch;
}
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}
.legal-nav a {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 6px 10px;
}
.legal-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  padding: 18px 16px;
  margin-bottom: 12px;
}
.legal-card h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
.legal-card p,
.legal-card li {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}
.legal-card p { margin: 0 0 10px; }
.legal-card p:last-child { margin-bottom: 0; }
.legal-card ul {
  margin: 0 0 10px;
  padding-left: 1.1rem;
}
.legal-card a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cookie-reset { margin-top: 12px; }

/* Cookie gate — full lock for outside the US */
html.cookie-locked,
html.cookie-locked body {
  overflow: hidden !important;
  touch-action: none;
  overscroll-behavior: none;
}
html.cookie-locked body > *:not(#cookie-banner) {
  pointer-events: none !important;
  user-select: none !important;
}

/* US soft mode: discreet full-width bottom bar */
html.cookie-us-soft body {
  padding-bottom: 92px;
}

.cookie-banner {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.cookie-banner.show {
  opacity: 1;
  pointer-events: auto;
}
.cookie-banner[data-mode="us"] {
  inset: auto 0 0 0;
  display: block;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
}
.cookie-banner[data-mode="us"].show .cookie-card {
  pointer-events: auto;
}

.cookie-card {
  width: min(420px, 100%);
  margin: 0 auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(12, 12, 14, 0.98);
  box-shadow: 0 18px 50px rgba(0,0,0,0.55);
  padding: 18px 16px 16px;
}
.cookie-banner[data-mode="us"] .cookie-card {
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 8, 10, 0.92);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.28);
  padding: 10px 18px calc(10px + var(--safe-bottom));
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 20px;
  row-gap: 2px;
  align-items: center;
}
.cookie-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}
.cookie-banner[data-mode="us"] .cookie-card > p {
  margin: 0;
  text-align: left;
  font-size: 0.78rem;
  line-height: 1.35;
  grid-column: 1;
}
.cookie-banner[data-mode="us"] .cookie-card > p:first-of-type {
  grid-row: 1;
}
.cookie-banner[data-mode="us"] .cookie-card > #cookie-note {
  grid-row: 2;
  margin-top: 0 !important;
  font-size: 0.7rem !important;
  opacity: 0.8;
}
.cookie-card a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  pointer-events: auto;
}
.cookie-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.cookie-banner[data-mode="us"] .cookie-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 10px;
}
.cookie-btn {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 8px 10px;
  font-size: 0.86rem;
  font-weight: 700;
  pointer-events: auto;
}
.cookie-btn.ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  min-height: 36px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cookie-btn.solid {
  min-height: 52px;
  font-size: 1rem;
  font-weight: 800;
  border-color: rgba(255,255,255,0.22);
  background: linear-gradient(180deg, #4aefe9 0%, #34d2cd 42%, #1fa8a3 100%);
  color: #031414;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.28) inset,
    0 10px 24px rgba(0,0,0,0.35),
    0 0 28px rgba(52, 210, 205, 0.4);
}
.cookie-banner[data-mode="us"] .cookie-btn.solid {
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border-color: rgba(52, 210, 205, 0.35);
  background: rgba(52, 210, 205, 0.16);
  color: #9ff5f1;
  box-shadow: none;
}
.cookie-banner[data-mode="us"] .cookie-btn.solid:hover {
  background: rgba(52, 210, 205, 0.24);
}
.cookie-banner[data-mode="us"] .cookie-btn.ghost {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.85;
}
@media (max-width: 640px) {
  html.cookie-us-soft body {
    padding-bottom: 120px;
  }
  .cookie-banner[data-mode="us"] .cookie-card {
    grid-template-columns: 1fr;
    row-gap: 8px;
    padding: 12px 14px calc(12px + var(--safe-bottom));
  }
  .cookie-banner[data-mode="us"] .cookie-card > p {
    text-align: left;
  }
  .cookie-banner[data-mode="us"] .cookie-actions {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    justify-content: flex-start;
  }
}

@media (min-width: 700px) and (max-width: 1024px) and (max-height: 900px) {
  .page { width: min(560px, 92vw); }
}

@media (max-width: 360px) {
  .page { padding-left: 14px; padding-right: 14px; }
}
