/* ============================================================
   KOJILABS — CSS Reset
   A modern, opinionated reset for premium Apple-style interfaces.
   Sets the foundation: box model, typography, rendering, and
   sensible element defaults so every component starts clean.
   ============================================================ */

/* ── Google Fonts ────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Universal Box Model ─────────────────────────────────────
   border-box ensures padding and borders are included inside
   the declared width/height — critical for predictable layouts. */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Root & Document ─────────────────────────────────────────── */
html {
  /* Smooth anchor scrolling across the page */
  scroll-behavior: smooth;

  /* Prevent font-size inflation on mobile orientation change */
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* ── Base Typography ─────────────────────────────────────────── */
body {
  /* System font stack with Inter as the primary web font.
     Falls back through the native system UI stack for the
     fastest possible first paint if Inter hasn't loaded yet. */
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI',
               Roboto, Helvetica, Arial, sans-serif,
               'Apple Color Emoji', 'Segoe UI Emoji';

  /* Sub-pixel antialiasing for crisp, thin text on macOS/iOS.
     Grayscale AA on other platforms for consistent rendering. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;

  /* Sensible baseline for line-height */
  line-height: 1.5;
}

/* ── Images & Media ──────────────────────────────────────────── */
img,
picture,
video,
canvas,
svg {
  /* Prevent images from overflowing their containers */
  max-width: 100%;
  display: block;
}

/* ── Links ───────────────────────────────────────────────────── */
a {
  text-decoration: none;
  color: inherit;
}

/* ── Buttons ─────────────────────────────────────────────────── */
button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}

/* ── Form Elements ───────────────────────────────────────────── */
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* ── Lists ───────────────────────────────────────────────────── */
ul,
ol {
  list-style: none;
}

/* ── Tables ──────────────────────────────────────────────────── */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ── Text Selection ──────────────────────────────────────────
   Branded selection color that adapts to the current theme's
   accent via custom properties (defined in variables.css). */
::selection {
  background-color: var(--accent, #FFFFFF);
  color: var(--bg, #000000);
}

::-moz-selection {
  background-color: var(--accent, #FFFFFF);
  color: var(--bg, #000000);
}

/* ── Scrollbar (WebKit / Blink) ──────────────────────────────
   Minimal, unobtrusive scrollbar that respects the dark theme. */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--surface-border, rgba(255, 255, 255, 0.08));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary, rgba(255, 255, 255, 0.35));
}

/* ── Reduced Motion ──────────────────────────────────────────
   Respect user preferences for reduced motion. Animations
   and transitions are disabled globally when this is set. */

