/* Self-hosted monospace (no CDN). The hero ASCII canvas renders its glyph grid
   with this face; a guaranteed, locally-available monospace keeps every glyph's
   advance width identical so the canvas's per-cell text placement stays exact.
   font-display: block holds first paint until the face is ready — the boot path
   in scene-ascii.js also gates the first render on document.fonts.ready. */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("fonts/jetbrains-mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url("fonts/jetbrains-mono-700.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --paper: #FFFFFF;
  --paper-2: #E6F6FC;
  --ink: #17171E;
  --ink-60: rgba(23, 23, 30, 0.6);
  --ink-40: rgba(23, 23, 30, 0.4);
  --blue: #EEFBFF;
  --blue-2: #D9F1FA;
  --sky: #2FAFE3;
  --sky-dark: #1B87B5;
  --yellow: #FFD338;
  --line: #17171E;
  --hairline: rgba(23, 23, 30, 0.18);
  --footer-rule: rgba(23, 23, 30, 0.14);
  --shade-1: #FFFFFF;
  --shade-2: #F1FAFD;
  --shade-3: #E6F6FC;
  --shade-hover: #D9F1FA;
  --ground: #E6F6FC;
  --accent-glow: rgba(47, 175, 227, 0.4);
  --accent-glow-strong: rgba(47, 175, 227, 0.55);
  --accent-wash: rgba(47, 175, 227, 0.08);
  --scanline-color: rgba(23, 23, 30, 0.05);
  --hero-veil: linear-gradient(180deg, transparent 62%, rgba(238, 251, 255, 0.42) 88%, rgba(217, 241, 250, 0.85) 100%),
    radial-gradient(58% 70% at 8% 82%, rgba(238, 251, 255, 0.5) 0%, transparent 66%);
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --nav-h: 62px;
  --maxw: 1392px;
  --section-pad: clamp(40px, 6vh, 72px);
  --slant: clamp(56px, 8vw, 120px);
  font-synthesis-weight: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #17171C;
  --paper-2: #232329;
  --ink: #EDEEF0;
  --ink-60: rgba(237, 238, 240, 0.62);
  --ink-40: rgba(237, 238, 240, 0.4);
  --blue: #202028;
  --blue-2: #262630;
  --sky-dark: #6FCFF2;
  --line: #4A4A57;
  --hairline: rgba(237, 238, 240, 0.16);
  --footer-rule: rgba(237, 238, 240, 0.14);
  --shade-1: #17171C;
  --shade-2: #1E1E25;
  --shade-3: #232329;
  --shade-hover: #262630;
  --ground: #232329;
  --accent-glow: rgba(111, 207, 242, 0.32);
  --accent-glow-strong: rgba(111, 207, 242, 0.5);
  --accent-wash: rgba(111, 207, 242, 0.07);
  --scanline-color: rgba(237, 238, 240, 0.045);
  --hero-veil: linear-gradient(180deg, transparent 62%, rgba(32, 32, 40, 0.45) 88%, rgba(38, 38, 48, 0.9) 100%),
    radial-gradient(58% 70% at 8% 82%, rgba(32, 32, 40, 0.5) 0%, transparent 66%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-x: clip;
}

::selection { background: var(--ink); color: var(--paper); }

body::-webkit-scrollbar { width: 10px; }
body::-webkit-scrollbar-track { background: var(--paper-2); }
body::-webkit-scrollbar-thumb { background: var(--line); border: 2px solid var(--paper-2); }

a { color: inherit; }
img, svg { display: block; }
button { font: inherit; cursor: pointer; }

:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

/* ============================================================================
 * Header — sticky blue bar with a hard 2px base line (malwatch nav DNA).
 * -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: var(--blue-2);
  border-bottom: 2px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo { height: 24px; width: auto; }

[data-theme="dark"] .brand-logo { filter: invert(1); }

.site-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-nav > a,
.nav-dropdown-trigger {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: relative;
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.site-nav > a:hover,
.site-nav > a[aria-current="page"],
.nav-dropdown:hover .nav-dropdown-trigger { color: var(--ink); }
.site-nav > a[aria-current="page"] { cursor: default; }

.site-nav > a::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--sky);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.site-nav > a:hover::after,
.site-nav > a[aria-current="page"]::after { transform: scaleX(1); }

.nav-chevron { transition: transform 0.25s var(--ease); }
.nav-dropdown:hover .nav-chevron { transform: rotate(180deg); }

/* Dropdown panel — hover bridge keeps the menu open between trigger and panel. */
.nav-dropdown { position: relative; }
.nav-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 14px;
}
.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  opacity: 0;
  pointer-events: none;
  min-width: 210px;
  padding: 6px;
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  z-index: 40;
}
.nav-dropdown:hover .nav-dropdown-panel,
.nav-dropdown:focus-within .nav-dropdown-panel {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.nav-dropdown-item {
  display: block;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-dropdown-item:hover {
  color: var(--ink);
  background: var(--shade-hover);
}
.nav-dropdown-item--heading {
  font-weight: 600;
  color: var(--ink);
}
.nav-dropdown-item--heading:not(:last-of-type) {
  border-bottom: 2px solid var(--line);
  margin-bottom: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Header chips — the bordered, hard-shadow switch style from the belt HUD. */
.cta-pill,
.theme-toggle {
  border: 2px solid var(--line);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--line);
  color: var(--ink);
  transition: transform 0.14s ease, box-shadow 0.14s ease, color 0.2s ease;
}

.cta-pill:hover,
.theme-toggle:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
.cta-pill:active,
.theme-toggle:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }

.cta-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 8px 14px;
  display: inline-block;
}
.cta-pill:hover { color: var(--ink); }

