/* ============================================================
   Deneural — v3 design system
   Red · Grey · Black ONLY. No blue.
   ============================================================ */

:root {
  /* Surfaces */
  --bg-0: #f6f5f2;          /* page (warm bone) */
  --bg-1: #ffffff;          /* card */
  --bg-2: #edebe6;          /* dim surface */
  --bg-3: #1a1a1a;          /* dark accent (footers, dark cards) */
  --bg-4: #0a0a0a;          /* full black */

  /* Strokes */
  --border: rgba(20, 18, 18, 0.09);
  --border-md: rgba(20, 18, 18, 0.16);
  --border-strong: rgba(20, 18, 18, 0.26);
  --border-dark: rgba(255, 255, 255, 0.12);   /* on dark surfaces */

  /* Type */
  --fg-0: #0d0d0d;
  --fg-1: #2a2a2a;
  --fg-2: #5e5e5e;
  --fg-3: #8e8e8e;
  --fg-4: #b8b8b8;
  --fg-on-dark: #f2f0ec;

  /* Brand — red (the only chromatic accent) */
  --brand: #d6322a;
  --brand-hi: #e8473e;
  --brand-tint: #fbe7e5;
  --brand-dim: #f0b8b5;
  --brand-glow: rgba(214, 50, 42, 0.28);
  --brand-deep: #9c1f19;

  /* "Accent" — kept for legacy semantics, now mapped to greyscale + brand */
  --accent: #d6322a;
  --accent-hi: #e8473e;
  --accent-tint: #fbe7e5;
  --accent-dim: #f0b8b5;
  --accent-glow: rgba(214, 50, 42, 0.22);

  /* Semantic (kept neutral) */
  --positive: #2c8a55;
  --warning: #b86b1e;

  /* Fonts — distinctive modern pairing (not the default template stack) */
  --font-sans: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-head: "Bricolage Grotesque", "Hanken Grotesk", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --font-display: "Fraunces", "Times New Roman", serif;

  --pad-x: clamp(20px, 4vw, 64px);
  --gutter: 24px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg-0);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { overflow-x: hidden; }

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

::selection { background: var(--brand-tint); color: var(--fg-0); }

body::before {
  content: ""; position: fixed; inset: 0;
  pointer-events: none; z-index: 200;
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================
   Typography
   ============================================================ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--brand);
  border-radius: 50%;
}

.h-display {
  font-size: clamp(48px, 7.2vw, 104px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  font-weight: 500;
  color: var(--fg-0);
  margin: 0;
}
.h-1 {
  font-size: clamp(36px, 4.6vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.028em;
  font-weight: 500;
  color: var(--fg-0);
  margin: 0;
}
.h-2 {
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.022em;
  font-weight: 500;
  color: var(--fg-0);
  margin: 0;
}
.h-3 {
  font-size: clamp(20px, 1.6vw, 24px);
  line-height: 1.25;
  letter-spacing: -0.012em;
  font-weight: 500;
  color: var(--fg-0);
  margin: 0;
}
.lede {
  font-size: clamp(17px, 1.25vw, 19px);
  line-height: 1.55;
  color: var(--fg-2);
  max-width: 62ch;
  margin: 0;
}

.serif-i {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--brand);
}

.mono { font-family: var(--font-mono); }

/* ============================================================
   Layout
   ============================================================ */
.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--pad-x);
  position: relative;
}
section { position: relative; padding: clamp(72px, 9vw, 140px) 0; }

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: 880px;
  margin: 0 0 56px;
}
.hr {
  height: 1px; width: 100%;
  background: linear-gradient(90deg, transparent, var(--border-strong) 20%, var(--border-strong) 80%, transparent);
  border: 0;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.25s var(--ease-out);
  white-space: nowrap;
}
.btn .arrow { width: 14px; height: 14px; transition: transform 0.3s var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

.btn-primary { background: var(--fg-0); color: #fff; }
.btn-primary:hover { background: var(--fg-1); box-shadow: 0 6px 24px -8px rgba(20, 18, 18, 0.25); }

.btn-ghost { background: transparent; color: var(--fg-0); border-color: var(--border-md); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--bg-1); }

.btn-accent {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 24px -8px var(--brand-glow);
}
.btn-accent:hover {
  background: var(--brand-hi);
  box-shadow: 0 12px 32px -8px var(--brand-glow);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-2);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.tag .dot {
  width: 5px; height: 5px;
  background: var(--brand);
  border-radius: 50%;
}

/* Cards */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.card:hover { border-color: var(--border-strong); }

/* Decoration */
.grid-bg {
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(20, 18, 18, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 18, 18, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 75%);
}
.dot-bg {
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(20, 18, 18, 0.08) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 70%);
}
.glow {
  position: absolute; border-radius: 50%;
  filter: blur(80px); pointer-events: none;
  opacity: 0.55;
}

/* Reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   Nav + Mega menu
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 14px 0;
  transition: backdrop-filter 0.3s, background 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(246, 245, 242, 0.86);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 36px;
  padding: 0 var(--pad-x);
  max-width: 1480px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-0);
  flex-shrink: 0;
}
.brand img.wordmark,
.brand svg.wordmark { height: 32px; width: 140px; object-fit: contain; object-position: left center; display: block; }
.footer-brand .brand img.wordmark,
.footer-brand .brand svg.wordmark {
  height: 40px;
  width: 176px;
}

.nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
  justify-content: center;
}
.nav-link {
  position: relative;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--fg-1);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover {
  color: var(--fg-0);
  background: rgba(20, 18, 18, 0.04);
}
.nav-link .chev {
  width: 12px; height: 12px;
  opacity: 0.65;
  transition: transform 0.25s var(--ease-out), opacity 0.2s;
}
.nav-link:hover .chev { opacity: 1; }
.nav-link[aria-expanded="true"] .chev { transform: rotate(180deg); color: var(--brand); opacity: 1; }

.nav-cta { display: flex; align-items: center; gap: 10px; }

/* Mega */
.mega {
  position: fixed;
  top: 62px;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  width: min(1180px, calc(100vw - 48px));
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border-md);
  border-radius: var(--r-lg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 24px 64px -16px rgba(20, 18, 18, 0.16);
  padding: 28px;
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease-out), transform 0.28s var(--ease-out);
}
.mega.open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.mega-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 1.4fr 1.2fr;
  gap: 28px;
}
.mega-col h6 {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-3);
  margin: 0 0 14px;
  font-weight: 500;
}
.mega-list { display: flex; flex-direction: column; gap: 1px; }
.mega-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.2s;
}
.mega-item:hover { background: var(--brand-tint); }
.mega-item .ico {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--brand);
  background: var(--bg-0);
}
.mega-item .ico svg { width: 13px; height: 13px; }
.mega-item .label {
  font-size: 13px;
  color: var(--fg-0);
  font-weight: 500;
  margin-bottom: 1px;
}
.mega-item .desc {
  font-size: 11.5px;
  color: var(--fg-2);
  line-height: 1.35;
}

.mega-feature {
  position: relative;
  border-radius: var(--r-md);
  padding: 18px;
  background:
    radial-gradient(120% 80% at 0% 0%, var(--brand-tint), transparent 60%),
    var(--bg-0);
  border: 1px solid var(--border-md);
  overflow: hidden;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}
.mega-feature .tag { align-self: flex-start; margin-bottom: 12px; background: rgba(255,255,255,0.75); }
.mega-feature h5 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 500;
  color: var(--fg-0);
  letter-spacing: -0.012em;
}
.mega-feature p {
  font-size: 12px;
  color: var(--fg-2);
  margin: 0 0 auto;
  line-height: 1.5;
}
.mega-feature .feat-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}

.nav-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-md);
  width: 38px; height: 38px;
  border-radius: 8px;
  color: var(--fg-0);
  align-items: center;
  justify-content: center;
}

@media (max-width: 1100px) {
  .nav-links { display: none; }
  .nav-cta .btn-ghost { display: none; }
  .nav-menu-btn { display: inline-flex; }
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  position: relative;
  padding: 96px 0 36px;
  border-top: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--fg-on-dark);
}
/* Footer logo: inline SVG — text uses currentColor (light), glyph stays brand red */
.footer .brand { color: var(--fg-on-dark); }
.footer .brand svg.wordmark { display: block; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--border-dark);
}
.footer-brand p {
  color: rgba(242, 240, 236, 0.6);
  font-size: 13.5px;
  max-width: 36ch;
  margin: 18px 0 28px;
}
.footer-col h6 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(242, 240, 236, 0.45);
  margin: 0 0 14px;
  font-weight: 500;
}
.footer-col a {
  display: block;
  font-size: 13px;
  color: rgba(242, 240, 236, 0.78);
  padding: 4px 0;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--brand); }

