/* ==================================================================
   Blaualgen Radar — website design system.
   Tokens mirror app/src/design/tokens.ts. Colour encodes SOURCE,
   never "safe". Green never appears next to water. (GAUNTLET C-01)
   ================================================================== */

:root {
  /* Brand ramp */
  --brand-900: #0B3E7A;
  --brand-800: #10529E;
  --brand-700: #1668D6;
  --brand-600: #2B84F5;
  --brand-500: #3D9BFF;
  --brand-300: #8FC8FF;
  --brand-200: #BEDFFF;
  --brand-100: #DCEDFF;
  --brand-50:  #F1F8FF;

  /* Ink */
  --ink-900: #0B1B2B;
  --ink-800: #122539;
  --ink-700: #1E3448;
  --ink-500: #5A7186;
  --ink-400: #8098AD;
  --ink-300: #A9BDCE;
  --ink-200: #C9D8E4;

  /* Surfaces */
  --card: #FFFFFF;
  --canvas: #EAF3FC;
  --canvas-deep: #E1EDF9;
  --inset: #F2F7FC;
  --line: #E2ECF6;
  --line-strong: #D2E1EF;

  /* Source semantics */
  --official: #E4483C;
  --official-strong: #C7362B;
  --official-tint: #FDECEA;
  --official-on-tint: #B7301F;
  --news: #F59328;
  --news-strong: #D97706;
  --news-tint: #FFF4E6;
  --news-on-tint: #A85D04;
  --community: #2B84F5;
  --community-strong: #1668D6;
  --community-tint: #E8F2FE;
  --community-on-tint: #1257B4;
  --neutral: #8296AA;
  --neutral-strong: #66798C;
  --neutral-tint: #EFF3F7;
  --neutral-on-tint: #4C5F72;

  /* Radii */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-xxl: 28px;
  --r-sheet: 30px;
  --r-pill: 999px;

  /* Shadows — blue-tinted, never grey */
  --shadow-sm: 0 2px 10px rgba(11, 62, 122, 0.06);
  --shadow-md: 0 6px 20px rgba(11, 62, 122, 0.11);
  --shadow-lg: 0 12px 32px rgba(11, 62, 122, 0.14);
  --shadow-brand: 0 6px 16px rgba(22, 104, 214, 0.38);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(20px, 5vw, 48px);
  --section-max: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink-800);
  background: var(--canvas);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* height:auto keeps width/height attributes as layout hints while
   letting aspect-ratio rules win (attribute height otherwise blocks it) */
img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--brand-200); color: var(--ink-900); }

