/* Avelorium — avelorium.net */

:root {
  --paper: #f2f0ea;
  --paper-2: #e9e6de;
  --paper-3: #dfdbd1;
  --ink: #141413;
  --ink-2: #3a3934;
  --muted: #67645b;
  --rule: #d3cfc4;
  --accent: #e5520e;
  --accent-ink: #b33c05;

  --night: #121211;
  --night-2: #191917;
  --night-3: #23221f;
  --on-night: #ece9e2;
  --on-night-2: #c4c0b6;
  --on-night-muted: #9a968c;
  --night-rule: #2e2d29;

  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --gap: clamp(16px, 2.2vw, 32px);
  --header-h: 60px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 8px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-stretch: 100%;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, h4, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
address { font-style: normal; }
svg { display: block; }

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

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.mono { font-family: var(--mono); font-size: .92em; }

.skip {
  position: absolute;
  left: var(--gutter);
  top: 8px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: .875rem;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .2s var(--ease);
}
.skip:focus { transform: none; }

.wrap {
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Header ---------- */

.top-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 8px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }

.hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-stretch: 116%;
  font-size: 1.0625rem;
  letter-spacing: -.015em;
  line-height: 1;
}
.mark { width: 22px; height: 22px; flex: none; }
.mark rect { fill: var(--ink); }
.mark-a { fill: none; stroke: var(--paper); stroke-width: 3; stroke-linejoin: miter; stroke-linecap: square; }
.mark-bar { fill: none; stroke: var(--accent); stroke-width: 3; }

.nav ul { display: flex; gap: clamp(16px, 3vw, 40px); }
.nav a {
  position: relative;
  display: block;
  padding: 10px 0;
  font-size: .9375rem;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .2s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after, .nav a.is-current::after { transform: scaleX(1); }
.nav a.is-current { color: var(--ink); }

/* ---------- Shared bits ---------- */

.status, .ix-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.status i, .ix-status i {
  width: 7px; height: 7px;
  background: var(--accent);
  flex: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: #000; }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn-arrow { display: inline-block; transition: transform .3s var(--ease); }
.btn-solid:hover .btn-arrow { transform: translateY(3px); }

/* ---------- Hero ---------- */

.hero { padding-top: clamp(40px, 7vw, 104px); padding-bottom: clamp(64px, 9vw, 128px); }

.hero-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.hero-loc { color: var(--muted); }

.hero-title {
  margin-top: clamp(36px, 6vw, 80px);
  max-width: 14.5ch;
  font-size: clamp(2.75rem, 1rem + 6.6vw, 7.25rem);
  font-weight: 500;
  font-stretch: 106%;
  line-height: .96;
  letter-spacing: -.042em;
  text-wrap: balance;
}
.stop { color: var(--accent); }

.hero-foot {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 32px;
  align-items: end;
  margin-top: clamp(40px, 5.5vw, 72px);
}
.hero-lede {
  grid-column: 1 / span 6;
  max-width: 46ch;
  font-size: clamp(1.0625rem, .98rem + .35vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-2);
}
.hero-actions {
  grid-column: 8 / -1;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

/* Product index */
.index { margin-top: clamp(64px, 9vw, 128px); }
.index-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.index a {
  display: grid;
  grid-template-columns: 64px minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr) auto 40px;
  align-items: baseline;
  column-gap: var(--gap);
  padding: 22px 0 20px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: background-color .25s ease;
}
.ix-n { font-family: var(--mono); font-size: .8125rem; color: var(--muted); }
.ix-name {
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.25rem);
  font-weight: 500;
  font-stretch: 112%;
  letter-spacing: -.03em;
  line-height: 1;
}
.ix-cat { color: var(--ink-2); }
.ix-tech { font-family: var(--mono); font-size: .8125rem; color: var(--muted); }
.ix-status { color: var(--ink-2); }
.ix-go {
  justify-self: end;
  font-size: 1.125rem;
  transition: transform .3s var(--ease), color .2s ease;
}
.index a:hover .ix-go { transform: translateX(4px); color: var(--accent-ink); }
.index a:hover .ix-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .14em; }

