/* ============================================================
   Rallie — marketing site
   CourtStack design system: warm off-white surfaces, near-black
   ink, hairline borders, editorial eyebrows, CourtStack blue
   accent. Matches the courtstack.io family of assets.
   ============================================================ */

:root {
  --surface: #fcfcfb;        /* warm off-white */
  --plane: #f2f1ed;          /* warm greige section tint */
  --ink-1: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #898781;
  --grid: #e1e0d9;
  --border: rgba(11, 11, 11, 0.1);
  --accent: #2a78d6;         /* CourtStack blue */
  --accent-dk: #1c5cab;
  --accent-soft: #eef4fd;
  --deep: #0d366b;           /* darkest blue in the scale */
  --warn: #b32e2e;
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;

  /* legacy aliases so any straggler rules stay coherent */
  --bg: var(--surface);
  --bg-alt: var(--plane);
  --bg-card: var(--surface);
  --navy: var(--ink-1);
  --blue: var(--accent);
  --line: var(--grid);
  --text: var(--ink-1);
  --text-dim: var(--ink-2);
  --accent-deep: var(--accent-dk);
  --accent-ink: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--surface);
  color: var(--ink-1);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-dk); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1120px, 92%); margin-inline: auto; }
.narrow { width: min(760px, 92%); }

h1, h2, h3 { line-height: 1.08; color: var(--ink-1); }
h1 { font-size: clamp(2.4rem, 5.4vw, 3.9rem); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); font-weight: 690; letter-spacing: -0.024em; }
h3 { font-size: 1.25rem; font-weight: 680; letter-spacing: -0.012em; line-height: 1.3; }

