/* Hallmark · genre: modern-minimal · macrostructure: Split Studio · theme: Cobalt · enrichment: code-hero (Tier B) · nav: N1b-bordered · footer: Ft2 */
/* Cobalt signature: cool engineered paper · hairlines · one cobalt signal · code-as-hero · bordered nav + ⌘K · tight radii · mono labels · one dark band */

html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  overflow-x: clip;
  margin: 0;
  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;
}

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

a { color: inherit; }
img { max-width: 100%; }

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

/* mono labels — machine readout */
.eyebrow, .diptych__tag, .proof__label, .stat__label, .arch__meta,
.code-card__bar, .code-card__status, .cmdk__kbd, .flow-node, .mono, .foot-inline__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- nav : N1b bordered */

.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: 0 var(--page-gutter);
  height: 60px;
  background: color-mix(in oklch, var(--color-paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: var(--rule-hair) solid var(--color-rule);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark__logo {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.nav__links {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__links a {
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  color: var(--color-ink-2);
  white-space: nowrap;
  padding: 0.25rem 0.125rem;
  border-bottom: var(--rule-hair) solid transparent;
  transition: color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}
.nav__links a:hover { color: var(--color-ink); border-color: var(--color-accent); }
.nav__links a:focus-visible { outline-offset: 4px; }
.nav__right { margin-left: auto; display: flex; align-items: center; gap: var(--space-md); }

.cmdk {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.625rem;
  background: var(--color-paper-2);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color var(--dur-short) var(--ease-out);
}
.cmdk:hover { border-color: var(--color-rule-2); }
.cmdk__kbd { font-size: 10px; color: var(--color-muted); }

/* ---------------------------------------------------------------- buttons : tight 6px */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.55rem 1.125rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
}
.btn--primary {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border: var(--rule-hair) solid transparent;
}
.btn--primary:hover { background: var(--color-accent-hover); }
.btn--primary:active { transform: translateY(1px); }
.btn--primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--primary[data-state="loading"] { opacity: 0.65; }
.btn--primary[data-state="error"] { background: var(--color-accent-hover); }
.btn--primary[data-state="success"] { background: var(--color-accent); }
.btn--ghost {
  background: transparent;
  color: var(--color-ink);
  border: var(--rule-hair) solid var(--color-rule-2);
}
.btn--ghost:hover { border-color: var(--color-accent); color: var(--color-accent-hover); }
.btn--ghost:active { transform: translateY(1px); }
.btn--ghost:focus-visible { outline-offset: 3px; }
.btn--ghost:disabled { opacity: 0.45; cursor: not-allowed; }

.link-underline {
  color: var(--color-ink);
  text-decoration: none;
  border-bottom: var(--rule-hair) solid var(--color-accent);
  padding-bottom: 0.05em;
  transition: border-color var(--dur-short) var(--ease-out);
}
.link-underline:hover { border-color: var(--color-ink); }

/* ---------------------------------------------------------------- hero : split studio */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--space-3xl);
  align-items: center;
  padding: var(--space-4xl) var(--page-gutter);
  border-bottom: var(--rule-hair) solid var(--color-rule);
}
.eyebrow { margin: 0 0 var(--space-lg); color: var(--color-muted); }
.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-display);
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--color-ink);
  margin: 0 0 var(--space-lg);
  max-width: 14ch;
  overflow-wrap: anywhere;
  min-width: 0;
}
.hero__lede {
  color: var(--color-muted);
  max-width: 52ch;
  margin: 0 0 var(--space-xl);
}
.hero__cta { display: flex; gap: var(--space-md); flex-wrap: wrap; }
.hero__cta .btn { white-space: nowrap; }
.hero__copy > * { opacity: 0; animation: hero-rise var(--dur-slow) var(--ease-out) forwards; }
.hero__copy > :nth-child(1) { animation-delay: 60ms; }
.hero__copy > :nth-child(2) { animation-delay: 140ms; }
.hero__copy > :nth-child(3) { animation-delay: 220ms; }
.hero__copy > :nth-child(4) { animation-delay: 300ms; }
.code-card { opacity: 0; animation: hero-rise var(--dur-slow) var(--ease-out) 120ms forwards; }
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- code card : dark graphite */

