/* =====================================================================
   Open Roleplay — portfolio site
   Design system: light-first, "Open" green accent, dark-mode toggle.
   Author: Open Roleplay Workshop
   ===================================================================== */

/* ------------------------------------------------------------------ */
/* 1. Design tokens                                                    */
/* ------------------------------------------------------------------ */
:root {
  /* Brand */
  --accent:       #16a34a;   /* green-600  — accessible on white  */
  --accent-2:     #22c55e;   /* green-500  — vivid, gradients     */
  --accent-3:     #0d9488;   /* teal-600   — gradient endpoint    */
  --accent-ink:   #14532d;   /* deep green — text on tinted bg    */
  --accent-soft:  rgba(34, 197, 94, 0.10);
  --accent-line:  rgba(22, 163, 74, 0.28);
  --ring:         rgba(34, 197, 94, 0.40);

  /* Surfaces (light) */
  --bg:           #f4f9f5;
  --bg-2:         #eef5f0;
  --surface:      #ffffff;
  --surface-2:    #f3f8f4;
  --surface-3:    #eaf2ec;
  --border:       rgba(13, 42, 28, 0.10);
  --border-2:     rgba(13, 42, 28, 0.16);

  /* Text */
  --text:         #0b1a11;
  --text-soft:    #3f5247;
  --text-mut:     #66786d;
  --text-inv:     #f4f9f5;

  /* Effects */
  --shadow-sm:    0 1px 2px rgba(8, 26, 16, 0.06), 0 1px 3px rgba(8, 26, 16, 0.05);
  --shadow-md:    0 6px 16px rgba(8, 26, 16, 0.08), 0 2px 6px rgba(8, 26, 16, 0.05);
  --shadow-lg:    0 24px 50px -18px rgba(8, 40, 24, 0.30);
  --glow:         0 0 0 1px var(--accent-line), 0 18px 50px -20px rgba(22, 163, 74, 0.45);

  /* Type */
  --font-sans:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-disp:    "Space Grotesk", var(--font-sans);
  --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Layout */
  --maxw:         1180px;
  --radius:       14px;
  --radius-lg:    22px;
  --radius-pill:  999px;
  --nav-h:        66px;

  --grad: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 45%, var(--accent-3) 100%);
}

[data-theme="dark"] {
  --accent:       #34d399;
  --accent-2:     #22c55e;
  --accent-3:     #2dd4bf;
  --accent-ink:   #bbf7d0;
  --accent-soft:  rgba(34, 197, 94, 0.13);
  --accent-line:  rgba(52, 211, 153, 0.30);
  --ring:         rgba(52, 211, 153, 0.45);

  --bg:           #070b09;
  --bg-2:         #0a100c;
  --surface:      #0e1611;
  --surface-2:    #121c16;
  --surface-3:    #18241c;
  --border:       rgba(180, 255, 210, 0.09);
  --border-2:     rgba(180, 255, 210, 0.16);

  --text:         #e9f2ec;
  --text-soft:    #aebbb2;
  --text-mut:     #7d8c83;
  --text-inv:     #06120b;

  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md:    0 8px 22px rgba(0, 0, 0, 0.45);
  --shadow-lg:    0 28px 60px -20px rgba(0, 0, 0, 0.7);
  --glow:         0 0 0 1px var(--accent-line), 0 22px 60px -22px rgba(34, 197, 94, 0.55);
}

/* ------------------------------------------------------------------ */
/* 2. Reset & base                                                     */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .35s ease, color .35s ease;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; }
ul { list-style: none; padding: 0; }

h1, h2, h3, h4 { font-family: var(--font-disp); line-height: 1.12; font-weight: 600; letter-spacing: 0; }