.footer-bot {
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-bot .meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: rgba(242, 240, 236, 0.5);
  letter-spacing: 0.04em;
}
.footer-bot a { color: rgba(242, 240, 236, 0.78); }
.footer-bot a:hover { color: var(--brand); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(242, 240, 236, 0.78);
  padding: 5px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-dark);
  border-radius: 999px;
}
.status-pill .ping {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  position: relative;
}
.status-pill .ping::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid #4ade80;
  animation: ping 1.8s var(--ease-out) infinite;
}
@keyframes ping {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

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

/* ============================================================
   Floating chat
   ============================================================ */
.chat-dock {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 90;
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 12px;
}
.chat-fab {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1px solid var(--border-md);
  background: var(--bg-1);
  color: var(--fg-0);
  display: grid;
  place-items: center;
  transition: transform 0.25s var(--ease-out), border-color 0.25s, box-shadow 0.25s;
  box-shadow: 0 8px 24px -8px rgba(20, 18, 18, 0.15);
}
.chat-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 32px -8px rgba(20, 18, 18, 0.22); }
.chat-fab.wa { background: #2da94f; border-color: #29984a; color: white; }
.chat-fab.wa:hover { background: #34b656; }
.chat-fab.ai {
  background: var(--bg-3);
  border-color: var(--bg-3);
  color: #fff;
  position: relative;
}
.chat-fab.ai::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 55%, var(--brand), transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 1px;
  animation: spin 6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.chat-panel {
  width: 360px;
  max-width: calc(100vw - 32px);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-md);
  border-radius: 18px;
  box-shadow: 0 24px 64px -16px rgba(20, 18, 18, 0.2);
  overflow: hidden;
  display: none;
  flex-direction: column;
  height: 480px;
}
.chat-panel.open { display: flex; }
.chat-head {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.chat-head .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-3);
  display: grid; place-items: center;
  color: white;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}
.chat-head .title { font-size: 13.5px; color: var(--fg-0); font-weight: 500; }
.chat-head .sub { font-size: 11px; color: var(--fg-2); font-family: var(--font-mono); }
.chat-head .close { margin-left: auto; background: transparent; border: 0; color: var(--fg-2); font-size: 18px; }
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg {
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 12px;
  max-width: 85%;
}
.msg.bot {
  background: var(--bg-2);
  color: var(--fg-1);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg.me {
  background: var(--brand);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px; }
.chat-suggest button {
  font-size: 11.5px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--fg-1);
  padding: 6px 10px;
  border-radius: 999px;
}
.chat-suggest button:hover { background: var(--brand-tint); border-color: var(--brand-dim); }
.chat-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); }
.chat-input input {
  flex: 1;
  background: var(--bg-0);
  border: 1px solid var(--border);
  color: var(--fg-0);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.chat-input input:focus { border-color: var(--brand); }
.chat-input button {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--fg-0);
  color: #fff;
  border: 0;
  display: grid; place-items: center;
}

/* Utility */
.flex { display: flex; } .grid { display: grid; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }
.mb-4 { margin-bottom: 24px; } .mb-6 { margin-bottom: 40px; }
.text-fg2 { color: var(--fg-2); } .text-fg3 { color: var(--fg-3); }
.no-wrap { white-space: nowrap; }
.center { display: grid; place-items: center; }

.num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.06em;
}

.accent-gradient { color: var(--fg-0); }

/* ============================================================
   v4 — modern identity layer (fonts, grain-gradient, motion, lead)
   ============================================================ */

/* Editorial display face on big headings */
.h-display, .h-1, .h-2 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.03em; }
.h-3, h3, h4, h5 { font-family: var(--font-head); }
.serif-i { font-family: var(--font-display); font-optical-sizing: auto; }

/* Grainy gradient surface (grain overlay already on body::before) */
html, body {
  background:
    radial-gradient(1200px 620px at 100% -8%, rgba(214,50,42,0.07), transparent 58%),
    radial-gradient(960px 540px at -12% 8%, rgba(20,18,18,0.05), transparent 55%),
    radial-gradient(700px 700px at 60% 120%, rgba(214,50,42,0.05), transparent 60%),
    var(--bg-0);
  background-attachment: fixed;
}
body::before { opacity: 0.05; }

/* Proximity hover (dock-style: JS sets scale per item) */
[data-prox] > * { transition: transform 0.22s var(--ease-out), border-color 0.22s; will-change: transform; }

/* Reveal stagger helper for GSAP/IO */
.reveal[data-d] { transition-delay: var(--rd, 0s); }

