/**
 * assets/css/global.css
 *
 * Design system foundation for Remember.
 * Defines all tokens, resets, base typography, and utilities.
 * Loaded on every page via includes/head-common.php.
 *
 * Do not add page-specific styles here.
 * Page styles belong in their respective CSS files.
 */

/* =========================================================
   DESIGN TOKENS
   ========================================================= */

:root {
  /* Colors — night sky palette */
  --navy-deepest:   #080d1a;
  --navy-deep:      #0d1428;
  --navy-mid:       #121c38;
  --navy-light:     #1a2648;

  --moon-white:     #f0eff4;
  --moon-soft:      #c8c5d8;
  --moon-dim:       #8a8799;

  --gold-lantern:   #e8c97a;
  --gold-warm:      #d4a853;
  --gold-dim:       #a07830;

  --lavender-soft:  #9d8ec4;
  --lavender-dim:   #6d5f9c;
  --lavender-deep:  #3d3060;

  --silver-soft:    #b8b5cc;
  --silver-dim:     #7a7890;

  --glass-bg:       rgba(255, 255, 255, 0.04);
  --glass-bg-hover: rgba(255, 255, 255, 0.07);
  --glass-border:   rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.14);

  /* Semantic colors */
  --color-bg:       var(--navy-deepest);
  --color-surface:  var(--navy-deep);
  --color-elevated: var(--navy-mid);
  --color-text:     var(--moon-white);
  --color-text-2:   var(--moon-soft);
  --color-text-3:   var(--moon-dim);
  --color-accent:   var(--gold-lantern);
  --color-accent-2: var(--lavender-soft);
  --color-border:   var(--glass-border);

  /* Typography */
  --font-display: 'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  /* Type scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;
  --text-7xl:  4.5rem;

  /* Spacing scale */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
  --space-40: 10rem;

  /* Radii */
  --radius-sm:   0.375rem;
  --radius-md:   0.75rem;
  --radius-lg:   1.25rem;
  --radius-xl:   2rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md:  0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg:  0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px rgba(232, 201, 122, 0.15);
  --shadow-glow-strong: 0 0 48px rgba(232, 201, 122, 0.25);

  /* Transitions */
  --ease-gentle:  cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out:  cubic-bezier(0.4, 0, 0.2, 1);

  --duration-instant: 100ms;
  --duration-fast:    200ms;
  --duration-mid:     400ms;
  --duration-slow:    700ms;
  --duration-drift:   1400ms;
  --duration-breath:  2400ms;

  /* Focus */
  --focus-ring-color:  var(--gold-lantern);
  --focus-ring-offset: 3px;
  --focus-ring:        0 0 0 2px var(--navy-deepest), 0 0 0 5px var(--focus-ring-color);

  /* Content widths */
  --content-xs: 30rem;
  --content-sm: 42rem;
  --content-md: 64rem;
  --content-lg: 80rem;
  --content-xl: 96rem;

  /* Z-index scale */
  --z-base:    0;
  --z-raised:  10;
  --z-nav:     100;
  --z-overlay: 200;
  --z-dialog:  300;
  --z-top:     400;
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast:   0ms;
    --duration-mid:    0ms;
    --duration-slow:   0ms;
    --duration-drift:  0ms;
    --duration-breath: 0ms;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================
   RESET
   ========================================================= */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  min-height: 100%;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: var(--gold-lantern);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-gentle);
}

a:hover {
  color: var(--gold-warm);
}

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-weight: 400;
}

p {
  max-width: 68ch;
}

/* =========================================================
   FOCUS STYLES
   ========================================================= */

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* =========================================================
   TYPOGRAPHY — BASE
   ========================================================= */

.display-1 {
  font-family: var(--font-display);
  font-size: clamp(var(--text-4xl), 6vw, var(--text-7xl));
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.display-2 {
  font-family: var(--font-display);
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.display-3 {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl));
  font-weight: 300;
  line-height: 1.3;
}

.text-mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.05em;
}

/* =========================================================
   SKIP TO CONTENT
   ========================================================= */

.skip-link {
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  z-index: var(--z-top);
  padding: var(--space-3) var(--space-6);
  background: var(--gold-lantern);
  color: var(--navy-deepest);
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  transform: translateY(calc(-100% - var(--space-8)));
  transition: transform var(--duration-fast) var(--ease-gentle);
}

.skip-link:focus {
  transform: translateY(0);
}

/* =========================================================
   SCREEN READER ONLY
   ========================================================= */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* =========================================================
   LAYOUT UTILITIES
   ========================================================= */

.container {
  width: 100%;
  max-width: var(--content-lg);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--sm {
  max-width: var(--content-sm);
}

.container--md {
  max-width: var(--content-md);
}

.container--xl {
  max-width: var(--content-xl);
}

.section {
  padding-block: var(--space-24);
}

.section--lg {
  padding-block: var(--space-32);
}

.section--sm {
  padding-block: var(--space-16);
}

/* =========================================================
   TEXT UTILITIES
   ========================================================= */

.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-gold    { color: var(--gold-lantern); }
.text-dim     { color: var(--color-text-2); }
.text-muted   { color: var(--color-text-3); }
.text-lavender{ color: var(--lavender-soft); }

/* =========================================================
   DIVIDER
   ========================================================= */

.divider {
  border: none;
  border-top: 1px solid var(--glass-border);
  margin-block: var(--space-16);
}

/* =========================================================
   ARIA LIVE
   ========================================================= */

[aria-live] {
  /* Ensure live regions are in the DOM even when empty */
}
