/*
 * Cribfolio Legal Site — Stylesheet
 * --------------------------------------------------------------------------
 * SINGLE SOURCE OF TRUTH for the entire site's look + feel.
 *
 * WHEN YOU REDESIGN VIA CLAUDE DESIGN OR A NEW DESIGN TOOL:
 * - You can REPLACE this entire file without touching the HTML pages
 * - The HTML pages use semantic class names (.nav, .hero, .features, etc.)
 *   so a redesign just means restyling those classes
 * - Legal content (privacy.html, terms.html) is generated from the .md files
 *   and uses standard semantic HTML (h1, h2, h3, p, ul, li, table) — no
 *   custom classes, so they'll inherit any new design automatically
 *
 * RESPONSIVE BREAKPOINTS:
 *   - Mobile:  <  640px (default styles)
 *   - Tablet:  640 - 1024px (.@media (min-width: 640px))
 *   - Desktop: > 1024px (@media (min-width: 1024px))
 *
 * TYPOGRAPHY (2026-05-03 — added to match the React Native app):
 *   - Montserrat (Google Fonts) — primary face, 7 weights to match the app's
 *     expo-font loadout (Light/Regular/Medium/SemiBold/Bold/ExtraBold/Black)
 *   - Falls back gracefully to system sans-serif if Google Fonts fails to
 *     load — additive change, zero regression risk
 *   - Loaded with display=swap so initial render is never blocked
 *
 * BRAND COLOR TOKENS (match the React Native app):
 *   --bg-base:    #04071A (primary dark background)
 *   --bg-card:    #1A1A2A (slightly lifted card surface)
 *   --brand-cyan: #38D9F5 (primary accent — links, headers)
 *   --brand-lime: #CCFF35 (CTA, secondary accent)
 *   --brand-purple: #B090FF (subheaders, badges)
 *   --brand-pink: #FF6B9A (danger, errors)
 *   --brand-orange: #FF8840 (warnings, hints)
 *   --brand-teal: #2EE8A0 (success)
 * --------------------------------------------------------------------------
 */

/* Load Montserrat from Google Fonts. display=swap = render with the system
   fallback first, then swap in Montserrat when it loads. Avoids any "flash
   of invisible text" during initial page load. */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg-base: #04071A;
  --bg-card: #1A1A2A;
  --brand-cyan: #38D9F5;
  --brand-lime: #CCFF35;
  --brand-purple: #B090FF;
  --brand-pink: #FF6B9A;
  --brand-orange: #FF8840;
  --brand-teal: #2EE8A0;

  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.78);
  --text-muted: rgba(255, 255, 255, 0.55);
  --text-dim: rgba(255, 255, 255, 0.45);

  --border-default: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);

  --max-content-width: 880px;
  --max-content-width-wide: 1180px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

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

body {
  background: var(--bg-base);
  color: var(--text-primary);
  /* Montserrat leads (matches React Native app); system stack fallback so
     the page renders cleanly if the Google Fonts CDN ever fails to load. */
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Layout primitives ──────────────────────────────────── */
.container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: var(--space-7) var(--space-5) var(--space-8);
}

.container-wide {
  max-width: var(--max-content-width-wide);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* ─── Navigation ─────────────────────────────────────────── */
.nav {
  max-width: var(--max-content-width);
  margin: 0 auto;
  /* Vertical padding trimmed so taller logo doesn't grow the bar.
     Was: var(--space-5) top/bottom. Now: var(--space-2) so bar height
     stays ~the same while logo grew 30% (64→84px). */
  padding: var(--space-2) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-default);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  /* text styling kept as fallback if image fails to load */
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  white-space: nowrap;
  line-height: 1;
}

.nav-logo img {
  height: 84px;
  width: auto;
  display: block;
  max-width: 320px;
}

.nav-logo span {
  color: var(--brand-cyan);
}

.nav-links {
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--brand-cyan);
  outline: none;
}

.nav-links a.active {
  color: var(--text-primary);
}

