/* ==============================================
   OnWave Lab — Global Styles
   Design tokens, reset, typography, layout
   ============================================== */

/* ---- Font Faces ---- */

@font-face {
  font-family: 'Aspekta';
  src: url('/fonts/AspektaVF.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Aspekta';
  src: url('/fonts/Aspekta-1000.woff2') format('woff2');
  font-weight: 1000;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---- Design Tokens ---- */

:root {
  /* Dark sections */
  --color-dark-bg: #0f1923;
  --color-dark-card: #1a2836;
  --color-dark-border: #263545;
  --color-dark-text: #e8e0d4;
  --color-dark-muted: #8a9aaa;

  /* Accent */
  --color-accent: #c8a96e;
  --color-accent-text: #c8a96e;
  --color-accent-hover: #dcc89a;
  --color-accent-glow: rgba(200, 169, 110, 0.25);
  --color-accent-subtle: rgba(200, 169, 110, 0.06);
  --color-warm: #c8a96e;
  --color-warm-text: #a8894e;
  --color-warm-hover: #dcc89a;

  /* Semantic */
  --color-success: #4ade80;
  --color-success-text: #16a34a;
  --color-success-subtle: rgba(74, 222, 128, 0.1);
  --color-danger: #f87171;
  --color-danger-text: #dc2626;
  --color-danger-subtle: rgba(248, 113, 113, 0.08);

  /* Fonts */
  --font-heading: 'Aspekta', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Type Scale (fluid) */
  --text-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.8rem);
  --text-sm: clamp(0.8rem, 0.75rem + 0.25vw, 0.875rem);
  --text-base: clamp(0.9rem, 0.85rem + 0.25vw, 1rem);
  --text-lg: clamp(1rem, 0.925rem + 0.375vw, 1.125rem);
  --text-xl: clamp(1.125rem, 1rem + 0.625vw, 1.375rem);
  --text-2xl: clamp(1.375rem, 1.15rem + 1.125vw, 1.875rem);
  --text-3xl: clamp(1.75rem, 1.4rem + 1.75vw, 2.5rem);
  --text-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 3.25rem);

  /* Line Heights */
  --leading-tight: 1.2;
  --leading-snug: 1.375;
  --leading-normal: 1.6;
  --leading-relaxed: 1.8;

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

  /* Section spacing */
  --section-py: clamp(4rem, 8vw, 7rem);
  --section-px: clamp(1.5rem, 5vw, 2rem);

  /* Container */
  --container-max: 1100px;
  --container-narrow: 800px;
  --container-text: 640px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 50%;

  /* Shadows (for white sections) */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 24px var(--color-accent-glow);

  /* Timing */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 500ms;

  /* Nav */
  --nav-height: 72px;
}

/* ---- CSS Reset ---- */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-normal);
  color: var(--color-dark-text);
  background-color: var(--color-dark-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

p {
  overflow-wrap: break-word;
}

/* ---- Typography ---- */

h1 { font-size: var(--text-4xl); font-weight: 1000; }
h2 { font-size: var(--text-3xl); font-weight: 900; }
h3 { font-size: var(--text-2xl); font-weight: 800; }
h4 { font-size: var(--text-xl); font-weight: 700; }
h5 { font-size: var(--text-lg); font-weight: 700; }
h6 { font-size: var(--text-base); font-weight: 700; }

.text-muted { color: var(--color-dark-muted); }
.text-accent { color: var(--color-accent-text); }
.text-center { text-align: center; }

/* ---- Layout Utilities ---- */

.container {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--section-px);
  padding-right: var(--section-px);
}

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

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

.section {
  padding-top: var(--section-py);
  padding-bottom: var(--section-py);
}

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

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

.section--subtle {
  background-color: var(--color-dark-card);
}

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

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

.flex {
  display: flex;
  gap: var(--space-4);
}

.flex--center {
  align-items: center;
  justify-content: center;
}

.flex--between {
  align-items: center;
  justify-content: space-between;
}

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

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent);
  color: var(--color-dark-bg);
  font-weight: 600;
  border-radius: var(--radius-md);
  z-index: 1000;
  transition: top var(--duration-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

/* Global focus indicator */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.nav__link:focus-visible,
.nav__cta:focus-visible,
.footer__link:focus-visible,
.mobile-menu__link:focus-visible,
.accordion__header:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
