/* ============ Reset & base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, p, ul, ol, li, blockquote, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button { background: none; border: none; cursor: pointer; }

:root {
  --paper: #F3F5F2;
  --dark: #14171C;
  --ink: #14171C;
  --paper-text: #F3F5F2;
  --paper-text-dim: #C7CDD6;
  --green: #0B7A4D;
  --green-bright: #17C974;
  --on-green: #FFFFFF;

  --font-display: "Bricolage Grotesque", "General Sans", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Inter", system-ui, sans-serif;
  --font-mono: "Fira Code", "IBM Plex Mono", ui-monospace, monospace;

  --header-h: 3.5rem;
  --palette-width: min(560px, 90vw);
  --container: 1200px;

  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
}

html {
  scroll-padding-top: var(--header-h);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  padding-top: var(--header-h);
}

main { display: block; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; }

::selection { background: var(--green-bright); color: var(--dark); }

:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 1px; }
.on-dark :focus-visible,
.split__half--dark :focus-visible,
.seam-header :focus-visible,
.palette :focus-visible { outline-color: var(--green-bright); }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: .8125rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: var(--space-2);
}
.on-dark .eyebrow,
.split__half--dark .eyebrow { color: var(--green-bright); }

.section-title {
  font-size: clamp(1.75rem, 3.25vw, 2.5rem);
  margin-bottom: var(--space-2);
}

.section-sub {
  font-size: 1.0625rem;
  max-width: 40ch;
  color: var(--ink);
  opacity: .72;
}
.on-dark .section-sub,
.split__half--dark .section-sub { color: var(--paper-text-dim); opacity: 1; }

a:not(.btn) { color: var(--green); }
.on-dark a:not(.btn),
.split__half--dark a:not(.btn) { color: var(--green-bright); }
a:not(.btn):hover { text-decoration: underline; }

/* ============ Skip link ============ */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 1000;
  background: var(--dark);
  color: var(--paper-text);
  padding: .75rem 1.25rem;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: .875rem;
  transition: top .2s ease;
}
.skip-link:focus { top: 1rem; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .8rem 1.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .9375rem;
  border-radius: 2px;
  border: 1.5px solid transparent;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn--primary { background: var(--green); color: var(--on-green); }
.btn--primary:hover { background: var(--dark); color: var(--paper-text); }
.btn--ghost { background: transparent; color: var(--green); border-color: var(--ink); }
.on-dark .btn--ghost,
.split__half--dark .btn--ghost { color: var(--green-bright); border-color: var(--paper-text-dim); }
.btn--ghost:hover { border-color: currentColor; }
.btn:active { transform: translateY(1px); }
.btn--full { width: 100%; }

/* ============ Header ============ */
.seam-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  background: var(--dark);
  color: var(--paper-text);
  z-index: 100;
  border-bottom: 1px solid rgba(199, 205, 214, .15);
}
.seam-header__inner {
  height: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: inline-flex; align-items: center; gap: .5rem; }
.seam-header .brand { color: var(--green-bright); }
.brand__word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -.01em;
}

.command-trigger {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .5rem .85rem;
  border: 1px solid var(--paper-text-dim);
  border-radius: 2px;
  font-size: .875rem;
  color: var(--paper-text);
  transition: border-color .15s ease, background-color .15s ease;
}
.command-trigger:hover { border-color: var(--green-bright); background: rgba(23, 201, 116, .08); }
.command-trigger__glyph {
  font-family: var(--font-mono);
  color: var(--green-bright);
  font-size: .9375rem;
  letter-spacing: .05em;
}
.command-trigger__hint {
  font-family: var(--font-mono);
  font-size: .75rem;
  border: 1px solid var(--paper-text-dim);
  border-radius: 2px;
  padding: .1rem .4rem;
  color: var(--paper-text-dim);
}
@media (max-width: 899.98px) {
  .command-trigger__hint { display: none; }
}

/* ============ Command palette ============ */
.palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 23, 28, .5);
  z-index: 200;
}
.palette-backdrop[hidden] { display: none; }

.palette {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--palette-width);
  max-height: 80vh;
  overflow: auto;
  background: var(--dark);
  color: var(--paper-text);
  border: 1px solid var(--green-bright);
  border-radius: 4px;
  z-index: 201;
  padding: var(--space-2);
}
.palette[hidden] { display: none; }

