:root {
  --bg-0: #020617;
  --bg-1: #0b1224;
  --bg-2: #121f39;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent-1: #22d3ee;
  --accent-2: #6366f1;
  --accent-3: #38bdf8;
  --card: rgba(15, 23, 42, 0.72);
  --card-border: rgba(148, 163, 184, 0.2);
  --radius: 18px;
  --shadow: 0 20px 48px rgba(2, 6, 23, 0.45);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", sans-serif;
  background: radial-gradient(circle at 16% -12%, #10203e 0%, var(--bg-1) 40%, var(--bg-0) 100%);
  color: var(--text);
  min-height: 100vh;
}

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

.container {
  width: min(100% - 2.4rem, var(--max));
  margin-inline: auto;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(2, 6, 23, 0.72);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.nav-shell {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-weight: 800;
  letter-spacing: 0.02em;
}

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

.nav-links a {
  padding: 0.45rem 0.68rem;
  border-radius: 999px;
  color: var(--muted);
  transition: color 180ms ease, background 180ms ease;
}

.nav-links a:hover {
  color: #f8fafc;
  background: rgba(34, 211, 238, 0.16);
}

.hero {
  position: relative;
  min-height: 62vh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 15%, rgba(34, 211, 238, 0.18), transparent 42%),
    radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.2), transparent 38%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.28), rgba(2, 6, 23, 0.78));
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: min(100% - 2rem, 860px);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--accent-1);
}

.hero-content h1 {
  margin: 0.7rem 0 0.8rem;
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  line-height: 1.1;
}

.hero-content p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.75;
}

.btn {
  margin-top: 1.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.46);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.26), rgba(99, 102, 241, 0.18));
  color: #f8fafc;
  padding: 0.72rem 1.2rem;
  font-weight: 700;
  overflow: hidden;
  position: relative;
}

.section {
  padding: 5rem 0;
}

.section-header {
  max-width: 780px;
}

.section-header h2 {
  margin: 0.58rem 0 0.7rem;
  font-size: clamp(1.5rem, 3.3vw, 2.4rem);
}

.section-header p {
  margin: 0;
  line-height: 1.75;
  color: var(--muted);
}

.chapter-grid {
  margin-top: 2.2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.chapter-card {
  position: relative;
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.chapter-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, rgba(34, 211, 238, 0.1), rgba(15, 23, 42, 0));
  pointer-events: none;
}

.chapter-card:hover {
  transform: translateY(-8px);
  border-color: rgba(34, 211, 238, 0.56);
  box-shadow: 0 22px 42px rgba(34, 211, 238, 0.16);
}

.chapter-canvas-wrap {
  height: 196px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.5), rgba(2, 6, 23, 0.82));
}

.chapter-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chapter-no {
  margin: 0.85rem 0 0.22rem;
  color: var(--accent-3);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.chapter-card h3 {
  margin: 0;
  font-size: 1.24rem;
}

.chapter-card p {
  margin: 0.42rem 0 0;
  color: #cbd5e1;
  line-height: 1.66;
}

.chapter-btn {
  margin-top: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.48);
  background: rgba(99, 102, 241, 0.2);
  color: #f8fafc;
  font-weight: 700;
  padding: 0.66rem 1.02rem;
  position: relative;
  overflow: hidden;
}

.chapter-btn:hover {
  box-shadow: 0 12px 26px rgba(99, 102, 241, 0.28);
}

.note-section {
  padding-top: 0;
}

.note-box {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.6);
  border-radius: var(--radius);
  padding: 1.4rem;
}

.note-box h2 {
  margin: 0.6rem 0 0.6rem;
}

.note-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.site-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.86);
}

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

.footer-inner p {
  margin: 0;
  color: var(--muted);
}

.footer-link {
  color: var(--accent-1);
  font-weight: 700;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 420ms ease, transform 420ms ease;
}

[data-reveal].in-view {
  opacity: 1;
  transform: translateY(0);
}

.ripple-btn > .ripple {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transform: scale(0);
  animation: ripple 560ms ease-out;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(24);
    opacity: 0;
  }
}

@media (max-width: 1024px) {
  .chapter-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .nav-shell {
    min-height: 60px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.35rem 0;
  }

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

  .section {
    padding: 4rem 0;
  }

  .chapter-canvas-wrap {
    height: 178px;
  }

  .footer-inner {
    min-height: 92px;
    flex-direction: column;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 1rem, var(--max));
  }

  .nav-shell {
    width: min(100% - 1rem, var(--max));
  }

  .hero {
    min-height: 72vh;
  }

  .hero-content {
    width: min(100% - 1rem, 860px);
  }

  .hero-content h1 {
    font-size: clamp(1.65rem, 8vw, 2.8rem);
  }

  .section {
    padding: 54px 0;
  }

  .section-header h2 {
    font-size: clamp(1.35rem, 6vw, 2rem);
  }

  .paper-card,
  .topic-card,
  .demo-card,
  .note-box {
    padding: 0.85rem;
  }

  .paper-canvas-wrap {
    height: 152px;
  }

  .topic-canvas-wrap {
    height: 144px;
  }

  .demo-card canvas {
    height: 188px;
  }

  .paper-card h3,
  .topic-card h3 {
    font-size: 1.04rem;
  }

  .paper-card p,
  .topic-card p,
  .demo-card p,
  .note-box p {
    font-size: 0.94rem;
    min-height: auto;
  }

  .chapter-points {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    align-items: center;
    text-align: center;
  }
}
