@font-face {
  font-family: "Archivo Stipend";
  src: url("/fonts/archivo-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono Stipend";
  src: url("/fonts/jetbrains-mono-variable.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --black: #000;
  --white: #fff;
  --warm-white: #f4f4f0;
  --gray: #a3a39e;
  --dim: #666762;
  --line: rgba(255, 255, 255, 0.34);
  --line-soft: rgba(255, 255, 255, 0.14);
  --denied: #ff3b30;
  --allowed: #42ff88;
  --display: "Archivo Stipend", "Arial Narrow", sans-serif;
  --mono: "JetBrains Mono Stipend", "Cascadia Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--black);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--black);
  color: var(--warm-white);
  font-family: var(--mono);
}

a {
  color: inherit;
}

button {
  color: inherit;
  font: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 4px;
}

.site-header {
  position: fixed;
  z-index: 60;
  top: 18px;
  right: 20px;
  left: 20px;
  display: flex;
  height: 66px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(12px, 2vw, 28px);
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.86);
  isolation: isolate;
  transform: translateZ(0);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 760;
  letter-spacing: 0.18em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand img {
  display: block;
  width: 150px;
  height: 54px;
  object-fit: contain;
}

.open-app,
.final-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--white);
  background: var(--black);
  color: var(--white);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 140ms steps(2, end), color 140ms steps(2, end);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.open-app {
  position: relative;
  z-index: 1;
}

.header-actions .social-link {
  min-width: 44px;
  padding-inline: 0;
}

.buy-stipend {
  border-color: var(--allowed);
  color: var(--allowed);
  cursor: pointer;
}

.buy-stipend:hover {
  background: var(--allowed) !important;
  color: var(--black) !important;
}

.open-app:hover,
.final-action:hover {
  background: var(--white);
  color: var(--black);
}

.page-progress {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  overflow: hidden;
}

.page-progress i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--white);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.buy-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--white);
  background: var(--black);
  color: var(--warm-white);
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.8);
}

.buy-dialog::backdrop {
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
}

.buy-dialog-bar {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--gray);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.buy-dialog-bar button {
  align-self: stretch;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font-size: 9px;
  text-transform: uppercase;
}

.buy-dialog-bar button:hover {
  background: var(--white);
  color: var(--black);
}

.buy-dialog-body {
  padding: 34px;
}

.buy-dialog-body h2 {
  margin: 0;
  font: 720 clamp(32px, 6vw, 48px)/0.96 var(--display);
  letter-spacing: -0.035em;
}

.buy-dialog-body > p {
  margin: 18px 0 0;
  color: var(--gray);
  font-size: 12px;
  line-height: 1.7;
}

.token-contract {
  display: grid;
  margin-top: 24px;
  border-top: 1px solid var(--white);
  border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(0, 1fr) auto;
}

.token-contract code {
  min-width: 0;
  padding: 18px 16px 18px 0;
  overflow-wrap: anywhere;
  color: var(--white);
  font: 500 11px/1.6 var(--mono);
  user-select: all;
}

.token-contract button {
  min-width: 92px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: 600 9px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.token-contract button:hover {
  background: var(--white);
  color: var(--black);
}

.buy-dialog-body .token-copy-status {
  min-height: 20px;
  margin-top: 10px;
  font-size: 10px;
}

.terminal-chrome {
  position: fixed;
  z-index: 35;
  inset: 18px;
  border: 1px solid var(--line);
  pointer-events: none;
}

.terminal-chrome::before,
.terminal-chrome::after {
  position: absolute;
  right: 50%;
  width: 1px;
  height: 10px;
  background: var(--line);
  content: "";
}

.terminal-chrome::before {
  top: -1px;
}

.terminal-chrome::after {
  bottom: -1px;
}

.glyph {
  position: absolute;
  color: var(--gray);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.glyph-a {
  top: -14px;
  left: 16px;
}

.glyph-b {
  top: -14px;
  left: 28%;
}

.glyph-c {
  right: 11%;
  bottom: -14px;
}

.glyph-d {
  right: 16px;
  bottom: -14px;
}

.film-stage {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  background: var(--black);
  pointer-events: none;
}

.film-scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  will-change: opacity;
}

.film-scene:first-child {
  opacity: 1;
}

.film-scene img,
.film-scene video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.film-scene video {
  opacity: 0;
}

.film-scene.is-live video {
  opacity: 1;
}

#world {
  position: relative;
  z-index: 10;
}

