/* =========================================================================
   Rally — marketing landing page
   Minimal / premium. Near-neutral base, court-green accent used sparingly,
   one soft warm-sand secondary neutral. Light + dark via prefers-color-scheme,
   overridable with a manual [data-theme] toggle on <html>.
   ========================================================================= */

/* ------------------------------ Tokens ---------------------------------- */
:root {
  /* Type */
  --font-display: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  /* Fluid type scale */
  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  --step-1: clamp(1.2rem, 1.12rem + 0.4vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.35rem + 0.75vw, 2rem);
  --step-3: clamp(1.9rem, 1.55rem + 1.75vw, 3rem);
  --step-4: clamp(2.4rem, 1.75rem + 3.25vw, 4.25rem);

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 72px;
  --sp-9: 112px;

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  --wrap: 1120px;

  /* Light theme (default) */
  --bg: #ffffff;
  --bg-alt: #fcfcfd;
  --bg-sand: #f4efe7; /* soft warm sand — the one secondary neutral */
  --surface: #ffffff;
  --ink: #10151b;
  --muted: #5b6472;
  --line: #e7e9ee;
  --line-strong: #d6dae1;
  --accent: #1f7a4d;
  --accent-strong: #196540;
  --accent-text: #ffffff;
  --accent-soft: #e3f1e9;
  --focus: #1f7a4d;
  --shadow: 0 1px 2px rgba(16, 21, 27, 0.04),
    0 12px 32px -12px rgba(16, 21, 27, 0.14);
  --shadow-sm: 0 1px 2px rgba(16, 21, 27, 0.05),
    0 4px 12px -6px rgba(16, 21, 27, 0.1);
}

/* Dark theme — via system preference … */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116;
    --bg-alt: #11151b;
    --bg-sand: #16130f;
    --surface: #161b22;
    --ink: #f5f7fa;
    --muted: #9aa4b2;
    --line: #232a33;
    --line-strong: #313a45;
    --accent: #3dbe7f;
    --accent-strong: #52cf90;
    --accent-text: #04150c;
    --accent-soft: #12321f;
    --focus: #3dbe7f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4),
      0 16px 40px -16px rgba(0, 0, 0, 0.6);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35),
      0 6px 16px -8px rgba(0, 0, 0, 0.5);
  }
}

/* … and via explicit toggle (wins over system) */
:root[data-theme="dark"] {
  --bg: #0e1116;
  --bg-alt: #11151b;
  --bg-sand: #16130f;
  --surface: #161b22;
  --ink: #f5f7fa;
  --muted: #9aa4b2;
  --line: #232a33;
  --line-strong: #313a45;
  --accent: #3dbe7f;
  --accent-strong: #52cf90;
  --accent-text: #04150c;
  --accent-soft: #12321f;
  --focus: #3dbe7f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35),
    0 6px 16px -8px rgba(0, 0, 0, 0.5);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  letter-spacing: -0.005em;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* guard against any accidental horizontal scroll */
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ------------------------ Utilities / a11y ------------------------------ */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 40px);
}

.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-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-text);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 12px;
}

/* Visible, consistent focus for keyboard users */
:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ------------------------------ Buttons --------------------------------- */
.btn {
  --btn-py: 12px;
  --btn-px: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: var(--btn-py) var(--btn-px);
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-0);
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease,
    border-color 0.15s ease, color 0.15s ease;
}
.btn-sm {
  --btn-py: 9px;
  --btn-px: 16px;
  font-size: var(--step--1);
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}
.btn-primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-quiet:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ------------------------------ Wordmark -------------------------------- */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.wordmark-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}
.mark-body {
  fill: var(--bg);
  stroke: var(--ink);
}
.mark-seam {
  stroke: var(--accent);
}

/* ------------------------------ Header ---------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  min-height: 68px;
}
.site-nav {
  display: none;
  gap: clamp(18px, 2.4vw, 34px);
  margin-inline: auto;
}
.site-nav a {
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 500;
  transition: color 0.15s ease;
}
.site-nav a:hover {
  color: var(--ink);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.theme-toggle {
  display: none;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--accent);
}

@media (min-width: 760px) {
  .site-nav {
    display: flex;
  }
  .theme-toggle {
    display: inline-flex;
  }
}

/* ------------------------------ Sections -------------------------------- */
main > section {
  padding-block: clamp(56px, 9vw, var(--sp-9));
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.section-title {
  font-size: var(--step-3);
}
.section-lede {
  margin-top: var(--sp-4);
  color: var(--muted);
  font-size: var(--step-1);
  line-height: 1.5;
}
.section-label {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-6);
}

