/* Hallmark · genre: modern-minimal · macrostructure: Narrative Workflow · theme: Cobalt (accent re-hued → matrix green, user request) · enrichment: Tier-A terminal card · nav: N13 (⌘K) · footer: Ft1 · tone: technical · anchor hue: 145
 * Hallmark · pre-emit critique: P5 H5 E5 S4 R5 V4
 * F4 knobs: numbering=1.0/2.0, layout=horizontal flow (2×2), connector=none · F3 knobs: columns=3, rules=every row, numbers=tabular · N13 knobs: pill=right-of-brand, groups=grouped, hints=shown
 * Hallmark · contrast: pass (40–41) · slop: pass (42–45) · honest: pass (46) · chrome: pass (47) · tokens: pass (48) · responsive: pass (49) · icons: pass (30) · mobile: pass (34, 49, 50–57)
 */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}
body {
  overflow-x: clip;
  background: var(--color-paper);
  color: var(--color-ink-2);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 600;
  color: var(--color-ink);
  letter-spacing: -0.02em;
  line-height: 1.08;
  overflow-wrap: anywhere;
  min-width: 0;
  margin: 0;
}
p { margin: 0; }
a { color: inherit; }
::selection { background: color-mix(in oklch, var(--color-accent) 22%, var(--color-paper)); }

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

.skip {
  position: absolute;
  left: var(--space-md);
  top: -100%;
  z-index: var(--z-toast);
  padding: var(--space-xs) var(--space-md);
  background: var(--color-ink);
  color: var(--color-paper);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}
.skip:focus-visible { top: var(--space-md); }

/* ---------- Reveal — the whole scroll-motion engine (one-shot) ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 600ms var(--ease-out),
    transform 600ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 60ms);
}
html.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Type helpers ---------- */
.meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.meta::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  flex: none;
}
.kbd {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: var(--space-3xs) var(--space-2xs);
  border: 1px solid var(--color-rule-2);
  border-radius: var(--radius-xs);
  color: var(--color-muted);
}

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 44px;
  padding: var(--space-xs) var(--space-lg);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--dur-short) var(--ease-out),
    transform 100ms var(--ease-out);
}
.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); }
.btn--primary:hover { background: var(--color-accent-hover); transform: translateY(-1.5px); }
.btn--primary:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-rule-2);
  padding-bottom: var(--space-3xs);
  transition:
    color var(--dur-short) var(--ease-out),
    border-color var(--dur-short) var(--ease-out);
}
.link-arrow::after { content: "→"; transition: transform var(--dur-short) var(--ease-out); }
.link-arrow:hover { color: var(--color-accent-deep); border-bottom-color: var(--color-accent); }
.link-arrow:hover::after { transform: translateX(3px); }
.link-arrow--light { color: var(--color-graphite-ink); border-bottom-color: var(--color-graphite-rule); }
.link-arrow--light:hover { color: var(--color-accent-lite); border-bottom-color: var(--color-accent-lite); }

/* ---------- Nav — N13: flush bordered bar + working ⌘K ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: var(--z-sticky);
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-rule);
  transition: box-shadow var(--dur-short) var(--ease-out);
}
.nav.is-scrolled { box-shadow: var(--shadow-whisper); }
.nav__inner {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}
.nav__left { display: flex; align-items: baseline; gap: var(--space-xl); min-width: 0; }
.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-md);
  letter-spacing: -0.02em;
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark__tld { color: var(--color-accent); }
.nav__links { display: flex; gap: var(--space-lg); }
.nav__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-ink-2);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition:
    color var(--dur-short) var(--ease-out),
    border-color var(--dur-short) var(--ease-out);
}
.nav__link:hover { color: var(--color-accent-deep); border-bottom-color: var(--color-accent); }
.nav__right { display: flex; align-items: center; gap: var(--space-md); }
.nav__cmdk {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 36px;
  padding: var(--space-2xs) var(--space-sm);
  background: var(--color-paper);
  border: 1px solid var(--color-rule-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--dur-short) var(--ease-out);
}
.nav__cmdk:hover { border-color: var(--color-accent); }
.nav__menu {
  display: none;
  min-height: 44px;
  padding: var(--space-2xs) var(--space-sm);
  background: none;
  border: 1px solid var(--color-rule-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-ink);
  cursor: pointer;
}

/* Mobile sheet */
.sheet {
  position: fixed;
  inset: 60px 0 auto;
  z-index: var(--z-dropdown);
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-rule);
  display: flex;
  flex-direction: column;
  padding: var(--space-sm) var(--page-gutter) var(--space-md);
}
.sheet[hidden] { display: none; }
.sheet__link {
  display: flex;
  align-items: center;
  min-height: 48px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-md);
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-rule);
}
.sheet__link:last-child { border-bottom: 0; }
.sheet__link--cta { color: var(--color-accent-deep); }

