/* ==========================================================================
   NB - landing page
   The NB app's cockpit identity grown into a webpage: JetBrains Mono
   throughout, a paper/cream default with a dark sibling, a fixed workshop-grid
   surface, and one motif carried everywhere - many quiet lines, one human dot.
   ========================================================================== */

/* ── Self-hosted type (no runtime CDN - the page is fully self-contained) ── */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/JetBrainsMono-400.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/JetBrainsMono-500.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/JetBrainsMono-600.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/JetBrainsMono-700.woff2") format("woff2");
}

/* ── Tokens ──────────────────────────────────────────────────────────────
   Light (paper) is the canonical default. Dark is honored when the OS asks
   for it, and either can be pinned by the theme toggle via [data-theme].     */
:root {
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", "SF Mono",
    Menlo, Consolas, monospace;

  /* Type scale */
  --t-xs: 12px;
  --t-sm: 13.5px;
  --t-base: 15px;
  --t-md: 16.5px;
  --t-lg: 19px;
  --t-xl: 23px;
  --t-2xl: 30px;
  --t-3xl: clamp(30px, 5vw, 46px);
  --t-hero: clamp(32px, 6.2vw, 62px);

  /* Spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  --r-sm: 4px;
  --r: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  --maxw: 1120px;

  /* Paper / light */
  --bg: #f3f0e8;
  --bg-deep: #ebe7dc;
  --surface: #ffffff;
  --surface-2: #fbf9f3;
  --surface-3: #f5f2ea;
  --border: #d8d4c7;
  --border-soft: #e7e3d6;
  --border-strong: #b9b4a3;
  --text: #161617;
  --text-2: #4a4a4d;
  --text-3: #7a7872;
  --text-4: #aeaba0;
  --accent: #2f7a4f;      /* the human dot - where a person still acts */
  --accent-soft: rgba(47, 122, 79, 0.12);
  --grid-line: rgba(0, 0, 0, 0.04);
  --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.02) inset;
  --shadow-2: 0 18px 40px -24px rgba(0, 0, 0, 0.28);
}

/* OS-dark, only while the user has not pinned light via the toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0b0d;
    --bg-deep: #07080a;
    --surface: #111317;
    --surface-2: #161a1f;
    --surface-3: #1d2128;
    --border: #23272f;
    --border-soft: #1a1d23;
    --border-strong: #2f343d;
    --text: #e7e8eb;
    --text-2: #b5b8c0;
    --text-3: #7a7e88;
    --text-4: #4f535c;
    --accent: #6fd49a;
    --accent-soft: rgba(111, 212, 154, 0.14);
    --grid-line: rgba(255, 255, 255, 0.03);
    --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
    --shadow-2: 0 18px 44px -22px rgba(0, 0, 0, 0.7);
  }
}

/* Explicit pin - wins over everything above */
:root[data-theme="dark"] {
  --bg: #0a0b0d;
  --bg-deep: #07080a;
  --surface: #111317;
  --surface-2: #161a1f;
  --surface-3: #1d2128;
  --border: #23272f;
  --border-soft: #1a1d23;
  --border-strong: #2f343d;
  --text: #e7e8eb;
  --text-2: #b5b8c0;
  --text-3: #7a7e88;
  --text-4: #4f535c;
  --accent: #6fd49a;
  --accent-soft: rgba(111, 212, 154, 0.14);
  --grid-line: rgba(255, 255, 255, 0.03);
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
  --shadow-2: 0 18px 44px -22px rgba(0, 0, 0, 0.7);
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--t-base);
  line-height: 1.6;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Fixed workshop grid - two crossed 1px gradients, softened by a radial mask */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 82% 74% at 50% 22%, #000 32%, transparent 100%);
  mask-image: radial-gradient(ellipse 82% 74% at 50% 22%, #000 32%, transparent 100%);
}

a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}
::selection {
  background: var(--text);
  color: var(--bg);
}

