/* ===================================================
   Variables 
   =================================================== */
:root {
  /* Colors */
  --color-bg: #101418;
  --color-text: #f2f4f8;
  --color-primary: #62b6cb;
  --color-success: #90b48c;
  --color-warning: #ffd166;
  --color-danger: #ea5455;
  --color-gray-100: #e0e4ea;
  --color-gray-300: #bfc9d1;
  --color-gray-500: #7d8797;
  --color-gray-700: #424957;
  --color-gray-900: #23272e;
  /* Typography */
  --font-base: 'Inter', 'Segoe UI', Arial, sans-serif;
  --font-heading: 'Merriweather', 'Georgia', serif;
  --text-xs: 0.813rem;
  --text-sm: 0.938rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.563rem;
  --text-2xl: 1.953rem;
  --text-3xl: 2.441rem;
  --line-height-tight: 1.15;
  --line-height-base: 1.65;
  --line-length: 68ch;
  /* Spacing (0, 4, 8, ..., 96 px) */
  --space-0: 0px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  /* Radius, Shadows, Transitions */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 18px;
  --shadow-xs: 0 1px 2px rgb(32 34 40 / .05);
  --shadow-md: 0 4px 16px rgb(28 32 36 / .12);
  --shadow-lg: 0 8px 32px rgb(20 27 38 / .20);
  --transition-fast: 100ms cubic-bezier(.7,.3,.37,1);
  --transition-base: 250ms cubic-bezier(.7,.3,.37,1);
  --transition-slow: 400ms cubic-bezier(.7,.3,.37,1);
}

/* ===================================================
   Reset & Normalize
   =================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-base);
  font-size: var(--text-base);
  line-height: var(--line-height-base);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

ul, ol, dl, h1, h2, h3, h4, h5, h6, p {
  margin: 0;
  padding: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--color-gray-700);
  margin: var(--space-6) 0;
}

/* Remove default button/input styles */
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 1em;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* ===================================================
   Base Styles
   =================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  line-height: var(--line-height-tight);
}
h1 {
  font-size: var(--text-3xl);
  margin-top: var(--space-12);
}
h2 {
  font-size: var(--text-2xl);
  margin-top: var(--space-10);
}
h3 {
  font-size: var(--text-xl);
  margin-top: var(--space-8);
}
h4 {
  font-size: var(--text-lg);
  margin-top: var(--space-6);
}
h5 {
  font-size: var(--text-base);
}
h6 {
  font-size: var(--text-sm);
}

p {
  max-width: var(--line-length);
  margin-bottom: var(--space-4);
  line-height: var(--line-height-base);
}

@media (max-width: 600px) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.35rem; }
  h3 { font-size: 1.15rem; }
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  transition: color var(--transition-base);
  outline: none;
}
a:hover,
a:focus-visible {
  color: var(--color-success);
  text-decoration: none;
}
a:active {
  color: var(--color-warning);
}

/* ===================================================
   Accessibility
   =================================================== */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    transition: none !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ===================================================
   Utilities
   =================================================== */
.container {
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: var(--space-4);
  width: 100%;
}
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.flex-center {
  justify-content: center;
  align-items: center;
}
.grid {
  display: grid;
}
.grid-gap {
  gap: var(--space-6);
}

/* Spacing utilities (for immersive storytelling elements) */
.mt-0 { margin-top: var(--space-0); }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.pt-8 { padding-top: var(--space-8); }
.pb-8 { padding-bottom: var(--space-8); }
.p-4 { padding: var(--space-4); }
.p-8 { padding: var(--space-8); }

/* ===================================================
   Components
   =================================================== */
.button,
button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background var(--transition-base),
              box-shadow var(--transition-base),
              color var(--transition-base);
  outline: none;
}
.button:hover,
button:hover,
.button:focus-visible,
button:focus-visible {
  background: var(--color-success);
  color: var(--color-bg);
  box-shadow: var(--shadow-md);
}
.button:disabled,
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

