/* =========================================
   Variables
   ========================================= */
:root {
  /* Color palette inspired by warm gold, midnight navy, soft lavender, crystal white */
  --color-bg: #0b1026;           /* midnight navy */
  --color-surface: #0f1b3d;      /* deeper navy surface */
  --color-text: #f5f7ff;         /* crystal white text */
  --color-primary: #f5c26b;      /* warm gold */
  --color-accent: #c7a0ff;       /* soft lavender */
  --color-success: #2fbd6a;
  --color-warning: #ffb020;
  --color-danger:  #e63946;

  /* Neutral grays */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1f2937;
  --gray-900: #0f172a;

  /* RGB helpers for translucent glows */
  --rgb-primary: 245, 194, 107;
  --rgb-accent: 199, 160, 255;
  --rgb-text: 245, 247, 255;

  /* Typography */
  --font-sans: 'Inter', 'Manrope', 'Segoe UI', Roboto, system-ui, -apple-system, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', 'DejaVu Sans', sans-serif;
  --font-display: 'Poppins', 'Inter', 'Segoe UI', Roboto, system-ui, -apple-system, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', 'DejaVu Sans', sans-serif;

  --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: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* Spacing scale (0–96px in 4px steps) */
  --space-0: 0px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 36px;
  --space-10: 40px;
  --space-11: 44px;
  --space-12: 48px;
  --space-13: 52px;
  --space-14: 56px;
  --space-15: 60px;
  --space-16: 64px;
  --space-17: 68px;
  --space-18: 72px;
  --space-19: 76px;
  --space-20: 80px;
  --space-21: 84px;
  --space-22: 88px;
  --space-23: 92px;
  --space-24: 96px;

  /* Radius */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
  --shadow-glow-primary: 0 0 0 2px rgba(var(--rgb-primary), 0.35), 0 10px 30px rgba(var(--rgb-primary), 0.25);
  --shadow-glow-accent: 0 0 0 2px rgba(var(--rgb-accent), 0.35), 0 10px 30px rgba(var(--rgb-accent), 0.25);

  /* Transitions */
  --easing-standard: cubic-bezier(0.2, 0.7, 0.2, 1);
  --duration-100: 100ms;
  --duration-150: 150ms;
  --duration-200: 200ms;
  --duration-300: 300ms;
  --duration-500: 500ms;

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

  /* Thematic background gradient (subtle, luminous) */
  --bg-gradient: radial-gradient(1200px 600px at 10% -10%, rgba(var(--rgb-accent), 0.08), transparent 60%), radial-gradient(800px 400px at 95% 0%, rgba(var(--rgb-primary), 0.08), transparent 60%), linear-gradient(180deg, #0b1026 0%, #0f1b3d 100%);
}

/* =========================================
   Reset / Normalize
   ========================================= */
html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
*, *::before, *::after { box-sizing: inherit; }

/* Remove default margins */
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }

/* Responsive media */
img, svg, video, canvas, audio, iframe, embed, object { display: block; max-width: 100%; height: auto; }

/* Improve text rendering */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }

/* Make buttons, inputs inherit fonts */
input, button, textarea, select { font: inherit; color: inherit; }

/* Smooth scrolling respect */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* =========================================
   Base
   ========================================= */
html, body { height: 100%; }

body {
  color-scheme: dark;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100%;
  letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: rgba(var(--rgb-primary), 0.35); color: #0b1026; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-snug);
  color: var(--color-text);
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2rem, 3.2vw + 1rem, 3.25rem); margin-top: 0; margin-bottom: var(--space-6); }
h2 { font-size: clamp(1.5rem, 2.2vw + 0.5rem, 2.25rem); margin-top: var(--space-10); margin-bottom: var(--space-4); }
h3 { font-size: clamp(1.25rem, 1.2vw + 0.6rem, 1.75rem); margin-top: var(--space-8); margin-bottom: var(--space-3); }
h4 { font-size: var(--text-xl); margin-top: var(--space-6); margin-bottom: var(--space-2); }
h5 { font-size: var(--text-lg); margin-top: var(--space-5); margin-bottom: var(--space-1); }
h6 { font-size: var(--text-base); margin-top: var(--space-4); margin-bottom: var(--space-1); }

