:root {
  --bg: #1b1916;
  --bar: #2c2924;
  --ink: #e8ddd0;
  --mute: #a89888;
  --ascii: #3d3832;
  --head: #f4ece3;
  --mark: #8f8578;
}

:root.light {
  --bg: #f3eee7;
  --bar: #e4ddd3;
  --ink: #2a241c;
  --mute: #6f6458;
  --ascii: #c9c0b4;
  --head: #1c1814;
  --mark: #3a342c;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  background: var(--bg);
  color: var(--ink);
  min-height: 100%;
}

body {
  font-family: Newsreader, Georgia, serif;
  overflow-x: hidden;
}

.cursor {
  position: fixed;
  width: 10px;
  height: 10px;
  border: 1px solid var(--head);
  border-radius: 50%;
  pointer-events: none;
  z-index: 50;
  transform: translate(-50%, -50%);
}

.dim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  z-index: 35;
  transition: opacity 0.2s ease;
}

.dim.on {
  opacity: 1;
}

.toast {
  position: fixed;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%) scale(0.92);
  max-width: min(90vw, 56ch);
  padding: 1rem;
  color: var(--head);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 0.02em;
  line-height: 1.45;
  text-align: left;
  white-space: pre;
  opacity: 0;
  pointer-events: none;
  z-index: 40;
}

.toast pre {
  margin: 0;
  font: inherit;
  white-space: pre;
}

.toast.show {
  animation: popupFade var(--popup-duration, 1s) ease both;
  pointer-events: auto;
}

  .toast a {
  color: var(--head);
  }

@keyframes popupFade {
  0% {
    opacity: 0;
    transform: translate(-50%, -46%);
  }

  18%, 78% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%);
  }
}

.chrome {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: var(--bar);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.tabs {
  display: flex;
  height: 100%;
}

.tab {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--mute);
  text-decoration: none;
}

.tab.on {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 7px;
}

.acts {
  display: flex;
  gap: 14px;
  align-items: center;
}

.ethos {
  color: var(--mute);
  text-decoration: none;
}

.acts button {
  background: 0;
  border: 0;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
}

.page {
  display: grid;
  grid-template-columns: 42px 1fr;
  min-height: calc(100vh - 34px);
}

.gutter {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  line-height: 20px;
  color: var(--mute);
  text-align: right;
  padding: 10px 7px 0 0;
  user-select: none;
}

.main {
  position: relative;
  min-height: calc(100vh - 34px);
  padding: 8px 3vw 22vh;
  overflow: hidden;
}

.ascii {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 10px 0 0 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 20px;
  color: var(--ascii);
  opacity: 0.7;
  white-space: pre;
  pointer-events: none;
  overflow: hidden;
}

.hook {
  position: relative;
  z-index: 2;
  max-width: 46ch;
  margin: 1.4rem 0 0 0.3rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--mute);
}

.click-controls {
  position: absolute;
  top: 1rem;
  right: 3vw;
  z-index: 3;
}

.dont-click {
  position: relative;
  margin: 0;
  padding: 0.55rem 0.8rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.dont-click:hover {
  border-color: var(--head);
  color: var(--head);
}

.dont-click.is-gone {
  opacity: 0;
  transform: translateY(-5px);
  pointer-events: none;
}

.replay-click {
  display: none;
  margin-left: 0.45rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--mute);
  background: transparent;
  color: var(--mute);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.replay-click.is-visible {
  display: inline-block;
}

.replay-click:hover {
  border-color: var(--head);
  color: var(--head);
}

h1 {
  position: relative;
  z-index: 2;
  margin: 1rem 0 0 0.2rem;
  max-width: 12ch;
  font-family: Syne, sans-serif;
  font-size: clamp(2.8rem, 7vw, 5.6rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.92;
  color: var(--head);
}

.who-intro {
  position: relative;
  z-index: 2;
  width: min(100%, 62rem);
  margin-top: 1rem;
  overflow: hidden;
}

#who-title {
  opacity: 0;
  transform: translateY(1.5rem);
  animation: titleReveal 1.1s cubic-bezier(.16, 1, .3, 1) 0.25s forwards;
}

@keyframes titleReveal {
  0% { opacity: 0; transform: translateY(1.5rem); letter-spacing: 0.08em; }
  60% { opacity: 1; }
  100% { opacity: 1; transform: translateY(0); letter-spacing: -0.055em; }
}

@media (prefers-reduced-motion: reduce) {
  #who-title {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

#jet-trigger {
  appearance: none;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.12em;
}

#jet-trigger:hover {
  color: var(--mute);
}