::selection { background: var(--accent-2); color: #04130a; }

:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------------------------------------------ */
/* 3. Layout helpers                                                   */
/* ------------------------------------------------------------------ */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
.container, .hero-grid > *, .manifesto > *, .arch > *, .module-card, .feature, .dl-card, .pill-item, .mod-meta .m { min-width: 0; }

.section { padding: clamp(56px, 9vw, 116px) 0; position: relative; }
.section--tight { padding: clamp(40px, 6vw, 72px) 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--accent); font-weight: 600;
  padding: 6px 12px; border: 1px solid var(--accent-line); border-radius: var(--radius-pill);
  background: var(--accent-soft);
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-title { font-size: clamp(1.7rem, 3.6vw, 2.7rem); margin-top: 16px; }
.section-sub { color: var(--text-soft); font-size: 1.06rem; margin-top: 14px; }

.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ------------------------------------------------------------------ */
/* 4. Buttons & chips                                                  */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 600; font-size: .95rem; line-height: 1;
  padding: 13px 20px; border-radius: var(--radius-pill);
  border: 1px solid transparent; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
  max-width: 100%; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--grad); color: #04130a; box-shadow: 0 10px 28px -10px rgba(22, 163, 74, .7); }
.btn-primary:hover { box-shadow: 0 16px 36px -10px rgba(22, 163, 74, .85); }

.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-outline { background: transparent; border-color: var(--border-2); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 9px 15px; font-size: .85rem; }
.btn-lg { padding: 16px 26px; font-size: 1rem; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .8rem; font-weight: 500; color: var(--text-soft);
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border);
}
.chip svg { width: 14px; height: 14px; color: var(--accent); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .04em; font-weight: 600;
  text-transform: uppercase; padding: 5px 10px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
  max-width: 100%; white-space: normal;
}
.badge--amber { background: rgba(245, 158, 11, .12); color: #b45309; border-color: rgba(245, 158, 11, .35); }
.badge--blue  { background: rgba(56, 132, 255, .12); color: #2563eb; border-color: rgba(56, 132, 255, .35); }
[data-theme="dark"] .badge--amber { color: #fbbf24; }
[data-theme="dark"] .badge--blue  { color: #7eb0ff; }

/* ------------------------------------------------------------------ */
/* 5. Navbar                                                           */
/* ------------------------------------------------------------------ */
.nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s ease, background .3s ease;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav .container { display: flex; align-items: center; gap: 22px; }

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; font-family: var(--font-disp); font-weight: 700; font-size: 1.12rem; letter-spacing: 0; white-space: nowrap; }
.brand .mark { width: 34px; height: 34px; flex: none; }
.brand b { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
.nav-links a {
  font-size: .92rem; font-weight: 500; color: var(--text-soft);
  padding: 8px 13px; border-radius: 9px; transition: color .18s ease, background .18s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface-2); }

.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.icon-btn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--border-2);
  color: var(--text-soft); box-shadow: var(--shadow-sm); transition: color .18s ease, border-color .18s ease;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

.nav-burger { display: none; }

/* mobile nav panel */
.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 auto 0; z-index: 99;
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: 14px 22px 22px; display: none; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow-lg);
}
.mobile-menu.open { display: flex; }
.mobile-menu a { padding: 13px 12px; border-radius: 10px; font-weight: 500; color: var(--text-soft); }
.mobile-menu a:hover { background: var(--surface-2); color: var(--text); }
.mobile-menu .btn { margin-top: 10px; }

/* ------------------------------------------------------------------ */
/* 6. Decorative backgrounds                                           */
/* ------------------------------------------------------------------ */
.bg-grid {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 78%);
  opacity: .6;
}
.bg-glow {
  position: absolute; z-index: -1; pointer-events: none; border-radius: 50%;
  filter: blur(90px); opacity: .5;
}
.bg-glow--a { width: 540px; height: 540px; top: -180px; right: -120px; background: radial-gradient(circle, rgba(34,197,94,.55), transparent 70%); }
.bg-glow--b { width: 460px; height: 460px; top: 120px; left: -160px; background: radial-gradient(circle, rgba(13,148,136,.40), transparent 70%); }
[data-theme="dark"] .bg-glow { opacity: .35; }

/* ------------------------------------------------------------------ */
/* 7. Hero                                                             */
/* ------------------------------------------------------------------ */
.hero { position: relative; padding: clamp(54px, 9vw, 104px) 0 clamp(40px, 6vw, 76px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }

.hero h1 { font-size: clamp(2.5rem, 6vw, 4.3rem); letter-spacing: 0; }
.hero .lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--text-soft); margin-top: 22px; max-width: 33ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 34px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