/* ---------- Floating WhatsApp (Assistant removed) ---------- */
.chat-fab.ai, .chat-panel { display: none !important; }
.chat-dock .chat-fab.wa { position: relative; }
.wa-tip {
  position: absolute; right: 68px; top: 50%; transform: translateY(-50%);
  background: var(--bg-3); color: var(--fg-on-dark);
  font-size: 12.5px; white-space: nowrap;
  padding: 8px 13px; border-radius: 999px;
  box-shadow: 0 8px 24px -8px rgba(20,18,18,0.3);
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s;
}
.chat-dock:hover .wa-tip { opacity: 1; transform: translateY(-50%) translateX(0); }

/* ---------- Lead-capture popup ---------- */
.dn-modal {
  position: fixed; inset: 0; z-index: 300;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(13,13,13,0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.35s var(--ease-out);
}
.dn-modal.open { display: flex; opacity: 1; }
.dn-modal-card {
  width: min(440px, 100%);
  background: var(--bg-1);
  border: 1px solid var(--border-md);
  border-radius: var(--r-xl);
  padding: 32px 30px 28px;
  position: relative;
  box-shadow: 0 40px 100px -30px rgba(20,18,18,0.5);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.4s var(--ease-out);
  overflow: hidden;
}
.dn-modal.open .dn-modal-card { transform: none; }
.dn-modal-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--brand-deep), var(--brand-hi), var(--brand-deep));
}
.dn-modal .tag { margin-bottom: 14px; }
.dn-modal h3 { font-size: 23px; margin: 0 0 8px; color: var(--fg-0); letter-spacing: -0.02em; }
.dn-modal p.sub { font-size: 14px; color: var(--fg-2); margin: 0 0 20px; line-height: 1.5; }
.dn-modal .field { margin-bottom: 12px; }
.dn-modal .dn-x {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-0);
  color: var(--fg-2); font-size: 16px; line-height: 1; display: grid; place-items: center;
}
.dn-modal .dn-x:hover { color: var(--brand); border-color: var(--brand-dim); }
.dn-modal .btn-accent { width: 100%; justify-content: center; margin-top: 4px; }
.dn-modal .fineprint { font-size: 11px; color: var(--fg-3); text-align: center; margin: 12px 0 0; }
.dn-trust-row { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--fg-3); text-align: center; }

/* ---------- Detail-page extras (CTA band, prose) ---------- */
.cta-band {
  background: var(--bg-3); color: var(--fg-on-dark);
  border-radius: var(--r-xl); padding: clamp(36px, 5vw, 64px);
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.4fr auto; gap: 28px; align-items: center;
}
.cta-band::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px;
  background: radial-gradient(circle, var(--brand-glow), transparent 70%); pointer-events: none;
}
.cta-band h2 { color: var(--fg-on-dark); font-size: clamp(26px, 3vw, 40px); margin: 0 0 8px; letter-spacing: -0.02em; }
.cta-band p { color: rgba(242,240,236,0.72); font-size: 15px; margin: 0; max-width: 52ch; }
.cta-band .cta-band-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cta-band .btn-ghost { color: var(--fg-on-dark); border-color: var(--border-dark); }
.cta-band .btn-ghost:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.3); }
@media (max-width: 860px){ .cta-band { grid-template-columns: 1fr; } }

.detail-prose { max-width: 64ch; }
.detail-prose p { font-size: 16px; line-height: 1.7; color: var(--fg-1); margin: 0 0 16px; }
.detail-prose p:last-child { margin-bottom: 0; }

.related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.related-card {
  background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 22px; transition: border-color 0.25s, transform 0.25s; display: block;
}
.related-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.related-card .rk { font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-3); letter-spacing: 0.08em; }
.related-card h5 { font-size: 16px; color: var(--fg-0); margin: 8px 0 4px; }
.related-card p { font-size: 13px; color: var(--fg-2); margin: 0; line-height: 1.5; }
@media (max-width: 860px){ .related-grid { grid-template-columns: 1fr; } }

/* Mobile-first refinements */
@media (max-width: 640px) {
  section { padding: 64px 0; }
  .h-display { font-size: clamp(38px, 11vw, 56px); }
  .chat-dock { right: 16px; bottom: 16px; }
  .chat-fab { width: 52px; height: 52px; }
  .footer-grid { gap: 28px; }
}

/* ============================================================
   Mobile nav drawer — MOVED HERE so every page hides it
   (was previously only in home.css → leaked on interior pages)
   ============================================================ */