.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 16px;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); line-height: 1.55; color: var(--ink-2); max-width: 60ch; }
.section-lead { font-size: 1.05rem; line-height: 1.55; color: var(--ink-2); max-width: 62ch; margin-inline: auto; }
.grad { color: var(--accent); -webkit-background-clip: unset; background: none; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--accent-dk);
  color: #fff; padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font); font-weight: 650; font-size: 1rem;
  padding: 14px 26px; border-radius: 7px; border: 2px solid transparent;
  cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease;
  text-decoration: none !important;
}
.btn-primary { background: var(--accent-dk); color: #fff; }
.btn-primary:hover { background: #164a8c; }
.btn-ghost { background: transparent; color: var(--ink-1); border-color: var(--grid); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-sm { padding: 9px 18px; font-size: 0.88rem; }
.btn-lg { padding: 15px 30px; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(252, 252, 251, 0.94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--grid);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand {
  font-weight: 750; font-size: 1.1rem; letter-spacing: -0.015em;
  color: var(--ink-1); text-decoration: none !important;
}
.brand-dot { color: var(--accent); }
.brand-suffix { color: var(--ink-3); font-weight: 500; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--ink-2); font-weight: 560; font-size: 0.92rem; text-decoration: none !important; }
.nav-links a:hover { color: var(--ink-1); }
.nav-links a.btn { color: #fff; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink-1); margin: 5px 0; transition: 0.2s; }
.mobile-menu {
  display: none; flex-direction: column; gap: 4px; padding: 12px 4%;
  border-top: 1px solid var(--grid); background: var(--surface);
}
.mobile-menu a { padding: 12px 8px; color: var(--ink-1); font-weight: 600; text-decoration: none !important; }
.mobile-menu .btn { margin-top: 8px; color: #fff; }
.mobile-menu[hidden] { display: none !important; }

/* ===== Hero ===== */
.hero { position: relative; padding: 84px 0 76px; overflow: hidden; }
.hero-glow {
  position: absolute; top: -220px; right: -160px; width: 640px; height: 640px;
  background: radial-gradient(circle, rgba(42, 120, 214, 0.07), transparent 65%);
  pointer-events: none;
}
.hero-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center;
  position: relative;
}
.hero-copy h1 { margin-bottom: 20px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 32px 0 18px; }
.hero-eligibility { font-size: 0.9rem; color: var(--ink-2); }
.powered-by {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 26px;
  padding: 9px 16px; border: 1px solid var(--grid); border-radius: 7px;
  background: var(--plane);
}
.pb-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink-3); font-weight: 650; }
.pb-brand { font-size: 0.88rem; color: var(--ink-2); }
.pb-brand strong { color: var(--ink-1); font-weight: 680; }

/* Rating card visual — a clean data card in the CourtStack idiom */
.hero-visual { position: relative; }
.rating-card {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 26px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.09);
  color: var(--ink-1);
}
.rc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.rc-avatar {
  width: 42px; height: 42px; border-radius: 7px; background: var(--accent-soft);
  color: var(--accent-dk); font-weight: 750; display: grid; place-items: center; font-size: 0.9rem;
}
.rc-name { display: block; font-weight: 680; font-size: 0.95rem; }
.rc-sub { display: block; font-size: 0.75rem; color: var(--ink-3); }
.rc-badge {
  margin-left: auto; font-size: 0.66rem; font-weight: 750; letter-spacing: 0.1em;
  color: var(--accent-dk); border: 1px solid var(--accent); border-radius: 4px; padding: 3px 8px;
}
.rc-rating { text-align: center; margin-bottom: 22px; border-top: 1px solid var(--grid); border-bottom: 1px solid var(--grid); padding: 18px 0; }
.rc-num {
  display: block; font-size: 4rem; font-weight: 730;
  color: var(--accent); line-height: 0.94; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.rc-lab { font-size: 0.72rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 680; margin-top: 8px; display: inline-block; }
.rc-bars { display: grid; gap: 12px; margin-bottom: 20px; }
.rc-bar { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 12px; }
.rc-bar-lab { font-size: 0.8rem; color: var(--ink-2); font-weight: 600; }
.rc-bar-track { height: 8px; border-radius: 4px; background: var(--plane); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(11, 11, 11, 0.055); }
.rc-bar-fill {
  display: block; height: 100%; width: var(--w); border-radius: 4px;
  background: linear-gradient(90deg, #6da7ec, var(--accent));
  animation: grow 1.2s ease both;
}
@keyframes grow { from { width: 0; } }
.rc-next {
  border-top: 1px solid var(--grid); padding-top: 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.rc-next-lab { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink-3); font-weight: 650; }
.rc-next-drill { font-weight: 680; font-size: 0.95rem; }
.float-chip {
  position: absolute; background: var(--surface); border: 1px solid var(--border);
  border-radius: 7px; padding: 10px 14px; font-size: 0.82rem; font-weight: 600;
  color: var(--ink-1); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}
.chip-a { top: -16px; left: -28px; animation: floaty 5s ease-in-out infinite; }
.chip-b { bottom: -14px; right: -18px; animation: floaty 6s ease-in-out 0.8s infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ===== Strip ===== */
.strip { background: var(--accent-soft); color: var(--ink-1); padding: 13px 0; border-block: 1px solid var(--grid); }
.strip-inner { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 10px 24px; }
.strip-item { font-size: 0.9rem; color: var(--ink-2); }
.strip-item strong { color: var(--accent-dk); font-weight: 680; }

/* ===== Sections ===== */
.section { padding: 88px 0; }
.section-alt { background: var(--plane); border-block: 1px solid var(--grid); }
.section-dark { background: var(--deep); color: #fff; }
.section-dark h2 { color: #fff; }
.section-dark .kicker { color: #9ec5f4; }
.section-dark .section-lead { color: #cde2fb; }
.section-head { text-align: center; margin-bottom: 52px; }
.section-head h2 { margin-bottom: 16px; }

/* Steps — hairline cards, CourtStack loop idiom */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps-4 { grid-template-columns: repeat(4, 1fr); }
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px 28px; position: relative; overflow: hidden;
}
.step::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--accent);
}
.step-num {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 7px; background: var(--accent-soft); color: var(--accent-dk);
  font-weight: 730; font-size: 1.05rem; margin-bottom: 16px;
}
.step h3 { margin-bottom: 9px; }
.step p { color: var(--ink-2); font-size: 0.94rem; line-height: 1.5; }

/* Split layout */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split h2 { margin-bottom: 20px; }
.feature-list { list-style: none; display: grid; gap: 13px; margin: 22px 0 28px; }
.feature-list li { color: var(--ink-2); padding-left: 26px; position: relative; font-size: 0.97rem; line-height: 1.5; }
.feature-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-dk); font-weight: 750; }
.feature-list strong { color: var(--ink-1); font-weight: 680; }

/* Plan mock — 1px stat-grid idiom */
.plan-mock {
  background: var(--grid); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; font-size: 0.92rem; display: grid; gap: 1px;
}
.pm-row {
  display: grid; grid-template-columns: 70px 1fr 110px; gap: 12px;
  padding: 15px 20px; background: var(--surface);
}
.pm-head {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--ink-3); font-weight: 680;
}
.pm-row span { font-variant-numeric: tabular-nums; }
.pm-active { background: var(--accent-soft); box-shadow: inset 5px 0 0 var(--accent); }

/* Drill library (legacy classes kept harmless) */
.drill-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 36px; }
.pill {
  font-family: var(--font); font-weight: 650; font-size: 0.85rem;
  padding: 9px 18px; border-radius: 7px; cursor: pointer;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--grid);
  transition: 0.15s;
}
.pill:hover { border-color: var(--ink-3); color: var(--ink-1); }
.pill.is-active { background: var(--ink-1); color: #fff; border-color: var(--ink-1); }
.drill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.drill {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; transition: border-color 0.2s;
}
.drill.is-hidden { display: none; }
.drill:hover { border-color: var(--ink-3); }
.drill h3 { margin: 12px 0 8px; }
.drill p { color: var(--ink-2); font-size: 0.92rem; margin-bottom: 14px; }
.drill-tag {
  display: inline-block; font-size: 0.68rem; font-weight: 750; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 4px;
}
.tag-preset { background: var(--accent-soft); color: var(--accent-dk); }
.tag-elite { background: #cde2fb; color: var(--deep); }
.tag-custom { background: var(--plane); color: var(--ink-2); }
.tag-other { background: var(--plane); color: var(--ink-3); }
.drill-meta { font-size: 0.76rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 650; }
.drill-note { text-align: center; color: var(--ink-2); font-size: 0.9rem; margin-top: 30px; }

/* Tiers (legacy classes kept harmless) */
.tier-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 420px)); gap: 16px; justify-content: center; }
.tier {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 34px 30px; position: relative; color: var(--ink-1);
}
.tier-featured { border: 2px solid var(--accent); }
.tier-flag {
  position: absolute; top: -13px; left: 28px; background: var(--accent-dk); color: #fff;
  font-size: 0.7rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 4px;
}
.tier-name { font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.tier-price { font-size: 2rem; font-weight: 720; letter-spacing: -0.028em; margin-bottom: 20px; color: var(--ink-1); }
.tier-list { list-style: none; display: grid; gap: 10px; margin-bottom: 26px; }
.tier-list li { color: var(--ink-2); font-size: 0.95rem; }
.tier-fine { font-size: 0.78rem; color: var(--ink-3); text-align: center; margin-top: 12px; }

/* FAQ (legacy classes kept harmless) */
.faq {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  margin-bottom: 12px; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 20px 24px; font-weight: 650; list-style: none;
  display: flex; justify-content: space-between; align-items: center; color: var(--ink-1);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--accent-dk); transition: 0.2s; }
