/* =========================================================================
   NAAM JAP · BASE
   Reset, global typography, body, focus states, utilities, accessibility.
   ========================================================================= */

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* Small creator line directly beneath a page headline */
.site-maker {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--bg);
  background-image: var(--paper-texture);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { max-width: var(--prose-max); }
a { color: var(--primary); text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--accent-strong); }
strong { font-weight: var(--label-weight); }

/* Numbers & stat figures */
.num, [data-stat] {
  font-variant-numeric: tabular-nums;
  font-weight: var(--number-weight);
  letter-spacing: var(--tracking);
}

/* Devanagari */
.dev { font-family: var(--font-dev); }
.dev-lg { font-family: var(--font-dev); font-size: var(--mantra-size); line-height: 1.5; }

/* Selected / highlight */
::selection { background: var(--accent-soft); color: var(--ink); }

/* Focus visibility — accessible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}
:focus:not(:focus-visible) { outline: none; }

/* Skip link */
.skip-link {
  position: absolute; left: var(--space-3); top: -60px;
  background: var(--surface-raised); color: var(--ink);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); z-index: var(--z-toast);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--space-3); }

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

/* ---- Layout helpers ---------------------------------------------------- */
.container { width: 100%; max-width: var(--page-max); margin-inline: auto; padding-inline: var(--page-gutter); }
.prose { max-width: var(--prose-max); }

.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;
}

.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }
.creator-credit { font-size: var(--text-xs); color: var(--ink-faint); letter-spacing: 0.01em; }
.creator-credit a { color: var(--accent-strong); text-decoration: none; }
.creator-credit a:hover { text-decoration: underline; }
.eyebrow {
  font-family: var(--font-body); font-size: var(--text-xs);
  font-weight: var(--label-weight); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-strong);
}
.gutter-y { padding-block: var(--section-gap) 0; }

/* Vertical rhythm for prose sections */
.stack > * + * { margin-top: var(--space-5); }
.stack-sm > * + * { margin-top: var(--space-3); }

/* ---- Reveal-on-scroll base (JS toggles .is-in) -------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}