/* ─── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  letter-spacing: -0.3px;
  line-height: 1.25;
}

h1 {
  font-size: 32px;
  font-weight: 900;
  margin-bottom: var(--space-3);
}

h2 {
  font-size: 22px;
  font-weight: 800;
  margin: var(--space-7) 0 var(--space-4);
  color: var(--brand-cyan);
}

h3 {
  font-size: 17px;
  font-weight: 700;
  margin: var(--space-5) 0 var(--space-2);
  color: var(--brand-purple);
}

h4 {
  font-size: 15px;
  font-weight: 700;
  margin: var(--space-4) 0 var(--space-2);
  color: var(--text-primary);
}

p, li {
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  font-size: 15px;
}

ul, ol {
  padding-left: var(--space-5);
  margin-bottom: var(--space-4);
}

li {
  margin-bottom: var(--space-2);
}

strong {
  color: var(--text-primary);
  font-weight: 700;
}

em {
  color: var(--brand-lime);
  font-style: normal;
  font-weight: 600;
}

a {
  color: var(--brand-cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

a:hover,
a:focus-visible {
  color: var(--brand-lime);
  outline: none;
}

code {
  background: rgba(56, 217, 245, 0.10);
  color: var(--brand-cyan);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 13px;
}

pre {
  background: #0E1018;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--space-4) 0;
  border: 1px solid var(--border-default);
}

pre code {
  background: none;
  color: rgba(255, 255, 255, 0.85);
  padding: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border-default);
  margin: var(--space-6) 0;
}

blockquote {
  border-left: 3px solid var(--brand-cyan);
  padding-left: var(--space-4);
  margin: var(--space-4) 0;
  color: var(--text-muted);
  font-style: italic;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-4) 0;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-default);
}

th {
  color: var(--brand-cyan);
  font-weight: 700;
}

.meta {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: var(--space-6);
}

/* ─── Hero (index page) ──────────────────────────────────── */
.hero {
  text-align: center;
  padding: var(--space-8) var(--space-5) var(--space-7);
  max-width: var(--max-content-width-wide);
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  padding: 6px var(--space-3);
  border-radius: 20px;
  background: rgba(176, 144, 255, 0.10);
  border: 1px solid rgba(176, 144, 255, 0.40);
  color: var(--brand-purple);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-5);
}

.hero h1 {
  font-size: 40px;
  max-width: 720px;
  margin: 0 auto var(--space-4);
  line-height: 1.15;
}

.hero p {
  font-size: 17px;
  max-width: 600px;
  margin: 0 auto var(--space-6);
  color: var(--text-muted);
}

.cta {
  display: inline-block;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  background: var(--brand-lime);
  color: var(--bg-base);
  text-decoration: none;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.3px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cta:hover {
  transform: translateY(-2px);
  color: var(--bg-base);
  box-shadow: 0 8px 24px rgba(204, 255, 53, 0.20);
}

/* ─── Features grid (index page) ─────────────────────────── */
.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin: var(--space-7) 0;
}

.feature {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.feature-icon {
  font-size: 28px;
  margin-bottom: var(--space-3);
}

.feature h3 {
  color: var(--brand-cyan);
  margin-top: 0;
  font-size: 16px;
}

.feature p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ─── Footer ─────────────────────────────────────────────── */
.footer {
  max-width: var(--max-content-width);
  margin: var(--space-8) auto 0;
  padding: var(--space-6) var(--space-5);
  border-top: 1px solid var(--border-default);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  color: var(--text-dim);
  font-size: 13px;
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
  margin-right: var(--space-4);
}

.footer a:hover {
  color: var(--brand-cyan);
}

/* ─── Tablet (640px+) ────────────────────────────────────── */
@media (min-width: 640px) {
  body {
    font-size: 16px;
  }

  h1 { font-size: 36px; }
  h2 { font-size: 24px; }

  .hero h1 { font-size: 52px; }
  .hero p { font-size: 18px; }

  .features {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
  }

  .nav {
    padding: var(--space-5) var(--space-6);
  }

  .container {
    padding: var(--space-8) var(--space-6) var(--space-8);
  }
}

/* ─── Desktop (1024px+) ──────────────────────────────────── */
@media (min-width: 1024px) {
  .hero h1 { font-size: 60px; }
  .hero { padding-top: var(--space-8); padding-bottom: var(--space-8); }

  .features {
    grid-template-columns: repeat(3, 1fr);
  }

  .nav {
    max-width: var(--max-content-width-wide);
  }

  .footer {
    max-width: var(--max-content-width-wide);
  }
}

/* ─── Reduced motion respect ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