.palette__row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem .9rem;
  border: 1px solid var(--paper-text-dim);
  border-radius: 3px;
  margin-bottom: var(--space-2);
}
.palette__prompt { font-family: var(--font-mono); color: var(--green-bright); }
.palette__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: .95rem;
  color: var(--paper-text);
}
.palette__input::placeholder { color: var(--paper-text-dim); }
.palette__cursor {
  width: 7px;
  height: 1.1rem;
  background: var(--green-bright);
  animation: caret-blink 1s steps(1) infinite;
}
@keyframes caret-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.palette__list { display: flex; flex-direction: column; gap: 2px; }
.palette__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem .9rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: .9rem;
  color: var(--paper-text);
  transition: background-color .12s ease;
}
.palette .palette__item { color: var(--paper-text); }
.palette__item:hover,
.palette__item:focus-visible { background: rgba(23, 201, 116, .12); }
.palette__item-hint { color: var(--paper-text-dim); font-size: .8rem; }
.palette__empty { padding: .7rem .9rem; color: var(--paper-text-dim); font-family: var(--font-mono); font-size: .875rem; }
.palette__empty[hidden] { display: none; }

.palette__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-1);
}
.palette__graph {
  width: 6rem;
  height: 1.75rem;
  opacity: .7;
}
.palette__esc {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--paper-text-dim);
  border: 1px solid var(--paper-text-dim);
  border-radius: 2px;
  padding: .15rem .5rem;
}
.palette__esc:hover { color: var(--paper-text); border-color: var(--paper-text-dim); }

body.palette-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .palette__cursor { animation: none; opacity: 1; }
}

/* ============ Seams ============ */
.seam {
  pointer-events: none;
  z-index: 2;
}
.seam-a, .seam-b { fill: var(--paper); }
.seam-crack { stroke: var(--green-bright); stroke-width: .6; opacity: .55; vector-effect: non-scaling-stroke; }

.split--light-first .seam-a { fill: var(--paper); }
.split--light-first .seam-b { fill: var(--dark); }
.split--dark-first .seam-a { fill: var(--dark); }
.split--dark-first .seam-b { fill: var(--paper); }

/* Seam is a real flex item (not absolutely positioned) so it always sits
   at the true boundary between the two halves, on both flex-row
   (desktop) and flex-column (mobile, where halves have unequal content
   height). Width/height are set explicitly per orientation rather than
   through flex-basis alone: SVG replaced elements with an intrinsic
   (viewBox) aspect ratio can derive their cross-size from that ratio
   instead of stretching when only flex-basis is set, which produced a
   ~120px-tall seam instead of 32px in testing. */
.seam {
  flex-grow: 0;
  flex-shrink: 0;
  z-index: 2;
}
.seam--v { width: 32px; height: auto; }
.seam--h { display: none; width: auto; height: 32px; }

@keyframes seam-settle-v {
  0% { transform: translateX(-2px); }
  60% { transform: translateX(1px); }
  100% { transform: translateX(0); }
}
@keyframes seam-settle-h {
  0% { transform: translateY(-2px); }
  60% { transform: translateY(1px); }
  100% { transform: translateY(0); }
}
.seam--v { animation: seam-settle-v 140ms ease-out both; }
.seam--h { animation: seam-settle-h 140ms ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .seam--v, .seam--h { animation: none; }
}

@media (max-width: 639.98px) {
  .seam--v { display: none; }
  .seam--h { display: block; }
}

/* ============ Split sections ============ */
.split {
  position: relative;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}
.split__half {
  padding: clamp(3.5rem, 7vw, 5.5rem) clamp(1.5rem, 5vw, 4rem);
  display: flex;
  align-items: center;
}
/* halves shed 16px each (half of the 32px seam) so half+seam+half == 100% */
.split__half--light { background: var(--paper); color: var(--ink); flex: 0 0 calc(48% - 16px); }
.split__half--dark { background: var(--dark); color: var(--paper-text); flex: 0 0 calc(52% - 16px); }

@media (max-width: 639.98px) {
  .split { flex-direction: column; }
  .split__half--light, .split__half--dark { flex: 1 1 auto; width: 100%; }
}

