/* ============================================================
   Quadbrains — Design System
   Concept: engineering blueprint. Precision paper/ink grounds,
   monospace dimension-label annotations, one copper signal accent.
   Light = drafting paper. Dark = the blueprint itself (ink ground,
   pale linework) — an actual blueprint's colors, not a generic
   "dark mode."
   ============================================================ */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/fraunces-variable.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/plexsans-variable.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plexmono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/plexmono-500.woff2") format("woff2");
}

/* ---------- tokens: dark (default look — the blueprint itself) ---------- */
:root {
  --bg-canvas: #0f1a22;
  --bg-surface: #15222b;
  --bg-surface-raised: #1a2932;
  --ink: #e9eef0;
  --ink-muted: #9cabb2;
  --ink-faint: #647177;
  --line: #263640;
  --line-strong: #35474f;
  --accent: #e08a4f;
  --accent-ink: #17222a;
  --accent-soft: #2c2119;
  --good: #7fb894;

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --content-max: 74rem;
  --measure: 40rem;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px -12px rgba(0, 0, 0, 0.55);
}

/* Deliberately single-theme: the dark blueprint ground IS the brand, not a
   "dark mode" of some other default. No prefers-color-scheme auto-switch —
   most browsers resolve that media query to a real value (often light)
   rather than leaving it unset, which would quietly undo the point of this
   design for a large share of visitors. The token block below is kept as a
   dormant manual override (data-theme="light") in case a toggle is added
   later, but nothing switches to it automatically. */
:root[data-theme="light"] {
  --bg-canvas: #eaeeec;
  --bg-surface: #ffffff;
  --bg-surface-raised: #ffffff;
  --ink: #16232c;
  --ink-muted: #566169;
  --ink-faint: #838d92;
  --line: #d3dad7;
  --line-strong: #b7c1bd;
  --accent: #b85a28;
  --accent-ink: #fdf7f2;
  --accent-soft: #f3e2d4;
  --good: #3f6b4f;
  --shadow-card: 0 1px 2px rgba(22, 35, 44, 0.06), 0 8px 24px -12px rgba(22, 35, 44, 0.12);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

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

.visually-hidden {
  position: absolute;
  left: -9999px;
  top: auto;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.75rem 1.25rem;
  z-index: 100;
  border-radius: 0 0 4px 0;
  text-decoration: none;
  font-size: 0.9rem;
}
.visually-hidden:focus {
  left: 0;
  top: 0;
}

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; text-wrap: balance; color: var(--ink); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 0.85em;
  height: 1px;
  background: currentColor;
}

.h1 { font-size: clamp(2.5rem, 1.85rem + 2.9vw, 4.15rem); line-height: 1.04; letter-spacing: -0.01em; }
.h2 { font-size: clamp(1.75rem, 1.45rem + 1.35vw, 2.6rem); line-height: 1.1; letter-spacing: -0.005em; }
.h3 { font-size: 1.3rem; line-height: 1.25; }

.lede {
  font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: var(--measure);
}
.prose { max-width: var(--measure); color: var(--ink-muted); }
.prose strong { color: var(--ink); font-weight: 600; }

.mono { font-family: var(--font-mono); }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.wrap {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 1rem + 2vw, 3rem);
}
.section { padding-block: clamp(3.5rem, 3rem + 2vw, 6rem); }
.section-tight { padding-block: clamp(2.5rem, 2.2rem + 1.5vw, 4rem); }
.stack { display: flex; flex-direction: column; }
.rule { border: none; border-top: 1px solid var(--line); margin: 0; }