.manifesto-tag { font-family: var(--font-mono); font-size: .82rem; color: var(--accent); margin-top: 26px; font-weight: 500; }

/* hero visual: floating code / module deck */
.hero-visual { position: relative; }
.code-window {
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-lg);
  max-width: 100%; box-shadow: var(--shadow-lg); overflow: hidden;
}
.code-window__bar { display: flex; align-items: center; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.code-window__bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--border-2); display: block; }
.code-window__bar i:nth-child(1) { background: #ff5f57; }
.code-window__bar i:nth-child(2) { background: #febc2e; }
.code-window__bar i:nth-child(3) { background: #28c840; }
.code-window__bar span { font-family: var(--font-mono); font-size: .76rem; color: var(--text-mut); margin-left: 8px; }
.code-window pre { margin: 0; padding: 20px 20px 22px; overflow-x: auto; }
.code-window code { font-family: var(--font-mono); font-size: .82rem; line-height: 1.85; color: var(--text-soft); }
.tok-key { color: #d946ef; } .tok-type { color: var(--accent); } .tok-str { color: #0891b2; } .tok-com { color: var(--text-mut); font-style: italic; } .tok-fn { color: #2563eb; }
[data-theme="dark"] .tok-key { color: #e879f9; } [data-theme="dark"] .tok-str { color: #22d3ee; } [data-theme="dark"] .tok-fn { color: #7eb0ff; }

.float-card {
  position: absolute; background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 14px; padding: 11px 15px; box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 10px; font-size: .85rem; font-weight: 600;
  animation: floaty 6s ease-in-out infinite;
}
.float-card svg { width: 20px; height: 20px; color: var(--accent); }
.float-card--1 { top: -22px; left: -26px; }
.float-card--2 { bottom: -20px; right: -22px; animation-delay: -3s; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* stats strip */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: clamp(48px, 7vw, 72px); }
.stat { text-align: center; padding: 22px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.stat b { display: block; font-family: var(--font-disp); font-size: clamp(1.7rem, 4vw, 2.4rem); color: var(--accent); letter-spacing: -.02em; }
.stat span { font-size: .82rem; color: var(--text-mut); }

/* ------------------------------------------------------------------ */
/* 8. Philosophy / manifesto                                           */
/* ------------------------------------------------------------------ */
.manifesto { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 70px); align-items: center; }
.manifesto-quotes { display: grid; gap: 14px; }
.mq { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 12px; padding: 16px 20px; box-shadow: var(--shadow-sm); }
.mq p { color: var(--text-soft); }
.mq b { color: var(--text); }
.manifesto-final { font-family: var(--font-disp); font-size: clamp(1.3rem, 3vw, 1.9rem); line-height: 1.35; }
.manifesto-final span { color: var(--text-mut); }

/* ------------------------------------------------------------------ */
/* 9. Modules grid                                                     */
/* ------------------------------------------------------------------ */
.modules-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

.module-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px; box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.module-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 60%);
  opacity: 0; transition: opacity .3s ease;
}
.module-card:hover { transform: translateY(-6px); box-shadow: var(--glow); border-color: var(--accent-line); }
.module-card:hover::after { opacity: 1; }

.module-card__icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent);
  margin-bottom: 18px;
}
.module-card__icon svg { width: 26px; height: 26px; }
.module-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.module-card h3 { font-size: 1.28rem; overflow-wrap: anywhere; }
.module-card .id { font-family: var(--font-mono); font-size: .76rem; color: var(--text-mut); margin-top: 3px; }
.module-card p { color: var(--text-soft); font-size: .95rem; margin-top: 12px; flex: 1; }
.module-card .tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.module-card .tags span { font-size: .73rem; color: var(--text-mut); background: var(--surface-2); border: 1px solid var(--border); padding: 4px 9px; border-radius: 7px; }
.module-card__foot { display: flex; align-items: center; gap: 14px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.module-card__foot a { font-size: .88rem; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.module-card__foot a:hover { gap: 9px; }
.module-card__foot a svg { width: 15px; height: 15px; transition: transform .18s ease; }
.module-card__foot .sec { color: var(--text-mut); font-weight: 500; }
.module-card__foot .sec:hover { color: var(--text); }

/* ------------------------------------------------------------------ */
/* 10. Feature grid / why                                              */
/* ------------------------------------------------------------------ */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); transition: border-color .2s ease, transform .2s ease; }
.feature:hover { border-color: var(--accent-line); transform: translateY(-3px); }
.feature .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 16px; }
.feature .ic svg { width: 22px; height: 22px; }
.feature h3 { font-size: 1.1rem; }
.feature p { color: var(--text-soft); font-size: .93rem; margin-top: 9px; }

