/* =============================================================
   LARKEN DESIGN SYSTEM — main.css
   Design tokens, reset, base typography, layout utilities.
   All values mirror the Design Bible (design_bible.md v1.0).
   ============================================================= */

/* ---- Google Fonts preconnect (also done via functions.php) ---- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400&family=Outfit:wght@300;400;500;600;700&display=swap');


/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* Backgrounds */
  --ls-bg:              #0a0a0a;
  --ls-surface:         #161616;
  --ls-surface-2:       #1e1e1e;
  --ls-surface-3:       #252525;

  /* Accent — Indigo */
  --ls-accent:          #6366f1;
  --ls-accent-2:        #818cf8;
  --ls-accent-3:        #a5b4fc;
  --ls-glow:            rgba(99, 102, 241, 0.35);
  --ls-glow-sm:         rgba(99, 102, 241, 0.15);
  --ls-glow-xs:         rgba(99, 102, 241, 0.08);

  /* Borders */
  --ls-border:          rgba(99, 102, 241, 0.18);
  --ls-border-subtle:   rgba(255, 255, 255, 0.07);
  --ls-border-medium:   rgba(255, 255, 255, 0.12);

  /* Text */
  --ls-text:            #f1f5f9;
  --ls-text-muted:      #94a3b8;
  --ls-text-faint:      #475569;

  /* Border Radii */
  --ls-radius:          16px;
  --ls-radius-sm:       10px;
  --ls-radius-xs:       6px;
  --ls-radius-pill:     999px;

  /* Transitions */
  --ls-transition:      all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  --ls-transition-slow: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);

  /* Layout */
  --ls-container-max:   1400px;
  --ls-content-max:     1200px;
  --ls-prose-max:        720px;
  --ls-section-pad-v:   120px;
  --ls-section-pad-h:    60px;
  --ls-nav-height:       72px;

  /* Font families */
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body:    'Outfit', system-ui, -apple-system, sans-serif;
}


/* ============================================================
   2. CSS RESET  (specificity 0-0-0 via :where — safe!)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

:where(*, *::before, *::after) {
  margin:  0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  line-height: 1.6;
  background-color: var(--ls-bg);
  color: var(--ls-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

ul, ol { list-style: none; }

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


/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ls-text);
}

h1 { font-size: clamp(48px, 7vw, 96px); }
h2 { font-size: clamp(36px, 5vw, 64px); }
h3 { font-size: clamp(24px, 3vw, 36px); letter-spacing: -0.02em; }
h4 { font-size: clamp(18px, 2.5vw, 24px); letter-spacing: -0.01em; }

p {
  font-family: var(--font-body);
  color: var(--ls-text-muted);
  line-height: 1.7;
  font-size: 1rem;
}

/* Links */
a {
  transition: color var(--ls-transition);
}
a:hover { color: var(--ls-accent-2); }
a:focus-visible {
  outline: 2px solid var(--ls-accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Section label pattern ("—— TOOLKIT") */
.ls-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ls-text-muted);
  margin-bottom: 20px;
}
.ls-label-dash {
  color: var(--ls-accent);
  letter-spacing: 0;
}

/* Accent-colored inline text */
.ls-accent-text {
  color: var(--ls-accent-2);
  background: linear-gradient(135deg, var(--ls-accent) 0%, var(--ls-accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* ============================================================
   4. LAYOUT UTILITIES
   ============================================================ */

/* Full-width section (background spans viewport) */
.ls-section {
  width: 100%;
  padding: var(--ls-section-pad-v) 0;
}

/* Centered content container */
.ls-section-inner {
  width: min(var(--ls-container-max), 100% - var(--ls-section-pad-h) * 2);
  margin-inline: auto;
}

/* Prose-width container (case studies) */
.ls-prose-inner {
  width: min(var(--ls-prose-max), 100% - 48px);
  margin-inline: auto;
}

/* Section header group */
.ls-section-header {
  margin-bottom: 64px;
}
.ls-section-title {
  margin-bottom: 16px;
  line-height: 1.1;
}
.ls-section-sub {
  max-width: 560px;
  font-size: 1.05rem;
}


/* ============================================================
   5. ADMIN BAR OFFSET
   ============================================================ */
.admin-bar .ls-header {
  top: 32px;
}
@media (max-width: 782px) {
  .admin-bar .ls-header {
    top: 46px;
  }
}


/* ============================================================
   6. SCROLLBAR
   ============================================================ */
::-webkit-scrollbar         { width: 5px; }
::-webkit-scrollbar-track   { background: var(--ls-bg); }
::-webkit-scrollbar-thumb   { background: var(--ls-surface-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ls-accent); }


/* ============================================================
   7. SELECTION
   ============================================================ */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: var(--ls-text);
}


/* ============================================================
   8. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ============================================================
   9. RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (max-width: 900px) {
  :root {
    --ls-section-pad-v: 80px;
    --ls-section-pad-h: 40px;
  }
}

@media (max-width: 600px) {
  :root {
    --ls-section-pad-v: 64px;
    --ls-section-pad-h: 24px;
  }
  h1 { font-size: clamp(40px, 11vw, 56px); }
  h2 { font-size: clamp(30px, 8vw, 48px); }
}