h1, h2, h3, h4 {
  color: var(--ink-900);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.wrap { max-width: var(--section-max); margin: 0 auto; padding-inline: var(--gutter); }

/* ------------------------------------------------------------------
   Navigation
   ------------------------------------------------------------------ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}
.nav.scrolled {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  max-width: var(--section-max);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--ink-900); }
.nav-logo:hover { text-decoration: none; }
.nav-logo img, .nav-logo svg { width: 34px; height: 34px; }
.nav-links { display: flex; gap: 24px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--ink-700); font-weight: 600; font-size: 15px; }
.nav-links a:hover { color: var(--brand-700); text-decoration: none; }
.nav-cta {
  background: var(--brand-600);
  color: #fff !important;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-brand);
  transition: transform 0.15s ease, background 0.15s ease;
}
.nav-cta:hover { background: var(--brand-700); transform: translateY(-1px); text-decoration: none; }
@media (max-width: 720px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .nav-inner { padding: 10px 16px; gap: 12px; }
  .nav-cta { padding: 9px 16px; font-size: 14px; }
  .nav-logo { font-size: 16px; }
}

/* ------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  min-height: 48px;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-700); }
.btn-ghost { background: rgba(255, 255, 255, 0.85); color: var(--ink-800); border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: #fff; }
.btn-dark { background: var(--ink-900); color: #fff; }
.btn-dark:hover { background: var(--ink-700); }

/* Store badges */
.store-badges { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.store-badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink-900); color: #fff;
  border-radius: 14px; padding: 10px 18px;
  min-width: 168px; min-height: 54px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.store-badge:hover { transform: translateY(-2px); text-decoration: none; }
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge .sb-lines { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.store-badge .sb-top { font-size: 10.5px; opacity: 0.75; letter-spacing: 0.02em; }
.store-badge .sb-bottom { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.store-badge.soon { opacity: 0.92; }
.store-badge .sb-soon {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em;
  background: var(--brand-600); border-radius: 99px; padding: 2px 7px; margin-left: 6px;
}

/* ------------------------------------------------------------------
   Chips / badges
   ------------------------------------------------------------------ */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: var(--r-pill);
  padding: 7px 14px;
  font-size: 13.5px; font-weight: 700;
  letter-spacing: 0.01em;
}
.chip-brand { background: var(--community-tint); color: var(--community-on-tint); }
.chip-official { background: var(--official-tint); color: var(--official-on-tint); }
.chip-news { background: var(--news-tint); color: var(--news-on-tint); }
.chip-neutral { background: var(--neutral-tint); color: var(--neutral-on-tint); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* ------------------------------------------------------------------
   Cards
   ------------------------------------------------------------------ */
.card {
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ------------------------------------------------------------------
   Phone frame — screenshots already contain their own status bar
   ------------------------------------------------------------------ */
.phone {
  position: relative;
  width: min(320px, 78vw);
  border-radius: 48px;
  background: #0d1522;
  padding: 10px;
  box-shadow: 0 24px 60px rgba(11, 62, 122, 0.28), 0 4px 12px rgba(11, 62, 122, 0.14),
    inset 0 0 0 2px #2a3648;
}
.phone::after {
  /* subtle screen gloss */
  content: "";
  position: absolute; inset: 10px;
  border-radius: 38px;
  background: linear-gradient(145deg, rgba(255,255,255,0.10) 0%, transparent 32%);
  pointer-events: none;
}
.phone img {
  border-radius: 38px;
  width: 100%;
  aspect-ratio: 640 / 1391;
  object-fit: cover;
  background: var(--canvas-deep);
}
.phone.small { width: min(250px, 66vw); border-radius: 40px; padding: 8px; }
.phone.small img, .phone.small::after { border-radius: 32px; }

/* ------------------------------------------------------------------
   Map pins (web) — mirror the app's teardrop markers
   ------------------------------------------------------------------ */
.pin {
  position: relative;
  width: 34px; height: 44px;
  filter: drop-shadow(0 4px 8px rgba(11, 27, 43, 0.3));
}
.pin .pin-body {
  position: absolute; inset: 0 0 10px 0;
  border-radius: 50% 50% 50% 50%;
  border: 3px solid #fff;
  display: flex; align-items: center; justify-content: center;
}
.pin::after {
  content: "";
  position: absolute; left: 50%; bottom: 2px;
  width: 12px; height: 12px;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 2px;
}
.pin-official .pin-body, .pin-official::after { background: var(--official); }
.pin-news .pin-body, .pin-news::after { background: var(--news); }
.pin-community .pin-body, .pin-community::after { background: var(--community); }
.pin-neutral .pin-body, .pin-neutral::after { background: var(--neutral); }
.pin svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------------
   Sections
   ------------------------------------------------------------------ */
.section { padding: clamp(72px, 10vw, 128px) 0; position: relative; }
.section-head { max-width: 720px; margin: 0 auto 56px; text-align: center; }
.section-head h2 { font-size: clamp(30px, 4.4vw, 46px); margin-bottom: 16px; }
.section-head p { font-size: clamp(16px, 2vw, 19px); color: var(--ink-500); }
.eyebrow {
  display: inline-block;
  font-size: 13px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--brand-700);
  margin-bottom: 14px;
}

/* ------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */
.footer {
  background: var(--ink-900);
  color: #B9C9D9;
  padding: 64px 0 40px;
  font-size: 14.5px;
}
.footer a { color: #DCEAF7; }
.footer h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer ul { list-style: none; display: grid; gap: 9px; }
.footer-note {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 24px;
  font-size: 13px;
  color: #8CA2B6;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
}
.footer-disclaimer {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-md);
  padding: 16px 20px;
  font-size: 13.5px;
  color: #A7BACC;
  margin-bottom: 32px;
}

/* ------------------------------------------------------------------
   Legal / prose pages
   ------------------------------------------------------------------ */
.prose { max-width: 780px; margin: 0 auto; padding: 140px var(--gutter) 96px; }
.prose h1 { font-size: clamp(30px, 4.5vw, 42px); margin-bottom: 10px; }
.prose .prose-meta { color: var(--ink-500); font-size: 14.5px; margin-bottom: 40px; }
.prose h2 { font-size: 24px; margin: 44px 0 14px; }
.prose h3 { font-size: 18.5px; margin: 30px 0 10px; }
.prose p, .prose li { color: var(--ink-700); font-size: 16px; }
.prose p { margin-bottom: 14px; }
.prose ul, .prose ol { padding-left: 24px; margin-bottom: 16px; display: grid; gap: 6px; }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0 24px; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-strong); vertical-align: top; }
.prose th { color: var(--ink-900); background: var(--inset); }
.prose .notice {
  background: var(--community-tint);
  border: 1px solid var(--brand-200);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 15px;
  color: var(--community-on-tint);
}
.prose .warn {
  background: var(--official-tint);
  border: 1px solid #F5C6C0;
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 15px;
  color: var(--official-on-tint);
}

/* ------------------------------------------------------------------
   Motion helpers — CSS-transition reveals driven by class toggles.
   Robust by design: the .gs-in end state is plain CSS, so content
   appears even if frames/timers stall; the transition is only decor.
   Hidden states apply only when JS runs (html.has-js).
   ------------------------------------------------------------------ */
html.has-js .gs-up,
html.has-js .gs-fade,
html.has-js .gs-left,
html.has-js .gs-right,
html.has-js .gs-zoom {
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
html.has-js .gs-up { opacity: 0; transform: translateY(44px); }
html.has-js .gs-fade { opacity: 0; }
html.has-js .gs-left { opacity: 0; transform: translateX(-56px); }
html.has-js .gs-right { opacity: 0; transform: translateX(56px); }
html.has-js .gs-zoom { opacity: 0; transform: scale(0.92); }
html.has-js .gs-in { opacity: 1 !important; transform: none !important; will-change: auto; }

.float-loop { animation: float 9s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-10px) rotate(0.6deg); }
  75% { transform: translateY(8px) rotate(-0.6deg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.has-js .gs-up, html.has-js .gs-fade, html.has-js .gs-left, html.has-js .gs-right, html.has-js .gs-zoom {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 12px; z-index: 999;
  background: #fff; color: var(--ink-900); padding: 10px 18px; border-radius: 10px;
  box-shadow: var(--shadow-md); font-weight: 700;
}
.skip-link:focus { left: 12px; }

:focus-visible { outline: 3px solid var(--brand-500); outline-offset: 2px; border-radius: 4px; }