/* ------------------------------------------------------------------ */
/* 11. Architecture diagram                                            */
/* ------------------------------------------------------------------ */
.arch { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 60px); align-items: center; }
.arch-diagram { display: grid; gap: 14px; }
.arch-core { background: var(--grad); color: #04130a; border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-md); }
.arch-core b { font-family: var(--font-disp); font-size: 1.1rem; }
.arch-core span { font-size: .85rem; opacity: .85; }
.arch-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.arch-node { background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 11px; font-weight: 600; font-size: .92rem; }
.arch-node svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.arch-node small { display: block; font-weight: 400; color: var(--text-mut); font-size: .76rem; }

/* ------------------------------------------------------------------ */
/* 12. Code blocks (content) + tables + steps                          */
/* ------------------------------------------------------------------ */
.code {
  position: relative; background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 14px; box-shadow: var(--shadow-sm); margin: 18px 0; overflow: hidden;
}
.code__head { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.code__head span { font-family: var(--font-mono); font-size: .74rem; color: var(--text-mut); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; }
.code code { font-family: var(--font-mono); font-size: .83rem; line-height: 1.75; color: var(--text-soft); white-space: pre; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600;
  color: var(--text-mut); background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 8px; padding: 5px 10px; transition: color .15s ease, border-color .15s ease;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin: 20px 0; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 540px; }
thead th { text-align: left; font-family: var(--font-disp); font-weight: 600; font-size: .82rem; letter-spacing: .02em; color: var(--text); background: var(--surface-2); padding: 13px 16px; border-bottom: 1px solid var(--border-2); }
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-soft); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td code, p code, li code { font-family: var(--font-mono); font-size: .84em; background: var(--accent-soft); color: var(--accent-ink); padding: 2px 7px; border-radius: 6px; }
[data-theme="dark"] td code, [data-theme="dark"] p code, [data-theme="dark"] li code { color: var(--accent); }

.steps { counter-reset: step; display: grid; gap: 16px; }
.step { position: relative; padding-left: 56px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 38px; height: 38px;
  display: grid; place-items: center; border-radius: 11px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent); font-family: var(--font-disp); font-weight: 700;
}
.step h4 { font-size: 1.02rem; }
.step p { color: var(--text-soft); font-size: .93rem; margin-top: 4px; }

/* generic prose lists used on module pages */
.bullets { display: grid; gap: 10px; margin: 16px 0; }
.bullets li { position: relative; padding-left: 28px; color: var(--text-soft); }
.bullets li::before {
  content: ""; position: absolute; left: 4px; top: .58em; width: 8px; height: 8px;
  border-radius: 2px; background: var(--grad); transform: rotate(45deg);
}
.cols-2 { columns: 2; column-gap: 40px; }
.cols-2 li { break-inside: avoid; }

/* ------------------------------------------------------------------ */
/* 13. Download cards                                                  */
/* ------------------------------------------------------------------ */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.dl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 14px; transition: border-color .2s, transform .2s; }
.dl-card:hover { border-color: var(--accent-line); transform: translateY(-3px); }
.dl-card .top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dl-card .ic { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.dl-card .ic svg { width: 22px; height: 22px; }
.dl-card h4 { font-size: 1.05rem; overflow-wrap: anywhere; }
.dl-card .id { font-family: var(--font-mono); font-size: .72rem; color: var(--text-mut); overflow-wrap: anywhere; }
.dl-card .actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: auto; }

