/* ═══════════════════════════════════════════════════════════════
   base.css — UnfoundMe Design System
   ═══════════════════════════════════════════════════════════════
   This file is loaded by EVERY page. It contains:
   1. CSS custom properties (colours, spacing, typography)
   2. Dark mode overrides
   3. Minimal reset
   4. Base element styles
   5. Shared utilities (buttons, containers, animations)

   HOW TO CUSTOMISE:
   ─ Change colour values in :root to re-skin the entire site
   ─ Swap font families (update the Google Fonts <link> in HTML too)
   ─ Adjust the spacing scale for tighter/looser layouts

   COLOUR PHILOSOPHY:
   Light mode: clean white/cool-grey canvas, slate text, electric blue accent
   Dark mode:  deep charcoal/navy canvas, same accent pushed brighter
   The accent blue (#2563eb) signals precision, trust, and authority —
   suited to professionals who work with high-value clients.
═══════════════════════════════════════════════════════════════ */


/* ─── 1. DESIGN TOKENS ──────────────────────────────────── */
:root {
  /* ── Backgrounds ── */
  --bg-primary:     #f9fafb;     /* near-white with a cool tint           */
  --bg-surface:     #ffffff;     /* card/panel surfaces                   */
  --bg-subtle:      #f1f3f5;     /* alternate section backgrounds         */
  --bg-elevated:    #ffffff;

  /* ── Text hierarchy ── */
  --text-primary:   #0f172a;     /* slate-900  — headlines, key content   */
  --text-secondary: #475569;     /* slate-600  — body text                */
  --text-tertiary:  #94a3b8;     /* slate-400  — captions, hints          */
  --text-inverse:   #ffffff;

  /* ── Accent — electric blue ── */
  --accent:         #2563eb;     /* blue-600  — primary actions           */
  --accent-soft:    #dbeafe;     /* blue-100  — badges, soft backgrounds  */
  --accent-hover:   #1d4ed8;     /* blue-700  — hover state               */
  --accent-light:   #eff6ff;     /* blue-50   — very subtle tint          */

  /* ── Borders & shadows ── */
  --border:         #e2e8f0;     /* slate-200                             */
  --border-light:   #f1f5f9;     /* slate-100                             */
  --shadow-xs:      0 1px 2px rgba(15,23,42,.04);
  --shadow-sm:      0 1px 3px rgba(15,23,42,.06);
  --shadow-md:      0 4px 12px rgba(15,23,42,.08);
  --shadow-lg:      0 8px 28px rgba(15,23,42,.10);
  --shadow-xl:      0 16px 48px rgba(15,23,42,.12);

  /* ── Radii ── */
  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      20px;
  --radius-xl:      28px;
  --radius-full:    9999px;

  /* ── Typography ──
     Display: Outfit — geometric, modern, confident
     Body:    DM Sans — clean, professional, highly readable              */
  --font-display:   'Outfit', -apple-system, sans-serif;
  --font-body:      'DM Sans', -apple-system, sans-serif;

  /* Type scale */
  --size-xs:        0.75rem;     /* 12px */
  --size-sm:        0.875rem;    /* 14px */
  --size-base:      1rem;        /* 16px */
  --size-lg:        1.125rem;    /* 18px */
  --size-xl:        1.375rem;    /* 22px */
  --size-2xl:       1.75rem;     /* 28px */
  --size-3xl:       2.25rem;     /* 36px */
  --size-4xl:       3rem;        /* 48px */
  --size-5xl:       3.75rem;     /* 60px */

  /* Spacing scale (8px-based) */
  --space-2xs:      0.25rem;     /* 4px  */
  --space-xs:       0.5rem;      /* 8px  */
  --space-sm:       0.75rem;     /* 12px */
  --space-md:       1rem;        /* 16px */
  --space-lg:       1.5rem;      /* 24px */
  --space-xl:       2rem;        /* 32px */
  --space-2xl:      3rem;        /* 48px */
  --space-3xl:      4rem;        /* 64px */
  --space-4xl:      6rem;        /* 96px */

  /* Layout */
  --max-width:      1120px;
  --max-width-sm:   680px;
  --max-width-xs:   440px;

  /* Motion */
  --ease:           cubic-bezier(.4, 0, .2, 1);
  --ease-out:       cubic-bezier(0, 0, .2, 1);
  --duration-fast:  .15s;
  --duration-med:   .3s;
  --duration-slow:  .5s;
}


/* ─── 2. DARK MODE ──────────────────────────────────────── */
[data-theme="dark"] {
  --bg-primary:     #0b0f1a;     /* deep navy-black                      */
  --bg-surface:     #131825;     /* card surfaces                        */
  --bg-subtle:      #1a2035;     /* alternate sections                   */
  --bg-elevated:    #131825;
  --text-primary:   #e8edf5;
  --text-secondary: #8b95a9;
  --text-tertiary:  #4f5b72;
  --accent:         #3b82f6;     /* blue-500 — slightly brighter in dark */
  --accent-soft:    #1e2d4a;
  --accent-hover:   #60a5fa;     /* blue-400                             */
  --accent-light:   #111c36;
  --border:         #1e293b;     /* slate-800                            */
  --border-light:   #162032;
  --shadow-xs:      0 1px 2px rgba(0,0,0,.2);
  --shadow-sm:      0 1px 3px rgba(0,0,0,.25);
  --shadow-md:      0 4px 12px rgba(0,0,0,.35);
  --shadow-lg:      0 8px 28px rgba(0,0,0,.4);
  --shadow-xl:      0 16px 48px rgba(0,0,0,.5);
}


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

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

body {
  font-family: var(--font-body);
  font-size: var(--size-base);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--duration-med) var(--ease),
              color var(--duration-med) var(--ease);
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease);
}

a:hover {
  color: var(--accent-hover);
}

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}


/* ─── 4. BASE ELEMENTS ─────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
}


/* ─── 5. SHARED UTILITIES ──────────────────────────────── */

/* Container — centres content with consistent padding */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--sm {
  max-width: var(--max-width-sm);
}

.container--xs {
  max-width: var(--max-width-xs);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: var(--size-sm);
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--text-inverse);
  background: var(--accent);
  border: none;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease),
              transform var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease);
}

.btn:hover {
  background: var(--accent-hover);
  color: var(--text-inverse);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(37,99,235,.3);
}

.btn:active {
  transform: translateY(0);
}

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}

.btn--ghost:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.btn--sm {
  padding: 10px 22px;
  font-size: var(--size-xs);
}

.btn--lg {
  padding: 18px 40px;
  font-size: var(--size-base);
}

/* Section label — small uppercase eyebrow text */
.section-label {
  font-family: var(--font-body);
  font-size: var(--size-xs);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

/* 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: 0;
}

/* Scroll-triggered reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Theme toggle ── */
.theme-toggle {
  appearance: none;
  border: none;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease),
              transform var(--duration-fast) var(--ease);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--border);
  transform: scale(1.08);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform .4s var(--ease);
}

.theme-toggle:hover svg {
  transform: rotate(20deg);
}

.icon-sun  { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun  { display: block; }
[data-theme="dark"] .icon-moon { display: none; }


/* ─── PRINT ─────────────────────────────────────────────── */
@media print {
  .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
}
