/* ============================================================================
   PADEV Zenith — base layer
   Installed type families, reset, atmosphere, and canonical type hierarchy.
   Load order: tokens → base → layout → components → motion.
   ========================================================================== */

/* --- Installed display / body families -----------------------------------
   Night pairing  : Space Grotesk (display) + DM Sans (body)  — dark board 01/10
   Day pairing    : Space Grotesk (display) + Inter (body)    — light board 01
   Satoshi remains the owner's licensed Day display option; the @font-face slot
   below is intentionally left for it and documented in assets/fonts/README.md.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/dm-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/dm-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Day switches the body face to Inter, matching light board 01 typography. */
[data-theme="day"] {
  --font-body: "Inter", "DM Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--color-canvas);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-body-lg);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Atmosphere: aurora bloom + faint construction grid, per board 10 lighting. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-canvas);
}

body::before {
  background: var(--atmosphere);
  filter: saturate(var(--aurora-saturation));
  opacity: var(--aurora-alpha);
}

body::after {
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  mask-image: radial-gradient(circle at 50% 22%, var(--mask-opaque) 0%, transparent 78%);
}

body > * {
  position: relative;
  z-index: var(--z-content);
}

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

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

/* --- Typography hierarchy -------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6,
.z-display-1,
.z-display-2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-heading);
  color: var(--color-text);
  text-wrap: balance;
}

.z-display-1 {
  font-size: var(--text-display-1);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
}

.z-display-2 {
  font-size: var(--text-display-2);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display-2);
}

h1 {
  font-size: var(--text-h1);
  letter-spacing: var(--tracking-heading);
}

h2 {
  font-size: var(--text-h2);
  letter-spacing: var(--tracking-heading);
}

h3 {
  font-size: var(--text-h3);
  letter-spacing: var(--tracking-h3);
  font-weight: var(--weight-semibold);
}

h4,
h5,
h6 {
  font-size: var(--text-body-lg);
  letter-spacing: var(--tracking-h3);
  font-weight: var(--weight-semibold);
}

p {
  margin: 0;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--duration-hover) var(--ease-default);
}

a:hover {
  color: var(--color-primary-strong);
}

small,
.z-small {
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-small);
}

.z-body-sm {
  font-size: var(--text-body);
  letter-spacing: var(--tracking-body);
}

.z-lead {
  font-size: var(--text-body-lg);
  color: var(--color-text-soft);
  line-height: var(--leading-body);
  text-wrap: pretty;
}

.z-muted {
  color: var(--color-text-muted);
}

.z-faint {
  color: var(--color-text-faint);
}

.z-w-300 { font-family: var(--font-display); font-weight: var(--weight-light); }
.z-w-400 { font-family: var(--font-display); font-weight: var(--weight-regular); }
.z-w-500 { font-family: var(--font-display); font-weight: var(--weight-medium); }
.z-w-600 { font-family: var(--font-display); font-weight: var(--weight-semibold); }
.z-w-700 { font-family: var(--font-display); font-weight: var(--weight-bold); }

.z-mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0;
}

/* Eyebrow / board label — the numbered caption style used on every board. */
.z-eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* inline-block keeps the paint box on the glyphs, so the ramp completes
   across the word instead of trailing off into empty line space. */
.z-gradient-text {
  display: inline-block;
  background: var(--gradient-wordmark);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Focus and skip link --------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-tight);
}

.z-skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  translate: -50% -120%;
  z-index: var(--z-overlay);
  padding: var(--space-12) var(--space-24);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: var(--color-primary);
  color: var(--color-on-action);
  font-weight: var(--weight-medium);
  transition: translate var(--duration-s) var(--ease-default);
}

.z-skip-link:focus-visible {
  translate: -50% 0;
  color: var(--color-on-action);
}

.z-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- Scrollbar ------------------------------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
}

*::-webkit-scrollbar-track {
  background: transparent;
}
