/* Layout concept: a dark drafting-table grid where a firm's workflow is mapped out,
   with a live 3D network as the engine at the center. One deliberate dark world, matching the brand banner. */
:root {
  color-scheme: dark;
  --bg: #050d22;
  --surface: #0a1838;
  --raised: #10244f;
  --line: rgba(140, 200, 255, 0.14);
  --line-strong: rgba(140, 200, 255, 0.28);
  --text: #e8f1ff;
  --muted: #9fb4d6;
  --accent: #3cc8ff;
  --cta: #22c3ff;
  --cta-ink: #04173d;
  --signal: #ffcf5c;

  --font-display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 1.4rem + 2vw, 2.6rem);
  --step-4: clamp(2.5rem, 1.6rem + 4vw, 4.2rem);

  --radius: 14px;
  --wrap: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 70% 0%, rgba(34, 120, 255, 0.22), transparent 60%),
              radial-gradient(ellipse at 0% 100%, rgba(60, 200, 255, 0.10), transparent 55%),
              linear-gradient(180deg, transparent 0%, var(--bg) 85%);
  z-index: -1;
}

img, canvas, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: var(--step-4); font-weight: 700; }
h2 { font-size: var(--step-3); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 600; }
p { margin: 0; }
.lede { font-size: var(--step-1); color: var(--muted); max-width: 58ch; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.accent { color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: rgba(5, 13, 34, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: radial-gradient(circle at 60% 25%, #3fa3ff, #0c2f8a 70%);
  box-shadow: 0 0 0 1px var(--line-strong), 0 6px 20px rgba(34, 140, 255, 0.35);
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: #fff;
}
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1rem; line-height: 1.15; }
.brand-name small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 0.78rem; color: var(--muted); }
.nav-links { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.97rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a.btn-primary, .nav-links a.btn-primary:hover, .nav-links a.btn-primary[aria-current="page"] { color: #000; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line-strong); color: var(--text);
  border-radius: 10px; padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.98rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary { background: var(--cta); color: #000; box-shadow: 0 8px 28px rgba(34, 195, 255, 0.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(34, 195, 255, 0.5); }
.btn-ghost { color: var(--text); border-color: var(--line-strong); background: rgba(16, 36, 79, 0.4); }
.btn-ghost:hover { border-color: var(--accent); }
.nav .btn { padding: 10px 18px; font-size: 0.92rem; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: 72px 56px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 32px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-visual { position: relative; aspect-ratio: 1 / 1; max-width: 100%; min-width: 0; }
.hero-visual canvas { width: 100% !important; height: 100% !important; display: block; }
.hero-visual .fallback-orb {
  position: absolute; inset: 12%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7fdcff, #1d6dff 45%, #071a4a 75%);
  box-shadow: 0 0 120px rgba(34, 160, 255, 0.45);
}
.hero-visual.webgl-on .fallback-orb { display: none; }
.hero-stage { min-width: 0; }
.hero-frame { position: relative; }
.hero-tags { position: absolute; inset: 0; pointer-events: none; list-style: none; margin: 0; padding: 0; }
.hero-tags li {
  position: absolute; display: grid; gap: 2px; max-width: 46%;
  font-family: var(--font-mono); font-size: 0.72rem; line-height: 1.35; letter-spacing: 0.04em;
  color: var(--text); background: rgba(10, 24, 56, 0.88); border: 1px solid var(--line-strong);
  padding: 7px 11px; border-radius: 10px; transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
}
.hero-tags li b { color: var(--accent); font-weight: 600; }
.hero-tags li.active { border-color: var(--signal); box-shadow: 0 0 24px rgba(255, 207, 92, 0.35); transform: translateY(-3px); }
.hero-tags li.active b { color: var(--signal); }
.hero-tags li:nth-child(1) { top: 0; left: 0; }
.hero-tags li:nth-child(2) { top: 0; right: 0; }
.hero-tags li:nth-child(3) { top: 13%; left: 50%; transform: translateX(-50%); max-width: none; white-space: nowrap; }
.hero-tags li:nth-child(3).active { transform: translateX(-50%) translateY(-3px); }
.hero-tags.hero-more { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.hero-tags.hero-more li, .hero-tags.hero-more li:nth-child(n) { position: static; max-width: none; transform: none; white-space: normal; }
.hero-tags.hero-more li.active { transform: translateY(-3px); }


.proof {
  display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 44px; padding-top: 22px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem;
}
.proof span::before { content: "◆"; color: var(--accent); font-size: 0.6rem; margin-right: 10px; vertical-align: 2px; }

/* ---------- Sections ---------- */
.section { padding-block: 84px; }
.section-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 40px; max-width: 760px; }

.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  position: relative; background: linear-gradient(180deg, rgba(16, 36, 79, 0.85), rgba(10, 24, 56, 0.85));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
  transform-style: preserve-3d; transition: transform 0.25s ease, border-color 0.25s ease;
}
.card:hover { border-color: var(--line-strong); }
.card .icon3d { width: 64px; height: 64px; }
.card p { color: var(--muted); }
.card ul { margin: 4px 0 0; padding-left: 18px; color: var(--text); display: grid; gap: 6px; font-size: 0.97rem; }
.card ul li::marker { color: var(--accent); }

/* Process */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: step; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.step { padding: 28px 24px; background: rgba(10, 24, 56, 0.6); display: flex; flex-direction: column; gap: 10px; min-width: 0; border-right: 1px solid var(--line); }
.step:last-child { border-right: 0; }
.step-num { font-family: var(--font-mono); color: var(--accent); font-size: 0.8rem; letter-spacing: 0.12em; }
.step p { color: var(--muted); font-size: 0.98rem; }

/* Industries */
.industries { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.industry { border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; background: rgba(10, 24, 56, 0.55); display: grid; gap: 12px; min-width: 0; }
.industry h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.industry h3 span { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.1em; font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 0.9rem; padding: 6px 12px; border-radius: 999px; background: rgba(60, 200, 255, 0.08); border: 1px solid rgba(60, 200, 255, 0.25); color: var(--text); }

/* Calculator */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line-strong); border-radius: 18px; overflow: hidden; background: rgba(10, 24, 56, 0.75); }
.calc-inputs { padding: 32px; display: grid; gap: 22px; min-width: 0; }
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; display: flex; justify-content: space-between; gap: 12px; }
.field label output { font-family: var(--font-mono); color: var(--accent); font-variant-numeric: tabular-nums; }
.field input[type="range"] { width: 100%; accent-color: var(--cta); }
.field small { color: var(--muted); font-size: 0.85rem; }
.calc-result {
  padding: 32px; display: flex; flex-direction: column; justify-content: center; gap: 18px; min-width: 0;
  background: radial-gradient(circle at 80% 20%, rgba(34, 160, 255, 0.28), transparent 60%), var(--raised);
  border-left: 1px solid var(--line);
}
.big-num { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.4rem, 1.8rem + 3vw, 3.6rem); line-height: 1; font-variant-numeric: tabular-nums; }
.big-num.money { color: var(--signal); }
.calc-result .label { color: var(--muted); font-size: 0.95rem; }
.calc-note { color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--line); padding-top: 14px; }