/* corner ticks — used sparingly, on the hero + spec boxes only */
.ticked {
  position: relative;
}
.ticked::before, .ticked::after {
  content: "";
  position: absolute;
  width: 0.65rem;
  height: 0.65rem;
  pointer-events: none;
}
.ticked::before {
  top: -1px; left: -1px;
  border-top: 1.5px solid var(--accent);
  border-left: 1.5px solid var(--accent);
}
.ticked::after {
  bottom: -1px; right: -1px;
  border-bottom: 1.5px solid var(--accent);
  border-right: 1.5px solid var(--accent);
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg-canvas) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.05rem;
}
.wordmark {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
}
.wordmark__icon {
  height: 26px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.site-header .wordmark {
  align-items: center;
}
.site-header .wordmark__icon {
  height: 50px;
}
.wordmark__text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.28rem;
  letter-spacing: -0.01em;
}
.wordmark__tag {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
  text-transform: uppercase;
  display: none;
}
@media (min-width: 40em) { .wordmark__tag { display: inline; } }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 1rem + 1vw, 2.25rem);
}
.nav__links {
  display: none;
  gap: clamp(1.25rem, 1rem + 1vw, 2.25rem);
  align-items: center;
}
@media (min-width: 52em) { .nav__links { display: flex; } }
.nav__links a {
  text-decoration: none;
  font-size: 0.94rem;
  color: var(--ink-muted);
  transition: color 0.15s ease;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a[aria-current="page"] { color: var(--ink); }

/* the header's inline primary CTA only fits once there's room to spare —
   below that it lives inside the mobile menu instead */
.nav > .btn--primary { display: none; }
@media (min-width: 52em) { .nav > .btn--primary { display: inline-flex; } }

.nav-toggle {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  border-radius: 4px;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
}
@media (min-width: 52em) { .nav-toggle { display: none; } }

.mobile-menu {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--line);
  padding: 1rem 0 1.4rem;
}
.mobile-menu.is-open { display: flex; }
.mobile-menu a:not(.btn) {
  text-decoration: none;
  color: var(--ink-muted);
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.02rem;
}
.mobile-menu a:not(.btn):last-of-type { border-bottom: none; }
.mobile-menu .btn { margin-top: 1rem; align-self: flex-start; }
@media (min-width: 52em) { .mobile-menu { display: none !important; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 3px;
  padding: 0.8rem 1.35rem;
  font-size: 0.96rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--sm { padding: 0.6rem 1rem; font-size: 0.86rem; }
.btn__arrow { font-family: var(--font-mono); }

/* ---------- hero ---------- */
.hero {
  padding-block: clamp(3.25rem, 2.6rem + 2.6vw, 5.5rem) clamp(2.5rem, 2rem + 2vw, 4rem);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  align-items: start;
}
@media (min-width: 60em) {
  .hero__grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
}
/* grid tracks sized with minmax(0, …) still won't stop an item's own
   content-based automatic minimum size from inflating them — that needs
   min-width: 0 on the item itself too. */
.hero__grid > * { min-width: 0; }
.hero__copy { display: flex; flex-direction: column; gap: 1.4rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 0.4rem; }

.specsheet {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow-card);
  padding: clamp(1.25rem, 1.1rem + 0.6vw, 1.75rem);
}
.specsheet__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 0.9rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px dashed var(--line-strong);
}
.specsheet__title { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.specsheet__id { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint); }
.specsheet__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.35rem 1rem;
  padding-block: 0.65rem;
  border-bottom: 1px solid var(--line);
}
.specsheet__row:last-of-type { border-bottom: none; }
.specsheet__row dt { color: var(--ink-muted); font-size: 0.88rem; min-width: 0; }
.specsheet__row dd { margin: 0; font-family: var(--font-mono); font-weight: 500; color: var(--ink); text-align: right; min-width: 0; overflow-wrap: break-word; }
.specsheet__foot {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--line-strong);
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* ---------- sections generic ---------- */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: clamp(2rem, 1.7rem + 1vw, 2.75rem);
  max-width: 42rem;
}

.grid-3 { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 46em) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-2 { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 46em) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
.grid-3 > *, .grid-2 > * { min-width: 0; }

.card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: clamp(1.4rem, 1.25rem + 0.6vw, 1.85rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* ---------- band (alt background section) ---------- */
.band {
  background: var(--bg-surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* ---------- phase list (sprint) ---------- */
.phase {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.1rem;
  padding-block: 2rem;
  border-bottom: 1px solid var(--line);
}
.phase:first-of-type { padding-top: 0; }
.phase:last-of-type { border-bottom: none; }
.phase > * { min-width: 0; }
.phase__num {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  width: 2.1rem;
  height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.phase__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-muted);
}
.phase__meta b { color: var(--ink); font-weight: 500; }

.todo-block {
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-faint);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

/* ---------- proof placeholder ---------- */
.proof-notice {
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  padding: clamp(1.5rem, 1.3rem + 0.8vw, 2.25rem);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 2rem + 1.5vw, 3.5rem);
}
.site-footer__grid {
  display: grid;
  gap: 2.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 46em) { .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer__grid > * { min-width: 0; }
.site-footer__links { display: flex; flex-direction: column; gap: 0.6rem; }
.site-footer__links a { text-decoration: none; color: var(--ink-muted); font-size: 0.92rem; }
.site-footer__links a:hover { color: var(--ink); }
.site-footer__bottom {
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-faint);
}

/* ---------- contact form ---------- */
.form-field { display: flex; flex-direction: column; gap: 0.45rem; }
.form-field label { font-size: 0.86rem; color: var(--ink-muted); }
.form-field input, .form-field textarea, .form-field select {
  font: inherit;
  font-size: 0.98rem;
  background: var(--bg-surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0.75rem 0.85rem;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.form-grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
.form-grid > * { min-width: 0; }
@media (min-width: 40em) { .form-grid--split { grid-template-columns: 1fr 1fr; } }

.contact-strip {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.contact-strip__item { display: flex; flex-direction: column; gap: 0.25rem; }
.contact-strip__label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.contact-strip__value { font-size: 1.05rem; }
.contact-strip__value a { text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line-strong); }
.contact-strip__value a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- utility ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
}
.gap-sm { gap: 0.6rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.75rem; }
.center-copy { max-width: 42rem; margin-inline: auto; text-align: center; }

/* ---------- motion: restrained scroll reveal + live cursor ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

.live-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--accent);
  margin-left: 0.15em;
  vertical-align: -0.15em;
  animation: cursor-blink 1.1s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce) { .live-cursor { animation: none; opacity: 1; } }
@keyframes cursor-blink { 0%, 45% { opacity: 1; } 46%, 100% { opacity: 0; } }

.card, .btn {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
}

/* subtle drifting blueprint grid in the hero backdrop */
.grid-drift {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.grid-drift::before {
  content: "";
  position: absolute;
  inset: -20% -10%;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.45;
  mask-image: radial-gradient(ellipse 70% 60% at 65% 20%, black 0%, transparent 72%);
  animation: grid-drift 40s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .grid-drift::before { animation: none; } }
@keyframes grid-drift {
  from { transform: translate(0, 0); }
  to { transform: translate(-56px, -56px); }
}
