/* esve.io — Tally design tokens + components, dark-only fork.
 * Source of truth: the shared Tally theme template. Token values
 * below are the canonical Tally dark set, pinned — this site ships no light
 * mode and no theme toggle. Vanilla CSS port: no Tailwind, no runtime JS.
 */

:root {
  --bg: #141929; /* ink-deep — page canvas */
  --surface: #1b2238; /* ink — cards */
  --surface-canvas: #0e1322; /* one step darker than --surface; slides/figures sit proud */
  --surface-soft: #2a314a; /* ink-soft */
  --ink-section: #0e1322; /* full-bleed dark ribbon */
  --text: #c7cfdc;
  --text-strong: #f5f2ed;
  --text-soft: #a5aebc;
  --text-mute: #7f8694;
  --text-on-ink: #f5f2ed;
  --text-on-ink-soft: rgba(245, 242, 237, 0.78);
  --text-on-ink-mute: rgba(245, 242, 237, 0.55);
  --border: #2a314a;
  --border-quiet: #1f2640;
  --border-strong: #3a4260;
  --signal: #8fe07f;
  --signal-deep: #a8e89a;
  --signal-soft: rgba(124, 217, 107, 0.12);
  --signal-halo: rgba(124, 217, 107, 0.16);
  --signal-glow: rgba(124, 217, 107, 0.55);
  /* macOS-style 4-layer downward stack — gravity-cast drops, not halos. */
  --shadow-sm:
    0 0.5px 0 rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-card:
    0 0.5px 0 rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4),
    0 6px 12px rgba(0, 0, 0, 0.4), 0 16px 28px rgba(0, 0, 0, 0.45);
  --shadow-card-hover:
    0 0.5px 0 rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.45),
    0 4px 10px rgba(0, 0, 0, 0.5), 0 12px 22px rgba(0, 0, 0, 0.55);
  --topnav-bg: rgba(20, 25, 41, 0.85);
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 17px;
  line-height: 27px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
ul,
figure {
  margin: 0;
}

.tnum {
  font-feature-settings: "tnum";
}

/* ---------- Typography ---------- */
.wordmark {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: -0.02em;
  line-height: 1;
}

.wordmark-dot {
  color: var(--signal);
}

.eyebrow-quiet {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-mute);
}

.eyebrow-mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.fig-caption {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  color: var(--text-mute);
}

.h1-hero {
  font-family: "Inter", system-ui, sans-serif;
  font-size: clamp(44px, 6.7vw, 80px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -0.025em;
  color: var(--text-strong);
}

.display-xl {
  font-family: "Inter", system-ui, sans-serif;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

/* Keep a heading on one line where the container has room; wrap on narrow screens. */
@media (min-width: 640px) {
  .nowrap-wide {
    white-space: nowrap;
  }
}

.display-md {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}

.body-lg {
  font-size: 17px;
  line-height: 28px;
}

.text-body-soft {
  color: var(--text-soft);
}

.text-body-mute {
  color: var(--text-mute);
}

.text-body-strong {
  color: var(--text-strong);
}

/* Focus ring — cream on navy; the light-mode ink outline is invisible here. */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--text-strong);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------- Buttons ---------- */
.btn-primary {
  background: #cdd2db;
  color: var(--bg);
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition:
    transform 180ms cubic-bezier(0.32, 0.72, 0, 1),
    box-shadow 180ms cubic-bezier(0.32, 0.72, 0, 1),
    background-color 180ms cubic-bezier(0.32, 0.72, 0, 1);
}

.btn-primary:hover {
  background: #dde1e8;
  transform: translateY(-1px);
  box-shadow: var(--shadow-card-hover);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text-strong);
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--text-soft);
  transition:
    border-color 180ms cubic-bezier(0.32, 0.72, 0, 1),
    color 180ms cubic-bezier(0.32, 0.72, 0, 1);
}

.btn-ghost:hover {
  border-color: var(--text-strong);
}

/* Cream button pinned for ink ribbons — must stay light in both modes. */
.btn-on-dark {
  background: #ecebe6;
  color: #1b2238;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition:
    background 180ms cubic-bezier(0.32, 0.72, 0, 1),
    transform 180ms cubic-bezier(0.32, 0.72, 0, 1);
}

.btn-on-dark:hover {
  background: #fbf9f5;
  transform: translateY(-1px);
}