input,
select,
textarea {
  padding: var(--space-2) var(--space-3);
  background: var(--color-gray-700);
  color: var(--color-text);
  border: 1px solid var(--color-gray-500);
  border-radius: var(--radius-sm);
  box-shadow: none;
  transition: border-color var(--transition-base), background var(--transition-base);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  background: var(--color-bg);
  outline: 2px solid var(--color-primary);
}
input:disabled,
select:disabled,
textarea:disabled {
  background: var(--color-gray-900);
  opacity: 0.5;
}

.card {
  background: var(--color-gray-900);
  color: var(--color-text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8);
  margin-bottom: var(--space-8);
  transition: box-shadow var(--transition-base);
}
.card:hover,
.card:focus-within {
  box-shadow: 0 12px 36px 0 rgba(30, 48, 60, 0.24);
}

/* ===================================================
   Header & Footer styles (shared)
   =================================================== */

.main-header {
  width: 100%;
  background: #181d22;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.nav-layout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
}

.brand-name {
  font-size: var(--text-xl);
  font-family: var(--font-heading);
  letter-spacing: 1px;
  color: var(--color-primary);
  user-select: none;
}

.nav-list {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  background: none;
  flex-wrap: wrap;
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
}
.menu-icon {
  width: 28px;
  height: 2.5px;
  display: block;
  background: var(--color-primary);
  position: relative;
  border-radius: 2px;
}
.menu-icon::before, .menu-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 28px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--color-primary);
  transition: transform .3s;
}
.menu-icon::before { top: -8px; }
.menu-icon::after { top: 8px; }
.menu-toggle[aria-expanded="true"] .menu-icon {
  background: transparent;
}
.menu-toggle[aria-expanded="true"] .menu-icon::before {
  transform: translateY(8px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-icon::after {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 900px) {
  .nav-list {
    position: absolute;
    top: 64px;
    right: 0;
    background: #23272e;
    flex-direction: column;
    align-items: flex-end;
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
    z-index: 1100;
  }
  .nav-list.active {
    opacity: 1;
    pointer-events: all;
  }
  .menu-toggle {
    display: inline-flex;
  }
}

.footer {
  background: #181d22;
  color: var(--color-gray-100);
  padding-top: var(--space-8);
  padding-bottom: 96px; /* Space for sticky cookie banner */
  font-size: var(--text-base);
  box-shadow: 0 -4px 16px 0 rgba(0,0,0,0.07);
}
.footer-content {
  gap: var(--space-8);
}
.footer-top {
  width: 100%;
  flex-wrap: wrap;
  gap: var(--space-10);
  justify-content: space-between;
  align-items: flex-start;
}
.footer-nav ul,
.footer-legal ul {
  list-style: none;
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
  padding: 0;
}
.footer-legal ul {
  gap: var(--space-3);
}
.footer-bottom {
  width: 100%;
  justify-content: center;
  text-align: center;
  padding-top: var(--space-8);
}

/* Cookie consent banner */
.cookie-consent-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  width: 100vw;
  background: #22252a;
  color: var(--color-text);
  z-index: 5000;
  box-shadow: 0 -4px 24px 0 rgba(16,20,24, .14);
  padding: var(--space-4) var(--space-8);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform .35s;
}
.cookie-consent-banner[aria-hidden="true"] {
  transform: translateY(160%);
  pointer-events: none;
}
.cookie-consent-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 760px;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.cookie-consent-actions {
  display: flex;
  gap: var(--space-4);
}
.button-tertiary {
  background: transparent;
  border: 2px solid var(--color-warning);
  color: var(--color-warning);
}
.button-tertiary:hover, .button-tertiary:focus-visible {
  background: var(--color-warning);
  color: var(--color-bg);
}

@media (max-width: 900px) {
  .cookie-consent-banner {
    padding: var(--space-4);
  }
  .cookie-consent-content {
    flex-direction: column;
    gap: var(--space-4);
    align-items: flex-start;
  }
}