/* ============ Hero ============ */
.hero-content, .motif-content, .contact-side { max-width: 32rem; }
.hero-headline {
  font-size: clamp(2.75rem, 6vw, 5.25rem);
  margin-bottom: var(--space-3);
}
.hero-sub { font-size: 1.125rem; opacity: .85; margin-bottom: var(--space-4); max-width: 34ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.hero-stat {
  font-size: .9rem;
  padding-top: var(--space-3);
  border-top: 1px solid rgba(20, 23, 28, .15);
  max-width: 36ch;
}
.hero-stat strong { font-family: var(--font-mono); color: var(--green); }

.hero-graph-wrap { width: 100%; text-align: center; }
.hero-graph-wrap .graph { max-width: 380px; margin-inline: auto; width: 100%; height: auto; }
.hero-graph-caption {
  font-family: var(--font-mono);
  font-size: .8125rem;
  color: var(--paper-text-dim);
  margin-top: var(--space-2);
}

/* ============ Graph motif ============ */
.graph-edge {
  stroke: var(--green-bright);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  fill: none;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset .6s ease;
  transition-delay: calc(var(--i, 0) * 80ms);
}
.graph.is-visible .graph-edge { stroke-dashoffset: 0; }

.graph-node {
  fill: var(--dark);
  stroke: var(--green-bright);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  transform-origin: center;
  transform: scale(.4);
  transition: opacity .4s ease, transform .4s ease;
  transition-delay: calc(var(--i, 0) * 80ms + 120ms);
}
.graph.is-visible .graph-node { opacity: 1; transform: scale(1); }
.graph-node--root { fill: var(--green-bright); stroke: none; }
.graph-node--ring { fill: none; stroke: var(--green-bright); opacity: 0; stroke-width: 1; }
.graph.is-visible .graph-node--ring { opacity: .5; }

.graph-label {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--paper-text-dim);
  opacity: 0;
  transition: opacity .4s ease;
  transition-delay: calc(var(--i, 0) * 80ms + 200ms);
}
.graph.is-visible .graph-label { opacity: .8; }
.graph-label--time { fill: var(--paper-text-dim); opacity: 0; font-size: 10px; }
.graph.is-visible .graph-label--time { opacity: .5; }
.graph-label--root { fill: var(--green-bright); font-weight: 600; opacity: 0; }
.graph.is-visible .graph-label--root { opacity: 1; }

.graph--static .graph-edge {
  stroke-dashoffset: 0;
  transition: none;
}
.graph--static .graph-node {
  opacity: 1;
  transform: scale(1);
  transition: none;
}
.graph--static .graph-node--ring { opacity: .5; }
.graph--static .graph-label { opacity: .8; transition: none; }
.graph--static .graph-label--time { opacity: .5; }
.graph--static .graph-label--root { opacity: 1; }

.motif-graph-wrap { width: 100%; }
.motif-graph-wrap .graph { width: 100%; height: auto; }

@media (prefers-reduced-motion: reduce) {
  .graph-edge, .graph-node, .graph-label, .graph-label--time, .graph-label--root {
    transition: none !important;
    stroke-dashoffset: 0 !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .graph-node--ring { opacity: .5 !important; }
  .graph-label--time { opacity: .5 !important; }
}

/* ============ Reveal (generic scroll fade) ============ */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity .3s ease, transform .3s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
}

/* ============ Proof ============ */
.proof { background: var(--dark); color: var(--paper-text); padding-block: var(--space-6); }
.proof-graph-wrap { margin-top: var(--space-4); }
.graph--proof { width: 100%; height: auto; overflow: visible; }
.proof-graph-caption {
  margin-top: -.25rem;
  text-align: right;
  color: var(--paper-text-dim);
  font-family: var(--font-mono);
  font-size: .75rem;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-5);
}
.stat-tile__number {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 5.5rem);
  color: var(--green-bright);
  line-height: 1;
}
.stat-tile__number span { font-family: var(--font-mono); font-size: 1.25rem; margin-left: .35rem; color: var(--paper-text-dim); }
.stat-tile__label { margin-top: var(--space-2); font-size: 1rem; }
.stat-tile__context { margin-top: .35rem; font-family: var(--font-mono); font-size: .8125rem; color: var(--paper-text-dim); }

@media (max-width: 899.98px) {
  .stat-grid { grid-template-columns: 1fr; gap: var(--space-4); }
}

