/* ============================================================
   ThirdEyeOS — Base / Reset / Typography
   ============================================================ */

/* OpenDyslexic — the official dyslexia-friendly typeface (opt-in via Settings) */
@font-face {
  font-family: 'OpenDyslexic';
  src: url('../assets/fonts/opendyslexic-400.woff2') format('woff2');
  font-weight: 300 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'OpenDyslexic';
  src: url('../assets/fonts/opendyslexic-700.woff2') format('woff2');
  font-weight: 600 800; font-style: normal; font-display: swap;
}
html.dys-font { --font: 'OpenDyslexic', 'Poppins', sans-serif; }
/* OpenDyslexic renders much larger than Poppins — scale text down so the UI stays calm.
   The sidebar is the worst offender, so it gets the firmest reduction. */
html.dys-font .nav-item { font-size: 11px; padding: 8px 10px; gap: 9px; letter-spacing: 0; }
html.dys-font .nav-item .ic { width: 16px; height: 16px; }
html.dys-font .nav-group-label { font-size: 8.5px; letter-spacing: 1.4px; }
html.dys-font .brand-word small { font-size: 7.5px; letter-spacing: 1.4px; }
html.dys-font .rail-cta p { font-size: 10.5px; line-height: 1.4; }
html.dys-font .rail-cta .btn { font-size: 11.5px; }
html.dys-font .botnav span { font-size: 8.5px; }
/* gentle global softening for the larger face */
html.dys-font body { letter-spacing: -0.2px; }
html.dys-font .tag, html.dys-font .rem-chip, html.dys-font .vis-chip, html.dys-font .pill { font-size: 10px; }
html.dys-font .btn { font-size: 12.5px; }
html.dys-font .card h3 { font-size: 13px; }
html.dys-font .row .t, html.dys-font .faint, html.dys-font .muted { font-size: 12px; }
html.dys-font .row .s { font-size: 11px; }
html.dys-font .db-t { font-size: clamp(22px, 2.8vw, 32px); }

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

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-1);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  letter-spacing: 0.1px;
  overflow-x: hidden;
}

/* living, breathing ambient glow (deepest layer) */
body::before {
  content: "";
  position: fixed;
  inset: -10%;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(1100px 720px at 78% -6%, rgba(var(--accent-rgb), 0.20), transparent 60%),
    radial-gradient(900px 640px at -8% 106%, rgba(var(--accent-rgb), 0.11), transparent 56%),
    radial-gradient(820px 600px at 42% 52%, rgba(var(--accent-rgb), 0.05), transparent 62%);
  animation: bgbreathe 18s ease-in-out infinite;
  will-change: transform, opacity;
}
@keyframes bgbreathe {
  0%, 100% { opacity: 0.82; transform: scale(1) translate3d(0, 0, 0); }
  50%      { opacity: 1;    transform: scale(1.07) translate3d(0, -1.2%, 0); }
}

/* background fx canvas: circuit traces + aura rings + dust (behind all content) */
#bgfx { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, textarea, select { font-family: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }

/* default icon size — context-specific rules override via higher specificity */
.ic { width: 18px; height: 18px; flex: none; }

/* ---- Type scale ---- */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--text-3);
}
.h-display {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.5px;
}
.h-section {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-2);
}
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(var(--accent-rgb),0.4); background-clip: content-box; }

::selection { background: var(--orange); color: var(--text-on-orange); }

:focus-visible {
  outline: 2px solid var(--orange-bright);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
