/* ============================================================
   Know First — styles.css
   Brand: Financial precision. Turquoise accent on deep near-black.
   See docs/brand/BRAND-GUIDELINES.md for the full token spec.
   No external dependencies — fully self-contained.
   ============================================================ */

/* ── Font: Plus Jakarta Sans (self-hosted) ──────────────────── */
/* Place woff2 at /fonts/plus-jakarta-sans/PlusJakartaSans-latin.woff2
   (same path as the proQueue heritage project).
   Falls back to the system stack below until the file is served. */
/* Official Plus Jakarta Sans (Google Fonts / OFL, variable 200-800) —
   replaced proQueue's glyph-modified build per founder direction. */
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/plus-jakarta-sans/PlusJakartaSans-latin.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2039-203A, U+20AC, U+2212;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/plus-jakarta-sans/PlusJakartaSans-latin-ext.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Custom properties ─────────────────────────────────────── */
:root {
  /* Backgrounds — slightly cool near-blacks */
  --bg:             #0a0c10;
  --surface:        #111620;
  --surface-raised: #171d2c;

  /* Borders — hairline only; use over shadows for separation */
  --border:         #1e2840;
  --border-subtle:  #151c2b;

  /* Text ramp */
  --text:           #dde4ee;
  --text-muted:     #7e8fa8;
  --text-dim:       #4a5568;

  /* Canonical accent: light turquoise (#5EEAD4 on #0a0c10 = 13.2:1 contrast) */
  --accent:         #5EEAD4;
  --accent-dim:     rgba(94, 234, 212, 0.10);
  --accent-hover:   #81F0E5;

  /* Semantic status — amber for "coming soon" ONLY; error red */
  --amber:          #f59e0b;
  --amber-dim:      rgba(245, 158, 11, 0.12);
  --error:          #f87171;
  --error-dim:      rgba(248, 113, 113, 0.12);

  /* Typeface — Plus Jakarta Sans first; system stack fallback */
  --font:           'Plus Jakarta Sans', system-ui, -apple-system,
                    BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:      ui-monospace, 'Cascadia Code', 'SF Mono', 'Fira Code',
                    monospace;

  /* Radius — one token for all UI elements; pills use 100px inline */
  --radius-sm:      4px;   /* focus ring only */
  --radius:         8px;   /* buttons, inputs, cards, badges */

  /* Elevation — ONE shadow treatment; no colored glows */
  --shadow:         0 4px 16px rgba(0, 0, 0, 0.40);

  /* Layout */
  --max-w:          1060px;
  --gap:            clamp(1.25rem, 4vw, 2.5rem);

  --transition:     0.18s ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

img, svg { display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

ul, ol { list-style: none; }

/* ── Skip link ──────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: #000;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 700;
  z-index: 1000;
  transition: top var(--transition);
}
.skip-link:focus { top: 1rem; }

/* ── Screen-reader only ─────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Honeypot ───────────────────────────────────────────────── */
.hp-field {
  display: none !important;
  visibility: hidden;
  position: absolute;
  left: -9999px;
}

/* ── Layout container ───────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(1rem, 5vw, 2.5rem);
}

/* ── Focus states (visible, themed) ────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition),
              box-shadow var(--transition), opacity var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-accent {
  background: var(--accent);
  color: #000;
  font-size: 1rem;
  padding: 0.875rem 2rem;
  width: 100%;
  border-radius: var(--radius);
}
.btn-accent:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* ── Form elements ──────────────────────────────────────────── */
input[type="email"],
input[type="text"] {
  background: var(--surface-raised);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9375rem;
  padding: 0.75rem 1rem;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

input[type="email"]::placeholder,
input[type="text"]::placeholder {
  color: var(--text-dim);
}

input[type="email"]:focus,
input[type="text"]:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.18);
}

/* ── Site header ────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 12, 16, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
  gap: 1rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  text-decoration: none;
  flex-shrink: 0;
}
.wordmark:hover { color: var(--text); }

.wordmark-img { height: 28px; width: auto; display: block; }
svg.wordmark-img { display: block; } /* inline SVG swap — ensures block layout matches <img> */

.site-header nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.site-header nav a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition);
}
.site-header nav a:hover { color: var(--text); }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  padding-block: clamp(4rem, 12vw, 8rem) clamp(3rem, 8vw, 6rem);
  position: relative;
  overflow: hidden;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
  position: relative;
}

.badge {
  display: inline-block;
  padding: 0.3rem 0.875rem;
  background: var(--accent-dim);
  border: 1px solid rgba(94, 234, 212, 0.25);
  border-radius: 100px;
  color: var(--accent);
  font-size: 0.78125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  max-width: 16ch;
  /* Reserve space for at least 2 lines so the swap from the static fallback
     to a shorter brand-line variant doesn't collapse the hero height. */
  min-height: 2.2em;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-muted);
  max-width: 52ch;
  line-height: 1.7;
}

/* Latency stat — hidden until stats.json provides a value.
   font-variant-numeric: tabular-nums per brand guidelines (numbers in UI). */
#latency-stat {
  font-size: 0.8125rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* "Give it a whirl!" — soft CTA above the signup form.
   Founder-approved copy; intentional exclamation mark (see BRAND-GUIDELINES.md). */