/* CTA banner */
.cta-banner { position: relative; overflow: hidden; background: var(--grad); border-radius: var(--radius-lg); padding: clamp(34px, 6vw, 64px); text-align: center; color: #04130a; box-shadow: var(--shadow-lg); }
.cta-banner h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); color: #04130a; }
.cta-banner p { color: rgba(4,19,10,.78); margin-top: 12px; font-size: 1.05rem; max-width: 56ch; margin-inline: auto; }
.cta-banner .hero-cta { justify-content: center; }
.cta-banner .btn-ghost { background: rgba(255,255,255,.92); border-color: transparent; color: #04130a; }
.cta-banner .btn-outline { border-color: rgba(4,19,10,.35); color: #04130a; }
.cta-banner .btn-outline:hover { background: rgba(4,19,10,.08); color: #04130a; border-color: rgba(4,19,10,.45); }

/* ------------------------------------------------------------------ */
/* 14. Module page specifics                                           */
/* ------------------------------------------------------------------ */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text-mut); margin-bottom: 22px; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb svg { width: 14px; height: 14px; }

.mod-hero { position: relative; padding: clamp(34px, 6vw, 60px) 0 0; overflow: hidden; }
.mod-hero__icon { width: 68px; height: 68px; border-radius: 18px; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); display: grid; place-items: center; margin-bottom: 22px; }
.mod-hero__icon svg { width: 34px; height: 34px; }
.mod-hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
.mod-hero .lead { font-size: 1.12rem; color: var(--text-soft); margin-top: 18px; max-width: 62ch; }
.mod-hero .hero-cta { margin-top: 26px; }
.mod-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-top: 36px; }
.mod-meta .m { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.mod-meta .m span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-mut); font-family: var(--font-mono); }
.mod-meta .m b { font-size: .98rem; font-family: var(--font-mono); color: var(--text); word-break: break-word; }

.block { padding: clamp(40px, 6vw, 64px) 0; border-top: 1px solid var(--border); }
.block > .container > h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 8px; }
.block .lede { color: var(--text-soft); max-width: 70ch; margin-bottom: 26px; }

.pill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pill-item { display: flex; align-items: flex-start; gap: 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 15px 17px; box-shadow: var(--shadow-sm); transition: border-color .2s; }
.pill-item:hover { border-color: var(--accent-line); }
.pill-item .ic { color: var(--accent); flex: none; margin-top: 2px; }
.pill-item .ic svg { width: 20px; height: 20px; }
.pill-item b { font-size: .95rem; display: block; }
.pill-item small { color: var(--text-mut); font-size: .82rem; }

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