.faq[open] summary::after { transform: rotate(45deg); }
.faq p { padding: 0 24px 20px; color: var(--ink-2); }

/* Signup */
.section-signup { background: var(--plane); border-top: 1px solid var(--grid); }
.signup-form {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 32px; display: grid; gap: 18px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.07);
}
.field { display: grid; gap: 7px; }
.field label { font-size: 0.85rem; font-weight: 650; color: var(--ink-1); }
.optional { color: var(--ink-3); font-weight: 500; }
.field input, .field select, .field textarea {
  font-family: var(--font); font-size: 0.95rem; color: var(--ink-1);
  background: var(--surface); border: 1px solid var(--grid);
  border-radius: 7px; padding: 12px 14px; width: 100%; transition: border-color 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.field select option { background: var(--surface); }
.field textarea { resize: vertical; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.form-status { font-size: 0.9rem; font-weight: 600; min-height: 1.2em; }
.form-status.ok { color: var(--accent-dk); }
.form-status.err { color: var(--warn); }
.form-fine { font-size: 0.78rem; color: var(--ink-3); text-align: center; }

/* ===== Footer — light, hairline-ruled ===== */
.site-footer { border-top: 1px solid var(--grid); padding: 48px 0 0; background: var(--surface); color: var(--ink-1); }
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px;
  padding-bottom: 36px;
}
.site-footer .brand { color: var(--ink-1); }
.site-footer .brand-suffix { color: var(--ink-3); }
.footer-brand p { color: var(--ink-2); font-size: 0.9rem; margin-top: 10px; line-height: 1.55; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; }
.footer-links a { color: var(--ink-2); font-size: 0.9rem; text-decoration: none !important; }
.footer-links a:hover { color: var(--ink-1); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  border-top: 1px solid var(--grid); padding: 18px 0; font-size: 0.82rem; color: var(--ink-3);
}
.site-footer .pb-brand { color: var(--ink-3); }
.site-footer .pb-brand strong { color: var(--ink-1); }

/* Mobile sticky CTA */
.mobile-cta {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  padding: 12px 4% calc(12px + env(safe-area-inset-bottom));
  background: rgba(252, 252, 251, 0.95); backdrop-filter: blur(10px);
  border-top: 1px solid var(--grid);
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .rc-bar-fill, .float-chip, .pulse-dot { animation: none; }
  html { scroll-behavior: auto; }
}

/* ===== Responsive ===== */
@media (max-width: 1000px) {
  .steps-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .hero-grid, .split { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { max-width: 440px; margin-inline: auto; }
  .steps, .drill-grid { grid-template-columns: 1fr 1fr; }
  .tier-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .mobile-menu { display: flex; }
  .steps, .steps-4, .drill-grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 48px; }
  .section { padding: 64px 0; }
  .chip-a { left: -6px; }
  .chip-b { right: -4px; }
  .mobile-cta { display: block; }
  body { padding-bottom: 74px; }
  .signup-form { padding: 24px 20px; }
}