/* ------------------------------ Hero ------------------------------------ */
.hero {
  padding-top: clamp(40px, 6vw, 72px);
  position: relative;
}
.hero-grid {
  display: grid;
  gap: clamp(40px, 6vw, 64px);
  align-items: center;
}
@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
  margin-bottom: var(--sp-5);
}
.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex: none;
}
.hero-title {
  font-size: var(--step-4);
  font-weight: 700;
  max-width: 15ch;
}
.accent-word {
  color: var(--accent);
  white-space: nowrap;
}
.hero-sub {
  margin-top: var(--sp-5);
  max-width: 46ch;
  font-size: var(--step-1);
  color: var(--muted);
  line-height: 1.5;
}
.hero-cta {
  margin-top: var(--sp-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.hero-note {
  margin-top: var(--sp-5);
  font-size: var(--step--1);
  color: var(--muted);
  max-width: 44ch;
}

/* Hero visual — court-line signature + illustrative match card */
.hero-visual {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 380px;
}
.court {
  width: 100%;
  height: auto;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
}
.court-line {
  stroke: var(--line-strong);
  stroke-width: 1.25;
}
.court-line.net {
  stroke: var(--accent);
  stroke-dasharray: 3 5;
  opacity: 0.85;
}
.court-ball {
  fill: var(--accent);
}
.match-card {
  position: absolute;
  right: -6px;
  bottom: 26px;
  width: min(260px, 82%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: var(--sp-4);
}
.match-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}
.compat-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}
.compat-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}
.compat-word {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.match-card-when {
  font-size: var(--step--1);
  color: var(--muted);
  font-weight: 500;
}
.match-card-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: var(--sp-2);
}
.match-card-reasons {
  display: grid;
  gap: 6px;
  margin-bottom: var(--sp-4);
}
.match-card-reasons li {
  position: relative;
  padding-left: 18px;
  font-size: var(--step--1);
  color: var(--muted);
  line-height: 1.35;
}
.match-card-reasons li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
}
.match-card-foot {
  display: flex;
  gap: 8px;
}
.mini-btn {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: var(--step--1);
  font-weight: 600;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
.mini-btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

/* -------------------------- Intent contrast ----------------------------- */
.contrast {
  background: var(--bg-alt);
  border-block: 1px solid var(--line);
}
.contrast-grid {
  display: grid;
  gap: var(--sp-5);
  align-items: stretch;
}
@media (min-width: 820px) {
  .contrast-grid {
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }
}
.contrast-col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(20px, 3vw, 32px);
}
.contrast-new {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: var(--shadow-sm);
}
.contrast-tag {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-4);
}
.contrast-tag-accent {
  color: var(--accent);
}
.contrast-list {
  display: grid;
  gap: var(--sp-3);
  counter-reset: c;
}
.contrast-list li {
  position: relative;
  padding-left: 30px;
  color: var(--ink);
  counter-increment: c;
}
.contrast-old .contrast-list li {
  color: var(--muted);
}
.contrast-list li::before {
  content: counter(c);
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--line-strong);
}
.contrast-new .contrast-list li::before {
  color: var(--accent-text);
  background: var(--accent);
  border-color: var(--accent);
}
.contrast-arrow {
  display: grid;
  place-items: center;
  color: var(--accent);
}
@media (max-width: 819px) {
  .contrast-arrow svg {
    transform: rotate(90deg);
  }
}

/* ----------------------------- How it works ----------------------------- */
.steps {
  display: grid;
  gap: var(--sp-5);
}
@media (min-width: 620px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1000px) {
  .steps {
    grid-template-columns: repeat(4, 1fr);
  }
}
.step {
  position: relative;
  padding-top: var(--sp-5);
  border-top: 2px solid var(--line-strong);
}
.step-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: var(--sp-3);
}
.step-title {
  font-size: var(--step-1);
  margin-bottom: var(--sp-2);
}
.step-body {
  color: var(--muted);
  font-size: var(--step-0);
}

/* ------------------------------ Features -------------------------------- */
.features {
  background: var(--bg-sand);
  border-block: 1px solid var(--line);
}
.feature-grid {
  display: grid;
  gap: var(--sp-5);
}
@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(22px, 3vw, 34px);
  box-shadow: var(--shadow-sm);
}
.feature-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent-strong);
  margin-bottom: var(--sp-4);
}
.feature-title {
  font-size: var(--step-1);
  margin-bottom: var(--sp-3);
}
.feature-body {
  color: var(--muted);
}

