/* ============================================================================
   WRAITHGRID design system
   Brand purple comes from the WRAITH wallet mark; teal is the telemetry layer -
   the colour the hardware itself is lit with in every photograph on the site.
   ========================================================================= */

:root {
  --ground: #06070b;
  --ground-2: #090b12;
  --panel: #0d0f16;
  --panel-2: #12151f;
  --line: #1b1f2c;
  --line-soft: #14181f;
  --ink: #eaeef7;
  --dim: #868fa6;
  --dimmer: #5b6478;

  --wraith: #9b4de0;
  --wraith-deep: #6b2e9e;
  --wraith-glow: rgba(155, 77, 224, 0.35);
  --teal: #6fe3d2;
  --teal-deep: #2b6b63;
  --amber: #f5b544;
  --red: #ff6b6b;
  --green: #6ee7a8;

  --display: "Sora", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "Source Serif 4", ui-serif, Georgia, serif;

  --max: 1240px;
  --gut: clamp(20px, 4vw, 48px);
  --r: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

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

/* ------------------------------------------------------------------ layout */

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }

section { position: relative; }

/* The nav is fixed, so anchor jumps must clear it. */
section[id], article.body h2[id] { scroll-margin-top: 92px; }

.band { padding: clamp(72px, 11vw, 140px) 0; }
.band + .band { border-top: 1px solid var(--line-soft); }

/* -------------------------------------------------------------- typography */

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }

h1 { font-size: clamp(38px, 7.2vw, 84px); line-height: 0.98; font-weight: 700; }
h2 { font-size: clamp(28px, 4.4vw, 50px); line-height: 1.06; }
h3 { font-size: clamp(19px, 2vw, 23px); line-height: 1.25; }

p { margin: 0 0 18px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--teal), transparent);
}

.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--dim); max-width: 60ch; }
.small { font-size: 14px; color: var(--dim); }
.mono { font-family: var(--mono); }

.grad {
  background: linear-gradient(96deg, var(--ink) 20%, var(--wraith) 62%, var(--teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--display);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--wraith); }

.btn.primary {
  background: linear-gradient(135deg, var(--wraith-deep), var(--wraith));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 30px -12px var(--wraith-glow);
}
.btn.primary:hover { box-shadow: 0 18px 44px -14px var(--wraith-glow); }

.btn.ghost { background: transparent; }

/* -------------------------------------------------------------------- nav */

header.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  backdrop-filter: blur(14px);
  background: rgba(6, 7, 11, 0.6);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
header.nav.stuck { background: rgba(6, 7, 11, 0.9); border-bottom-color: var(--line); }

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px var(--gut);
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand { display: flex; align-items: center; gap: 11px; font-weight: 600; letter-spacing: 0.02em; }
.brand img { width: 30px; height: 30px; filter: drop-shadow(0 0 12px var(--wraith-glow)); }
.brand span { font-size: 16px; }
.brand small {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--dimmer);
  display: block;
  margin-top: -2px;
}

.nav-links { display: none; gap: 26px; margin-left: auto; }
@media (min-width: 900px) { .nav-links { display: flex; } }
.nav-links a { font-size: 14px; color: var(--dim); transition: color 0.2s; }
.nav-links a:hover { color: var(--ink); }

.nav-cta { margin-left: auto; }
@media (min-width: 900px) { .nav-cta { margin-left: 0; } }

/* ------------------------------------------------------------------- hero */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px 0 60px;
  overflow: hidden;
}

.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media video,
.hero-media img.fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.32;
  filter: saturate(1.15) contrast(1.05);
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, transparent 20%, var(--ground) 78%),
    linear-gradient(180deg, rgba(6, 7, 11, 0.5) 0%, rgba(6, 7, 11, 0.25) 40%, var(--ground) 96%);
}

#gridCanvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; display: block; }

/* Scrim between the WebGL layer and the copy. Without it the headline competes with 2,600
   glowing points and legibility loses. */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--ground) 8%, rgba(6, 7, 11, 0.72) 38%, transparent 68%),
    linear-gradient(180deg, rgba(6, 7, 11, 0.55), transparent 30%, rgba(6, 7, 11, 0.65));
}
@media (max-width: 999px) {
  .hero-scrim { background: linear-gradient(180deg, rgba(6, 7, 11, 0.86) 42%, rgba(6, 7, 11, 0.5)); }
}

.hero .wrap { position: relative; z-index: 2; }

.hero h1 { margin-bottom: 22px; max-width: 15ch; }
.hero .lede { max-width: 54ch; margin-bottom: 34px; font-size: clamp(17px, 1.8vw, 21px); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 46px; }

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--dimmer);
  text-transform: uppercase;
}
.trust b { color: var(--teal); font-weight: 500; }

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 2;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--dimmer);
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.scroll-hint i {
  width: 1px;
  height: 34px;
  background: linear-gradient(180deg, var(--teal), transparent);
  animation: drip 2.4s var(--ease) infinite;
}
@keyframes drip {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}