p { margin-bottom: var(--space-5); max-width: 72ch; }

ul, ol { padding-left: var(--space-6); margin: 0 0 var(--space-5); }

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

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  text-underline-offset: 2px;
  transition: color var(--duration-150) var(--easing-standard), text-shadow var(--duration-150) var(--easing-standard);
}
a:hover { color: var(--color-accent); text-shadow: 0 0 12px rgba(var(--rgb-accent), 0.35); }
a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; box-shadow: 0 0 0 4px rgba(var(--rgb-primary), 0.15); border-radius: var(--radius-sm); }

/* Buttons shouldn't wrap awkwardly */
button { cursor: pointer; background: none; border: none; }

/* Form elements base */
label { display: inline-block; margin-bottom: var(--space-2); }
input::placeholder, textarea::placeholder { color: var(--gray-400); }

/* Comfortable line lengths in articles/long reads */
.prose { max-width: 100%; }

/* =========================================
   Utilities
   ========================================= */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}
@media (min-width: 768px) { .container { padding-inline: var(--space-6); } }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.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; }
.gap-sm { gap: var(--space-4); }
.gap-md { gap: var(--space-6); }
.gap-lg { gap: var(--space-8); }

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

/* Luminous glow utilities */
.u-glow-primary { box-shadow: var(--shadow-glow-primary); }
.u-glow-accent { box-shadow: var(--shadow-glow-accent); }

/* Screen reader only */
.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;
}

/* =========================================
   Components
   ========================================= */
/* Buttons */
.btn {
  --_btn-bg: var(--color-primary);
  --_btn-color: #0b1026;
  --_btn-border: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem 1rem;
  border: 1px solid var(--_btn-border);
  border-radius: var(--radius-lg);
  background: var(--_btn-bg);
  color: var(--_btn-color);
  font-weight: 600;
  line-height: 1;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-150) var(--easing-standard), box-shadow var(--duration-200) var(--easing-standard), background-color var(--duration-150) var(--easing-standard), color var(--duration-150) var(--easing-standard), border-color var(--duration-150) var(--easing-standard);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md), 0 0 24px rgba(var(--rgb-primary), 0.15); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; box-shadow: var(--shadow-glow-primary); }
.btn[disabled], .btn:disabled { opacity: 0.6; cursor: not-allowed; filter: grayscale(20%); }

.btn--primary { --_btn-bg: var(--color-primary); --_btn-color: #0b1026; }
.btn--accent { --_btn-bg: var(--color-accent); --_btn-color: #0b1026; }
.btn--success { --_btn-bg: var(--color-success); --_btn-color: #081018; }
.btn--warning { --_btn-bg: var(--color-warning); --_btn-color: #081018; }
.btn--danger  { --_btn-bg: var(--color-danger);  --_btn-color: #ffffff; }

.btn--outline {
  --_btn-bg: transparent;
  --_btn-color: var(--color-primary);
  --_btn-border: rgba(var(--rgb-primary), 0.6);
  background: transparent;
}
.btn--outline:hover { background: rgba(var(--rgb-primary), 0.08); }

.btn--ghost {
  --_btn-bg: rgba(255, 255, 255, 0.05);
  --_btn-color: var(--color-text);
  --_btn-border: transparent;
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.08); }

/* Inputs */
.input, input[type='text'], input[type='email'], input[type='password'], input[type='search'], input[type='tel'], input[type='url'], input[type='number'], select, textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--duration-150) var(--easing-standard), box-shadow var(--duration-200) var(--easing-standard), background-color var(--duration-150) var(--easing-standard);
}
.input:focus, input:focus, select:focus, textarea:focus {
  border-color: rgba(var(--rgb-primary), 0.65);
  box-shadow: 0 0 0 4px rgba(var(--rgb-primary), 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.06);
}
input[disabled], select[disabled], textarea[disabled] { opacity: 0.6; cursor: not-allowed; }
select { appearance: none; background-image: none; }

/* Cards */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  color: var(--color-text);
  backdrop-filter: saturate(120%) blur(6px);
  transition: transform var(--duration-200) var(--easing-standard), box-shadow var(--duration-200) var(--easing-standard), border-color var(--duration-200) var(--easing-standard);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg), 0 0 40px rgba(var(--rgb-accent), 0.08); border-color: rgba(255, 255, 255, 0.16); }