.theme-toggle {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  color: var(--ink);
}

.theme-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.theme-icon--sun { display: none; }
:root[data-theme="dark"] .theme-icon--sun { display: block; }
:root[data-theme="dark"] .theme-icon--moon { display: none; }

/* ============================================================================
 * Hero — the slanted blue band. The ASCII scene paints the band colour per
 * theme so it seats flush inside; the clip-path cuts the signature slant.
 * -------------------------------------------------------------------------- */
.hero {
  position: relative;
  height: clamp(640px, 78svh, 960px);
  overflow: hidden;
  background: var(--blue);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--slant)), 0 100%);
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  /* Hidden until scene-ascii.js paints its first frame (boot adds .scene--live).
     The opaque canvas is pure black before then; the hero's own background is
     the same colour as the scene background, so nothing shows through. */
  opacity: 0;
}

#scene.scene--live { opacity: 1; }

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: var(--hero-veil);
}

.hero-copy {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 1320px;
  padding: 0 24px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 5.4vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--ink);
}

/* malwatch highlight — sky block with a hard offset shadow, not a gradient. */
.hero-title-em {
  background: var(--sky);
  color: #0D141B;
  padding: 0 0.12em;
  box-shadow: 0.12em 0.12em 0 var(--line);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

/* ============================================================================
 * Buttons — bordered blocks with hard offset shadows (malwatch .btn DNA).
 * -------------------------------------------------------------------------- */
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 2px solid var(--line);
  padding: 13px 24px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 5px 5px 0 var(--line);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.btn-primary { background: var(--yellow); color: #17171E; }
.btn-ghost { background: var(--paper); color: var(--ink); }

.btn-primary:hover,
.btn-ghost:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--line); }
.btn-primary:active,
.btn-ghost:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--line); }

.btn-primary span { transition: transform 0.25s var(--ease); }
.btn-primary:hover span { transform: translateX(4px); }

.btn-primary--lg {
  padding: 21px 40px;
  font-size: 21px;
  box-shadow: 6px 6px 0 var(--line);
}

/* ============================================================================
 * Sections
 * -------------------------------------------------------------------------- */
.section { position: relative; }

.section-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--section-pad) 24px 0;
}
.section-inner.wide { max-width: 1600px; }
.section-inner.center { text-align: center; }
.section-inner.narrow { max-width: 1040px; }
.section--tall .section-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#quote .section-inner { padding-bottom: calc(var(--section-pad) / 2); }

/* Metadata strip — monospace small-caps run that heads each section, led by
   the sky square marker. */
.meta-strip {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-60);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
}
.meta-strip::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--sky);
  flex: none;
}
.meta-sep { color: var(--ink-40); }

/* Vault rule — a hard 2px rule with a centered sky square tick. */
.vault-rule {
  position: relative;
  width: 100%;
  height: 2px;
  background: var(--line);
  max-width: calc(var(--maxw) - 48px);
  margin: 0 auto var(--section-pad);
}
.vault-rule::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: var(--sky);
  box-shadow: 2px 2px 0 var(--line);
}

/* ============================================================================
 * Product grid (§01) — malwatch intro + the sentinel's stage
 * -------------------------------------------------------------------------- */
.product-grid {
  display: grid;
  grid-template-columns: 1.38fr 1fr;
  gap: clamp(40px, 6vw, 64px);
  align-items: center;
}
.product-copy { display: flex; flex-direction: column; align-items: flex-start; align-self: stretch; justify-content: center; }
.product-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 3vw, 48px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: var(--ink);
  margin-bottom: 28px;
}
.product-body {
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.6;
  color: var(--ink-60);
  max-width: 820px;
  margin-bottom: 44px;
  text-wrap: pretty;
}

/* Product art — the site's watchtower illustration. Transparent PNG that
   reads on both themes; height-capped so the portrait aspect never blows
   out the grid. The stage shrink-wraps the img so the wizard overlay SVG
   (same 650x769 aspect) maps 1:1 onto the castle at any size. */
