@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/SpaceGrotesk.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

@view-transition { navigation: auto; }

:root {
  --bg: #000000;
  --surface-1: #0b0b0b;
  --surface-2: #141414;
  --surface-3: #1b1b1b;
  --line: #222222;
  --line-strong: #333333;

  --text: #e8e4dc;
  --text-dim: #8a8681;
  --text-faint: #7a7671;

  --t-rust: #c2542b;
  --t-teal: #3f8f8c;
  --t-mustard: #c9992b;
  --t-dusty: #8f3a3a;
  --t-bone: #bdb8b0;
  --t-blue: #2f6bd8;

  --t-rust-lit: #e8814f;
  --t-teal-lit: #4fb3ae;
  --t-mustard-lit: #d9ad3f;
  --t-dusty-lit: #d06a6a;
  --t-blue-lit: #6f9dff;

  --accent: var(--t-blue-lit);
  --accent-deep: var(--t-blue);

  --radius: 3px;
  --ui: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --gutter: clamp(20px, 4vw, 48px);
  --max: 1240px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

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

#threads {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 1;
}

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

.mono { font-family: var(--mono); font-feature-settings: 'zero' 1; }

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin: 0 0 18px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(#000 60%, rgba(0, 0, 0, 0));
}

.bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.wordmark {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.wordmark-mark {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.wordmark-mark path { transition: transform .6s var(--ease-out); transform-origin: center; }
.wordmark:hover .wordmark-mark path:nth-child(2) { transform: rotate(60deg); }

.nav {
  display: flex;
  gap: 4px;
}

.nav a {
  position: relative;
  font-size: 14px;
  color: var(--text-faint);
  padding: 10px 14px;
  transition: color .15s linear;
}

.nav a:hover { color: var(--text); }
.nav a[aria-current='page'] { color: var(--text); }

.nav a::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}

.nav a:hover::after { transform: scaleX(.4); }
.nav a[aria-current='page']::after { transform: scaleX(1); }

.clock {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--t-teal-lit);
  position: relative;
}

.dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--t-teal-lit);
  animation: ping 2.4s var(--ease) infinite;
}

@keyframes ping {
  0% { transform: scale(.4); opacity: .9; }
  80%, 100% { transform: scale(1.6); opacity: 0; }
}

.rule {
  height: 1px;
  background: var(--line);
  transform-origin: left;
}

.rule-draw { transform: scaleX(0); transition: transform 1.1s var(--ease-out); }
.is-in .rule-draw, .rule-draw.is-in { transform: scaleX(1); }

h1, h2, h3 { font-weight: 500; margin: 0; }

.display {
  font-size: clamp(64px, 13vw, 184px);
  line-height: .92;
  letter-spacing: -0.045em;
  font-weight: 500;
}

.h1 {
  font-size: clamp(38px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.h2 {
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.lede {
  color: var(--text-dim);
  font-size: clamp(16px, 1.5vw, 19px);
  max-width: 54ch;
  margin: 22px 0 0;
}

.accent { color: var(--accent); }

.split { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .06em; margin-bottom: -.06em; }
.split > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 45ms + var(--d, 0ms));
}
.is-ready .split > span { transform: none; }

.rise {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.is-ready .rise, .rise.is-in { opacity: 1; transform: none; }

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .15s linear, border-color .15s linear, color .15s linear;
}

.btn-primary { background: var(--text); color: #000; border-color: var(--text); }
.btn-primary:hover { background: #fff; border-color: #fff; }

.btn-blue { background: var(--accent-deep); color: #fff; border-color: var(--accent-deep); }
.btn-blue:hover { background: #3c7cf0; border-color: #3c7cf0; }

.btn-secondary { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--text-dim); background: var(--surface-2); }

.btn .arrow { transition: transform .3s var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }

.section { padding: clamp(80px, 11vw, 150px) 0 0; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}

.section-head p { color: var(--text-dim); max-width: 46ch; margin: 12px 0 0; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 46px;
}

.stat { background: rgba(11, 11, 11, .88); padding: 18px 20px 20px; }
.stat-value { display: block; font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-label { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-top: 4px; }

.foot {
  margin-top: clamp(100px, 12vw, 170px);
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: 13px;
}

.foot a:hover { color: var(--text); }
.foot-links { display: flex; gap: 22px; }

.contact {
  position: relative;
  border: 1px solid var(--line);
  background: rgba(11, 11, 11, .9);
  padding: clamp(28px, 5vw, 56px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  align-items: end;
  overflow: hidden;
}

.contact::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--t-blue), var(--t-teal), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.4s var(--ease-out);
}

.contact.is-in::before { transform: scaleX(1); }
.contact p { color: var(--text-dim); margin: 14px 0 0; max-width: 46ch; }
.contact-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  transition: width .25s var(--ease-out), height .25s var(--ease-out), margin .25s var(--ease-out), opacity .2s linear, background-color .2s linear;
}

.cursor.is-on { opacity: .7; }
.cursor.is-hover { width: 54px; height: 54px; margin: -27px 0 0 -27px; background: rgba(47, 107, 216, .08); }

@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 200;
  background: var(--text);
  color: #000;
  padding: 8px 14px;
}
.skip:focus { left: 8px; }

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: var(--surface-3); }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }

.home {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.home-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 4vh;
  padding-bottom: 6vh;
}

.home-sub {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}

.choose-label {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: clamp(46px, 8vh, 90px) 0 18px;
}

.choose-label .rule { flex: 1; }

.choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 16px;
}

.choice {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 28px 28px 28px 26px;
  background: rgba(11, 11, 11, .92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s linear, background-color .2s linear, transform .5s var(--ease-out);
  transform-style: preserve-3d;
  will-change: transform;
}

.choice::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--thread, var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .6s var(--ease-out);
}

.choice::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(47, 107, 216, .13), transparent 60%);
  opacity: 0;
  transition: opacity .3s linear;
  pointer-events: none;
}

.choice:hover { border-color: var(--line-strong); background: rgba(20, 20, 20, .95); }
.choice:hover::before, .choice:focus-visible::before { transform: scaleX(1); }
.choice:hover::after { opacity: 1; }

.choice-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--thread, var(--accent));
  background: #000;
  transition: border-color .2s linear;
}

.choice:hover .choice-icon { border-color: var(--thread, var(--accent)); }
.choice-icon svg { width: 34px; height: 34px; overflow: visible; }
.choice-icon svg * { fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

.icon-draw * {
  stroke-dasharray: var(--len, 120);
  stroke-dashoffset: var(--len, 120);
  animation: draw 1.4s var(--ease-out) forwards;
  animation-delay: calc(var(--d, 0ms) + 600ms);
}

@keyframes draw { to { stroke-dashoffset: 0; } }

.choice:hover .icon-code .chev-l { transform: translateX(-3px); }
.choice:hover .icon-code .chev-r { transform: translateX(3px); }
.choice:hover .icon-code .slash { transform: rotate(8deg); }
.icon-code .chev-l, .icon-code .chev-r, .icon-code .slash { transition: transform .45s var(--ease-out); transform-box: fill-box; transform-origin: center; }

.icon-model { animation: spin-y 9s linear infinite; transform-origin: center; }
.choice:hover .icon-model { animation-duration: 2.4s; }

@keyframes spin-y {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.choice-title { font-size: 24px; letter-spacing: -0.015em; display: block; }
.choice-desc { color: var(--text-dim); font-size: 14px; display: block; margin-top: 4px; }
.choice-meta { font-family: var(--mono); font-size: 12px; color: var(--text-faint); display: block; margin-top: 12px; }
.choice-meta b { color: var(--text); font-weight: 500; }

.choice-arrow {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  transition: transform .45s var(--ease-out), background-color .2s linear, color .2s linear, border-color .2s linear;
}

.choice:hover .choice-arrow { transform: translateX(4px); background: var(--thread, var(--accent)); border-color: var(--thread, var(--accent)); color: #000; }

.choice-soon {
  grid-column: 1 / -1;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 12px 18px;
  border-style: dashed;
  background: transparent;
  cursor: default;
}

.choice-soon .choice-icon { width: 30px; height: 30px; }
.choice-soon .choice-icon svg { width: 16px; height: 16px; }
.choice-soon .choice-title { display: inline; font-size: 14px; margin-right: 10px; }
.choice-soon .choice-desc { display: inline; font-size: 13px; }

.choice-soon:hover { background: transparent; border-color: var(--line-strong); }
.choice-soon .choice-icon { border-style: dashed; color: var(--text-faint); }
.choice-soon .choice-title { color: var(--text-faint); }

.home-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px 0 30px;
  color: var(--text-faint);
  font-size: 13px;
  border-top: 1px solid var(--line);
}

.leaving .page { opacity: 0; transform: translateY(-10px); transition: opacity .35s linear, transform .35s var(--ease); }

@media (max-width: 760px) {
  .nav a { padding: 10px 8px; }
  .nav a::after { left: 8px; right: 8px; }
  .clock-text { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact { grid-template-columns: 1fr; }
  .choice { grid-template-columns: auto 1fr; padding: 22px; gap: 18px; }
  .choice-arrow { display: none; }
  .choice-icon { width: 54px; height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0ms !important;
  }
}