/* Keyboard focus - always visible, good contrast in both themes */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Shared structure ─────────────────────────────────────────────────────── */
.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--s-6);
}
.section {
  position: relative;
  z-index: 1;
  padding-block: var(--s-9);
  border-top: 1px solid var(--border-soft);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.section-head {
  max-width: 640px;
  margin-bottom: var(--s-7);
}
.section-title {
  margin-top: var(--s-4);
  font-size: var(--t-3xl);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.section-sub {
  margin-top: var(--s-4);
  color: var(--text-2);
  font-size: var(--t-md);
  max-width: 56ch;
}

/* Small board+dot glyph reused as a structural marker */
.mark {
  flex: none;
  color: var(--text);
}
.mark .m-dot {
  fill: var(--accent);
}

/* ── Top bar ──────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-weight: 600;
}
.brand .wordmark {
  font-size: var(--t-lg);
  letter-spacing: -0.03em;
}
.brand .brand-tag {
  font-size: var(--t-xs);
  color: var(--text-4);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-top: 2px;
}
.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 40px;
  padding-inline: var(--s-4);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: var(--t-sm);
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.btn-primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--text-2);
  border-color: var(--text-2);
}
.btn-lg {
  height: 48px;
  padding-inline: var(--s-5);
  font-size: var(--t-md);
}
.btn .arrow {
  transition: transform 0.18s ease;
}
.btn:hover .arrow {
  transform: translateX(3px);
}

/* Icon-only theme toggle (revealed by JS; hidden for no-JS so no dead control) */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
}
.theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.theme-toggle .i-sun {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .i-sun {
  display: block;
}
:root[data-theme="dark"] .theme-toggle .i-moon {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun {
    display: block;
  }
  :root:not([data-theme="light"]) .theme-toggle .i-moon {
    display: none;
  }
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  z-index: 1;
  padding-block: clamp(48px, 9vw, 104px) var(--s-9);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero-lockup {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}
.hero-lockup .mono-badge {
  font-size: var(--t-2xl);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}
.hero-lockup .lockup-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  border-left: 1px solid var(--border);
  padding-left: var(--s-3);
}
.hero-lockup .lockup-meta b {
  font-weight: 600;
  font-size: var(--t-sm);
}
.hero-lockup .lockup-meta span {
  font-size: var(--t-xs);
  color: var(--text-3);
}
.hero h1 {
  font-size: var(--t-hero);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.hero h1 .accent-word {
  color: var(--accent);
}
.hero-sub {
  margin-top: var(--s-5);
  font-size: var(--t-lg);
  color: var(--text-2);
  max-width: 46ch;
}
.hero-sub strong {
  color: var(--text);
  font-weight: 600;
}
.hero-cta {
  margin-top: var(--s-7);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
}
.hero-note {
  font-size: var(--t-sm);
  color: var(--text-3);
}

/* The signature: a "board" card - many faint change-lines resolving to one
   human dot (the PR that is ready to merge). */
.board-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2), var(--shadow-1);
  padding: var(--s-5);
  overflow: hidden;
}
.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--s-4);
  margin-bottom: var(--s-4);
  border-bottom: 1px dashed var(--border);
}
.board-head .bh-title {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-sm);
  font-weight: 600;
}
.board-head .bh-meta {
  font-size: var(--t-xs);
  color: var(--text-3);
  letter-spacing: 0.06em;
}
.board-rows {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.row .tick {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--border-strong);
  opacity: 0.55;
}
.row .line {
  height: 6px;
  border-radius: 3px;
  background: var(--text-4);
  opacity: 0.5;
}
.row .agent-tag {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--text-4);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* The one line that carries the human dot */
.row-merge {
  margin-top: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
  box-shadow: var(--shadow-1);
  gap: var(--s-3);
}
.row-merge .dot {
  flex: none;
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.row-merge .dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--accent);
}
.row-merge .merge-label {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.row-merge .merge-label b {
  font-size: var(--t-sm);
  font-weight: 600;
}
.row-merge .merge-label span {
  font-size: var(--t-xs);
  color: var(--text-3);
}
.row-merge .merge-cta {
  margin-left: auto;
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ── How it works - a real 3-step sequence, so numbering is earned ────────── */
.pipeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
}
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6) var(--s-5) var(--s-5);
}
.step-n {
  display: block;
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.1em;
}
/* Connector line between steps on desktop, ending in the human dot on step 3 */
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(var(--s-6) + 7px);
  right: calc(-1 * var(--s-5) - 1px);
  width: calc(var(--s-5) + 2px);
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    var(--border-strong) 0 5px,
    transparent 5px 10px
  );
}
.step-title {
  margin-top: var(--s-4);
  font-size: var(--t-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.step-body {
  margin-top: var(--s-3);
  color: var(--text-2);
  font-size: var(--t-base);
}
.step-body .hl {
  color: var(--text);
}
.step.is-out {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--surface);
}
.step.is-out .step-title {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.step.is-out .step-title .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ── Capabilities - 6 quiet cards, each with a lines-and-dot glyph ────────── */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
}
.cap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.cap:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.cap .cap-glyph {
  color: var(--text-3);
  margin-bottom: var(--s-4);
}
.cap .cap-glyph .g-dot {
  fill: var(--accent);
}
.cap h3 {
  font-size: var(--t-md);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.cap p {
  margin-top: var(--s-2);
  color: var(--text-2);
  font-size: var(--t-sm);
  line-height: 1.55;
}

/* ── Deployment model - a spec sheet, engineered look ─────────────────────── */
.deploy {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}
.spec {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.spec-row {
  display: grid;
  grid-template-columns: 172px 1fr;
  gap: var(--s-4);
  padding: var(--s-5);
  border-bottom: 1px solid var(--border-soft);
}
.spec-row:last-child {
  border-bottom: 0;
}
.spec-row dt {
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  padding-top: 2px;
}
.spec-row dd {
  font-size: var(--t-base);
  color: var(--text);
}
.spec-row dd small {
  display: block;
  margin-top: 3px;
  color: var(--text-3);
  font-size: var(--t-sm);
}

/* ── CTA ──────────────────────────────────────────────────────────────────── */
.cta {
  text-align: center;
}
.cta-card {
  max-width: 720px;
  margin-inline: auto;
  padding: clamp(36px, 6vw, 72px) var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 140% at 50% 0%, var(--accent-soft), transparent 55%),
    var(--surface);
  box-shadow: var(--shadow-2);
}
.cta-card .mark {
  margin-inline: auto;
  display: block;
}
.cta-card h2 {
  margin-top: var(--s-5);
  font-size: var(--t-3xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  text-wrap: balance;
}
.cta-card p {
  margin-top: var(--s-4);
  color: var(--text-2);
  font-size: var(--t-md);
  max-width: 48ch;
  margin-inline: auto;
}
.cta-card .hero-cta {
  justify-content: center;
}
.mono-mail {
  font-weight: 600;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-soft);
  padding-block: var(--s-6);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  font-size: var(--t-sm);
  color: var(--text-3);
}
.footer-inner a:hover {
  color: var(--text);
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--text-2);
  font-weight: 600;
}

/* ── Motion - enhancement only; content is fully visible without it ───────── */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .d1 { animation-delay: 0.05s; }
  .d2 { animation-delay: 0.12s; }
  .d3 { animation-delay: 0.19s; }
  .row-merge .dot::after {
    animation: pulse-ring 2.4s ease-out infinite;
  }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse-ring {
  0% { opacity: 0.7; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(2.5); }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--s-7); }
  .board-card { order: 2; }
  .pipeline { grid-template-columns: 1fr; gap: var(--s-4); }
  .step:not(:last-child)::after {
    top: auto;
    right: auto;
    left: calc(var(--s-6));
    bottom: calc(-1 * var(--s-4) - 1px);
    width: 1px;
    height: calc(var(--s-4) + 2px);
    background: repeating-linear-gradient(
      180deg,
      var(--border-strong) 0 5px,
      transparent 5px 10px
    );
  }
  .cap-grid { grid-template-columns: repeat(2, 1fr); }
  .deploy { grid-template-columns: 1fr; gap: var(--s-6); }
}

@media (max-width: 600px) {
  :root {
    --s-9: 64px;
  }
  .wrap { padding-inline: var(--s-5); }
  .section { padding-block: var(--s-8); }
  .cap-grid { grid-template-columns: 1fr; }
  .spec-row { grid-template-columns: 1fr; gap: var(--s-2); padding: var(--s-4); }
  .brand .brand-tag { display: none; }
  .hero-cta { gap: var(--s-3); }
  .btn { width: 100%; justify-content: center; }
  .theme-toggle, .topbar .btn { width: auto; }
  .topbar .btn-primary { display: none; }
}

@media (max-width: 380px) {
  .hero-lockup .lockup-meta { display: none; }
}