.code-card {
  margin: 0;
  background: var(--color-graphite);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px var(--shadow-lift);
  overflow: hidden;
}
.code-card__bar {
  margin: 0;
  padding: var(--space-sm) var(--space-md);
  border-bottom: var(--rule-hair) solid var(--color-rule-2);
  color: var(--color-graphite-mut);
  font-size: 10px;
}
.code-card__body {
  margin: 0;
  padding: var(--space-lg) var(--space-md);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-graphite-ink);
  overflow-x: auto;
  white-space: pre;
}
.code-card__body code { font-family: inherit; }
.code-card__body span { display: block; }
.code-card__body span:not(.caret) { opacity: 0; animation: line-in var(--dur-med) var(--ease-out) forwards; }
.code-card__body span:nth-child(1) { animation-delay: 200ms; }
.code-card__body span:nth-child(2) { animation-delay: 260ms; }
.code-card__body span:nth-child(3) { animation-delay: 320ms; }
.code-card__body span:nth-child(4) { animation-delay: 380ms; }
.code-card__body span:nth-child(5) { animation-delay: 440ms; }
.code-card__body span:nth-child(6) { animation-delay: 500ms; }
.code-card__body span:nth-child(7) { animation-delay: 560ms; }
.code-card__body .caret {
  display: inline-block;
  width: 1ch;
  height: 1.05em;
  margin-left: 0.125rem;
  background: var(--color-accent);
  vertical-align: text-bottom;
  animation: caret-blink 1.1s steps(2) infinite;
  animation-delay: 900ms;
}
@keyframes line-in { to { opacity: 1; } }
@keyframes caret-blink { 50% { opacity: 0; } }
.code-card__status {
  margin: 0;
  padding: var(--space-sm) var(--space-md);
  border-top: var(--rule-hair) solid var(--color-rule-2);
  color: var(--color-accent);
  font-size: 10px;
}

/* ---------------------------------------------------------------- stats */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: var(--space-2xl) var(--page-gutter);
  border-bottom: var(--rule-hair) solid var(--color-rule);
}
.stat { padding: var(--space-md) var(--space-lg); }
.stat:nth-child(2) { border-inline: var(--rule-hair) solid var(--color-rule); }
.stat__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 4vw + 1rem, 4rem);
  line-height: 1;
  color: var(--color-ink);
  margin: 0 0 var(--space-sm);
  font-variant-numeric: tabular-nums;
}
.stat__label { margin: 0; color: var(--color-muted); }

/* ---------------------------------------------------------------- sections */

.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-display-s);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--color-ink);
  margin: 0 0 var(--space-md);
  overflow-wrap: anywhere;
  min-width: 0;
}
.section__lede { color: var(--color-muted); max-width: 58ch; margin: 0; }

/* ---------------------------------------------------------------- features : split diptychs */

.features { padding: var(--space-4xl) var(--page-gutter) var(--space-2xl); }
.features__head { max-width: 720px; margin-bottom: var(--space-3xl); }

.diptych {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-3xl);
  align-items: start;
  padding: var(--space-3xl) 0;
  border-bottom: var(--rule-hair) solid var(--color-rule);
}
.diptych--rev .diptych__text { order: 2; }
.diptych--rev .diptych__proof { order: 1; }

.diptych__tag { margin: 0 0 var(--space-md); color: var(--color-muted); }
.diptych__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.4vw + 0.5rem, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  margin: 0 0 var(--space-md);
  max-width: 22ch;
  overflow-wrap: anywhere;
  min-width: 0;
}
.diptych__body { color: var(--color-ink-2); max-width: 52ch; margin: 0; }

.diptych__proof {
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-md);
  background: var(--color-paper-2);
  padding: var(--space-lg);
}
.proof__label { margin: 0 0 var(--space-md); color: var(--color-muted); font-size: 10px; }
.proof__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: var(--space-sm);
}
.proof__steps li {
  counter-increment: step;
  position: relative;
  padding-left: var(--space-xl);
  font-size: var(--text-sm);
  color: var(--color-ink-2);
}
.proof__steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tracking-micro);
  color: var(--color-accent);
}

/* ---------------------------------------------------------------- workflow : dark band */

.workflow {
  background: var(--color-graphite);
  color: var(--color-graphite-ink);
  padding: var(--space-4xl) var(--page-gutter);
  margin-top: var(--space-2xl);
}
.workflow__head { max-width: 640px; margin-bottom: var(--space-3xl); }
.workflow .eyebrow { color: var(--color-graphite-mut); }
.workflow .section__title--light { color: var(--color-graphite-ink); }
.workflow__lede { color: var(--color-graphite-mut); max-width: 52ch; margin: 0; }

.workflow__flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-md);
  align-items: stretch;
}
.flow-node {
  font-size: 11px;
  color: var(--color-graphite-ink);
  border: var(--rule-hair) solid var(--color-rule-2);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  background: var(--color-graphite-2);
  text-transform: none;
  letter-spacing: 0.01em;
}
.flow-arrow { align-self: center; text-align: center; color: var(--color-accent); font-family: var(--font-mono); font-size: 14px; }

/* ---------------------------------------------------------------- download */

.download { padding: var(--space-4xl) var(--page-gutter) var(--space-2xl); }
.download__head { max-width: 640px; margin-bottom: var(--space-3xl); }