/* FAQ */
.faq { display: grid; gap: 12px; max-width: 860px; }
.faq details { border: 1px solid var(--line); border-radius: 12px; background: rgba(10, 24, 56, 0.6); padding: 4px 22px; }
.faq summary { cursor: pointer; list-style: none; padding-block: 16px; font-family: var(--font-display); font-weight: 600; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); padding-bottom: 18px; max-width: 68ch; }

/* Newsletter teaser + CTA band */
.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.issue {
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 26px; background: #f3f1ea; color: #111;
  font-family: Georgia, "Times New Roman", serif; transform: rotate(-1.2deg); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}
.issue .masthead { font-family: "Old English Text MT", Georgia, serif; font-size: 1.9rem; text-align: center; border-bottom: 3px double #111; padding-bottom: 8px; }
.issue .dateline { display: flex; justify-content: space-between; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid #111; padding-block: 6px; margin-bottom: 12px; }
.issue h4 { margin: 0 0 6px; font-size: 1.15rem; }
.issue p { font-size: 0.92rem; color: #333; }

.cta-band {
  border: 1px solid var(--line-strong); border-radius: 22px; padding: 48px;
  background: radial-gradient(circle at 15% 20%, rgba(60, 200, 255, 0.25), transparent 55%), linear-gradient(120deg, #0b2a6b, #0a1838 60%);
  display: grid; grid-template-columns: 1.4fr auto; gap: 28px; align-items: center;
}
.cta-band p { color: var(--muted); margin-top: 10px; }

/* Insights page */
.articles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.article { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(10, 24, 56, 0.7); padding: 26px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.article .meta { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.article p, .article li { color: var(--muted); }
.article ul, .article ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.prompt {
  font-family: var(--font-mono); font-size: 0.86rem; color: var(--text); background: rgba(5, 13, 34, 0.8);
  border: 1px dashed var(--line-strong); border-radius: 10px; padding: 14px; white-space: pre-wrap; overflow-wrap: anywhere;
}
.copy-btn { justify-self: start; background: none; border: 1px solid var(--line-strong); color: var(--text); border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 0.85rem; cursor: pointer; }
.copy-btn:hover { border-color: var(--accent); }

/* Book page */
.book-grid { display: grid; grid-template-columns: 0.9fr 1.3fr; gap: 28px; align-items: start; }
.expect { display: grid; gap: 16px; }
.expect li { color: var(--muted); }
.expect ol { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.calendly-shell { border: 1px solid var(--line-strong); border-radius: 18px; background: #fff; overflow: hidden; min-height: 700px; position: relative; }
.calendly-inline-widget { min-width: 280px; height: 720px; }
.calendly-fallback { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 32px; background: var(--surface); color: var(--text); gap: 14px; align-content: center; }
.calendly-shell.loaded .calendly-fallback { display: none; }
.contact-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); }
.contact-line code { font-family: var(--font-mono); color: var(--text); background: rgba(16, 36, 79, 0.7); padding: 4px 8px; border-radius: 6px; user-select: all; }

/* Page hero (sub pages) */
.page-hero { padding-block: 64px 24px; display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 24px; align-items: center; }
.page-hero .hero-visual { max-width: 320px; justify-self: end; width: 100%; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 40px; margin-top: 40px; color: var(--muted); font-size: 0.93rem; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer-grid nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-grid a { color: var(--muted); text-decoration: none; }
.footer-grid a:hover { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .split, .book-grid, .page-hero { grid-template-columns: 1fr; }
  .hero-visual { max-width: 460px; margin-inline: auto; width: 100%; }
  .hero-tags { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
  .hero-tags li, .hero-tags li:nth-child(n) { position: static; max-width: none; transform: none; }
  .hero-tags:not(.hero-more) li:nth-child(3) { grid-column: 1 / -1; }
  .hero-tags li.active, .hero-tags li:nth-child(n).active { transform: none; }
  .page-hero .hero-visual { display: none; }
  .services { grid-template-columns: 1fr; }
  .process { grid-template-columns: repeat(2, 1fr); }
  .step:nth-child(2) { border-right: 0; }
  .step:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .calc { grid-template-columns: 1fr; }
  .calc-result { border-left: 0; border-top: 1px solid var(--line); }
  .cta-band { grid-template-columns: 1fr; padding: 32px; }
  .issue { transform: none; }
}
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .nav-links.open { display: flex; }
  .nav-links li a { display: block; padding: 14px 20px; border-top: 1px solid var(--line); }
  .nav-links .btn { margin: 12px 20px 16px; justify-content: center; }
  .industries, .articles, .process { grid-template-columns: 1fr; }
  .step { border-right: 0; border-bottom: 1px solid var(--line); }
  .step:last-child { border-bottom: 0; }
  .section { padding-block: 60px; }
  .hero { padding-block: 40px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .card, .hero-tags li { transition: none; }
}
