:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #101216;
  --panel-2: #161a20;
  --text: #f4f7fb;
  --muted: #b7c1cc;
  --faint: #8b97a6;
  --line: #2a303a;
  --blue: #14a1e1;
  --blue-deep: #0c6f9e;
  --ink: #041018;
  --danger: #ffb4a8;
  --ok: #c8f5d4;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --serif: "Syne", "Avenir Next", "Trebuchet MS", sans-serif;
  --sans: "Manrope", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", monospace;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.6;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(20, 161, 225, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 161, 225, 0.05) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 62%);
}
body::after {
  content: "";
  position: fixed;
  right: max(-4vw, -2rem);
  bottom: 4.5rem;
  width: min(70vw, 900px);
  aspect-ratio: 1600 / 313;
  pointer-events: none;
  z-index: 0;
  background: url("/img/logo.png") center / contain no-repeat;
  opacity: 0.12;
}
a { color: var(--blue); }
img { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { overflow-wrap: anywhere; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 50;
  background: var(--blue);
  color: var(--ink);
  padding: 0.5rem 0.75rem;
  text-decoration: none;
}

.wrap {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.92);
  border-bottom: 1px solid #1a1d22;
  backdrop-filter: blur(10px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
}
.brand {
  display: block;
  line-height: 0;
}
.brand img {
  height: 48px;
  width: auto;
  display: block;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.25rem;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--blue);
}

main { position: relative; z-index: 1; padding-bottom: 4rem; }

.kicker {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 0.8rem;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.03em; line-height: 1.02; }
h1 {
  font-size: clamp(2.7rem, 6vw, 5.1rem);
  margin: 0 0 1rem;
  max-width: 14ch;
}
h2 { font-size: clamp(1.8rem, 3vw, 2.7rem); margin: 0 0 0.8rem; }
h3 { font-size: 1.55rem; margin: 0 0 0.45rem; }
.lead {
  font-size: 1.16rem;
  color: var(--muted);
  max-width: 42rem;
  margin: 0 0 1.5rem;
}
.lede-tight { margin-bottom: 0; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.7fr);
  gap: 3rem;
  align-items: end;
  padding: 4.2rem 0 3.2rem;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.button, button.button, .assistant-input button, .assistant-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--blue);
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--blue);
  padding: 0.78rem 1.05rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 0;
}
.button.ghost, button.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.button:hover, button.button:hover { background: #3cb4ea; border-color: #3cb4ea; }
.button.ghost:hover { border-color: var(--blue); color: var(--text); background: transparent; }
.button:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.specimen {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1.25rem 1.3rem 1.35rem;
  box-shadow: var(--shadow);
}
.specimen-id {
  font-family: var(--mono);
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.04em;
  color: var(--blue);
  margin: 0 0 0.7rem;
  line-height: 1;
}
.specimen p:last-child { margin: 0; color: var(--muted); font-size: 0.98rem; }
.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 1rem;
}

.section { padding: 1rem 0 3.2rem; }
.section-head { max-width: 40rem; margin-bottom: 1.6rem; }
.section-head p { color: var(--muted); margin: 0; }

