/* ─── Design Tokens & System Primitives (Simple Writing Editorial System) ─── */

:root {
  /* Typography: Titan One Display + IBM Plex Mono Body/Subheadings/Meta */
  --font-display: "Titan One", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;

  /* Site-wide font aliases so all components share the monospace editorial rhythm */
  --font-body: var(--font-mono);
  --font-sans: var(--font-mono);
  --font-serif: var(--font-mono);
  --font-editorial-sans: var(--font-mono);
  --font-meta: var(--font-mono);
  --font-caption: var(--font-mono);
  --font-source-code: var(--font-mono);

  /* Scale (anchored to 1rem = 16px root) */
  --text-meta: 0.75rem;       /* 12px */
  --text-sm: 0.875rem;        /* 14px */
  --text-base: 1rem;          /* 16px */
  --text-h3: 1.25rem;         /* 20px */
  --text-h2: 1.5rem;          /* 24px */
  --text-h1: 2rem;            /* 32px — standard 2em H1 scale on 16px base */

  /* Legacy Typography Scale Aliases */
  --font-size-xs: var(--text-meta);
  --font-size-meta: var(--text-meta);
  --font-size-sm: var(--text-sm);
  --font-size-body: var(--text-base);
  --font-size-md: 1.125rem;
  --font-size-h3: var(--text-h3);
  --font-size-h2: var(--text-h2);
  --font-size-intro: var(--text-h3);
  --font-size-h1: var(--text-h1);
  --font-size-quote: 2rem;

  /* Weights */
  --font-weight-light: 400;
  --font-weight-regular: 400;
  --font-weight-body: 400;
  --font-weight-meta: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 700;
  --font-weight-bold: 700;
  --font-weight-display: 700;

  /* Rhythm & Measure (720px text column, 1024px wide media & layout column) */
  --leading-body: 1.5;
  --leading-display: 1.2;
  --leading-subheading: 1.3;
  --line-height-tight: var(--leading-display);
  --line-height-base: var(--leading-body);
  --line-height-relaxed: 1.6;

  --content-max-width: 720px;
  --media-max-width: 1024px;
  --cutout-radius: 0.75rem;   /* 12px rounded cutout corners */
  --space-unit: 1.5rem;       /* 24px — matches 1 line-height unit (16px * 1.5) */

  /* Editorial Tier & Container Aliases */
  --tier-full-bleed: 100vw;
  --tier-wide-media: var(--media-max-width);
  --tier-pullout: var(--media-max-width);
  --tier-prose: var(--content-max-width);
  --container: var(--media-max-width);
  --container-narrow: var(--content-max-width);
  --container-readable: var(--content-max-width);
  --nav-height: 4rem;         /* 64px clean header height */

  /* Spacing Scale */
  --space-3xs: 0.125rem;      /* 2px */
  --space-2xs: 0.25rem;       /* 4px */
  --space-xs: 0.5rem;         /* 8px */
  --space-sm: 0.75rem;        /* 12px */
  --space-md: 1rem;           /* 16px */
  --space-lg: 1.5rem;         /* 24px */
  --space-xl: 2rem;           /* 32px */
  --space-2xl: 3rem;          /* 48px */
  --space-3xl: 4rem;          /* 64px */
  --space-4xl: 5rem;          /* 80px */

  --page-padding-inline: 1.5rem;

  /* Foldable & Dual-Screen Spanning Primitives */
  --fold-active: 0;
  --fold-posture: continuous;
  --fold-segment-0-width: 50%;
  --fold-segment-1-width: 50%;
  --fold-segment-0-inline-size: 50%;
  --fold-segment-1-inline-size: 50%;
  --fold-segment-top-height: 50%;
  --fold-segment-bottom-height: 50%;
  --fold-hinge-width: 0px;
  --fold-hinge-height: 0px;
  --fold-seam-gutter: var(--space-2xl);
  --fold-seam-gutter-block: var(--space-2xl);
  --fold-page-padding: var(--space-lg);
  --fold-spine-shadow: none;

  /* Shape & Radius */
  --radius-xs: 0.25rem;       /* 4px */
  --radius-sm: 0.375rem;      /* 6px */
  --radius-md: 0.5rem;        /* 8px */
  --radius-lg: 0.75rem;       /* 12px */
  --radius-pill: 9999px;

  /* Motion & Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 350ms;

  /* Z-Index Scale */
  --z-base: 1;
  --z-content: 5;
  --z-header: 100;
  --z-modal: 500;
  --z-toast: 1000;
}
