/* Aural Lab Sound - Design tokens & base */

:root {
  /* Typography */
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Quicksand", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  --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: 2rem;
  --text-4xl: clamp(2.25rem, 5vw, 3.25rem);
  --text-5xl: clamp(2.75rem, 6vw, 4.25rem);
  --text-hero: clamp(2.5rem, 8vw, 4.5rem);
  --text-section: clamp(2rem, 5vw, 3rem);

  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  --tracking-tight: -0.02em;
  --tracking-wide: 0.08em;
  --tracking-wider: 0.14em;

  /* Spacing */
  --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;

  /* Layout */
  --layout-max-width: 68rem;
  --container-narrow: 40rem;
  --container-default: 68rem;
  --container-wide: 80rem;
  --header-height: 4.5rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  /* Radius */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;

  /* Borders */
  --border-width: 1px;
  --border-style: solid;
}

/* Dark theme (site default) - WCAG 2.1 AA compliant */
html {
  color-scheme: dark;
  --color-bg: #0F0F0F;
  --color-surface: #1A1A1A;
  --color-text-primary: #F5F5F5;
  --color-text-secondary: #CCCCCC;
  --color-border: #2D2D2D;
  --color-accent: #7BA3FF;
  --color-accent-hover: #A8D5FF;
  --color-on-accent: #0F0F0F;

  /* Backwards compatibility */
  --color-bg-elevated: #1A1A1A;
  --color-bg-subtle: #262626;
  --color-text: #F5F5F5;
  --color-text-muted: #CCCCCC;
  --color-text-subtle: #A6A6A6;
  --color-border-strong: #404040;
  --color-accent-muted: rgba(123, 163, 255, 0.15);
  --color-focus: #7BA3FF;
  --color-hero-overlay: rgba(0, 0, 0, 0.5);
  --color-header-bg: rgba(15, 15, 15, 0.98);
  --color-panel-overlay: rgba(15, 15, 15, 0.95);
  --color-on-image-heading: #FFFFFF;
  --color-on-image-lead: rgba(255, 255, 255, 0.95);
  --color-on-image-body: rgba(255, 255, 255, 0.9);
  --color-on-image-muted: rgba(255, 255, 255, 0.75);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --wave-opacity: 0;
}

/* Light theme - only when visitor chooses via theme toggle - WCAG 2.1 AA compliant.
   Secondary text is darker than a typical gray because Quicksand's thin strokes
   wash out on white at small sizes even when the hex value technically passes AA. */
html[data-theme="light"] {
  color-scheme: light;
  --color-bg: #FFFFFF;
  --color-surface: #F5F7F9;
  --color-text-primary: #111111;
  --color-text-secondary: #2A2A2A;
  --color-border: #D9D9D9;
  --color-accent: #1D4ED8;
  --color-accent-hover: #0D47A1;
  --color-on-accent: #FFFFFF;

  /* Backwards compatibility */
  --color-bg-elevated: #F5F7F9;
  --color-bg-subtle: #FAFBFC;
  --color-text: #111111;
  --color-text-muted: #2A2A2A;
  --color-text-subtle: #3D3D3D;
  --color-border-strong: #CCCCCC;
  --color-accent-muted: rgba(29, 78, 216, 0.1);
  --color-focus: #1D4ED8;
  --color-hero-overlay: rgba(0, 0, 0, 0.35);
  --color-header-bg: rgba(255, 255, 255, 0.98);
  --color-panel-overlay: rgba(255, 255, 255, 0.95);
  --color-on-image-heading: #FFFFFF;
  --color-on-image-lead: rgba(255, 255, 255, 0.95);
  --color-on-image-body: rgba(255, 255, 255, 0.9);
  --color-on-image-muted: rgba(255, 255, 255, 0.75);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
  --wave-opacity: 0;
}

html[data-theme="light"] body {
  font-weight: 500;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--leading-tight);
}

h1 {
  font-size: var(--text-hero);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-size: var(--text-section);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
}

h3 {
  font-size: var(--text-2xl);
  font-weight: 600;
}

p {
  line-height: var(--leading-normal);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-base) var(--ease-out);
}

ul, ol {
  list-style: none;
}

/* Container */
.container {
  max-width: var(--container-default);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

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

/* Utility */
.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;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #1a1a1a;
  color: #ffffff;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
}