:root {
  --bg-deep: #020203;
  --bg-base: #050506;
  --bg-elevated: #0a0a0c;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --foreground: #edecef;
  --foreground-muted: #8a8f98;
  --foreground-subtle: rgba(255, 255, 255, 0.6);
  --accent: #5e6ad2;
  --accent-bright: #6872d9;
  --accent-glow: rgba(94, 106, 210, 0.3);
  --border-default: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(94, 106, 210, 0.3);
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 2px 20px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(0, 0, 0, 0.2);
  --shadow-card-hover: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 8px 40px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(94, 106, 210, 0.1);
  --shadow-button: 0 0 0 1px rgba(94, 106, 210, 0.5), 0 4px 12px rgba(94, 106, 210, 0.3),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
  --shadow-inner: inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --container: min(1180px, calc(100vw - 32px));
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, "Geist Sans", system-ui, sans-serif;
  color: var(--foreground);
  background:
    radial-gradient(circle at top, rgba(12, 13, 24, 0.95) 0%, rgba(5, 5, 6, 0.92) 45%, rgba(2, 2, 3, 1) 100%);
  line-height: 1.6;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -3;
}

body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.3;
}

body::after {
  opacity: 0.08;
  background-image: radial-gradient(rgba(255, 255, 255, 0.2) 0.7px, transparent 0.7px);
  background-size: 8px 8px;
  mix-blend-mode: soft-light;
}

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

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

button {
  font: inherit;
}

.site-shell {
  position: relative;
  isolation: isolate;
}

.ambient-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(140px);
  opacity: 0.8;
  animation: float 10s ease-in-out infinite;
}

.blob-1 {
  width: 58rem;
  height: 78rem;
  left: 50%;
  top: -24rem;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(94, 106, 210, 0.28), rgba(94, 106, 210, 0.03) 72%);
}

.blob-2 {
  width: 42rem;
  height: 58rem;
  left: -10rem;
  top: 8rem;
  background: radial-gradient(circle, rgba(122, 92, 183, 0.18), rgba(122, 92, 183, 0.02) 70%);
  animation-duration: 8s;
}

.blob-3 {
  width: 34rem;
  height: 48rem;
  right: -6rem;
  top: 16rem;
  background: radial-gradient(circle, rgba(79, 121, 255, 0.14), rgba(79, 121, 255, 0.02) 68%);
  animation-duration: 9s;
}

.blob-4 {
  width: 46rem;
  height: 28rem;
  left: 50%;
  bottom: -12rem;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(94, 106, 210, 0.12), rgba(94, 106, 210, 0.01) 72%);
  animation: pulse-float 9s ease-in-out infinite;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(5, 5, 6, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    linear-gradient(135deg, rgba(94, 106, 210, 0.8), rgba(94, 106, 210, 0.22));
  box-shadow: var(--shadow-card);
}

.brand-mark span {
  font-size: 0.95rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-links a {
  color: var(--foreground-muted);
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  transition: color 200ms var(--ease-expo), background 200ms var(--ease-expo);
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.active {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.05);
}

.menu-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  border: 1px solid var(--border-default);
  background: rgba(255, 255, 255, 0.04);
  color: var(--foreground);
  box-shadow: var(--shadow-inner);
}

.menu-panel {
  display: none;
}

.section {
  position: relative;
  padding: 6rem 0;
}

.section + .section {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  font-size: 0.72rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(94, 106, 210, 0.08);
}

.hero {
  padding-top: 4.5rem;
  min-height: calc(100vh - 76px);
  display: grid;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
}

.hero-copy {
  max-width: 43rem;
}

.hero-title,
.page-title {
  margin: 1.25rem 0 1.5rem;
  font-size: clamp(3.4rem, 8vw, 6.4rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  font-weight: 600;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.76));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.accent-text {
  background: linear-gradient(90deg, #5e6ad2, #98a2ff, #5e6ad2);
  background-size: 200% 100%;
  animation: shimmer 6s linear infinite;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead,
.page-lead,
.article-intro {
  color: var(--foreground-muted);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  max-width: 42rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 3rem;
  padding: 0.9rem 1.25rem;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  transition:
    transform 220ms var(--ease-expo),
    background 220ms var(--ease-expo),
    box-shadow 220ms var(--ease-expo),
    color 220ms var(--ease-expo);
}

.button:focus-visible,
.nav-links a:focus-visible,
.menu-toggle:focus-visible,
.footer-link:focus-visible,
.toc a:focus-visible {
  outline: 2px solid rgba(94, 106, 210, 0.6);
  outline-offset: 3px;
}

.button-primary {
  color: #fff;
  background: linear-gradient(180deg, #6872d9, #5e6ad2);
  box-shadow: var(--shadow-button);
}

.button-primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #7380ec, #6872d9);
}

.button-secondary {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow-inner);
  border: 1px solid var(--border-default);
}

.button-secondary:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.hero-panel,
.card,
.timeline-item,
.article-card,
.quote-card,
.meta-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(10, 10, 12, 0.7);
  box-shadow: var(--shadow-card);
}

.hero-panel {
  min-height: 33rem;
  padding: 1.25rem;
}

.spotlight::before,
.hero-panel::before,
.card::before,
.timeline-item::before,
.article-card::before,
.quote-card::before,
.meta-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(94, 106, 210, 0.16), transparent 42%);
  opacity: 0;
  transition: opacity 240ms var(--ease-expo);
  pointer-events: none;
}

.spotlight:hover::before,
.hero-panel:hover::before,
.card:hover::before,
.timeline-item:hover::before,
.article-card:hover::before,
.quote-card:hover::before,
.meta-card:hover::before {
  opacity: 1;
}