.link-arrow {
  color: var(--text-strong);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.link-arrow .arrow {
  display: inline-block;
  transition: transform 180ms cubic-bezier(0.32, 0.72, 0, 1);
}

.link-arrow:hover .arrow {
  transform: translateX(4px);
}

/* ---------- Status pills ---------- */
/* Live earns the signal; everything pre-Live stays neutral so the one
 * chromatic accent keeps meaning "in market". */
.pill-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-mute);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 16px;
  white-space: nowrap;
}

.pill-status.is-live {
  border-color: rgba(124, 217, 107, 0.4);
  background: var(--signal-soft);
  color: var(--signal);
}

.pill-status.is-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--signal);
  flex-shrink: 0;
}

/* ---------- Top nav ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--topnav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-quiet);
}

.topnav .container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 1024px) {
  .topnav .container {
    padding: 0 64px;
  }
}

.nav-links {
  display: none;
  align-items: center;
  gap: 32px;
}

@media (min-width: 768px) {
  .nav-links {
    display: inline-flex;
  }
}

.nav-link {
  color: var(--text-soft);
  font-weight: 500;
  font-size: 15px;
  padding: 8px 4px;
  position: relative;
  transition: color 180ms cubic-bezier(0.32, 0.72, 0, 1);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 2px;
  height: 1px;
  background: var(--signal);
  transition: right 180ms cubic-bezier(0.32, 0.72, 0, 1);
}

.nav-link:hover {
  color: var(--text-strong);
}

.nav-link:hover::after {
  right: 0;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.nav-cta .btn-ghost {
  padding: 8px 16px;
  font-size: 14px;
}

/* ---------- Hero — full-bleed rocket video ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Poster fallback doubles as the reduced-motion / no-video state.
   * 75% center keeps the rocket in frame across aspect ratios. */
  background: #0b0f1c url("bg-hero.jpg") no-repeat 75% center / cover;
}

.hero-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 75% center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(20, 25, 41, 0.55) 0%,
    rgba(20, 25, 41, 0.12) 28%,
    rgba(20, 25, 41, 0) 52%,
    rgba(20, 25, 41, 0.82) 86%,
    #141929 100%
  );
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    rgba(14, 19, 34, 0.78) 0%,
    rgba(14, 19, 34, 0.3) 44%,
    transparent 68%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 5;
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 96px 20px 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 1024px) {
  .hero-content {
    padding: 96px 64px 72px;
  }
}

.hero-copy {
  max-width: 700px;
}

.hero-copy .h1-hero {
  margin-top: 24px;
}

.hero-copy .body-lg {
  margin-top: 24px;
  max-width: 54ch;
  color: var(--text-on-ink-soft);
}

.hero-actions {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.hero-copy .fig-caption {
  margin-top: 28px;
  color: var(--text-on-ink-mute);
}

/* ---------- Sections ---------- */
.section {
  padding: 104px 20px;
  scroll-margin-top: 72px;
}

@media (min-width: 1024px) {
  .section {
    padding: 112px 64px;
  }
}

.section .container {
  max-width: 1280px;
  margin: 0 auto;
}

.section-head {
  max-width: 720px;
  margin-bottom: 56px;
}

.section-head .eyebrow-quiet {
  margin-bottom: 16px;
}

.section-head .lead {
  margin-top: 20px;
  font-size: 17px;
  line-height: 28px;
  color: var(--text-soft);
  max-width: 62ch;
}

.ink-section {
  background: var(--ink-section);
}

/* ---------- Cards ---------- */
.card {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  box-shadow: none;
  padding: 28px;
  transition:
    transform 180ms cubic-bezier(0.32, 0.72, 0, 1),
    box-shadow 180ms cubic-bezier(0.32, 0.72, 0, 1),
    border-color 180ms cubic-bezier(0.32, 0.72, 0, 1);
}

.card-bordered {
  background: var(--surface);
  border-color: var(--border-quiet);
}

.card-interactive:hover,
a.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border);
}

/* ---------- Portfolio grid ---------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* Group header between portfolio sub-grids (pipeline vs standalone). */
.group-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 56px 0 24px;
}

.group-head:first-of-type {
  margin-top: 0;
}

.group-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-quiet);
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-card .card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.product-card h3 {
  font-size: 19px;
  line-height: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}