.arch-list {
  list-style: none;
  margin: 0 0 var(--space-xl);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
  max-width: 760px;
}
.arch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-paper-2);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: border-color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out);
}
.arch:hover { border-color: var(--color-accent); background: var(--color-paper); }
.arch:active { transform: translateY(1px); }
.arch__name { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-ink); white-space: nowrap; text-transform: none; letter-spacing: 0.01em; }
.arch__meta { font-size: 10px; color: var(--color-muted); white-space: nowrap; }

.download__pick { color: var(--color-muted); max-width: 60ch; margin: 0 0 var(--space-lg); font-size: var(--text-sm); }
.download__pick .mono { color: var(--color-ink); text-transform: none; letter-spacing: 0.01em; }

.download__foot { display: flex; gap: var(--space-3xl); align-items: start; flex-wrap: wrap; }
.shot {
  margin: 0;
  max-width: 220px;
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.shot img { display: block; width: 100%; height: auto; }
.download__alt { color: var(--color-muted); margin: 0; }

/* ---------------------------------------------------------------- final cta */

.final-cta {
  padding: var(--space-4xl) var(--page-gutter);
  text-align: center;
  border-top: var(--rule-hair) solid var(--color-rule);
}
.final-cta__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-display-s);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--color-ink);
  max-width: 24ch;
  margin: 0 auto var(--space-2xl);
  overflow-wrap: anywhere;
  min-width: 0;
}
.final-cta .btn { white-space: nowrap; }

/* ---------------------------------------------------------------- footer : Ft2 inline */

.foot-inline { padding: var(--space-2xl) var(--page-gutter) var(--space-xl); }
.foot-inline__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
  padding-block-start: var(--space-lg);
  border-top: var(--rule-hair) solid var(--color-rule);
}
.foot-inline__line { color: var(--color-muted); font-size: var(--text-sm); margin: 0; }
.foot-inline__meta { font-size: 10px; color: var(--color-muted); }

/* ---------------------------------------------------------------- command palette */

.palette { position: fixed; inset: 0; z-index: 50; }
.palette[hidden] { display: none; }
.palette__backdrop { position: absolute; inset: 0; background: var(--scrim); }
.palette__panel {
  position: relative;
  margin: 18vh auto 0;
  width: min(560px, calc(100% - var(--page-gutter) * 2));
  background: var(--color-paper);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px -24px var(--shadow-palette);
  overflow: hidden;
}
.palette__input {
  width: 100%;
  box-sizing: border-box;
  padding: var(--space-lg);
  border: none;
  border-bottom: var(--rule-hair) solid var(--color-rule);
  background: transparent;
  color: var(--color-ink);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  outline: none;
}
.palette__input::placeholder { color: var(--color-muted); }
.palette__list { list-style: none; margin: 0; padding: var(--space-xs); }
.palette__list li[hidden] { display: none; }
.palette__list a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--color-ink-2);
  text-decoration: none;
  white-space: nowrap;
}
.palette__list a:hover { background: var(--color-paper-2); color: var(--color-ink); }
.palette__list a:focus-visible { outline-offset: -2px; }
body.is-palette { overflow: hidden; }

/* ---------------------------------------------------------------- reveal */

.reveal { opacity: 0; transform: translateY(10px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }

.arch-list .reveal:nth-child(1) { transition-delay: 0ms; }
.arch-list .reveal:nth-child(2) { transition-delay: 70ms; }
.arch-list .reveal:nth-child(3) { transition-delay: 140ms; }
.arch-list .reveal:nth-child(4) { transition-delay: 210ms; }

.stat { opacity: 0; transform: translateY(8px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.stats.is-in .stat { opacity: 1; transform: none; }
.stat:nth-child(1) { transition-delay: 0ms; }
.stat:nth-child(2) { transition-delay: 90ms; }
.stat:nth-child(3) { transition-delay: 180ms; }

/* ---------------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
  .reveal { opacity: 1; transform: none; }
  .hero__copy > *, .code-card, .stat { opacity: 1 !important; transform: none !important; animation: none !important; }
  .code-card__body span:not(.caret) { opacity: 1 !important; animation: none !important; }
  .code-card__body .caret { animation: none !important; opacity: 1 !important; }
}

/* ---------------------------------------------------------------- mobile */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: var(--space-2xl); padding-top: var(--space-3xl); }
  .hero__title { max-width: 100%; }
  .diptych, .diptych--rev { grid-template-columns: 1fr; gap: var(--space-xl); }
  .diptych--rev .diptych__text { order: 0; }
  .diptych--rev .diptych__proof { order: 0; }
  .workflow__flow { grid-template-columns: 1fr; gap: var(--space-sm); }
  .flow-arrow { display: inline-block; transform: rotate(90deg); justify-self: start; }
  .nav__links { display: none; }
}

@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
  .stat { border-inline: none !important; border-bottom: var(--rule-hair) solid var(--color-rule); }
  .stat:last-child { border-bottom: none; }
  .arch-list { grid-template-columns: 1fr; }
  .nav { gap: var(--space-sm); }
  .cmdk { display: none; }
}