.service-list { list-style: none; margin: 0; padding: 0; }
.service {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.5rem 1.25rem;
  padding: 1.45rem 0;
  border-top: 1px solid var(--line);
}
.service:last-child { border-bottom: 1px solid var(--line); }
.service .idx {
  font-family: var(--mono);
  color: var(--blue);
  padding-top: 0.35rem;
}
.service p { margin: 0 0 0.7rem; color: var(--muted); max-width: 46rem; }
.service a { font-weight: 700; text-underline-offset: 0.18em; }
.service.invert {
  background: var(--blue);
  color: var(--ink);
  padding: 1.45rem 1.25rem;
  border: 0;
  margin-top: 0.4rem;
}
.service.invert .idx, .service.invert a, .service.invert h3 { color: var(--ink); }
.service.invert p { color: #06283a; }
.service.invert a { text-decoration-thickness: 2px; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.steps li {
  border-top: 2px solid var(--blue);
  padding-top: 0.9rem;
  min-width: 0;
}
.steps .num {
  font-family: var(--mono);
  color: var(--blue);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}
.steps h3 { font-size: 1.25rem; margin: 0.35rem 0; }
.steps p { margin: 0; color: var(--muted); font-size: 0.98rem; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 2.5rem;
  align-items: start;
  padding-top: 3rem;
}
.note-list { margin: 0; padding: 0; list-style: none; }
.note-list li {
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.note-list strong { color: var(--text); font-weight: 700; }

.chapter { padding: 2.4rem 0; border-top: 1px solid var(--line); }
.chapter h2 { max-width: 18ch; }
.prose { max-width: 42rem; }
.prose p { color: var(--muted); }
.prose p strong { color: var(--text); }
.check {
  margin: 1.2rem 0 0;
  padding: 1rem 1.1rem;
  background: var(--panel);
  border-left: 3px solid var(--blue);
}
.check h3 { font-family: var(--sans); font-size: 0.95rem; letter-spacing: 0; font-weight: 700; }
.check ul { margin: 0.4rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.pull {
  margin: 1.2rem 0 0;
  padding: 0;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--text);
  max-width: 22ch;
}
.band {
  background: var(--blue);
  color: var(--ink);
  padding: 1.5rem 1.35rem;
  margin-top: 1.2rem;
}
.band p { margin: 0.4rem 0 0; }
.band a { color: var(--ink); font-weight: 800; }

.page-intro { padding: 3rem 0 1rem; }
.page-intro h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); }

.form-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1.2rem 1.2rem 1.3rem;
}
.form-card + .form-card { margin-top: 1rem; }
.stack { display: grid; gap: 0.85rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.95rem; }
.hint { font-weight: 500; color: var(--faint); font-size: 0.85rem; }
input, textarea, select {
  width: 100%;
  background: #000;
  border: 1px solid #343b46;
  padding: 0.7rem 0.75rem;
  border-radius: 0;
}
textarea { min-height: 8rem; resize: vertical; }
.field-error { color: var(--danger); font-size: 0.85rem; font-weight: 600; min-height: 0; }
label.invalid input, label.invalid textarea, label.invalid select { border-color: var(--danger); }
.result {
  margin-top: 1rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  background: #071910;
}
.result.error { background: #1a0d0b; }
.result[hidden] { display: none; }
.result .rid {
  font-family: var(--mono);
  font-size: 2rem;
  color: var(--ok);
  margin: 0.2rem 0;
  line-height: 1.1;
}
.result p { margin: 0.35rem 0 0; color: var(--muted); }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.fine { color: var(--faint); font-size: 0.9rem; margin: 0.8rem 0 0; }

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid #1a1d22;
  padding: 1.6rem 0 6.2rem;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.site-footer a { color: var(--text); text-decoration: none; font-weight: 700; }
.site-footer a:hover { color: var(--blue); }
.site-footer p { margin: 0.3rem 0; max-width: 38rem; }

.assistant { position: relative; z-index: 30; }
.assistant-launch {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 30;
  box-shadow: var(--shadow);
}
.assistant.is-open .assistant-launch { display: none; }
.assistant-panel {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 30;
  width: min(400px, calc(100vw - 1.5rem));
  height: min(640px, calc(100vh - 5.5rem));
  background: #0c0e12;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.assistant-panel[hidden] { display: none; }
.assistant-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--line);
}
.assistant-top strong { display: block; font-family: var(--serif); font-size: 1.15rem; letter-spacing: -0.03em; }
.assistant-top span { color: var(--faint); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }
.assistant-top button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}
.assistant-log {
  flex: 1;
  overflow: auto;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.msg {
  max-width: 92%;
  padding: 0.6rem 0.7rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.bot { background: #1a1f27; }
.msg.user { background: var(--blue); color: var(--ink); margin-left: auto; font-weight: 600; }
.msg .who {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  color: var(--blue);
}
.msg.user .who { color: var(--ink); }
.assistant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.9rem 0.7rem;
}
.assistant-chips button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  font-size: 0.86rem;
}
.assistant-chips button:hover { border-color: var(--blue); }
.assistant-input {
  display: flex;
  gap: 0.45rem;
  padding: 0.75rem 0.9rem 0.9rem;
  border-top: 1px solid var(--line);
}
.assistant-input input {
  flex: 1;
  min-width: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 900px) {
  .hero, .split, .steps { grid-template-columns: 1fr; }
  .steps li { border-top: 0; border-left: 2px solid var(--blue); padding: 0.15rem 0 0.2rem 0.9rem; }
  h1 { max-width: none; }
}
@media (max-width: 640px) {
  .wrap { width: min(var(--max), calc(100% - 1.5rem)); }
  .brand img { height: 36px; }
  .header-inner { padding: 0.7rem 0; }
  .nav { width: 100%; }
  .nav a { padding: 0.35rem 0.45rem; font-size: 0.9rem; }
  .hero { padding-top: 2.2rem; gap: 1.6rem; }
  .pair { grid-template-columns: 1fr; }
  .service { grid-template-columns: 3.2rem minmax(0, 1fr); }
  .assistant-panel {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(78vh, 680px);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .site-footer { padding-bottom: 5.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
