/* ============================================================
   CORTEX STUDIO — DESIGN SYSTEM v3
   Dark premium editorial — Aether-inspired
   ============================================================ */

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

/* ------------------------------------------------------------
   Design Tokens
   ------------------------------------------------------------ */
:root {
  /* Surfaces */
  --surface: #071325;
  --surface-dim: #030e20;
  --surface-container-low: #101c2e;
  --surface-container: #142032;
  --surface-container-high: #1f2a3d;
  --surface-container-highest: #2a3548;
  --surface-bright: #2e394d;

  /* Text */
  --on-surface: #d7e3fc;
  --on-surface-variant: #a1a8b8;
  --on-primary: #002e6a;

  /* Accents */
  --primary: #adc6ff;
  --primary-container: #4d8eff;
  --secondary: #e9c349;
  --secondary-container: #af8d11;
  --tertiary: #c7c6c4;

  /* Borders */
  --outline: #8c909f;
  --outline-variant: #424754;

  /* Error */
  --error: #ffb4ab;

  /* Typography */
  --font-headline: 'Manrope', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Layout */
  --container-max: 1400px;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 3rem;
  --spacing-xl: 5rem;
  --spacing-2xl: 8rem;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1.5rem;

  --transition: all 0.3s ease;
}

/* ------------------------------------------------------------
   Reset
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; line-height: 1.6; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
ul, ol { list-style: none; }
a { text-decoration: none; color: inherit; }
table { border-collapse: collapse; border-spacing: 0; }

/* ------------------------------------------------------------
   Body
   ------------------------------------------------------------ */
body {
  background-color: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: rgba(173, 198, 255, 0.3);
  color: var(--primary);
}

/* ------------------------------------------------------------
   Typography
   ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headline);
  color: var(--on-surface);
}

h1 {
  font-size: clamp(2.5rem, 5vw + 1rem, 5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.75rem, 3vw + 0.5rem, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h3 {
  font-size: clamp(1.125rem, 1.5vw + 0.25rem, 1.375rem);
  font-weight: 700;
  line-height: 1.3;
}

h4 {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
}

h5, h6 { font-size: 1rem; font-weight: 600; }

a { transition: color 0.2s ease; }
a:hover { color: var(--secondary); }
a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }

/* ------------------------------------------------------------
   Layout
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
}

main { position: relative; }

/* Sections */
.section {
  padding: var(--spacing-2xl) 0;
}

.section-light {
  background-color: var(--surface-dim);
}

.section-light h1, .section-light h2, .section-light h3, .section-light h4 { color: var(--on-surface); }
.section-light p { color: var(--on-surface-variant); }

/* Grids */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

/* Flex */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-secondary { color: var(--on-surface-variant); }
.text-gold { color: var(--secondary); }
.text-blue { color: var(--primary); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Spacing */
.mt-xs { margin-top: var(--spacing-xs); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-xs { margin-bottom: var(--spacing-xs); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

/* Visibility */
.sr-only, .visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.hidden { display: none !important; }

/* Offset for fixed header */
main > .section:first-child:not(.hero):not(.cortex-reveal) {
  padding-top: calc(72px + var(--spacing-xl));
}