/* ------------------------------------------------------------------ */
/* 15. Footer                                                          */
/* ------------------------------------------------------------------ */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 56px 0 30px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 36px; }
.footer .brand { margin-bottom: 14px; }
.footer-about { color: var(--text-soft); font-size: .92rem; max-width: 34ch; }
.footer-social { display: flex; gap: 10px; margin-top: 18px; }
.footer h5 { font-family: var(--font-disp); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-mut); margin-bottom: 14px; }
.footer ul { display: grid; gap: 10px; }
.footer ul a { font-size: .92rem; color: var(--text-soft); }
.footer ul a:hover { color: var(--accent); }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 46px; padding-top: 24px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--text-mut); }
.footer-bottom .lic { display: flex; gap: 16px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ */
/* 16. Reveal animation                                                */
/* ------------------------------------------------------------------ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .08s; }
.reveal[data-d="2"] { transition-delay: .16s; }
.reveal[data-d="3"] { transition-delay: .24s; }
.reveal[data-d="4"] { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .float-card { animation: none; }
  html { scroll-behavior: auto; }
}

/* ------------------------------------------------------------------ */
/* 17. Responsive                                                      */
/* ------------------------------------------------------------------ */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero-visual { order: -1; max-width: 440px; }
  .modules-grid, .features { grid-template-columns: repeat(2, 1fr); }
  .manifesto, .arch { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 720px) {
  :root { --nav-h: 60px; }
  .container { padding-inline: 18px; }
  .section { padding: 52px 0; }
  .section-head { margin-bottom: 32px; }
  .section-head.center { text-align: left; }
  .nav .container { gap: 10px; padding-inline: 14px; }
  .brand { gap: 9px; font-size: 1rem; }
  .brand .mark { width: 30px; height: 30px; }
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
  .nav-actions .btn { display: none; }
  .nav-actions { gap: 8px; }
  .icon-btn { width: 38px; height: 38px; border-radius: 9px; }
  .mobile-menu {
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
    padding: 12px 16px 18px;
  }
  .hero { padding: 40px 0 48px; }
  .hero-grid { gap: 30px; }
  .hero-visual { order: 0; max-width: 100%; }
  .hero .lead { max-width: none; }
  .hero-cta { gap: 10px; margin-top: 26px; }
  .hero-meta { gap: 8px; margin-top: 22px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cols-2 { columns: 1; }
  .arch-row { grid-template-columns: 1fr; }
  .code-window pre, .code pre { padding: 15px 16px; }
  .code-window code, .code code { font-size: .78rem; }
  .module-card__head { flex-wrap: wrap; }
  .module-card__foot { flex-wrap: wrap; }
  .dl-grid { grid-template-columns: 1fr; }
  .dl-card .actions .btn { flex: 1 1 160px; }
  .mod-hero .hero-cta .btn { flex: 1 1 190px; }
  .breadcrumb { flex-wrap: wrap; }
}
@media (max-width: 540px) {
  .container { padding-inline: 16px; }
  .eyebrow {
    max-width: 100%;
    font-size: .66rem;
    letter-spacing: .12em;
    white-space: normal;
  }
  .nav-actions > a.icon-btn { display: none; }
  .hero h1 {
    max-width: 100%;
    font-size: 2.08rem;
    overflow-wrap: break-word;
  }
  .hero .lead, .mod-hero .lead { overflow-wrap: break-word; }
  .section-title { font-size: 1.82rem; }
  .section-sub { font-size: 1rem; }
  .btn {
    min-height: 44px;
    line-height: 1.18;
    text-align: center;
    white-space: normal;
  }
  .btn svg { flex: none; }
  .hero-cta .btn, .mod-hero .hero-cta .btn, .cta-banner .hero-cta .btn, .dl-card .actions .btn {
    width: 100%;
    flex-basis: 100%;
  }
  .mod-hero .hero-cta, .dl-card .actions { flex-direction: column; }
  .hero-visual { margin-top: 4px; }
  .float-card { display: none; }
  .code-window { border-radius: 16px; }
  .code-window__bar { padding: 10px 12px; }
  .code-window__bar span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .stats { gap: 10px; }
  .stat { padding: 17px 10px; }
  .modules-grid, .features { grid-template-columns: 1fr; }
  .module-card, .feature, .dl-card { padding: 20px; border-radius: 16px; }
  .module-card__foot { gap: 10px 16px; }
  .pill-grid, .related-grid, .mod-meta { grid-template-columns: 1fr; }
  .pill-item { padding: 14px 15px; }
  .cta-banner {
    border-radius: 18px;
    padding: 30px 18px;
  }
  .mod-hero h1 {
    max-width: 100%;
    font-size: 2.04rem;
    overflow-wrap: break-word;
  }
  .mod-hero .lead { font-size: 1.02rem; }
  .mod-hero__icon { width: 58px; height: 58px; border-radius: 16px; }
  .mod-hero__icon svg { width: 29px; height: 29px; }
  .code__head { align-items: flex-start; gap: 8px; }
  .copy-btn { flex: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { align-items: flex-start; }
}
@media (max-width: 380px) {
  .nav .container { padding-inline: 10px; gap: 8px; }
  .brand { font-size: .94rem; gap: 7px; }
  .brand .mark { width: 28px; height: 28px; }
  .icon-btn { width: 36px; height: 36px; }
  .hero h1 { font-size: 1.95rem; }
  .hero { padding-top: 32px; }
  .chip { width: 100%; justify-content: center; }
  .stat b { font-size: 1.55rem; }
}