.product-art-stage {
  position: relative;
  justify-self: center;
}
.product-art {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: clamp(540px, 78vh, 840px);
}
.wizard-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}
.wizard-overlay .wiz-gem { fill: var(--sky-dark); }
.wizard-overlay .wiz-glow,
.wizard-overlay .wiz-flash { fill: var(--accent-glow-strong); }
.wizard-overlay.wiz-summit .wiz-glow { animation: wiz-glint 2.8s ease-in-out infinite; }
@keyframes wiz-glint {
  0%, 100% { opacity: 0.14; }
  50% { opacity: 0.5; }
}
/* The tower rises into the hero's slant wedge: no top pad on this section,
   and a negative margin nudges the tip toward the slanted edge. Restored to
   normal rhythm when the grid stacks on narrow screens. */
#malwatch .section-inner { padding-top: 0; max-width: 1320px; }
#malwatch .product-art-stage { margin-top: calc(var(--section-pad) * -1); }
/* The castle's base rests directly on the shelf's top border. */
#features .section-inner { padding-top: 0; max-width: 1320px; }
@media (max-width: 860px) {
  #malwatch .section-inner { padding-top: var(--section-pad); }
  #malwatch .product-art-stage { margin-top: 0; }
}

/* ============================================================================
 * Feature shelf (§02) — bordered 3-cell table of value props
 * -------------------------------------------------------------------------- */
.section--scanlines::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--scanline-color) 0px,
    var(--scanline-color) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.6;
}
.section--scanlines .section-inner { position: relative; z-index: 1; }

.shelf {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 2px solid var(--ink-40);
  overflow: hidden;
}
.shelf-cell {
  padding: clamp(22px, 2.6vw, 32px);
  border-right: 2px solid var(--hairline);
  background: var(--shade-1);
  transition: background 0.25s var(--ease);
}
.shelf-cell:nth-child(2) { background: var(--shade-2); }
.shelf-cell:nth-child(3) { background: var(--shade-3); }
.shelf-cell:last-child { border-right: none; }
.shelf-cell:hover { background: var(--shade-hover); }
.shelf-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 12px;
}
.shelf-body {
  font-size: clamp(14px, 1.3vw, 16px);
  line-height: 1.65;
  color: var(--ink-60);
}

/* ============================================================================
 * Quote (§03) — bordered quote card + supporting statement
 * -------------------------------------------------------------------------- */
.quote-block {
  border: 2px solid var(--line);
  padding: clamp(28px, 3.5vw, 44px);
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--line);
  max-width: 720px;
  margin: 0 auto 34px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.quote-block:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--line); }
.quote-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 3.8vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
  margin: 0 0 16px;
}
.quote-attr {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-60);
  text-align: right;
  margin: 0;
}
.quote-after {
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.65;
  color: var(--ink-60);
  max-width: 600px;
  margin: 0 auto;
  text-wrap: pretty;
}
.quote-copy {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
}
.section-inner.center .btn-primary { margin: 0 auto; }
.section-inner.center .meta-strip { justify-content: center; }

/* ============================================================================
 * Footer — the slanted blue band, mirrored.
 * -------------------------------------------------------------------------- */
.site-footer {
  background: var(--blue);
  color: var(--ink);
  padding: calc(46px + var(--slant)) 24px 26px;
  clip-path: polygon(0 var(--slant), 100% 0, 100% 100%, 0 100%);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}
/* NEED HELP? column removed — the two nav columns shift right to take its place. */
.footer-nav:first-of-type { grid-column: 3; }
.footer-tagline {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-60);
  max-width: 300px;
}
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-heading {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sky-dark);
  margin: 0 0 4px;
}
.footer-nav a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-60);
  padding: 3px 0;
  border-bottom: 2px solid transparent;
  align-self: flex-start;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.footer-nav a:hover { color: var(--ink); border-bottom-color: var(--sky); }
.status-strip {
  max-width: var(--maxw);
  margin: 34px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--footer-rule);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-40);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.status-strip .meta-sep { color: var(--ink-40); }

/* ============================================================================
 * Responsive
 * -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .product-grid { grid-template-columns: 1fr; gap: 48px; }
  .product-art-stage { order: -1; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-nav:first-of-type { grid-column: auto; }
}

@media (max-width: 720px) {
  .site-nav { display: none; }
  .hero-copy { max-width: 92vw; }
  .shelf { grid-template-columns: 1fr; }
  .shelf-cell { border-right: none; border-bottom: 2px solid var(--hairline); }
  .shelf-cell:last-child { border-bottom: none; }
}

@media (max-width: 480px) {
  .site-header { padding: 0 18px; }
  .cta-pill { padding: 7px 11px; font-size: 9.5px; }
  .theme-toggle { width: 33px; height: 33px; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .section-inner { padding: var(--section-pad) 20px 0; }
  .hero-actions .btn-ghost { display: none; }
  .hero-actions .btn-primary { width: 100%; justify-content: center; }
}
