/* ═══════════════════════════════════════════════════════════════════
   ELYKSIR — Global Design System
   Tokens, Reset, Typography, Grid, Utilities
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════ DESIGN TOKENS ═══════ */

:root {
  /* Colors — Core Palette */
  --color-midnight: #0A0F1E;
  --color-navy-deep: #0F1629;
  --color-navy-mid: #141B2E;
  --color-gold: #C9A84C;
  --color-gold-dim: rgba(201, 168, 76, 0.2);
  --color-gold-hover: #E2C06A;
  --color-ivory: #F8F5EF;

  /* Colors — Text */
  --color-text-light: #E8E4DC;
  --color-text-dark: #1A1A1A;
  --color-text-muted: #8A8680;

  /* Colors — Surfaces */
  --color-surface-card: #0F1629;
  --color-surface-sidebar: #141B2E;
  --color-border: rgba(201, 168, 76, 0.15);

  /* Colors — Status */
  --color-success: #2E7D52;
  --color-error: #8B2020;
  --color-info: #1A3A5C;
  --color-warning: #7A5C1A;

  /* Colors — Status Backgrounds */
  --color-success-bg: rgba(46, 125, 82, 0.15);
  --color-error-bg: rgba(139, 32, 32, 0.15);
  --color-info-bg: rgba(26, 58, 92, 0.15);
  --color-warning-bg: rgba(122, 92, 26, 0.15);

  /* Typography — Font Families */
  --font-heading: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Typography — Font Sizes (modular scale 1.25) */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-md: 1.125rem;    /* 18px */
  --text-lg: 1.25rem;     /* 20px */
  --text-xl: 1.5rem;      /* 24px */
  --text-2xl: 1.875rem;   /* 30px */
  --text-3xl: 2.25rem;    /* 36px */
  --text-4xl: 3rem;       /* 48px */
  --text-5xl: 3.75rem;    /* 60px */
  --text-6xl: 4.5rem;     /* 72px */

  /* Typography — Line Heights */
  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  /* Typography — Font Weights */
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  /* Typography — Letter Spacing */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.05em;
  --tracking-wider: 0.1em;
  --tracking-widest: 0.2em;

  /* Spacing Scale */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 720px;
  --max-width-wide: 1440px;
  --sidebar-width: 280px;
  --nav-height: 72px;
  --nav-height-mobile: 60px;

  /* Borders & Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --border-thin: 1px solid var(--color-border);
  --border-gold: 1px solid var(--color-gold);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 4px 20px rgba(201, 168, 76, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Z-Index Scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-tooltip: 600;
}


/* ═══════ CSS RESET ═══════ */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-light);
  background-color: var(--color-midnight);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

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

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

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

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

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

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

fieldset {
  border: none;
}

:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

::selection {
  background-color: var(--color-gold-dim);
  color: var(--color-ivory);
}


/* ═══════ TYPOGRAPHY ═══════ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-regular);
  line-height: var(--leading-tight);
  color: var(--color-ivory);
  letter-spacing: var(--tracking-tight);
}

h1 {
  font-size: var(--text-5xl);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-size: var(--text-4xl);
  font-weight: var(--weight-light);
}

h3 {
  font-size: var(--text-3xl);
  font-weight: var(--weight-regular);
}

h4 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-medium);
}

h5 {
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
}

h6 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

p {
  margin-bottom: var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

.text-serif {
  font-family: var(--font-heading);
}

.text-mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.text-editorial {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-light);
  font-style: italic;
  line-height: var(--leading-snug);
}

.text-gold {
  color: var(--color-gold);
}

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

.text-ivory {
  color: var(--color-ivory);
}

.text-dark {
  color: var(--color-text-dark);
}

small,
.text-small {
  font-size: var(--text-sm);
}

.text-xs {
  font-size: var(--text-xs);
}

.text-lg {
  font-size: var(--text-lg);
}

.text-xl {
  font-size: var(--text-xl);
}

.text-2xl {
  font-size: var(--text-2xl);
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-uppercase {
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.text-wide {
  letter-spacing: var(--tracking-widest);
}

blockquote {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-style: italic;
  font-weight: var(--weight-light);
  line-height: var(--leading-snug);
  color: var(--color-ivory);
  border-left: 3px solid var(--color-gold);
  padding-left: var(--space-6);
  margin: var(--space-8) 0;
}

blockquote cite {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--color-text-muted);
  margin-top: var(--space-3);
}

.label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-gold);
}

.overline {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--color-gold);
  margin-bottom: var(--space-3);
}


/* ═══════ LAYOUT — CONTAINERS ═══════ */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

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

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

.container--full {
  max-width: none;
}


/* ═══════ LAYOUT — GRID ═══════ */

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.grid-auto-sm {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}


/* ═══════ LAYOUT — FLEX ═══════ */

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }


/* ═══════ SECTIONS ═══════ */

.section {
  padding: var(--space-20) 0;
}

.section--sm {
  padding: var(--space-12) 0;
}

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

.section--navy {
  background-color: var(--color-navy-deep);
}

.section--midnight {
  background-color: var(--color-midnight);
}

.section--ivory {
  background-color: var(--color-ivory);
  color: var(--color-text-dark);
}

.section--ivory h1,
.section--ivory h2,
.section--ivory h3,
.section--ivory h4,
.section--ivory h5,
.section--ivory h6 {
  color: var(--color-text-dark);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
  max-width: var(--max-width-narrow);
  margin-left: auto;
  margin-right: auto;
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
}

.divider {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: var(--space-8) 0;
}

.divider--gold {
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
  height: 1px;
}


/* ═══════ SPACING UTILITIES ═══════ */

.m-0 { margin: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mt-16 { margin-top: var(--space-16); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }


/* ═══════ DISPLAY UTILITIES ═══════ */

.hidden {
  display: none !important;
}

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

.relative {
  position: relative;
}

.overflow-hidden {
  overflow: hidden;
}

.w-full {
  width: 100%;
}


/* ═══════ RESPONSIVE ═══════ */

@media (max-width: 1024px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }

  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  html { font-size: 15px; }

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

  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .section { padding: var(--space-12) 0; }
  .section--lg { padding: var(--space-20) 0; }

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }

  .hide-mobile { display: none !important; }
}

@media (max-width: 480px) {
  html { font-size: 14px; }

  .container {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }
}

@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}