/* ---------- ⌘K palette ---------- */
.cmdk { position: fixed; inset: 0; z-index: var(--z-modal); }
.cmdk__backdrop {
  position: absolute;
  inset: 0;
  background: var(--color-scrim);
}
.cmdk__panel {
  position: relative;
  margin: 18vh auto 0;
  width: min(34rem, calc(100% - 2 * var(--page-gutter)));
  background: var(--color-paper);
  border: 1px solid var(--color-rule-2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.cmdk__input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border: 0;
  border-bottom: 1px solid var(--color-rule);
  background: transparent;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-ink);
}
.cmdk__input::placeholder { color: var(--color-muted); }
.cmdk__input:focus-visible { outline: none; border-bottom-color: var(--color-accent); }
.cmdk__list {
  list-style: none;
  margin: 0;
  padding: var(--space-xs);
  max-height: 20rem;
  overflow-y: auto;
}
.cmdk__group {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  padding: var(--space-sm) var(--space-sm) var(--space-2xs);
}
.cmdk__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  width: 100%;
  padding: var(--space-sm) var(--space-sm);
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-ink);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.cmdk__item.is-active { background: var(--color-paper-2); }
.cmdk__meta { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-muted); }
.cmdk__empty {
  padding: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--color-muted);
  text-align: center;
}
.cmdk__hints {
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--color-rule);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-muted);
}

/* ---------- Page frame ---------- */
main { display: block; }
.section, .hero, .cta, .foot__inner {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

/* ---------- Hero — title left, terminal right ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.05fr minmax(0, 0.95fr);
  gap: var(--space-2xl);
  align-items: center;
  padding-top: calc(60px + var(--space-2xl));
  padding-bottom: var(--space-3xl);
}
.hero__title {
  font-size: var(--text-display);
  margin-top: var(--space-md);
}
.hero__lede {
  margin-top: var(--space-lg);
  font-size: var(--text-md);
  line-height: 1.55;
  max-width: 34rem;
}
.hero__cta {
  margin-top: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

/* Terminal card — typographic frame (label between hairlines), no fake chrome */
.term { margin: 0; min-width: 0; }
.term__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-muted);
  padding-block: var(--space-xs);
  border-top: var(--rule);
  border-bottom: var(--rule);
  margin-bottom: var(--space-sm);
}
.term__body {
  margin: 0;
  background: var(--color-graphite);
  color: var(--color-graphite-ink);
  border: 1px solid var(--color-graphite-rule);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-whisper);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.75;
  padding: var(--space-lg) var(--space-xl);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  font-variant-numeric: tabular-nums;
}
.tok-prompt { color: var(--color-accent-lite); }
.tok-cmd { color: var(--color-graphite-ink); font-weight: 500; }
.tok-com { color: var(--color-graphite-mut); }
.tok-key { color: var(--color-accent-lite); }
.tok-fn { color: var(--color-graphite-ink); font-weight: 500; }
.tok-ok { color: var(--color-accent-lite); font-weight: 500; }
.term__status { display: block; margin-top: var(--space-sm); }
html.js .term__out, html.js .term__status {
  opacity: 0;
  transition: opacity var(--dur-long) var(--ease-out);
}
html.js .term__out.is-in, html.js .term__status.is-in { opacity: 1; }
.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: var(--space-3xs);
  vertical-align: text-bottom;
  background: var(--color-accent-lite);
  animation: caret-blink 1s steps(2) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

/* ---------- Section heads — S2 hanging, no eyebrows ---------- */
.head-hang { padding-block: var(--space-3xl) var(--space-xl); }
.head-hang h2 { font-size: var(--text-2xl); }
.section__lede {
  margin-top: var(--space-sm);
  font-size: var(--text-md);
  max-width: 38rem;
}
.section__lede--dark { color: var(--color-graphite-mut); }

/* ---------- Services — F3 tabular spec sheet ---------- */
.section { padding-bottom: var(--space-2xl); }
.spec {
  width: 100%;
  border-collapse: collapse;
  border-top: var(--rule);
  font-variant-numeric: tabular-nums;
}
.spec thead th {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  text-align: left;
  padding: var(--space-sm) var(--space-md) var(--space-sm) 0;
  border-bottom: var(--rule);
}
.spec tbody th, .spec tbody td {
  text-align: left;
  vertical-align: top;
  padding: var(--space-lg) var(--space-lg) var(--space-lg) 0;
  border-bottom: var(--rule);
}
.spec tbody th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-md);
  color: var(--color-ink);
  letter-spacing: -0.01em;
  width: 30%;
}
.spec__sub {
  display: block;
  margin-top: var(--space-2xs);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-sm);
  color: var(--color-muted);
  letter-spacing: 0;
}
.spec tbody td { font-size: var(--text-sm); line-height: 1.7; width: 52%; }
.spec__model {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-muted);
  white-space: nowrap;
}
.spec tr { transition: background-color var(--dur-short) var(--ease-out); }
.spec tbody tr:hover { background: var(--color-paper-2); }

