:root {
  --bg: #0b0f14;
  --bg-alt: #0f1522;
  --surface: #121827;
  --surface-elev: #151c2e;
  --surface-soft: #182234;
  --border: rgba(122, 132, 156, 0.25);
  --text: #e6eaf2;
  --text-muted: #aab3c5;
  --accent-1: #5b7cfa;
  --accent-2: #7a63d2;
  --accent-3: #65b5ff;
  --glow: rgba(91, 124, 250, 0.18);
  --shadow: 0 25px 60px rgba(6, 10, 18, 0.55);
  --radius: 16px;
  --radius-sm: 10px;
  --max-width: 1120px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --display: "Sora", "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 15% 10%, rgba(90, 130, 255, 0.18), transparent 60%),
    radial-gradient(900px 600px at 85% 20%, rgba(120, 90, 210, 0.16), transparent 55%),
    radial-gradient(700px 500px at 50% 90%, rgba(80, 170, 240, 0.12), transparent 60%);
  pointer-events: none;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 15, 20, 0.92) 0%, rgba(11, 15, 20, 0.98) 40%, #0b0f14 100%);
  pointer-events: none;
  z-index: -1;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--text);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  padding: 12px 16px;
  background: var(--accent-1);
  color: #08101b;
  border-radius: 999px;
  font-weight: 600;
  z-index: 200;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 20, 0.8);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(120, 130, 150, 0.2);
}

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

.logo {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.4px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(91, 124, 250, 0.5), rgba(122, 99, 210, 0.55));
  box-shadow: 0 0 18px rgba(91, 124, 250, 0.3);
  display: grid;
  place-items: center;
  font-size: 14px;
  color: #e6eaf2;
}

.nav-links {
  display: flex;
  gap: 18px;
  font-weight: 500;
  font-size: 15px;
}

.nav-links a {
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--text-muted);
  transition: color 200ms ease, background 200ms ease;
}

.nav-links a.active,
.nav-links a:hover,
.nav-links a:focus {
  color: var(--text);
  background: rgba(91, 124, 250, 0.12);
}

.main {
  display: flex;
  flex-direction: column;
  gap: 80px;
  padding: 72px 0 96px;
}

.hero {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: center;
}

.hero-title {
  font-family: var(--display);
  font-size: clamp(2.4rem, 3vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(91, 124, 250, 0.9), rgba(122, 99, 210, 0.85));
  color: #0b0f14;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(91, 124, 250, 0.22);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.btn:hover,
.btn:focus {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(91, 124, 250, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(122, 132, 156, 0.4);
  box-shadow: none;
}

.btn-outline:hover,
.btn-outline:focus {
  background: rgba(91, 124, 250, 0.12);
  box-shadow: none;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.section-title {
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 600;
}

.section-subtitle {
  color: var(--text-muted);
  max-width: 520px;
}

.meta-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.card {
  background: linear-gradient(160deg, rgba(18, 24, 39, 0.95), rgba(21, 28, 46, 0.9));
  border: 1px solid rgba(122, 132, 156, 0.2);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 210px;
  transition: transform 200ms ease, border 200ms ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(91, 124, 250, 0.4);
}

.card h3 {
  font-family: var(--display);
  font-size: 1.2rem;
}

.card p {
  color: var(--text-muted);
}

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(91, 124, 250, 0.12);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(122, 132, 156, 0.35);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-button {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(18, 24, 39, 0.7);
  color: var(--text-muted);
  border: 1px solid rgba(122, 132, 156, 0.3);
  cursor: pointer;
  transition: all 200ms ease;
}

.filter-button[aria-pressed="true"],
.filter-button:hover {
  color: var(--text);
  border-color: rgba(91, 124, 250, 0.4);
  background: rgba(91, 124, 250, 0.18);
}

.search-input {
  width: min(320px, 100%);
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(122, 132, 156, 0.3);
  background: rgba(18, 24, 39, 0.8);
  color: var(--text);
}

.search-input::placeholder {
  color: rgba(170, 179, 197, 0.7);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 40px;
}

.article-layout .markdown {
  max-width: 760px;
}

.toc {
  position: sticky;
  top: 96px;
  align-self: start;
  border: 1px solid rgba(122, 132, 156, 0.2);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: rgba(18, 24, 39, 0.75);
}

.toc-title {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.toc ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.toc a:hover,
.toc a:focus {
  color: var(--text);
}

.markdown h1,
.markdown h2,
.markdown h3 {
  font-family: var(--display);
  margin: 24px 0 12px;
}

.markdown p {
  margin-bottom: 16px;
  color: var(--text-muted);
}

.markdown ul,
.markdown ol {
  margin: 0 0 16px 20px;
  color: var(--text-muted);
}

.markdown blockquote {
  border-left: 2px solid rgba(91, 124, 250, 0.6);
  padding-left: 14px;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.markdown code {
  font-family: var(--mono);
  font-size: 0.9rem;
  background: rgba(91, 124, 250, 0.15);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text);
}

.markdown pre {
  background: #0e1424;
  border-radius: 12px;
  padding: 16px;
  overflow: auto;
  margin: 0 0 18px;
  border: 1px solid rgba(122, 132, 156, 0.2);
}

.markdown pre code {
  display: block;
  padding: 0;
  background: transparent;
  color: #dbe4ff;
}

.project-hero {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.project-sections {
  display: grid;
  gap: 24px;
}

.report-panel {
  display: grid;
  gap: 16px;
  background: rgba(18, 24, 39, 0.75);
  border-radius: var(--radius);
  border: 1px solid rgba(122, 132, 156, 0.2);
  padding: 20px;
}

.report-panel iframe {
  width: 100%;
  height: 420px;
  border: none;
  border-radius: 12px;
}

.chart-panel {
  display: grid;
  gap: 12px;
}

.chart-canvas {
  width: 100%;
  min-height: 280px;
  background: rgba(10, 14, 22, 0.8);
  border-radius: 14px;
  border: 1px solid rgba(122, 132, 156, 0.2);
  padding: 12px;
}

.chart-panel img.chart-canvas {
  height: 280px;
  object-fit: cover;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(122, 132, 156, 0.2);
  background: rgba(18, 24, 39, 0.65);
}

.stat strong {
  display: block;
  font-size: 1.2rem;
  font-family: var(--display);
}

.footer {
  border-top: 1px solid rgba(122, 132, 156, 0.2);
  padding: 40px 0 60px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.footer h4 {
  font-family: var(--display);
  margin-bottom: 10px;
  color: var(--text);
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }
}

@media (max-width: 720px) {
  .nav-inner {
    flex-direction: column;
    gap: 10px;
    height: auto;
    padding: 12px 0 16px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition-duration: 0ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