/* ------------------------------------------------------------------ cards */

.grid2 { display: grid; gap: 22px; }
@media (min-width: 860px) { .grid2 { grid-template-columns: 1fr 1fr; gap: 26px; } }

.grid3 { display: grid; gap: 18px; }
@media (min-width: 780px) { .grid3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  position: relative;
  background: linear-gradient(180deg, var(--panel), var(--ground-2));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 26px;
  overflow: hidden;
  transition: border-color 0.35s, transform 0.35s var(--ease);
}
.card:hover { border-color: #2a3145; transform: translateY(-3px); }
.card > :last-child { margin-bottom: 0; }

.card.feature { padding: 0; }
.card.feature .shot { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.card.feature .shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 1.1s var(--ease);
}
.card.feature:hover .shot img { transform: scale(1.07); }
.card.feature .shot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, var(--panel) 98%);
}
.card.feature .body { padding: 24px 26px 28px; margin-top: -46px; position: relative; z-index: 2; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--dim);
  background: rgba(6, 7, 11, 0.7);
}
.tag.soul { color: var(--wraith); border-color: rgba(155, 77, 224, 0.4); }
.tag.shell { color: var(--teal); border-color: rgba(111, 227, 210, 0.35); }

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

.stats { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--panel); padding: 26px 24px; }
.stat .n {
  font-family: var(--mono);
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 8px;
}
.stat .n em { font-style: normal; color: var(--teal); font-size: 0.6em; }
.stat .l { font-size: 13px; color: var(--dim); }

/* ------------------------------------------------------- liveness timeline */

.timeline { position: relative; margin-top: 40px; overflow-x: auto; padding-bottom: 8px; }
.track { min-width: 720px; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; padding-top: 42px; }
.track::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--green), var(--teal) 30%, var(--amber) 66%, var(--red));
  opacity: 0.5;
}
.track::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 14px var(--teal);
  animation: sweep 6s linear infinite;
}
@keyframes sweep { 0% { left: 0; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { left: 100%; opacity: 0; } }

.stop { position: relative; padding-right: 18px; }
.stop::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ground);
  border: 2px solid var(--teal);
}
.stop.warn::before { border-color: var(--amber); }
.stop.bad::before { border-color: var(--red); }
.stop .t { font-family: var(--mono); font-size: 12px; color: var(--teal); display: block; margin-bottom: 6px; letter-spacing: 0.08em; }
.stop.warn .t { color: var(--amber); }
.stop.bad .t { color: var(--red); }
.stop .s { font-weight: 600; display: block; margin-bottom: 6px; }
.stop .d { font-size: 13.5px; color: var(--dim); line-height: 1.5; }

/* ------------------------------------------------------------------ loops */

.loop { display: grid; gap: 14px; margin-top: 34px; }
@media (min-width: 820px) { .loop { grid-template-columns: repeat(4, 1fr); align-items: stretch; } }
.loop .node {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  background: var(--panel);
  position: relative;
}
.loop .node .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--wraith); margin-bottom: 10px; }
.loop .node p { font-size: 14px; color: var(--dim); margin: 0; }
.loop .node::after {
  content: "→";
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dimmer);
  font-size: 15px;
  display: none;
}
@media (min-width: 820px) { .loop .node:not(:last-child)::after { display: block; } }

/* ---------------------------------------------------------------- marquee */

.marquee { overflow: hidden; border-block: 1px solid var(--line-soft); padding: 16px 0; }
.marquee-inner { display: flex; gap: 42px; width: max-content; animation: slide 42s linear infinite; }
.marquee span {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dimmer);
  white-space: nowrap;
}
.marquee span b { color: var(--dim); font-weight: 400; }
@keyframes slide { to { transform: translateX(-50%); } }

/* --------------------------------------------------------------- reveals */

.rise { opacity: 0; transform: translateY(22px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.rise.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ glow */

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.glow.p { background: var(--wraith); }
.glow.t { background: var(--teal); }

/* ---------------------------------------------------------------- tables */

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); margin: 26px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--panel); min-width: 540px; }
th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 400;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 13px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: top; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
td.num { text-align: right; font-family: var(--mono); white-space: nowrap; }

/* ---------------------------------------------------------------- footer */

footer.site { border-top: 1px solid var(--line); padding: 56px 0 40px; background: var(--ground-2); }
.foot { display: grid; gap: 32px; }
@media (min-width: 780px) { .foot { grid-template-columns: 2fr 1fr 1fr; } }
.foot h5 { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dimmer); margin: 0 0 14px; font-weight: 400; }
.foot a { display: block; font-size: 14px; color: var(--dim); margin-bottom: 9px; transition: color 0.2s; }
.foot a:hover { color: var(--teal); }
.legal { margin-top: 42px; padding-top: 22px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--dimmer); }

/* --------------------------------------------------------------- a11y */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .rise { opacity: 1; transform: none; }
}