.chapter {
  position: relative;
  min-height: 170vh;
}

.chapter-viewport {
  position: sticky;
  top: 0;
  display: flex;
  width: 100%;
  height: 100svh;
  align-items: center;
  padding: 104px clamp(42px, 7vw, 112px) 60px;
}

.chapter-intro {
  min-height: 150vh;
}

.intro-copy {
  width: min(48vw, 700px);
  margin-left: auto;
  padding-right: 4vw;
  text-align: left;
  text-shadow: 0 2px 22px #000, 0 0 60px #000;
}

.terminal-line {
  margin: 0 0 18px;
  color: var(--gray);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.intro-copy h1 {
  max-width: 7ch;
  margin: 0;
  color: var(--white);
  font-family: var(--display);
  font-size: clamp(70px, 9.3vw, 150px);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 0.86;
}

.hero-subtitle {
  margin: 28px 0 0;
  color: var(--warm-white);
  font-size: clamp(15px, 1.35vw, 21px);
  letter-spacing: 0.04em;
}

.scroll-cue {
  display: flex;
  width: min(320px, 100%);
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  margin-top: 42px;
  padding-left: 18px;
  border: 1px solid var(--line);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color 140ms steps(2, end), background 140ms steps(2, end);
}

.scroll-cue:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}

.scroll-cue i {
  position: relative;
  width: 46px;
  align-self: stretch;
  border-left: 1px solid var(--line);
}

.scroll-cue i::after {
  position: absolute;
  top: 10px;
  left: 21px;
  width: 3px;
  height: 9px;
  background: var(--white);
  content: "";
  animation: cue-scan 1.6s steps(5, end) infinite;
}

@keyframes cue-scan {
  70%,
  100% {
    top: 36px;
    opacity: 0;
  }
}

.chapter-copy {
  position: relative;
  width: min(38vw, 530px);
  text-shadow: 0 2px 16px #000, 0 0 46px #000, 0 0 80px #000;
}

.chapter-copy::before {
  position: absolute;
  z-index: -1;
  inset: -42px -54px;
  background: rgba(0, 0, 0, 0.62);
  box-shadow: 0 0 52px 48px rgba(0, 0, 0, 0.62);
  content: "";
}

.chapter-copy-left {
  margin-right: auto;
}

.chapter-copy-right {
  margin-left: auto;
}

.chapter-copy-wide {
  width: min(44vw, 660px);
}

.chapter-copy h2 {
  max-width: 12ch;
  margin: 0;
  color: var(--white);
  font-family: var(--display);
  font-size: clamp(42px, 5.4vw, 84px);
  font-weight: 730;
  letter-spacing: -0.035em;
  line-height: 0.94;
}

.chapter-copy > p {
  max-width: 56ch;
  margin: 28px 0 0;
  color: var(--warm-white);
  font-size: clamp(13px, 1.05vw, 17px);
  line-height: 1.72;
}