/* ---------- Section heads ---------- */

.sec { padding-block: clamp(80px, 11vw, 160px); }

.sec-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--ink);
}
.sec-label {
  grid-column: 1 / span 3;
  display: flex;
  gap: 14px;
  padding-top: .55em;
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.sec-label span { color: var(--muted); }
.sec-title {
  grid-column: 4 / -1;
  font-size: clamp(2.125rem, 1.2rem + 3.4vw, 4.25rem);
  font-weight: 500;
  font-stretch: 106%;
  line-height: 1;
  letter-spacing: -.035em;
}
.sec-intro {
  grid-column: 4 / span 6;
  max-width: 52ch;
  font-size: clamp(1.0625rem, 1rem + .3vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-2);
}

/* ---------- Products ---------- */

.products { padding-top: clamp(16px, 2vw, 32px); }
.products > .wrap { padding-bottom: clamp(56px, 8vw, 112px); }

.product { padding-bottom: clamp(88px, 11vw, 160px); }

.p-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 14px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.p-idx { margin-right: 14px; color: var(--muted); }

.p-name {
  margin: clamp(28px, 4vw, 56px) 0 0 -.04em;
  font-size: clamp(4.75rem, 1rem + 15vw, 14rem);
  font-weight: 600;
  font-stretch: 120%;
  line-height: .8;
  letter-spacing: -.055em;
}
.glint .p-name { font-size: clamp(4.25rem, 1rem + 12vw, 11rem); }

.p-intro {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 24px;
  margin-top: clamp(40px, 5vw, 72px);
}
.p-sub {
  grid-column: 1 / span 5;
  max-width: 20ch;
  font-size: clamp(1.5rem, 1.1rem + 1.25vw, 2.25rem);
  font-weight: 500;
  font-stretch: 104%;
  line-height: 1.12;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.p-desc { grid-column: 7 / -1; max-width: 60ch; color: var(--ink-2); }
.p-desc p + p { margin-top: 1em; }

/* Spec strip */
.spec {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.spec > div {
  padding: 16px 18px 18px;
  border-left: 1px solid var(--rule);
}
.spec > div:first-child { border-left: 0; padding-left: 0; }
.spec dt {
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.spec dd { font-size: .9375rem; line-height: 1.4; font-weight: 500; }
.spec .q { display: block; margin-top: 2px; font-weight: 400; color: var(--muted); font-size: .8125rem; }

/* Figures */
.fig {
  margin-top: clamp(48px, 6vw, 88px);
  border: 1px solid var(--ink);
  background: var(--paper-2);
}
.fig-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.fig-head p:first-child { display: flex; flex-wrap: wrap; gap: 4px 14px; min-width: 0; }
.fig-n { color: var(--muted); flex: none; }
.fig-state { flex: none; color: var(--accent-ink); }
.fig-body {
  padding: clamp(20px, 3.5vw, 48px);
  background-image: radial-gradient(circle at 1px 1px, rgba(20, 20, 19, .13) 1px, transparent 1.4px);
  background-size: 18px 18px;
  background-position: 8px 8px;
}
.fig figcaption {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--ink);
  background: var(--paper);
  font-size: .875rem;
  line-height: 1.55;
  color: var(--ink-2);
}

/* --- Fig. 1: Velocir transfer --- */
.vx-body {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  grid-template-areas:
    "src lanes"
    "out out";
  row-gap: 40px;
}
.vx-step { display: none; }

.vx-k {
  display: block;
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.vx-src {
  grid-area: src;
  align-self: center;
  position: relative;
  display: grid;
  gap: 4px;
  padding: 14px 16px 16px;
  border: 1px solid var(--ink);
  background: var(--paper);
}
.vx-src strong { font-weight: 600; font-size: 1rem; line-height: 1.3; }
.vx-sm { font-size: .8125rem; line-height: 1.45; color: var(--muted); }

/* fork connector: source → two lanes */
.vx-src::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  width: 29px;
  border-top: 1px solid var(--ink);
}
.vx-lanes {
  grid-area: lanes;
  position: relative;
  display: grid;
  gap: 14px;
  padding-left: 56px;
}
.lane { position: relative; }
.lane::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -28px;
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--ink) 50%, transparent 0) 0 0 / 6px 1px repeat-x;
}
.lane::after {
  content: "";
  position: absolute;
  left: -28px;
  border-left: 1px solid var(--ink);
}
.lane[data-lane="a"]::after { top: 50%; bottom: -8px; }
.lane[data-lane="b"]::after { top: -7px; bottom: 50%; }
.vx[data-phase="fetch"] .lane::before { animation: flow .5s linear infinite; }
@keyframes flow { to { background-position: 6px 0; } }

