/* =========================
   THEME & GLOBAL SETTINGS
   ========================= */
:root {
  --bg: #121212;
  --container-bg: rgba(27, 38, 59, 0.5);
  --text-color: #FFFFFF;
  --accent-color: rgba(217, 141, 60, 0.5);
  --highlight-color: #C9A227;
  --section-bg: rgba(27, 38, 59, 0.5);
  --section-border: #888888;
  --shadow-color: rgba(0,0,0,0.6);
  --glow-color: rgba(217, 141, 60, 0.5);
  --focus-ring: 0 0 0 3px rgba(217, 141, 60, 0.4);
}

html[data-theme="light"] {
  --bg: #F5F5F5;
  --container-bg: rgba(255, 255, 255, 0.5);
  --text-color: #222222;
  --accent-color: rgba(217, 141, 60, 0.5);
  --highlight-color: #C9A227;
  --section-bg: #FFFFFF;
  --section-border: #CCCCCC;
  --shadow-color: rgba(0,0,0,0.1);
  --glow-color: #D98D3C;
}

/* =========================
   RESET & ACCESSIBILITY
   ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  font-size: 16px;
}

.no-js body .loading {
  display: none;
}

.no-js section {
  opacity: 1;
  transform: none;
}

.no-js section::before {
  display: none;
}

body {
  font-family: 'Fira Code', monospace;
  font-weight: 400;
  line-height: 1.8;
  background: var(--bg);
  color: var(--text-color);
  transition: background-color 0.4s ease, color 0.4s ease;
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
}

/* =========================
   LOADING STATE
   ========================= */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--section-border);
  border-top: 3px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* =========================
   TYPOGRAPHY & LINKS
   ========================= */
h1,
h2,
h3 {
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 2.2vw + 1.4rem, 2.6rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-color) 0%, var(--accent-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: clamp(1.5rem, 1.2vw + 1.1rem, 2rem);
  font-weight: 600;
  position: relative;
}

h3 {
  font-size: clamp(1.2rem, 0.8vw + 0.9rem, 1.4rem);
  font-weight: 600;
}

p,
ul li {
  font-size: clamp(1rem, 0.4vw + 0.9rem, 1.08rem);
  margin-bottom: 0.8rem;
  line-height: 1.7;
  margin-top: 0.5rem;
}

ul {
  list-style: none;
  padding-left: 0;
}

ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  cursor: progress;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  outline: none;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--container-bg);
  color: var(--text-color);
  padding: .5rem .75rem;
  border-radius: .5rem;
  z-index: 1200;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  box-shadow: var(--focus-ring);
}