.control-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 30px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.control-signals li {
  flex: 1 1 32%;
  min-width: 130px;
  padding: 12px 14px;
  border-right: 1px solid var(--line-soft);
  color: var(--gray);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.decision-readout {
  display: grid;
  margin-top: 30px;
  border-top: 1px solid var(--line);
}

.decision-readout span {
  display: flex;
  min-height: 42px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  color: var(--gray);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.signal {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 12px;
}

.signal-denied {
  background: var(--denied);
  box-shadow: 0 0 14px rgba(255, 59, 48, 0.78);
}

.signal-allowed {
  background: var(--allowed);
  box-shadow: 0 0 14px rgba(66, 255, 136, 0.72);
}

.command-shell {
  display: grid;
  margin-top: 30px;
  border-top: 1px solid var(--white);
  border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(0, 1fr) auto;
}

.command-shell code {
  display: flex;
  min-height: 76px;
  align-items: center;
  padding: 16px 18px 16px 0;
  overflow-wrap: anywhere;
  color: var(--white);
  font: 500 clamp(10px, 0.8vw, 13px)/1.55 var(--mono);
}

.command-shell button {
  min-width: 112px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--gray);
  cursor: pointer;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.command-shell button:hover {
  background: var(--white);
  color: var(--black);
}

.copy-status {
  min-height: 22px;
  margin-top: 10px !important;
  color: var(--gray) !important;
  font-size: 10px !important;
}

.control-readout {
  margin: 30px 0 0;
  border-top: 1px solid var(--white);
}

.control-readout div {
  display: grid;
  min-height: 42px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  grid-template-columns: 110px 1fr;
}

.control-readout dt {
  color: var(--gray);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-readout dd {
  margin: 0;
  color: var(--white);
  font-size: 11px;
}

.chapter-final {
  min-height: 180vh;
}

.final-copy .final-action {
  margin-top: 34px;
}

@media (max-width: 860px) {
  .site-header {
    top: 10px;
    right: 10px;
    left: 10px;
    height: 60px;
  }

  .terminal-chrome {
    inset: 10px;
  }

  .brand img {
    width: 112px;
    height: 34px;
  }

  .header-actions {
    gap: 4px;
  }

  .open-app {
    min-height: 38px;
    padding: 0 9px;
    font-size: 9px;
  }

  .chapter,
  .chapter-intro,
  .chapter-final {
    min-height: 135vh;
  }

  .chapter-viewport {
    align-items: flex-end;
    padding: 88px 24px max(80px, 12svh);
  }

  .intro-copy,
  .chapter-copy,
  .chapter-copy-wide {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .intro-copy {
    align-self: center;
  }

  .intro-copy h1 {
    font-size: clamp(58px, 19vw, 94px);
  }

  .chapter-copy h2 {
    font-size: clamp(40px, 12vw, 66px);
  }

  .chapter-copy::before {
    inset: -28px -24px;
    background: rgba(0, 0, 0, 0.78);
    box-shadow: 0 0 34px 28px rgba(0, 0, 0, 0.78);
  }

  .film-scene img,
  .film-scene video {
    object-position: center;
  }

  .control-signals li {
    flex-basis: 50%;
  }

  .command-shell {
    grid-template-columns: 1fr;
  }

  .command-shell code {
    padding-right: 0;
  }

  .command-shell button {
    min-height: 44px;
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }

  .buy-dialog-body {
    padding: 26px 22px;
  }

  .token-contract {
    grid-template-columns: 1fr;
  }

  .token-contract button {
    min-height: 44px;
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }
}

@media (max-width: 540px) {
  .site-header {
    padding-inline: 8px;
  }

  .site-header .brand {
    display: none;
  }

  .header-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr) 40px;
    width: 100%;
  }

  .open-app {
    min-width: 0;
  }

  .header-actions .social-link {
    min-width: 0;
  }

  .open-app {
    padding-inline: 7px;
    letter-spacing: 0.04em;
  }
}

@media (max-width: 380px) {
  .site-header {
    right: 6px;
    left: 6px;
    padding-inline: 4px;
  }

  .brand img {
    width: 58px;
  }

  .header-actions {
    gap: 2px;
  }

  .open-app {
    min-height: 36px;
    padding-inline: 5px;
    font-size: 9px;
  }
}

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

  .scroll-cue i::after {
    animation: none;
  }

  .film-scene video {
    display: none;
  }
}
