/* ===========================
   DESIGN SYSTEM
   =========================== */
:root {
  --bg:           #ffffff;
  --bg-soft:      #F8FAFC;
  --bg-blue:      #EFF6FF;
  --text:         #0F172A;
  --text-muted:   #64748B;
  --text-light:   #94A3B8;
  --accent:       #2563EB;
  --accent-mid:   #BFDBFE;
  --accent-light: #EFF6FF;
  --amber:        #D97706;
  --border:       #E2E8F0;
  --radius:       10px;
  --radius-lg:    16px;
  --max-w:        760px;
  --shadow:       0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
}

/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

/* ===========================
   NAVIGATION
   =========================== */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: min(var(--max-w), 100%);
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.nav-logo {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav-logo span { color: var(--accent); }

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

.nav-links a {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--accent);
  background: var(--accent-light);
}

.nav-links a.active {
  color: var(--accent);
  background: var(--accent-light);
}

.nav-github {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}

.nav-github:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===========================
   LAYOUT
   =========================== */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 5rem 0;
}

section + section {
  border-top: 1px solid var(--border);
}

/* ===========================
   TYPOGRAPHY
   =========================== */
h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--text);
}

h2 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

p {
  margin-bottom: 1.1rem;
  color: var(--text);
}

p:last-child { margin-bottom: 0; }

a { color: var(--accent); }

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

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

/* ===========================
   HERO
   =========================== */
.hero {
  padding: 5.5rem 0 4rem;
  border: none;
}

.hero h1 {
  margin-bottom: 1.4rem;
  max-width: 640px;
}

.hero-lead {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 580px;
  margin-bottom: 2rem;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.25rem 0.7rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-soft);
}

/* ===========================
   QUOTE
   =========================== */
.quote-block {
  position: relative;
  border-left: 3px solid var(--accent);
  padding: 1.25rem 1.5rem 1.25rem 1.75rem;
  background: var(--accent-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 2rem 0;
}

.quote-block p {
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.quote-source {
  font-size: 0.82rem;
  font-style: normal;
  color: var(--text-muted);
}

.quote-source a {
  color: var(--accent);
  text-decoration: none;
}

/* ===========================
   DIAGRAM
   =========================== */
.diagram-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2.5rem 0;
  overflow-x: auto;
}

.diagram-card svg {
  display: block;
  max-width: 100%;
}

.diagram-caption {
  font-size: 0.83rem;
  color: var(--text-light);
  text-align: center;
  margin-top: 1rem;
  font-style: italic;
}

/* ===========================
   HIGHLIGHT BOX
   =========================== */
.insight-box {
  background: var(--accent-light);
  border: 1px solid var(--accent-mid);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}

.insight-box p {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin: 0;
}

/* ===========================
   ACT CARDS
   =========================== */
.acts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.act-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.18s;
  box-shadow: var(--shadow);
}

.act-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

.act-number {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.act-card h3 {
  font-size: 1rem;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.act-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

.act-badge {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  background: var(--accent-light);
  border-radius: 6px;
  align-self: flex-start;
}

/* ===========================
   FOOTER
   =========================== */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

footer a:hover { color: var(--accent); }

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero h1       { animation: fadeUp 0.55s ease both; }
.hero-lead     { animation: fadeUp 0.55s 0.1s ease both; }
.hero-tags     { animation: fadeUp 0.55s 0.18s ease both; }

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ===========================
   RESPONSIVE
   =========================== */
/* ── burger button (hidden on desktop) ── */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  flex-shrink: 0;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── canvas scroll wrapper ── */
.canvas-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.35rem; }

  .hero { padding: 3.5rem 0 2.5rem; }
  section { padding: 3.5rem 0; }

  .acts-grid { grid-template-columns: 1fr; }

  /* nav burger */
  .nav-burger { display: flex; }
  .nav-github { display: none; }
  .nav-links {
    display: none;
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.25rem 0;
    gap: 0;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    white-space: normal;
  }
  .nav-links li:last-child a { border-bottom: none; }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