.form-tagline {
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Live time span in brand-line 'a'.
   Tabular numerals required (brand guideline): digits must not shift
   as the clock ticks every 30 s. */
.kf-time {
  font-variant-numeric: tabular-nums;
}

/* ── Signup form ────────────────────────────────────────────── */
.signup-form {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

@media (min-width: 540px) {
  .form-row {
    flex-direction: row;
    align-items: stretch;
  }

  .form-row input[type="email"] {
    flex: 1 1 auto;
    min-width: 0;
  }

  .form-row .btn {
    flex-shrink: 0;
  }
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--text-dim);
  text-align: center;
}

.form-status {
  font-size: 0.875rem;
  font-weight: 600;
  min-height: 1.4em;
  text-align: center;
  padding: 0.5rem 0;
}
.form-status.success { color: var(--accent); }
.form-status.error   { color: var(--error); }

/* ── Section base ───────────────────────────────────────────── */
section {
  padding-block: clamp(3rem, 8vw, 6rem);
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.section-sub {
  color: var(--text-muted);
  font-size: 1.0625rem;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

/* ── How it works ───────────────────────────────────────────── */
.how-it-works {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.how-it-works h2 { margin-bottom: clamp(2rem, 5vw, 3rem); }

.steps {
  display: grid;
  gap: 2rem;
  counter-reset: steps;
}

@media (min-width: 700px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}

.step {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  position: relative;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.step h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.step p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* ── Feed lineup ────────────────────────────────────────────── */
.feeds h2 { margin-bottom: 0.5rem; }

.feed-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin-top: clamp(2rem, 5vw, 3rem);
}

@media (min-width: 600px) {
  .feed-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .feed-grid { grid-template-columns: repeat(3, 1fr); }
  /* First card (live) spans 2 col on 3-col grid */
  .feed-card:first-child { grid-column: span 2; }
}

.feed-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.feed-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

/* Live card: accent border only — no gradient fill */
.feed-live {
  border-color: rgba(94, 234, 212, 0.22);
}

.feed-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.live {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.22);
  animation: pulse-dot 2s ease-in-out infinite;
}

.status-dot.coming {
  background: var(--amber);
  opacity: 0.75;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.22); }
  50%       { box-shadow: 0 0 0 6px rgba(94, 234, 212, 0.08); }
}

.status-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.feed-live .status-label  { color: var(--accent); }
.feed-coming .status-label { color: var(--amber); }

.feed-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.feed-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

/* ── Pricing ────────────────────────────────────────────────── */
.pricing {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.pricing-inner {
  display: flex;
  justify-content: center;
}

.pricing-card {
  background: var(--surface-raised);
  border: 1px solid rgba(94, 234, 212, 0.22);
  border-radius: var(--radius);
  padding: clamp(2rem, 6vw, 3.5rem);
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}

.pricing-badge {
  display: inline-block;
  padding: 0.3rem 0.875rem;
  background: var(--accent-dim);
  border: 1px solid rgba(94, 234, 212, 0.25);
  border-radius: 100px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.price-display {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.125rem;
  margin-bottom: 0.75rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.price-amount {
  font-size: clamp(3.5rem, 10vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text);
}

.price-period {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
  padding-bottom: 0.75rem;
}

.price-desc {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.price-features {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 2rem;
}

.price-features li {
  font-size: 0.9375rem;
  color: var(--text-muted);
  padding-left: 1.25rem;
  position: relative;
}

.price-features li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.875rem;
}

.price-status {
  font-size: 0.875rem;
  font-weight: 600;
  min-height: 1.4em;
  margin-top: 0.75rem;
}
.price-status.success { color: var(--accent); }
.price-status.error   { color: var(--error); }

.price-note {
  font-size: 0.8125rem;
  color: var(--text-dim);
  margin-top: 0.625rem;
}

/* ── FAQ ────────────────────────────────────────────────────── */
.faq h2 { margin-bottom: clamp(2rem, 5vw, 3rem); }

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 760px;
}

.faq-item {
  border-top: 1px solid var(--border);
}
.faq-item:last-child { border-bottom: 1px solid var(--border); }

.faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
  padding: 1.125rem 0;
  cursor: pointer;
  gap: 1rem;
  transition: color var(--transition);
  line-height: 1.4;
}

.faq-q:hover { color: var(--accent); }

.faq-q::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--transition), color var(--transition);
  line-height: 1;
}

.faq-q[aria-expanded="true"]::after {
  content: '\2212';
  color: var(--accent);
  transform: none;
}

.faq-list dd {
  padding-bottom: 1.125rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
  max-width: 68ch;
}

/* ── Bottom CTA ─────────────────────────────────────────────── */
.cta-bottom {
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
}

.cta-bottom .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.cta-bottom h2 {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  letter-spacing: -0.03em;
}

.cta-bottom p {
  color: var(--text-muted);
  max-width: 50ch;
  font-size: 1rem;
}

.signup-form--compact { max-width: 480px; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2.5rem 3rem;
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--text); }

.footer-disclaimers {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.footer-disclaimers p {
  font-size: 0.78125rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ── Divider lines between major sections ───────────────────── */
.section-divider {
  height: 1px;
  background: var(--border);
  border: none;
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Responsive adjustments ─────────────────────────────────── */
@media (max-width: 420px) {
  .site-header nav { display: none; }
  .hero h1 { font-size: 1.875rem; }
}

@media (min-width: 700px) {
  .site-footer .container {
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .footer-disclaimers {
    flex: 0 0 100%;
    order: 3;
  }

  .footer-brand { order: 1; }
  .footer-links { order: 2; }
}

/* ── Foundation mode (pre-launch prod) ─────────────────────────
   Body class added by app.js when KF_MODE === 'foundation'.
   Hides signup mechanics until the product can actually deliver;
   data-foundation text swaps handle the copy. */
.kf-foundation .signup-form,
.kf-foundation .form-tagline,
.kf-foundation #latency-stat,
.kf-foundation .price-interest-row,
.kf-foundation #price-interest {
  display: none;
}