/* ============ Product / step list ============ */
.step-list { margin-top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.step-list li { display: flex; gap: var(--space-2); align-items: baseline; }
.step-list__num {
  font-family: var(--font-mono);
  color: var(--green);
  font-size: .875rem;
  flex: 0 0 auto;
  padding-top: .3rem;
}
.step-list h3 { font-size: 1.0625rem; margin-bottom: .25rem; }
.step-list p { opacity: .78; font-size: .95rem; max-width: 40ch; }

/* ============ Features / panels ============ */
.features, .pricing { padding-block: var(--space-6); }
.features .section-sub, .pricing .section-title, .pricing .section-sub { margin-inline: auto; }
.features > .container > .eyebrow,
.features > .container > .section-title,
.features > .container > .section-sub { text-align: center; margin-inline: auto; }

.panel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
@media (min-width: 640px) {
  .panel-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .panel-grid { grid-template-columns: repeat(3, 1fr); }
}

.panel {
  position: relative;
  border: 1px solid var(--ink);
  border-radius: 3px;
  padding: var(--space-3);
  background: var(--paper);
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  background: var(--green);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.panel__num {
  display: block;
  font-family: var(--font-mono);
  font-size: .8125rem;
  color: var(--green);
  margin-bottom: var(--space-2);
}
.panel h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.panel p { font-size: .9375rem; opacity: .78; }

/* ============ Pricing ============ */
.pricing__inner { display: flex; flex-direction: column; gap: var(--space-5); }
.pricing .section-title, .pricing .eyebrow { text-align: center; }
.pricing .section-title { max-width: none; }

.panel--pricing { display: flex; flex-direction: column; }
.panel--pricing .panel__price { font-family: var(--font-display); font-size: 2.25rem; margin: .25rem 0 .5rem; }
.panel--pricing .panel__price span { font-family: var(--font-mono); font-size: 1rem; opacity: .6; }
.panel__tagline { font-size: .9rem; opacity: .78; margin-bottom: var(--space-3); }
.panel .panel__flag {
  font-family: var(--font-mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--green);
  opacity: 1;
  margin-bottom: .25rem;
}
.panel__list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: var(--space-3); }
.panel__list li {
  font-size: .875rem;
  padding-left: 1rem;
  position: relative;
  opacity: .85;
}
.panel__list li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--green);
  font-family: var(--font-mono);
}
.panel--highlight { border-color: var(--green); }
.panel--pricing .btn { margin-top: auto; }

.pricing__band {
  background: var(--dark);
  color: var(--paper-text);
  border-radius: 3px;
  padding: var(--space-4);
  text-align: center;
  max-width: 30rem;
  margin-inline: auto;
}
.pricing__band-stat { font-family: var(--font-display); font-size: clamp(2.5rem, 5vw, 3.5rem); color: var(--green-bright); line-height: 1; }
.pricing__band-stat span { font-family: var(--font-mono); font-size: 1.5rem; }
.pricing__band-copy { margin-top: var(--space-1); color: var(--paper-text-dim); font-size: .9375rem; }
.pricing__band-link { display: inline-block; margin-top: var(--space-2); color: var(--green-bright); font-weight: 600; }

@media (min-width: 900px) {
  .pricing__inner { flex-direction: row; align-items: stretch; }
  .pricing__main { flex: 1 1 auto; }
  .pricing__band { flex: 0 0 260px; margin-inline: 0; display: flex; flex-direction: column; justify-content: center; }
}

/* ============ Contact ============ */
.quote {
  margin-top: var(--space-4);
  padding-left: var(--space-2);
  border-left: 2px solid var(--green-bright);
}
.quote p { font-size: 1.0625rem; font-style: italic; opacity: .92; }
.quote footer { margin-top: var(--space-2); font-family: var(--font-mono); font-size: .8125rem; color: var(--paper-text-dim); }

.contact-form { width: 100%; max-width: 26rem; }
.contact-form h3 { font-size: 1.375rem; margin-bottom: var(--space-3); }
.field { margin-bottom: var(--space-3); }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .4rem;
  opacity: .75;
}
.field input, .field select {
  width: 100%;
  padding: .75rem .9rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  font-size: .9375rem;
}
.field input:focus-visible, .field select:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.form-note { margin-top: var(--space-2); font-size: .9rem; color: var(--green); }
.form-note[hidden] { display: none; }

/* ============ Footer ============ */
.seam-footer .split__half { align-items: flex-start; }
.footer-brand .brand { margin-bottom: var(--space-2); }
.footer-tagline { font-size: .95rem; opacity: .8; margin-bottom: var(--space-2); }
.footer-copyright { font-family: var(--font-mono); font-size: .75rem; opacity: .6; }

.footer-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); width: 100%; }
.footer-group h3 {
  font-family: var(--font-mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--paper-text-dim);
  margin-bottom: var(--space-2);
  font-weight: 500;
}
.footer-group ul { display: flex; flex-direction: column; gap: .6rem; }
.footer-group a { font-size: .9rem; }

@media (max-width: 480px) {
  .footer-columns { grid-template-columns: 1fr 1fr; }
}