.mobile-nav {
  position: fixed; inset: 0;
  background: var(--bg-1);
  z-index: 200;
  display: none;
  flex-direction: column;
  padding: 24px var(--pad-x);
  overflow-y: auto;
}
.mobile-nav.open { display: flex; }
.mnav-top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.mnav-close { width: 38px; height: 38px; background: transparent; border: 1px solid var(--border-md); border-radius: 8px; color: var(--fg-0); display: grid; place-items: center; }
.mnav-list { display: flex; flex-direction: column; padding: 20px 0; }
.mnav-list a { font-size: 22px; font-weight: 500; letter-spacing: -0.012em; color: var(--fg-0); padding: 14px 0; border-bottom: 1px solid var(--border); }
.mnav-list .h6-mnav { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); padding: 22px 0 8px; border-bottom: 0; font-weight: 500; }
.mnav-list a.sub { font-size: 15px; font-weight: 400; color: var(--fg-1); padding: 8px 0; border-bottom: 0; }
.mnav-cta { padding-top: 24px; display: flex; gap: 12px; }

/* ============================================================
   Deep detail pages — overview, sticky flow, stack, outcomes, FAQ
   ============================================================ */
.overview-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: start; }
.glance { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 8px 22px; }
.glance .grow { display: grid; grid-template-columns: 88px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.glance .grow:last-child { border-bottom: 0; }
.glance .gk { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand); }
.glance .gv { font-size: 14px; color: var(--fg-1); line-height: 1.5; }
@media (max-width: 900px){ .overview-grid { grid-template-columns: 1fr; gap: 28px; } }

/* Sticky-scroll flow */
.flow { display: grid; grid-template-columns: 320px 1fr; gap: 56px; align-items: start; }
.flow-rail { position: sticky; top: 100px; display: flex; flex-direction: column; }
.flow-rail .rail-item { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid var(--border); opacity: 0.35; transition: opacity 0.3s var(--ease-out); cursor: pointer; align-items: start; }
.flow-rail .rail-item.active { opacity: 1; }
.flow-rail .rail-item .rn { font-family: var(--font-mono); font-size: 12px; color: var(--brand); padding-top: 3px; }
.flow-rail .rail-item h4 { font-size: 17px; font-weight: 500; color: var(--fg-0); margin: 0; letter-spacing: -0.012em; }
.flow-rail .rail-item .rprog { grid-column: 1 / -1; height: 2px; background: var(--border); margin-top: 14px; border-radius: 2px; overflow: hidden; display: none; }
.flow-steps { display: flex; flex-direction: column; gap: 20px; }
.flow-step { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 36px; scroll-margin-top: 100px; }
.flow-step .fsn { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); letter-spacing: 0.1em; }
.flow-step h3 { font-size: 24px; font-weight: 500; color: var(--fg-0); margin: 12px 0 12px; letter-spacing: -0.016em; }
.flow-step p { font-size: 15px; color: var(--fg-2); line-height: 1.65; margin: 0 0 14px; }
.flow-step .fs-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
@media (max-width: 900px){ .flow { grid-template-columns: 1fr; gap: 24px; } .flow-rail { display: none; } }

/* Tech stack groups */
.stack-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.stack-col { background: var(--bg-1); padding: 28px 26px; }
.stack-col h5 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); margin: 0 0 16px; font-weight: 500; }
.stack-col .si { font-size: 14px; color: var(--fg-1); padding: 7px 0; border-bottom: 1px solid var(--border); }
.stack-col .si:last-child { border-bottom: 0; }
@media (max-width: 900px){ .stack-grid { grid-template-columns: 1fr; } }

/* Outcomes */
.outcomes { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.outcome { background: var(--bg-1); padding: 30px 28px; }
.outcome .ov { font-size: 30px; font-weight: 600; font-family: var(--font-head); letter-spacing: -0.02em; color: var(--fg-0); line-height: 1; }
.outcome .ok { font-size: 15px; color: var(--fg-0); margin: 12px 0 6px; font-weight: 500; }
.outcome .od { font-size: 13px; color: var(--fg-2); line-height: 1.55; }
@media (max-width: 900px){ .outcomes { grid-template-columns: 1fr; } }

/* Detail FAQ */
.dfaq-list { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.dfaq { border-bottom: 1px solid var(--border); }
.dfaq summary { list-style: none; cursor: pointer; padding: 22px 0; display: flex; align-items: center; gap: 16px; font-size: 17px; color: var(--fg-0); font-weight: 500; letter-spacing: -0.01em; }
.dfaq summary::-webkit-details-marker { display: none; }
.dfaq summary .dfp { margin-left: auto; color: var(--brand); transition: transform 0.25s; flex-shrink: 0; }
.dfaq[open] summary .dfp { transform: rotate(45deg); }
.dfaq .dfa { font-size: 14.5px; color: var(--fg-2); line-height: 1.65; padding: 0 0 22px; max-width: 76ch; }