#jet-trigger:focus-visible {
  outline: 1px dashed var(--mute);
  outline-offset: 6px;
}

/* Year Chips */
.year-chips {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 6px;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.year-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 28px;
  padding: 0 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--mute);
  background: transparent;
  border: 1px solid var(--mute);
  border-radius: 3px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.year-chip:hover {
  color: var(--head);
  border-color: var(--head);
  transform: translateY(-2px);
}

.year-chip:focus-visible {
  outline: 2px solid var(--head);
  outline-offset: 2px;
  border-color: var(--head);
}

.year-chip.active {
  background: var(--head);
  color: var(--bg);
  border-color: var(--head);
}

.copy {
  position: relative;
  z-index: 2;
  max-width: 52ch;
  margin: 3.2rem 0 0 0.3rem;
  font-family: Newsreader, Georgia, serif;
  font-size: 1.12rem;
  line-height: 1.72;
  color: var(--ink);
  scroll-margin-top: 56px;
}

.copy p + p {
  margin-top: 1rem;
}

.label {
  display: inline-flex;
  align-items: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--head);
  border-bottom: 1px solid var(--mute);
  padding-bottom: 4px;
  margin-bottom: 1rem;
}

.label-sub {
  display: inline-flex;
  align-items: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--mute);
  margin: 0.2rem 0 1.6rem 0.3rem;
}

/* Story Year Sections */
.story-year {
  position: relative;
  margin-bottom: 3rem;
  scroll-margin-top: 56px;
}

.year-heading {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--head);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--mute);
  text-transform: uppercase;
}

/* Code Block Styling */
.code-block {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  line-height: 1.6;
  color: var(--mute);
  background: transparent;
  padding: 0;
  margin: 1rem 0.3rem;
  overflow-x: auto;
  white-space: pre;
  border: none;
}

.who-egg-wrap {
  margin-top: -0.2rem;
}

.who-egg {
  background: none;
  border: 0;
  padding: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 1.4;
  color: var(--mute);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}

.who-egg:hover,
.who-egg:focus-visible {
  color: var(--ink);
  transform: translateX(3px);
}

.who-egg:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.close {
  margin-top: 2.2rem;
  font-family: Syne, sans-serif;
  font-weight: 700;
  color: var(--head);
}

.links {
  margin-top: 1.4rem;
  display: flex;
  gap: 1.2rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
}

.links a {
  color: var(--ink);
}

.rail {
  position: fixed;
  right: 2.5vw;
  top: 42%;
  transform: translateY(-20%);
  z-index: 36;
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.prompt-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.prompt-box p {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  line-height: 1.45;
  color: var(--mute);
  margin: 0;
}

.prompt {
  background: none;
  border: 0;
  padding: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}

.prompt:hover {
  color: var(--head);
  transform: translateX(3px);
}

.thanks {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--mute);
}

.wallets {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 1.6rem;
  padding-top: 0.4rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  line-height: 1.45;
  color: var(--ink);
  text-shadow: none;
  overflow-wrap: anywhere;
}

.wallets p {
  margin: 0;
}

.wallets span,
.wallet-title {
  color: var(--head);
}

.wallet-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mark {
  position: absolute;
  right: -3vw;
  bottom: -4vh;
  z-index: 1;
  font-family: Syne, sans-serif;
  font-size: clamp(8rem, 24vw, 18rem);
  font-weight: 800;
  letter-spacing: -0.07em;
  line-height: 0.78;
  color: var(--mark);
  pointer-events: none;
}

@media (max-width: 900px) {
  .cursor {
    display: none;
  }

  .ethos {
    display: none;
  }

  .rail {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: auto;
    max-width: 52ch;
    margin: 3rem 0 0 0.3rem;
  }

  .prompt {
    font-size: 13px;
  }

  .year-chips {
    gap: 4px;
  }

  .year-chip {
    min-width: 36px;
    height: 24px;
    font-size: 10px;
  }
}