.card:focus-within { box-shadow: var(--shadow-glow-accent); }

.card-header { margin-bottom: var(--space-4); }
.card-footer { margin-top: var(--space-4); }

/* =========================================
   Header & Footer styles
   ========================================= */

/* Accessibility: skip link */
.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: fixed; left: var(--space-4); top: var(--space-4); width: auto; height: auto; padding: var(--space-3) var(--space-4); background: var(--color-text); color: #0b1026; border-radius: var(--radius-md); z-index: 10000; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 1000; background: rgba(11, 16, 38, 0.6); backdrop-filter: blur(8px) saturate(140%); border-bottom: 1px solid rgba(255,255,255,0.08); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) 0; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--color-text); letter-spacing: 0.02em; }
.brand:hover { color: var(--color-accent); }

.primary-nav { position: relative; }
.menu { list-style: none; display: flex; gap: var(--space-6); margin: 0; padding: 0; }
.menu a { color: var(--color-text); font-weight: 600; }
.menu a:hover { color: var(--color-accent); }

.nav-toggle { flex-direction: column; display: none; width: 44px; height: 44px; border-radius: var(--radius-lg); border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.04); align-items: center; justify-content: center; }
.nav-toggle:focus-visible { box-shadow: var(--shadow-glow-primary); }
.nav-toggle-bar { display: block; width: 22px; height: 2px; background: var(--color-text); margin: 3px 0; border-radius: 2px; transition: transform var(--duration-150) var(--easing-standard), opacity var(--duration-150) var(--easing-standard); }

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .menu { position: absolute; right: 0; top: calc(100% + 8px); width: min(82vw, 360px); flex-direction: column; gap: 0; background: linear-gradient(180deg, rgb(15 33 61) 0%, rgb(44 48 79) 100%) !important; border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: var(--space-3); opacity: 0; pointer-events: none; transform: translateY(-6px); transition: all var(--duration-200) var(--easing-standard); }
  .menu li { border-radius: var(--radius-md); }
  .menu a { display: block; padding: 10px 12px; }
  .primary-nav.open .menu { opacity: 1; pointer-events: auto; transform: translateY(0); }
}

/* Footer */
.site-footer { border-top: 1px solid rgba(255,255,255,0.08); background: rgba(15, 27, 61, 0.6); backdrop-filter: blur(8px); }
.footer-grid { display: grid; gap: var(--space-8); grid-template-columns: 1.2fr; padding: var(--space-8) 0; }
.footer-title { font-size: 1rem; margin-bottom: var(--space-3); color: var(--gray-100); }
.footer-nav ul, .footer-legal ul { list-style: none; padding: 0; margin: 0; }
.footer-nav li, .footer-legal li { margin-bottom: var(--space-2); }
.footer-base { border-top: 1px solid rgba(255,255,255,0.08); padding: var(--space-4) 0; color: var(--gray-300); }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; } }

/* Cookie banner */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 999; transform: translateY(0); background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.04)); border-top: 1px solid rgba(255,255,255,0.12); box-shadow: 0 -8px 24px rgba(0,0,0,0.35); }
.cookie-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); padding: var(--space-4) 0; }
.cookie-text { color: var(--gray-100); }
.cookie-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
@media (max-width: 780px) { .cookie-inner { flex-direction: column; align-items: stretch; text-align: center; } .cookie-actions { justify-content: center; } }

/* Noscript */
.noscript-msg { margin: var(--space-4); padding: var(--space-4); background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius-lg); }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