.lane {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) 84px;
  align-items: center;
  column-gap: 20px;
  padding: 14px 16px;
  border: 1px solid var(--ink);
  background: var(--paper);
}
.lane-id { display: grid; grid-template-columns: 10px auto; justify-content: start; column-gap: 10px; align-items: center; line-height: 1.25; }
.lane-id span { font-weight: 600; font-size: .9375rem; }
.lane-id em { grid-column: 2; font-style: normal; font-size: .8125rem; color: var(--muted); }
.sw { width: 10px; height: 10px; }
.sw-a { background: var(--ink); }
.sw-b { background: var(--accent); }

.lane-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.slot { display: grid; gap: 6px; min-width: 0; }
.slot b {
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 400;
  color: var(--ink-2);
  white-space: nowrap;
}
.bar { display: block; height: 4px; background: var(--paper-3); overflow: hidden; }
.bar span {
  display: block;
  height: 100%;
  transform-origin: left;
  transform: scaleX(0);
}
.lane[data-lane="a"] .bar span { background: var(--ink); }
.lane[data-lane="b"] .bar span { background: var(--accent); }
.slot.is-idle b { color: var(--muted); }

.lane-count {
  justify-self: end;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--muted);
  white-space: nowrap;
}
.lane-count b { font-weight: 500; color: var(--ink); }

.vx-out { grid-area: out; position: relative; }
.vx-out::before {
  /* connector from lanes down into the output */
  content: "";
  position: absolute;
  top: -40px;
  left: calc(50% + 133px);
  height: 74px;
  border-left: 1px solid var(--ink);
}
.vx-out-head {
  height: 18px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 10px;
  line-height: 18px;
}
.vx-verify {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.vx[data-phase="done"] .vx-verify { color: var(--ink); }
.vx[data-phase="done"] .vx-verify::before { content: "✓ "; color: var(--accent-ink); }

.cells {
  position: relative;
  display: grid;
  grid-template-columns: repeat(32, minmax(0, 1fr));
  gap: 3px;
  padding: 6px;
  border: 1px solid var(--ink);
  background: var(--paper);
}
.cell {
  height: 34px;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--rule);
  transition: background-color .25s ease, box-shadow .25s ease;
}
.cell.a.flight { background: rgba(20, 20, 19, .14); box-shadow: inset 0 0 0 1px var(--ink); }
.cell.b.flight { background: rgba(229, 82, 14, .18); box-shadow: inset 0 0 0 1px var(--accent); }
.cell.a.done { background: var(--ink); box-shadow: none; }
.cell.b.done { background: var(--accent); box-shadow: none; }

.sweep {
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: 0;
  width: 2px;
  background: var(--accent-ink);
  opacity: 0;
  pointer-events: none;
}
.vx[data-phase="verify"] .sweep { opacity: 1; }

.ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Feature list */
.feats { margin-top: clamp(56px, 7vw, 104px); border-top: 1px solid var(--ink); }
.feat {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 8px;
  padding: 26px 0 30px;
  border-bottom: 1px solid var(--rule);
}
.feat-n {
  grid-column: 1 / span 1;
  padding-top: .2em;
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--muted);
}
.feat h4 {
  grid-column: 2 / span 5;
  font-size: clamp(1.1875rem, 1rem + .6vw, 1.5rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.015em;
}
.feat p { grid-column: 7 / -1; max-width: 60ch; color: var(--ink-2); }

.note {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  margin-top: 28px;
  font-size: .875rem;
  line-height: 1.55;
  color: var(--muted);
}
.note-k {
  grid-column: 1 / span 1;
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding-top: .2em;
}
.note-t { grid-column: 2 / -1; max-width: 88ch; }

/* ---------- Glint (dark) ---------- */

.dark {
  --ink: #ece9e2;
  --ink-2: #c4c0b6;
  --muted: #9a968c;
  --rule: #2e2d29;
  --paper: #121211;
  --paper-2: #191917;
  --paper-3: #2a2925;
  --accent-ink: #f0763d;
  background: var(--paper);
  color: var(--ink);
  padding-top: clamp(72px, 9vw, 128px);
}
.dark ::selection { background: var(--accent); color: #fff; }
.dark .fig-body {
  background-image: radial-gradient(circle at 1px 1px, rgba(236, 233, 226, .09) 1px, transparent 1.4px);
}
.dark .fig, .dark .fig-head, .dark .fig figcaption { border-color: #3d3c37; }
.dark .p-bar, .dark .spec { border-color: #4a4843; }

.gx-body {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: stretch;
}

.gx-steps { border-top: 1px solid var(--rule); align-self: center; }
.gx-steps li { border-bottom: 1px solid var(--rule); }
.step {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  row-gap: 4px;
  width: 100%;
  padding: 18px 8px 18px 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  color: var(--muted);
  transition: color .25s ease;
}
.step:hover { color: var(--ink-2); }
.step-n { grid-row: 1 / span 2; padding-top: .2em; font-family: var(--mono); font-size: .75rem; }
.step-t { font-size: 1.125rem; font-weight: 500; line-height: 1.3; letter-spacing: -.01em; }
.step-d { font-size: .875rem; line-height: 1.5; }
.step[aria-pressed="true"] { color: var(--ink); }
.step[aria-pressed="true"] .step-n { color: var(--accent-ink); }
.step[aria-pressed="true"] .step-d { color: var(--ink-2); }
.step-bar {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}
.gx[data-auto="on"] .step[aria-pressed="true"] .step-bar {
  animation: dwell var(--dwell, 3400ms) linear forwards;
}
@keyframes dwell { to { transform: scaleX(1); } }

/* stage */
.gx-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 380px;
  padding: 64px clamp(18px, 3vw, 36px) clamp(18px, 3vw, 36px);
}
.gx-vm {
  position: absolute;
  inset: 0;
  border: 1px dashed var(--muted);
  opacity: 0;
  transition: opacity .45s ease, border-color .45s ease;
}
.gx-tag, .gx-run {
  position: absolute;
  top: 14px;
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.gx-tag { left: 16px; color: var(--ink-2); }
.gx-run { right: 16px; display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.gx-run i { width: 7px; height: 7px; background: var(--accent); }
.gx-run .s-reset { display: none; }

.gx-stack { position: relative; display: grid; gap: 10px; }

.gx-label {
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.gx-overlay, .gx-ghost { height: 76px; }
.gx-overlay {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 12px 12px;
  border: 1px solid var(--accent);
  background: rgba(229, 82, 14, .07);
  color: var(--accent-ink);
  opacity: 0;
  transform: translateY(-18px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.gx-writes { display: flex; gap: 5px; flex-wrap: wrap; }
.gx-writes i {
  width: 14px; height: 14px;
  background: var(--accent);
  transform: scale(0);
  transition: transform .3s var(--ease);
}
.gx-ghost {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #4a4843;
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  transition: opacity .4s ease .25s;
}
.gx-ghost span { text-decoration: line-through; text-decoration-color: var(--accent); }

.gx-base {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  height: 150px;
  padding: 10px 12px;
  border: 1px solid var(--ink-2);
  color: var(--ink-2);
  background:
    repeating-linear-gradient(135deg, rgba(236, 233, 226, .13) 0 1px, transparent 1px 8px),
    var(--paper-2);
}
.gx-intact {
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0;
  transition: opacity .4s ease .3s;
}
.gx-intact::before { content: "✓ "; color: var(--accent-ink); }

/* stage states */
.gx-stage[data-stage="2"] .gx-overlay,
.gx-stage[data-stage="3"] .gx-overlay { opacity: 1; transform: none; }
.gx-stage[data-stage="3"] .gx-vm,
.gx-stage[data-stage="4"] .gx-vm { opacity: 1; }
.gx-stage[data-stage="3"] .gx-writes i { transform: scale(1); }
.gx-stage[data-stage="3"] .gx-run i { animation: blink 1.6s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.gx-stage[data-stage="4"] .gx-overlay { opacity: 0; transform: translateY(-26px); }
.gx-stage[data-stage="4"] .gx-ghost { opacity: 1; }
.gx-stage[data-stage="4"] .gx-intact { opacity: 1; }
.gx-stage[data-stage="4"] .s-run { display: none; }
.gx-stage[data-stage="4"] .s-reset { display: inline; }
.gx-stage[data-stage="4"] .gx-run i { background: var(--muted); }
.gx-stage[data-stage="1"] .gx-base { border-color: var(--ink); }

.gx-writes i:nth-child(1) { transition-delay: .25s; }
.gx-writes i:nth-child(2) { transition-delay: .45s; }
.gx-writes i:nth-child(3) { transition-delay: .6s; }
.gx-writes i:nth-child(4) { transition-delay: .9s; }
.gx-writes i:nth-child(5) { transition-delay: 1.05s; }
.gx-writes i:nth-child(6) { transition-delay: 1.3s; }
.gx-writes i:nth-child(7) { transition-delay: 1.6s; }
.gx-writes i:nth-child(8) { transition-delay: 1.75s; }
.gx-writes i:nth-child(9) { transition-delay: 2.05s; }
.gx-writes i:nth-child(10) { transition-delay: 2.3s; }
.gx-writes i:nth-child(11) { transition-delay: 2.5s; }
.gx-writes i:nth-child(12) { transition-delay: 2.7s; }
.gx-stage:not([data-stage="3"]) .gx-writes i { transition-delay: 0s; }

/* Glint features */
.gfeats {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  margin-top: clamp(56px, 7vw, 104px);
}
.gfeats li {
  grid-column: span 4;
  padding: 22px 0 36px;
  border-top: 1px solid #4a4843;
}
.gfeats h4 {
  margin-bottom: 10px;
  font-size: 1.1875rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.gfeats p { max-width: 42ch; color: var(--ink-2); font-size: 1rem; }

/* ---------- How we build ---------- */

.principles { margin-top: clamp(48px, 6vw, 88px); }
.principles li {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 10px;
  padding: 30px 0 36px;
  border-top: 1px solid var(--rule);
}
.principles li:last-child { border-bottom: 1px solid var(--rule); }
.pr-n {
  grid-column: 1 / span 3;
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--accent-ink);
  padding-top: .45em;
}
.principles h3 {
  grid-column: 4 / span 4;
  font-size: clamp(1.375rem, 1.05rem + 1vw, 2rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.025em;
  font-stretch: 104%;
}
.principles p {
  grid-column: 8 / -1;
  max-width: 48ch;
  padding-top: .35em;
  color: var(--ink-2);
}

/* ---------- Company ---------- */

.company { padding-top: 0; }

.about {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 48px;
  margin-top: clamp(40px, 5vw, 72px);
}
.about-body {
  grid-column: 4 / span 5;
  font-size: clamp(1.125rem, 1rem + .45vw, 1.375rem);
  line-height: 1.5;
  color: var(--ink-2);
}
.about-body p:first-child { color: var(--ink); }
.about-body p + p { margin-top: 1em; }

.facts { grid-column: 10 / -1; align-self: start; border-top: 1px solid var(--ink); }
.facts > div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--rule);
  font-size: .9375rem;
}
.facts dt {
  padding-top: .2em;
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.facts a { text-underline-offset: .2em; text-decoration-thickness: 1px; }
.facts a:hover { color: var(--accent-ink); }

/* ---------- Contact ---------- */

.contact { padding-top: 0; }
.contact-body { margin-top: clamp(40px, 5vw, 72px); padding-left: calc((100% + var(--gap)) / 12 * 3); }
.contact-lede { max-width: 44ch; font-size: clamp(1.0625rem, 1rem + .3vw, 1.25rem); color: var(--ink-2); }
.contact-mail {
  margin-top: 18px;
  font-size: clamp(2.125rem, .6rem + 6.4vw, 6.25rem);
  font-weight: 500;
  font-stretch: 104%;
  line-height: 1.05;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}
.contact-mail a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat;
  padding-bottom: .04em;
  transition: color .2s ease, background-size .35s var(--ease);
}
.contact-mail a:hover { color: var(--accent-ink); }
.contact-mail .at { color: var(--accent); }
.contact-mail a:hover .at { color: inherit; }

.contact-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 32px;
}
.copy {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: none;
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.copy:hover { background: var(--ink); color: var(--paper); }
.copy.is-done { background: var(--ink); color: var(--paper); }
.contact-tz {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.site-footer {
  --ink: #ece9e2;
  --paper: #121211;
  --accent-ink: #f0763d;
  background: var(--night);
  color: var(--on-night-2);
  padding: clamp(64px, 8vw, 104px) 0 28px;
  font-size: .9375rem;
  line-height: 1.6;
}
.site-footer a { text-underline-offset: .2em; text-decoration-thickness: 1px; }
.site-footer a:hover { color: var(--on-night); }
.site-footer .brand { color: var(--on-night); }
.site-footer .mark rect { fill: var(--on-night); }
.site-footer .mark-a { stroke: var(--night); }

.ft-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 40px;
}
.ft-brand { grid-column: 1 / span 3; }
.ft-brand p { margin-top: 18px; max-width: 26ch; color: var(--on-night-muted); }
.ft-col { grid-column: span 3; }
.ft-col h3 {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--night-rule);
  font-family: var(--mono);
  font-size: .6875rem;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--on-night-muted);
}
.ft-legal { color: var(--on-night); font-weight: 500; letter-spacing: .01em; }
.ft-col address { max-width: 34ch; }

.ft-base {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin-top: clamp(56px, 7vw, 96px);
  padding-top: 20px;
  border-top: 1px solid var(--night-rule);
  font-size: .8125rem;
  color: var(--on-night-muted);
}
.ft-base ul { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.ft-base a { text-decoration: none; }
.ft-base a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .spec { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .spec > div { border-top: 1px solid var(--rule); }
  .spec > div:nth-child(-n+3) { border-top: 0; }
  .spec > div:nth-child(3n+1) { border-left: 0; padding-left: 0; }

  .lane { grid-template-columns: minmax(130px, 150px) minmax(0, 1fr) 72px; column-gap: 16px; }

  .gx-body { grid-template-columns: 1fr; }
  .gx-steps { order: 2; }
  .gfeats li { grid-column: span 6; }

  .ft-brand { grid-column: 1 / -1; }
  .ft-col { grid-column: span 4; }
}

@media (max-width: 860px) {
  .hero-lede { grid-column: 1 / -1; }
  .hero-actions { grid-column: 1 / -1; justify-content: flex-start; }

  .index a { grid-template-columns: 44px minmax(0, 1fr) auto; row-gap: 6px; }
  .ix-name { grid-column: 2; }
  .ix-cat { grid-column: 2; grid-row: 2; font-size: .9375rem; }
  .ix-tech { display: none; }
  .ix-status { grid-column: 3; grid-row: 1; justify-self: end; }
  .ix-go { display: none; }

  .sec-label { grid-column: 1 / -1; padding-top: 0; }
  .sec-title, .sec-intro { grid-column: 1 / -1; }

  .p-sub, .p-desc { grid-column: 1 / -1; }
  .p-sub { max-width: 22ch; }

  /* Fig 1 stacks vertically */
  .vx-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "src" "s1" "lanes" "s2" "out";
    row-gap: 0;
  }
  .vx-src::after, .lane::before, .lane::after, .vx-out::before { display: none; }
  .vx-lanes { padding-left: 0; gap: 10px; }
  .vx-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 0 14px 15px;
    margin-left: 0;
    border-left: 1px solid var(--ink);
    margin-inline-start: 20px;
    font-family: var(--mono);
    font-size: .6875rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .vx-step-1 { grid-area: s1; }
  .vx-step-2 { grid-area: s2; }
  .vx-step::before { content: "↓"; color: var(--ink); font-family: var(--sans); }

  .lane { grid-template-columns: minmax(0, 1fr) auto; row-gap: 14px; }
  .lane-slots { grid-column: 1 / -1; grid-row: 2; }
  .lane-count { grid-column: 2; grid-row: 1; }
  .lane-id { grid-template-columns: 10px auto auto; column-gap: 10px; }
  .lane-id em { grid-column: auto; }

  .cells { grid-template-columns: repeat(16, minmax(0, 1fr)); }
  .cell { height: 26px; }

  .feat-n { grid-column: 1 / -1; padding-top: 0; }
  .feat h4, .feat p { grid-column: 1 / -1; }
  .feat { padding: 22px 0 26px; }
  .note-k, .note-t { grid-column: 1 / -1; }
  .note { row-gap: 6px; }

  .principles li { padding: 24px 0 28px; }
  .pr-n, .principles h3, .principles p { grid-column: 1 / -1; padding-top: 0; }

  .about-body, .facts { grid-column: 1 / -1; }
  .contact-body { padding-left: 0; }
}

@media (max-width: 640px) {
  :root { --header-h: 56px; }

  .spec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec > div { border-left: 1px solid var(--rule); border-top: 1px solid var(--rule); padding: 14px 14px 16px; }
  .spec > div:nth-child(-n+3) { border-top: 1px solid var(--rule); }
  .spec > div:nth-child(-n+2) { border-top: 0; }
  .spec > div:nth-child(3n+1) { border-left: 1px solid var(--rule); padding-left: 14px; }
  .spec > div:nth-child(2n+1) { border-left: 0; padding-left: 0; }
  .spec > div:last-child:nth-child(odd) { grid-column: 1 / -1; }

  .fig-head { padding: 10px 12px; }
  .fig-head p:first-child { gap: 10px; }
  .fig-body { padding: 16px; }
  .fig figcaption { padding: 12px; }
  .fig-head #fig1-title { display: none; }
  .fig-head p:first-child::after { content: "Segmented transfer"; }
  .gx .fig-head p:first-child::after { content: none; }

  .lane { padding: 12px; }
  .lane-slots { gap: 10px; }

  .gx-stage { min-height: 320px; padding: 56px 14px 14px; }
  .gx-overlay, .gx-ghost { height: 68px; }
  .gx-base { height: 116px; }
  .gx-writes i { width: 12px; height: 12px; }

  .gfeats li { grid-column: 1 / -1; padding: 20px 0 26px; }

  .facts > div { grid-template-columns: 96px minmax(0, 1fr); }

  .btn { flex: 1 1 auto; }

  .ft-col { grid-column: 1 / -1; }
  .ft-base { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  .nav ul { gap: 16px; }
  .nav a { font-size: .875rem; }
  .gx-base { flex-direction: column; }
}

@media (max-width: 359px) {
  .header-brand .brand-word { display: none; }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
  .gx[data-auto="on"] .step[aria-pressed="true"] .step-bar { animation: none; }
}

@media print {
  .site-header, .skip, .copy { display: none; }
  .dark, .site-footer { background: #fff; color: #000; }
}