.hero-panel:hover,
.card:hover,
.timeline-item:hover,
.article-card:hover,
.quote-card:hover,
.meta-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-hover);
}

.hero-stack {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 1rem;
}

.panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--foreground-subtle);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-pill::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #85f0a2;
  box-shadow: 0 0 16px rgba(133, 240, 162, 0.65);
}

.panel-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1rem;
}

.metrics,
.quick-notes,
.article-grid,
.insight-grid,
.footer-grid,
.bento-grid,
.timeline {
  display: grid;
  gap: 1rem;
}

.metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric {
  padding: 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-value {
  margin: 0.35rem 0 0;
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.metric-label,
.small-label {
  color: var(--foreground-subtle);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quick-notes {
  align-content: start;
}

.note {
  padding: 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.section-heading {
  max-width: 42rem;
  margin-bottom: 2.5rem;
}

.section-heading h2 {
  margin: 1rem 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.section-heading p {
  margin: 0;
  color: var(--foreground-muted);
  font-size: 1.03rem;
}

.bento-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: minmax(180px, auto);
}

.card {
  padding: 1.5rem;
  transition:
    transform 260ms var(--ease-expo),
    border-color 260ms var(--ease-expo),
    box-shadow 260ms var(--ease-expo);
}

.card h3,
.timeline-item h3,
.article-card h3 {
  margin: 0.5rem 0 0.75rem;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
}

.card p,
.timeline-item p,
.article-card p,
.meta-card p,
.quote-card p,
.article-body p,
.article-body li {
  color: var(--foreground-muted);
}

.span-4 {
  grid-column: span 4;
}

.span-3 {
  grid-column: span 3;
}

.span-2 {
  grid-column: span 2;
}

.span-row-2 {
  grid-row: span 2;
}

.card-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.card-list div {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.timeline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.timeline-item {
  padding: 1.5rem;
  transition:
    transform 260ms var(--ease-expo),
    border-color 260ms var(--ease-expo),
    box-shadow 260ms var(--ease-expo);
}

.article-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.article-card {
  padding: 1.5rem;
  transition:
    transform 260ms var(--ease-expo),
    border-color 260ms var(--ease-expo),
    box-shadow 260ms var(--ease-expo);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  color: var(--foreground-subtle);
  font-size: 0.86rem;
}

.article-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  color: var(--foreground);
  font-weight: 500;
}

.article-link::after {
  content: "->";
  color: var(--accent-bright);
}

.footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-grid {
  grid-template-columns: 1.2fr 0.8fr;
  align-items: end;
}

.footer-copy p,
.footer-links {
  color: var(--foreground-muted);
}

.footer-links {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.page-hero {
  padding-top: 5rem;
  padding-bottom: 2rem;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.1fr) minmax(260px, 0.5fr);
  gap: 2rem;
  align-items: start;
}

.article-main {
  grid-column: 1 / 3;
}

.article-card {
  padding: 2rem;
}

.article-cover {
  height: 18rem;
  border-radius: 18px;
  background:
    linear-gradient(140deg, rgba(104, 114, 217, 0.35), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  margin-bottom: 2rem;
}

.article-body h2 {
  margin-top: 2.4rem;
  margin-bottom: 0.8rem;
  font-size: 1.8rem;
  letter-spacing: -0.03em;
}

.article-body ul {
  padding-left: 1.2rem;
}

.quote-card,
.meta-card {
  padding: 1.4rem;
  margin-bottom: 1rem;
  transition:
    transform 260ms var(--ease-expo),
    border-color 260ms var(--ease-expo),
    box-shadow 260ms var(--ease-expo);
}

.quote-card blockquote {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.7;
  letter-spacing: -0.01em;
}

.toc {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.toc a {
  color: var(--foreground-muted);
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  transition: background 220ms var(--ease-expo), color 220ms var(--ease-expo);
}

.toc a:hover {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.06);
}

.reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition:
    opacity 600ms var(--ease-expo),
    transform 600ms var(--ease-expo);
}

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

.delay-1 {
  transition-delay: 80ms;
}

.delay-2 {
  transition-delay: 160ms;
}

.delay-3 {
  transition-delay: 240ms;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-20px) rotate(1deg);
  }
}

@keyframes pulse-float {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(-18px);
  }
}

@keyframes shimmer {
  0% {
    background-position: 0 50%;
  }

  100% {
    background-position: 200% 50%;
  }
}

@media (max-width: 1024px) {
  .hero-grid,
  .panel-grid,
  .article-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .article-main {
    grid-column: auto;
  }

  .timeline,
  .article-grid {
    grid-template-columns: 1fr 1fr;
  }

  .bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-4,
  .span-3,
  .span-2,
  .span-row-2 {
    grid-column: span 1;
    grid-row: span 1;
  }
}

@media (max-width: 767px) {
  .section {
    padding: 4.5rem 0;
  }

  .hero {
    min-height: auto;
    padding-top: 3rem;
  }

  .nav-links {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .menu-panel {
    display: grid;
    gap: 0.75rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition:
      max-height 220ms var(--ease-expo),
      opacity 220ms var(--ease-expo),
      padding 220ms var(--ease-expo);
  }

  .menu-panel.is-open {
    max-height: 420px;
    opacity: 1;
    padding-bottom: 1rem;
  }

  .menu-panel a {
    padding: 0.95rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--foreground);
    border: 1px solid rgba(255, 255, 255, 0.05);
  }

  .hero-title,
  .page-title {
    font-size: clamp(2.8rem, 14vw, 4.4rem);
  }

  .hero-panel,
  .article-card {
    padding: 1.1rem;
  }

  .timeline,
  .article-grid,
  .metrics,
  .footer-grid,
  .bento-grid {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
