/* ============================================================
   core.css — Chedders DNA V3
   Global Resets · Typography · Layout Foundation
   Overflow/pull protection per §5.4
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700&display=swap');

/* ──────────────────────────────────────────
   BASE RESET
────────────────────────────────────────── */

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

/* V3 §5.4 — Prevent Android WebView horizontal overflow */
html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;   /* prevent horizontal overflow at root */
  max-width: 100%;
}

body {
  font-family: 'Inter', 'Plus Jakarta Sans', 'Manrope', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--background);
  overflow-x: hidden;   /* belt-and-braces horizontal lock */
  max-width: 100%;
  position: relative;
  transition: background-color var(--transition-base), color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ──────────────────────────────────────────
   TYPOGRAPHY SCALE — V3 §3.3
────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, sans-serif;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  transition: color var(--transition-base);
}

/* H1 — clamp(28px, 4vw, 42px) per V3 §3.3 */
h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* H2 — clamp(20px, 3vw, 28px) per V3 §3.3 */
h2 {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* H3 — clamp(16px, 2vw, 20px) per V3 §3.3 */
h3 {
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 600;
}

h4 { font-size: 16px; font-weight: 600; }
h5 { font-size: 14px; font-weight: 600; letter-spacing: 0; }

p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  transition: color var(--transition-base);
}

small {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

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

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

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

ul, ol { list-style: none; padding: 0; margin: 0; }
figure  { margin: 0; }

figcaption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
  text-align: center;
}

blockquote { margin: 0; padding: 0; border: none; font-style: normal; }

/* ──────────────────────────────────────────
   LAYOUT — CONTAINER
   V3 §5.6 — max-width 1320px, centered
────────────────────────────────────────── */

.container {
  max-width: 1320px;
  padding-left: 24px;
  padding-right: 24px;
  overflow: hidden; /* clip any child that attempts to escape */
}

/* ──────────────────────────────────────────
   SECTION BASE
────────────────────────────────────────── */

section { position: relative; transition: background-color var(--transition-base); }

/* ──────────────────────────────────────────
   GLOBAL THEME TRANSITIONS
────────────────────────────────────────── */

nav, header, footer, article, aside,
.card-custom, .status-card, .security-card, .ecosystem-card,
.founder__card, .early-access, .about__stat, .why-card,
.phil-card, .approach-item, .footer-grid {
  transition: background-color var(--transition-base),
              border-color var(--transition-base),
              box-shadow var(--transition-base),
              color var(--transition-base);
}

/* ──────────────────────────────────────────
   REDUCED MOTION — V3 §9 canonical pattern
────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fade-in-up { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ──────────────────────────────────────────
   SCROLLBAR
────────────────────────────────────────── */

::-webkit-scrollbar        { width: 6px; }
::-webkit-scrollbar-track  { background: var(--surface); }
::-webkit-scrollbar-thumb  { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
