/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
body {
  background: #0A1A2F;
  color: #F0F4F8;
  font-family: 'JetBrains Mono', 'Source Han Sans SC', monospace;
  line-height: 1.6;
  min-height: 100vh;
}
img, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}
a {
  color: #00E5FF;
  text-decoration: none;
  transition: color 0.2s;
}
a:hover, a:focus-visible {
  color: #FFD700;
}
ul {
  list-style: none;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}
/* Skip Link */
.skip-link {
  position: fixed;
  top: -999px;
  left: 0;
  z-index: 1000;
  padding: 0.5rem 1.5rem;
  background: #00E5FF;
  color: #0A1A2F;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
}
/* CSS Variables */
:root {
  --color-primary: #0A1A2F;
  --color-secondary: #00E5FF;
  --color-accent: #FFD700;
  --color-neutral: #F0F4F8;
  --color-dark: #1A1A2E;
  --color-border: #2A3A5F;
  --font-heading: 'Inter', 'Noto Sans SC', sans-serif;
  --font-body: 'JetBrains Mono', 'Source Han Sans SC', monospace;
  --header-width: 260px;
  --header-collapsed: 60px;
  --transition-speed: 0.3s;
}
/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-neutral);
}
h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
body, p, li { font-size: 1rem; }
small, .caption { font-size: 0.75rem; }
/* Container */
.container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
/* Header – fixed left navigation */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--header-width);
  height: 100vh;
  background: var(--color-primary);
  border-right: 1px solid var(--color-border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-speed);
}
.header-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2rem 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  color: var(--color-neutral);
  text-decoration: none;
}
.brand-icon {
  display: block;
  width: 36px;
  height: 36px;
  background: conic-gradient(from 90deg, var(--color-secondary), var(--color-accent), var(--color-secondary));
  border: 2px solid var(--color-secondary);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(0,229,255,0.3);
}
.brand-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-toggle {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  color: var(--color-secondary);
  z-index: 10;
}
.primary-nav {
  flex: 1;
}
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.nav-list a {
  display: block;
  padding: 0.6rem 1rem;
  border-left: 3px solid transparent;
  color: var(--color-neutral);
  font-size: 0.95rem;
  transition: all 0.2s;
  font-weight: 400;
}
.nav-list a:hover,
.nav-list a:focus-visible {
  border-left-color: var(--color-secondary);
  background: rgba(0,229,255,0.08);
  color: var(--color-secondary);
}
.nav-list a[aria-current="page"] {
  border-left-color: var(--color-accent);
  color: var(--color-accent);
  font-weight: 700;
  background: rgba(255,215,0,0.08);
}
/* Footer */
.site-footer {
  background: #1A1A2E;
  border-top: 2px solid var(--color-accent);
  padding: 2rem 1.5rem 1rem;
  margin-left: var(--header-width);
}
.footer-inner {
  max-width: 1260px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-neutral);
}
.brand-icon-footer {
  width: 28px;
  height: 28px;
  background: conic-gradient(from 90deg, var(--color-secondary), var(--color-accent), var(--color-secondary));
  border: 1px solid var(--color-secondary);
  border-radius: 3px;
}
.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--color-neutral);
  font-size: 0.85rem;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--color-secondary);
}
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #8899AA;
}
.footer-sep {
  color: var(--color-accent);
}
.footer-bottom {
  max-width: 1260px;
  margin: 1rem auto 0;
  text-align: center;
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
  font-size: 0.8rem;
  color: #8899AA;
}
/* Generic Button */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.8rem;
  background: var(--color-secondary);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.9rem;
  border: 2px solid var(--color-accent);
  border-radius: 4px;
  transition: all 0.2s;
  text-decoration: none;
}
.btn:hover, .btn:focus-visible {
  background: var(--color-accent);
  color: var(--color-primary);
  box-shadow: 0 0 20px rgba(0,229,255,0.3);
}
/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 0;
  font-size: 0.85rem;
}
.breadcrumb a {
  color: var(--color-neutral);
}
.breadcrumb a:hover {
  color: var(--color-secondary);
}
.breadcrumb span.sep {
  color: var(--color-secondary);
}
/* Scroll to top button (shared) */
[data-scroll-top] {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 300;
  width: 48px;
  height: 48px;
  background: var(--color-secondary);
  color: var(--color-primary);
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  font-size: 1.5rem;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.3s, transform 0.3s, background 0.3s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
[data-scroll-top].visible {
  display: flex;
}
[data-scroll-top]:hover, [data-scroll-top]:focus-visible {
  background: var(--color-accent);
  opacity: 1;
  transform: scale(1.1);
}
/* Responsive */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
@media (max-width: 1024px) {
  :root {
    --header-width: 220px;
  }
}
@media (max-width: 768px) {
  .site-header {
    width: 100%;
    height: auto;
    position: fixed;
    bottom: auto;
    top: 0;
    left: 0;
    right: 0;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: 0 1rem;
    min-height: 60px;
  }
  .header-inner {
    flex-direction: row;
    align-items: center;
    padding: 0.5rem 0;
    width: 100%;
  }
  .brand {
    margin-bottom: 0;
    flex: 1;
  }
  .nav-toggle {
    display: block;
  }
  .primary-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-primary);
    transform: translateX(-100%);
    transition: transform var(--transition-speed);
    overflow-y: auto;
    padding: 2rem 1.5rem;
  }
  .primary-nav[data-open] {
    transform: translateX(0);
  }
  .nav-list {
    flex-direction: column;
  }
  .site-footer {
    margin-left: 0;
    padding: 1.5rem 1rem;
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }
  .footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }
  .footer-meta {
    flex-direction: column;
    align-items: flex-start;
  }
  [data-scroll-top] {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}
/* Focus visible */
:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}
/* Grid utility */
.grid-2, .grid-3, .grid-4 {
  display: grid;
  gap: 1.5rem;
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}
/* Image placeholders (for page-level use) */
.img-placeholder {
  background: linear-gradient(135deg, #1A1A2E, #0A1A2F);
  border: 2px dashed var(--color-border);
  border-radius: 4px;
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8899AA;
  font-size: 0.85rem;
}