/* Honest availability label chips */
.label-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--sp-4);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink);
}
.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
/* Only "Live" gets the accent — meaning is carried by the label too, not
   colour alone. */
.chip-live {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  color: var(--accent-strong);
}
.chip-live .chip-dot {
  background: var(--accent);
}

/* --------------------------- Trust & privacy ---------------------------- */
.trust-inner {
  display: grid;
  gap: clamp(32px, 5vw, 56px);
  align-items: start;
}
@media (min-width: 900px) {
  .trust-inner {
    grid-template-columns: 1.15fr 0.85fr;
  }
}
.trust-list {
  display: grid;
  gap: var(--sp-5);
  margin-top: clamp(28px, 4vw, 44px);
}
.trust-list li {
  display: flex;
  gap: var(--sp-4);
}
.trust-list strong {
  color: var(--ink);
  font-weight: 600;
}
.trust-list div {
  color: var(--muted);
}
.trust-check {
  flex: none;
  width: 26px;
  height: 26px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--accent-soft);
  position: relative;
}
.trust-check::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 7px;
  width: 6px;
  height: 11px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(43deg);
}
.trust-aside {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-lg);
  padding: clamp(22px, 3vw, 32px);
  box-shadow: var(--shadow-sm);
}
.trust-aside-tag {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-3);
}
.trust-aside-body {
  color: var(--muted);
}

/* ------------------------------- Join ----------------------------------- */
.join {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
}
.join-inner {
  max-width: 620px;
  text-align: center;
  margin-inline: auto;
}
.join-title {
  font-size: var(--step-3);
}
.join-sub {
  margin-top: var(--sp-4);
  color: var(--muted);
  font-size: var(--step-1);
}
.join-form {
  margin-top: var(--sp-6);
}
.join-prototype-note {
  font-size: var(--step--1);
  color: var(--muted);
  margin-bottom: var(--sp-4);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-pill);
}
.join-field {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  justify-content: center;
}
.join-field input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
}
.join-field input::placeholder {
  color: color-mix(in srgb, var(--muted) 80%, transparent);
}
.join-field input:focus-visible {
  border-color: var(--accent);
  outline-offset: 1px;
}
.join-field .btn {
  flex: 0 0 auto;
}
.join-help {
  margin-top: var(--sp-4);
  font-size: var(--step--1);
  color: var(--muted);
}
.join-status {
  margin-top: var(--sp-4);
  font-size: var(--step-0);
  font-weight: 500;
  min-height: 1.4em;
}
.join-status.is-ok {
  color: var(--accent-strong);
}
.join-status.is-error {
  color: #b91c1c;
}
:root[data-theme="dark"] .join-status.is-error,
:root:not([data-theme="light"]) .join-status.is-error {
  color: #f98a8a;
}

/* ------------------------------ Footer ---------------------------------- */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding-block: var(--sp-7) var(--sp-6);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-6);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--line);
}
.footer-tagline {
  margin-top: var(--sp-3);
  color: var(--muted);
  font-size: var(--step--1);
  max-width: 32ch;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-6);
  align-content: start;
}
.footer-nav a {
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 500;
  transition: color 0.15s ease;
}
.footer-nav a:hover {
  color: var(--ink);
}
.footer-fine {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-5);
  padding-top: var(--sp-5);
  color: var(--muted);
  font-size: var(--step--1);
}

/* --------------------------- Scroll reveal ------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* --------------------------- Reduced motion ----------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Language switch link in the header — reuses the theme-toggle look. */
a.lang-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* --------------------- German text-length guards ------------------------ */
/* German: the hero accent phrase ("weniger Nachrichten") is wider than a
   phone viewport — let it wrap. EN keeps nowrap; `normal` only wraps when
   needed, so German desktop is unaffected. */
:lang(de) .accent-word {
  white-space: normal;
}

/* Nav links and pill CTAs never wrap internally (verified safe for EN). */
.site-nav a,
.btn {
  white-space: nowrap;
}

/* The German nav ("So funktioniert's · Funktionen · Vertrauen & Datenschutz")
   doesn't fit on one line until ~940px — keep the mobile header until then. */
@media (min-width: 760px) and (max-width: 959px) {
  html[lang="de"] .site-nav {
    display: none;
  }
}