/* ---------- Process — Narrative Workflow on the one dark graphite band ---------- */
.band {
  background: var(--color-graphite);
  color: var(--color-graphite-ink);
  border-block: 1px solid var(--color-graphite-rule);
}
.band__inner {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
  padding-bottom: var(--space-3xl);
}
.band .head-hang h2 { color: var(--color-graphite-ink); }
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-2xl);
}
.step {
  border-top: 1px solid var(--color-graphite-rule);
  padding-block: var(--space-xl);
}
.step__num {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--color-accent-lite);
  font-variant-numeric: tabular-nums;
}
.step__title {
  color: var(--color-graphite-ink);
  font-size: var(--text-lg);
  margin-top: var(--space-sm);
}
.step__body {
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-graphite-mut);
  max-width: 30rem;
}
.step__artifact {
  margin-top: var(--space-md);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-graphite-mut);
}
.band__foot { padding-top: var(--space-xl); border-top: 1px solid var(--color-graphite-rule); }

/* ---------- About ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 1.1fr minmax(0, 0.9fr);
  gap: var(--space-2xl);
  align-items: start;
}
.about__body {
  font-size: var(--text-md);
  line-height: 1.6;
  max-width: 34rem;
}
.facts { margin: 0; }
.facts__row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-lg);
  padding-block: var(--space-sm);
  border-top: var(--rule);
}
.facts__row dt {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  padding-top: var(--space-3xs);
}
.facts__row dd { margin: 0; font-size: var(--text-sm); color: var(--color-ink); text-align: right; }
.facts__mail { color: var(--color-accent-deep); text-decoration: none; border-bottom: 1px solid var(--color-rule-2); }
.facts__mail:hover { border-bottom-color: var(--color-accent); }

/* ---------- CTA strip — one sentence, one button ---------- */
.cta { padding-block: var(--space-4xl) var(--space-3xl); }
.cta__line {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--color-ink);
  max-width: 26ch;
}
.cta .btn { margin-top: var(--space-xl); }

/* ---------- Footer — Ft1 mast-headed ---------- */
.foot { border-top: var(--rule); }
.foot__inner { padding-block: var(--space-2xl); }
.wordmark--foot { font-size: var(--text-lg); }
.foot__tag { margin-top: var(--space-xs); font-size: var(--text-sm); color: var(--color-muted); }
.foot__links { margin-top: var(--space-lg); font-size: var(--text-sm); }
.foot__links a {
  color: var(--color-ink-2);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}
.foot__links a:hover { color: var(--color-accent-deep); border-bottom-color: var(--color-accent); }
.foot__meta { margin-top: var(--space-sm); font-size: var(--text-xs); color: var(--color-muted); }

/* ---------- Breakpoint: ~960px layout collapse ---------- */
@media (max-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); padding-top: calc(60px + var(--space-3xl)); }
  .about__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .nav__links, .nav__cmdk { display: none; }
  .nav__menu { display: inline-flex; align-items: center; }
  /* Spec sheet: rows become stacked blocks */
  .spec thead { display: none; }
  .spec, .spec tbody, .spec tr, .spec th, .spec td { display: block; width: 100%; }
  .spec tbody th { padding-bottom: var(--space-xs); }
  .spec tbody td { padding-top: 0; padding-bottom: var(--space-xs); }
  .spec tbody .spec__model { padding-bottom: var(--space-lg); }
  .cmdk__meta { display: none; }
}

/* Bar items: explicit line-height keeps rows on one baseline (gate 36) */
.btn, .nav__link, .nav__cmdk, .cmdk__item, .sheet__link { line-height: 1; }
.cmdk__item:hover { background: var(--color-paper-2); }

/* ---------- Breakpoint: ~640px typography step-down ---------- */
@media (max-width: 40rem) {
  .hero__title { font-size: var(--text-display-s); }
  .term__body { font-size: var(--text-xs); padding: var(--space-md) var(--space-lg); }
  .cta__line { font-size: var(--text-lg); }
  .btn { padding-inline: var(--space-md); }
}

/* ---------- Reduced motion — everything settles instantly ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 150ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 150ms !important;
  }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  html.js .term__out, html.js .term__status { opacity: 1; transition: none; }
  .caret { animation: none; }
}
