:root {
  --bg-color: #05050a;
  --surface-color: rgba(15, 15, 25, 0.7);
  --surface-border: rgba(0, 255, 204, 0.2);
  --text-primary: #e0e0ff;
  --text-secondary: #9ba1cc;
  --accent-primary: #00ffcc;
  --accent-secondary: #ff0055;
  --accent-tertiary: #0077ff;
  --glow-primary: 0 0 15px rgba(0, 255, 204, 0.5);
  --glow-secondary: 0 0 20px rgba(255, 0, 85, 0.5);
  --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --border-radius: 16px;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(0, 255, 204, 0.05), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(255, 0, 85, 0.05), transparent 25%);
  background-attachment: fixed;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  letter-spacing: -0.5px;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  background: linear-gradient(to right, var(--accent-primary), var(--accent-tertiary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2rem;
  filter: drop-shadow(0 0 20px rgba(0, 255, 204, 0.2));
}

h2 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  color: #fff;
  border-left: 4px solid var(--accent-secondary);
  padding-left: 1rem;
  margin-top: 3rem;
}

h3 {
  font-size: 1.5rem;
  color: var(--accent-primary);
  margin-top: 2rem;
}

p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--text-primary);
  text-shadow: var(--glow-primary);
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header & Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(5, 5, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-border);
  z-index: 1000;
  transition: var(--transition);
}

header.scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  padding: 0.5rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo img {
  height: 50px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links li a {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
  padding: 0.5rem 0;
  position: relative;
}

.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: var(--transition);
  box-shadow: var(--glow-primary);
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
  width: 100%;
}

/* Mobile Menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 2rem;
  cursor: pointer;
}

/* Main Content */
main {
  padding-top: 120px;
  padding-bottom: 4rem;
}

.hero {
  text-align: center;
  padding: 4rem 0;
  margin-bottom: 2rem;
}

/* Content Formatting */
article {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--border-radius);
  padding: 3rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

figure {
  margin: 3rem 0;
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

figure::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  box-shadow: inset 0 0 20px rgba(0, 255, 204, 0.2);
  pointer-events: none;
  z-index: 1;
}

img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

figure:hover img {
  transform: scale(1.02);
}

figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  color: var(--accent-primary);
  font-size: 0.9rem;
  text-align: center;
  z-index: 2;
  border-top: 1px solid rgba(0, 255, 204, 0.3);
}

/* Tables */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2.5rem 0;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(10, 10, 18, 0.8);
  border: 1px solid var(--surface-border);
}

th, td {
  padding: 1.25rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
  background: rgba(0, 255, 204, 0.1);
  color: var(--accent-primary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Lists */
ul, ol {
  margin: 1.5rem 0 2.5rem 2rem;
  color: var(--text-secondary);
}

li {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  position: relative;
}

ul li::marker {
  color: var(--accent-secondary);
}

ol li::marker {
  color: var(--accent-tertiary);
  font-weight: bold;
}

/* Asides / Notes */
aside {
  background: linear-gradient(135deg, rgba(255,0,85,0.1), rgba(0,0,0,0));
  border-left: 4px solid var(--accent-secondary);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0 12px 12px 0;
}

aside p {
  margin: 0;
  color: #fff;
  font-style: italic;
}

/* Footer */
footer {
  background: rgba(5, 5, 10, 0.95);
  border-top: 1px solid var(--surface-border);
  padding: 3rem 0;
  margin-top: 4rem;
  text-align: center;
}

.footer-content p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.4);
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Media Queries */
@media (max-width: 1024px) {
  h1 { font-size: 3rem; }
  article { padding: 2rem; }
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .nav-links {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: var(--bg-color);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
  }
  .nav-links.active { left: 0; }
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.8rem; }
  table, thead, tbody, th, td, tr { display: block; }
  th { position: absolute; top: -9999px; left: -9999px; }
  tr { border-bottom: 1px solid var(--surface-border); padding: 1rem; }
  td {
    border: none;
    position: relative;
    padding-left: 50%;
    margin-bottom: 0.5rem;
  }
  td:before {
    position: absolute;
    top: 0;
    left: 0;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    content: attr(data-label);
    color: var(--accent-primary);
    font-weight: bold;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  article { padding: 1.5rem; }
  h1 { font-size: 2rem; }
}