:root {
  --bg: #000;
  --mint: #8efcd4;
  --hot: #f4fff9;
  --dim: #3c9a78;
  --mid: #c9ffe8;
  --line: rgba(142, 252, 212, 0.28);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--mint);
  overflow-x: hidden;
}

::selection {
  background: #145c44;
  color: var(--hot);
}

body {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 400;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--mint);
  z-index: 6;
  pointer-events: none;
}

a {
  color: var(--mint);
  text-decoration: none;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
}

a:hover { color: var(--hot); }

a:focus-visible {
  outline: 1px solid var(--mint);
  outline-offset: 4px;
}

.field {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr min(40rem, 100%) 1fr;
  pointer-events: none;
  z-index: 0;
}

.field img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.field .left {
  -webkit-mask-image: linear-gradient(90deg, #000 42%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 42%, transparent 100%);
}

.field .right {
  -webkit-mask-image: linear-gradient(270deg, #000 42%, transparent 100%);
  mask-image: linear-gradient(270deg, #000 42%, transparent 100%);
}

.field .mid { background: #000; }

.scrim { display: none; }

.tear {
  display: none;
  position: fixed;
  top: 40vh;
  left: 0;
  width: 16vw;
  height: 2px;
  z-index: 5;
  pointer-events: none;
  background: var(--hot);
  box-shadow: 0 0 10px var(--mint);
}

header, main { position: relative; z-index: 2; }

header {
  width: min(40rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.15rem 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

main {
  width: min(40rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.kicker {
  margin: 0;
  color: var(--dim);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
}

h1 {
  margin: 0.45rem 0 0.85rem;
  font-size: clamp(1.85rem, 5vw, 3.25rem);
  font-weight: 500;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: var(--hot);
  line-height: 1;
}

.ch {
  display: inline-block;
  width: 1ch;
  text-align: center;
}

.ch .g {
  display: block;
  width: 0.78em;
  height: 0.78em;
  margin: 0 auto;
  position: relative;
  top: 0.13em;
  opacity: 1;
}

.lead, .sub {
  margin: 0 auto;
  max-width: 34em;
  font-size: 0.92rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

.lead { color: var(--mid); }

.sub {
  margin-top: 0.35rem;
  color: #6fceb0;
}

.stream {
  margin-top: 1.35rem;
  text-align: left;
}

.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1.6rem;
}

.note {
  height: 14px;
  margin-bottom: 5px;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.14em;
  opacity: 0;
}

.note::before { content: "// "; }

.note.on { opacity: 1; }

.block { margin-bottom: 0.85rem; }

.words {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.7rem;
  min-height: 20px;
}

.word {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.g {
  width: 22px;
  height: 22px;
  display: block;
  overflow: visible;
  opacity: 0;
  color: var(--mint);
  filter: drop-shadow(0 0 1px rgba(142, 252, 212, 0.75));
}

.g.on { opacity: 1; }

.g.hot { color: var(--hot); }

.caret {
  width: 7px;
  height: 15px;
  background: var(--mint);
  box-shadow: 0 0 6px rgba(142, 252, 212, 0.85);
  animation: blink 1.05s steps(1, end) infinite;
  flex: none;
}

@keyframes blink {
  0%, 45% { opacity: 1; }
  45.01%, 100% { opacity: 0; }
}

footer {
  position: relative;
  z-index: 2;
  height: 78px;
  overflow: hidden;
  background: #000;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
}

.track {
  display: flex;
  width: max-content;
  transform: translate3d(var(--x, 0px), 0, 0);
  will-change: transform;
}

.track img {
  height: 62px;
  width: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

body.hitch::before { clip-path: inset(0 28% 0 6%); }

body.hitch .field .left { transform: translateX(-12px); }
body.hitch .field .right { transform: translateX(10px); }
body.hitch h1 { transform: translateX(2px); text-shadow: 3px 0 #eafff8, -2px 0 #145c44; }
body.hitch .stream { transform: translateX(-5px); filter: brightness(1.45); }
body.hitch .track { transform: translate3d(calc(var(--x, 0px) + 11px), 0, 0); }

body.frozen .caret { animation: none; opacity: 1; }
body.frozen::before { height: 3px; }
body.torn .tear { display: block; }

@media (max-width: 760px) {
  .field {
    display: block;
    opacity: 0.42;
  }

  .field .mid,
  .field .right { display: none; }

  .field .left {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    -webkit-mask-image: none;
    mask-image: none;
    object-fit: cover;
  }

  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.78);
    pointer-events: none;
  }

  .cols { gap: 0.2rem 0.8rem; }
  .words { flex-wrap: wrap; }
  .g { width: 16px; height: 16px; }
  h1 { letter-spacing: 0.16em; text-indent: 0.16em; }
  footer { height: 64px; }
  .track img { height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
  body.hitch h1,
  body.hitch .stream,
  body.hitch .field .left,
  body.hitch .field .right { transform: none; filter: none; text-shadow: none; }
}