.product-card .domain {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 18px;
  color: var(--text-mute);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

a.domain:hover {
  color: var(--signal);
}

.product-card p {
  font-size: 15px;
  line-height: 24px;
  color: var(--text-soft);
}

.product-card .footnote {
  margin-top: auto;
  padding-top: 10px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  border-top: 1px solid var(--border-quiet);
}

/* ---------- System stages ---------- */
.stage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--border);
}

@media (min-width: 760px) {
  .stage-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .stage-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.stage {
  padding: 28px 24px 32px 0;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 760px) {
  .stage {
    border-right: 1px solid var(--border);
    padding-right: 24px;
  }

  .stage + .stage {
    padding-left: 24px;
  }

  .stage:nth-child(3n) {
    border-right: none;
    padding-right: 0;
  }

  .stage:nth-child(3n + 1) {
    padding-left: 0;
  }

  .stage:nth-child(n + 4) {
    border-bottom: none;
  }
}

@media (min-width: 1200px) {
  .stage {
    border-bottom: none;
  }

  .stage:nth-child(3n) {
    border-right: 1px solid var(--border);
    padding-right: 24px;
  }

  .stage:nth-child(3n + 1) {
    padding-left: 24px;
  }

  .stage:first-child {
    padding-left: 0;
  }

  .stage:last-child {
    border-right: none;
    padding-right: 0;
  }
}

.stage .eyebrow-mono {
  color: var(--signal);
}

.stage h3 {
  margin-top: 14px;
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  color: var(--text-strong);
}

.stage .who {
  margin-top: 6px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 18px;
  color: var(--text-mute);
}

.stage p.what {
  margin-top: 12px;
  font-size: 14px;
  line-height: 22px;
  color: var(--text-soft);
}

/* Receipts — the shipped/spec seams between products. */
.receipts {
  margin-top: 56px;
  border: 1px solid var(--border-quiet);
  background: var(--surface-canvas);
  border-radius: 12px;
  padding: 28px;
}

.receipts ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.receipts li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 15px;
  line-height: 24px;
  color: var(--text-soft);
}

.receipts li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--signal);
  flex-shrink: 0;
  transform: translateY(-2px);
}

.receipts .fig-caption {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-quiet);
}

/* ---------- Ways-in (invest ribbon) ---------- */
.ways-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 900px) {
  .ways-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.way-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 32px;
}

.way-card .eyebrow-mono {
  color: var(--signal);
}

.way-card h3 {
  font-size: 22px;
  line-height: 30px;
  font-weight: 700;
  color: var(--text-strong);
}

.way-card p {
  font-size: 15px;
  line-height: 25px;
  color: var(--text-soft);
}

.way-card .link-arrow {
  margin-top: auto;
  padding-top: 12px;
}

/* ---------- Operator strip ---------- */
.operator {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}

@media (min-width: 900px) {
  .operator {
    grid-template-columns: 1.2fr 1fr;
    gap: 80px;
  }
}

.operator .facts {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.operator .facts li {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-quiet);
  font-size: 15px;
  line-height: 24px;
}

.operator .facts li:first-child {
  border-top: 1px solid var(--border-quiet);
}

.operator .facts .k {
  color: var(--text-mute);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 3px;
  white-space: nowrap;
}

.operator .facts .v {
  color: var(--text);
  text-align: right;
}

/* ---------- Footer ---------- */
footer {
  padding: 56px 20px 64px;
}

@media (min-width: 1024px) {
  footer {
    padding: 56px 64px 64px;
  }
}

footer .footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 640px) {
  footer .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

footer .footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-soft);
}

footer .footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
}

/* ---------- Enter animations ---------- */
.h1-lift {
  opacity: 0;
  transform: translateY(20px);
  animation: lift 700ms cubic-bezier(0.32, 0.72, 0, 1) 200ms forwards;
}

.fade-in {
  opacity: 0;
  transform: translateY(6px);
  animation: hero-fade 500ms cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

.fade-in.d-0 {
  animation-delay: 0ms;
}

.fade-in.d-1 {
  animation-delay: 500ms;
}

.fade-in.d-2 {
  animation-delay: 650ms;
}

.fade-in.d-3 {
  animation-delay: 900ms;
}

@keyframes lift {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-fade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Utilities ---------- */
.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 16px;
  background: var(--surface);
  color: var(--text-strong);
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  z-index: 60;
}

.center-screen {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  .h1-lift,
  .fade-in {
    opacity: 1;
    transform: none;
  }

  /* Still rocket instead of motion — the .hero poster shows through. */
  .hero-video {
    display: none;
  }
}
