/* ══════════════════════════════════════════════════════════════════════
   3Netra Base — base.css
   Reset, global type, skip link, focus ring, layout utilities
   ══════════════════════════════════════════════════════════════════════ */

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

html {
  scroll-behavior: smooth;
  width: 100%;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  color: var(--color-text-dark);
  background: var(--color-surface-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  transition: background var(--transition-slow), color var(--transition-slow);
}

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

a { color: inherit; text-decoration: none; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

/* ── Skip Link ────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-brand-indigo);
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
  z-index: 9999;
  transition: top var(--transition-fast);
}
.skip-link:focus { top: var(--space-md); }

/* ── Focus Styles (NEVER override) ───────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--color-brand-indigo);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Typography ───────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--lh-heading);
  font-weight: 700;
}

.text-hero    { font-size: var(--text-hero);    line-height: var(--lh-hero);    font-family: var(--font-display); font-weight: 700; }
.text-display { font-size: var(--text-display); line-height: var(--lh-display); font-family: var(--font-display); font-weight: 700; }
.text-h1      { font-size: var(--text-h1);      line-height: var(--lh-heading); font-family: var(--font-display); font-weight: 700; }
.text-h2      { font-size: var(--text-h2);      line-height: var(--lh-heading); font-family: var(--font-display); font-weight: 700; }
.text-h3      { font-size: var(--text-h3); }
.text-body-lg { font-size: var(--text-body-lg); }
.text-small   { font-size: var(--text-small); }
.text-label   { font-size: var(--text-label); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; }

/* ── Eyebrow ──────────────────────────────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-brand-indigo);
  margin-bottom: var(--space-lg);
}
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 2px;
  background: var(--color-brand-indigo);
  border-radius: var(--radius-pill);
}
.eyebrow--light { color: var(--color-brand-indigo-lt); }
.eyebrow--light::before { background: var(--color-brand-indigo-lt); }
.eyebrow--amber { color: var(--color-brand-amber); }
.eyebrow--amber::before { background: var(--color-brand-amber); }
.eyebrow--teal  { color: var(--color-brand-teal); }
.eyebrow--teal::before  { background: var(--color-brand-teal); }

/* ── Layout Utilities ────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--grid-gutter);
}
.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding: var(--space-3xl) 0;
}
@media (max-width: 768px) {
  .section { padding: var(--space-2xl) 0; }
}

/* Surface variants */
.surface-white   { background: var(--color-surface-white); }
.surface-off     { background: var(--color-surface-off); }
.surface-subtle  { background: var(--color-surface-subtle); }
.surface-dark    { background: var(--color-dark-base); }
.surface-dark-card { background: var(--color-dark-card); }

/* In dark mode, flip light surfaces naturally via token overrides.
   Hard-coded dark sections keep their explicit background. */
[data-theme="dark"] .surface-dark    { background: var(--color-dark-base); }
[data-theme="dark"] .surface-dark-card { background: var(--color-dark-card); }

/* Text color helpers */
.text-dark   { color: var(--color-text-dark); }
.text-mid    { color: var(--color-text-mid); }
.text-muted  { color: var(--color-text-muted); }
.text-light  { color: var(--color-text-light); }
.text-dim    { color: var(--color-text-dim); }
.text-indigo { color: var(--color-brand-indigo); }
.text-amber  { color: var(--color-brand-amber); }
.text-teal   { color: var(--color-brand-teal); }
.text-center { text-align: center; }

/* Flex helpers */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--grid-gutter); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--grid-gutter); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--grid-gutter); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* GSAP reveal classes — start hidden, revealed by JS */
.reveal { opacity: 0; transform: translateY(40px); }
.reveal-item { opacity: 0; transform: translateY(40px); }

/* sr-only for screen reader only text */
.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;
}
