:root {
  --bg-void: #020406;
  --text-pure: #d4ecee;
  --text-soft: rgba(198, 228, 232, 0.86);
  --text-muted: rgba(146, 198, 202, 0.58);
  --phosphor-cyan: #82cbd0;
  --phosphor-amber: #d4c46c;
  --phosphor-crimson: #b8372f;
  --phosphor-teal: rgba(130, 203, 208, 0.42);
  --phosphor-red: rgba(184, 55, 47, 0.35);
  --phosphor-err: #d86058;
  --input-bg: rgba(5, 13, 19, 0.92);
  --input-border: rgba(132, 198, 204, 0.34);
  --btn-slate: rgba(8, 22, 30, 0.86);
  --btn-slate-hover: rgba(14, 34, 44, 0.94);
  --font-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: var(--bg-void);
  color: var(--text-pure);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.crt-stage {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-void);
  background-image: url('assets/replicantman-bg-1.jpg');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: crosshair;
}

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

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

input, textarea {
  user-select: text;
  -webkit-user-select: text;
}

.osd-btn, .submit-btn, .cookie-btn, .bleed-edge-cue, .bleed-nav-item, .bleed-cta {
  touch-action: manipulation;
}

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

.crt-scanlines {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(to bottom,
      rgba(0, 0, 0, 0) 0px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 4, 8, 0.24) 3px,
      rgba(0, 4, 8, 0.24) 4px),
    url('assets/crt-static-grain.png');
  background-size: 100% 100%, 220px 220px;
  background-repeat: no-repeat, repeat;
  opacity: 0.42;
}

.crt-vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 80% 84%,
      rgba(2, 8, 12, 0.44) 0%,
      rgba(2, 8, 12, 0.14) 42%,
      rgba(0, 0, 0, 0) 68%),
    radial-gradient(ellipse at center,
      rgba(0, 0, 0, 0) 58%,
      rgba(0, 2, 4, 0.56) 100%);
}

.crt-boot {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: #010203;
  opacity: 1;
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.crt-boot::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%) scaleX(0.08);
  background: linear-gradient(90deg, transparent, #b8fbff, #ffffff, #b8fbff, transparent);
  box-shadow: 0 0 28px 6px rgba(142, 245, 255, 0.8);
  animation: boot-beam 0.72s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.crt-boot.is-done {
  opacity: 0;
}

@keyframes boot-beam {
  0% {
    opacity: 0.95;
    transform: translateY(-50%) scaleX(0.05) scaleY(1);
  }

  45% {
    opacity: 1;
    transform: translateY(-50%) scaleX(1.02) scaleY(2.2);
  }

  100% {
    opacity: 0;
    transform: translateY(-50%) scaleX(1.06) scaleY(180);
  }
}

/* Diegetic Monitor OSD */
.osd-top {
  position: absolute;
  top: clamp(0.85rem, 2.2vh, 1.4rem);
  left: clamp(0.95rem, 2.4vw, 1.75rem);
  right: clamp(0.95rem, 2.4vw, 1.75rem);
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(182, 224, 228, 0.78);
  text-shadow: 0 0 1px rgba(130, 203, 208, 0.35);
}

.osd-cluster {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.osd-right {
  pointer-events: auto;
  gap: 0.45rem;
}

.osd-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--phosphor-cyan);
  box-shadow: none;
  animation: osd-pulse 2.2s ease-in-out infinite;
}

@keyframes osd-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

.osd-metric {
  color: var(--phosphor-amber);
  text-shadow: none;
}

.osd-clock {
  color: rgba(172, 212, 216, 0.6);
}

.osd-btn {
  appearance: none;
  background: rgba(5, 13, 19, 0.86);
  border: 1px solid rgba(130, 203, 208, 0.32);
  color: rgba(206, 232, 234, 0.86);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-shadow: none;
  padding: 0.34rem 0.6rem;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.osd-btn:hover,
.osd-btn:focus-visible {
  outline: none;
  color: #d4ecee;
  border-color: rgba(130, 203, 208, 0.72);
  background: rgba(12, 28, 36, 0.94);
}

.osd-btn[aria-pressed='true'] {
  color: #051015;
  border-color: var(--phosphor-cyan);
  background: var(--phosphor-cyan);
}

.osd-key {
  opacity: 0.55;
}

.osd-bottom-left {
  position: absolute;
  left: clamp(0.95rem, 2.4vw, 1.75rem);
  bottom: clamp(0.85rem, 2.2vh, 1.35rem);
  z-index: 8;
  pointer-events: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(172, 212, 216, 0.6);
  text-shadow: none;
}

.osd-field {
  pointer-events: none;
}

.osd-link {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0.15rem 0;
  color: rgba(172, 212, 216, 0.66);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-color: rgba(130, 203, 208, 0.3);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.osd-link:hover,
.osd-link:focus-visible {
  outline: none;
  color: #d4ecee;
  text-decoration-color: rgba(130, 203, 208, 0.8);
}

.osd-coffee {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.svg-fx-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.glitch-clone-layer {
  pointer-events: none !important;
  user-select: none !important;
}

.is-hero-glitch {
  filter: url('#crt-text-glitch');
  will-change: transform, filter;
}

.is-copy-glitch {
  filter: url('#crt-copy-glitch');
  will-change: transform, filter;
}

/* Left-flush Hero Typography */
.hero-title-anchor {
  position: absolute;
  left: clamp(1.4rem, 3vw, 2.6rem);
  top: 47%;
  transform: translateY(-50%);
  z-index: 6;
  pointer-events: auto;
}

.hero-title {
  position: relative;
  display: inline-block;
  margin: 0;
  padding: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.65rem, 7.6vw, 7.8rem);
  line-height: 0.92;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: #d4ecee;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  text-shadow:
    0 0 2px rgba(176, 228, 232, 0.3),
    -1px 0 0 rgba(184, 55, 47, 0.34),
    1px 0 0 rgba(130, 203, 208, 0.38);
  transition: text-shadow 0.08s linear;
}

.hero-title .glyph {
  display: inline-block;
  will-change: transform;
  transition: color 0.12s ease, text-shadow 0.12s ease;
}

.hero-title .glyph.is-scrambling {
  color: var(--phosphor-cyan);
  text-shadow:
    0 0 16px rgba(142, 245, 255, 0.92),
    -3px 0 0 rgba(255, 58, 102, 0.85),
    3px 0 0 rgba(70, 246, 255, 0.9);
}

/* Bottom-Right Transmission Panel */
.comm-panel {
  position: absolute;
  left: auto;
  right: clamp(1.4rem, 3vw, 2.6rem);
  bottom: clamp(1.5rem, 3.5vh, 2.6rem);
  width: min(40vw, 520px);
  z-index: 7;
  cursor: default;
}

.comm-status {
  position: relative;
  margin: 0 0 0.72rem 0;
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 0.85vw, 0.78rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #cbe6e8;
  text-shadow: 0 0 1px rgba(130, 203, 208, 0.32);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: crosshair;
}

.comm-status::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28%;
  left: -30%;
  background: linear-gradient(90deg, transparent, rgba(142, 245, 255, 0.5), transparent);
  animation: carrier-sweep 4.2s linear infinite;
  pointer-events: none;
}

@keyframes carrier-sweep {
  0% {
    left: -35%;
  }

  100% {
    left: 110%;
  }
}

.comm-manifesto {
  margin: 0 0 1.25rem 0;
  font-family: var(--font-display);
  font-size: clamp(0.76rem, 0.95vw, 0.89rem);
  font-weight: 400;
  line-height: 1.46;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.82);
  cursor: crosshair;
}

.m-word {
  display: inline-block;
  will-change: transform;
  transition: color 0.12s ease, text-shadow 0.12s ease;
}

.m-word.is-glitching {
  color: var(--phosphor-cyan);
  text-shadow:
    0 0 10px rgba(142, 245, 255, 0.85),
    -2px 0 0 rgba(255, 68, 108, 0.75),
    2px 0 0 rgba(76, 246, 255, 0.8);
}

.access-form {
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 42px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  box-shadow: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.input-shell:focus-within {
  border-color: var(--phosphor-cyan);
  box-shadow: none;
  background: rgba(6, 16, 22, 0.96);
}

.input-shell.is-error {
  border-color: var(--phosphor-err);
  box-shadow: none;
}

.input-shell input {
  width: 100%;
  height: 100%;
  padding: 0 2.5rem 0 0.95rem;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  outline: none;
  user-select: text;
}

.input-shell input::placeholder {
  color: rgba(212, 232, 238, 0.45);
  letter-spacing: 0.12em;
  font-size: 0.68rem;
}

.email-led {
  position: absolute;
  right: 0.62rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 2px;
  color: rgba(210, 238, 245, 0.55);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  pointer-events: none;
}

.email-led.is-ready {
  color: #051015;
  background: var(--phosphor-amber);
  border-color: var(--phosphor-amber);
  box-shadow: none;
}

.submit-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 42px;
  padding: 0 1rem;
  border: 1px solid rgba(130, 203, 208, 0.34);
  background: var(--btn-slate);
  backdrop-filter: none;
  color: #cbe6e8;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.12s ease;
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  left: -45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-18deg);
  transition: left 0.48s ease;
  pointer-events: none;
}

.submit-btn:hover:not(:disabled)::before,
.submit-btn:focus-visible:not(:disabled)::before {
  left: 120%;
}

.submit-btn:hover:not(:disabled),
.submit-btn:focus-visible:not(:disabled) {
  outline: none;
  background: var(--btn-slate-hover);
  border-color: var(--phosphor-cyan);
  color: #d4ecee;
  box-shadow: none;
}

.submit-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.submit-btn:disabled {
  opacity: 0.75;
  cursor: wait;
}

.submit-btn.is-confirmed {
  background: rgba(14, 40, 46, 0.92);
  border-color: var(--phosphor-cyan);
  color: #d4ecee;
  box-shadow: none;
  cursor: default;
}

.form-feedback {
  min-height: 1.15rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--phosphor-cyan);
  text-shadow: none;
}

.form-feedback.is-error {
  color: var(--phosphor-err);
  text-shadow: none;
}

/* Diegetic CRT Cookie Warning Banner */
.cookie-banner {
  position: fixed;
  left: clamp(0.95rem, 2.4vw, 1.75rem);
  bottom: clamp(2.45rem, 5.2vh, 3.2rem);
  width: min(400px, calc(42vw - 1.5rem));
  z-index: 16;
  padding: 0.9rem 1rem;
  background: rgba(5, 13, 19, 0.96);
  border: 1px solid rgba(130, 203, 208, 0.34);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.72);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  cursor: default;
}

.cookie-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cookie-eyebrow {
  margin: 0 0 0.45rem 0;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}

.cookie-copy {
  margin: 0 0 0.82rem 0;
  font-family: var(--font-display);
  font-size: 0.72rem;
  line-height: 1.46;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(242, 246, 250, 0.82);
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cookie-btn {
  appearance: none;
  flex: 1 1 auto;
  min-width: 112px;
  height: 36px;
  padding: 0 0.75rem;
  background: rgba(6, 9, 12, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.cookie-btn:hover,
.cookie-btn:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, 0.62);
  color: #ffffff;
  background: rgba(16, 20, 24, 0.96);
}

.cookie-btn-primary {
  background: var(--btn-slate);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.cookie-btn-primary:hover,
.cookie-btn-primary:focus-visible {
  background: var(--btn-slate-hover);
  border-color: rgba(255, 255, 255, 0.52);
}

/* Right-Edge Raw Signal Bleed Navigation */
.bleed-edge-cue {
  position: fixed;
  right: clamp(0.95rem, 2vw, 1.4rem);
  top: 34%;
  transform: translateY(-50%);
  z-index: 12;
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0.6rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.bleed-edge-cue:hover,
.bleed-edge-cue:focus-visible,
.bleed-edge-cue.is-approaching {
  outline: none;
  color: #ffffff;
  opacity: 1;
}

.bleed-edge-cue.is-active {
  opacity: 0;
  pointer-events: none;
}

.signal-bleed {
  position: fixed;
  top: clamp(4.5rem, 11vh, 6.8rem);
  right: clamp(1.4rem, 3vw, 2.6rem);
  width: min(40vw, 520px);
  max-height: calc(100dvh - 18.5rem);
  z-index: 14;
  padding: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 0.78rem;
  overflow: visible;
  pointer-events: none;
  opacity: 0;
  transform: translateX(18px);
  transition: opacity 0.24s ease, transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.signal-bleed.is-open {
  pointer-events: auto;
  opacity: 1;
  transform: translateX(0);
}

.bleed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.bleed-eyebrow {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 0.85vw, 0.78rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #cbe6e8;
  text-shadow: 0 0 1px rgba(130, 203, 208, 0.32);
  cursor: crosshair;
}

.bleed-eyebrow::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28%;
  left: -30%;
  background: linear-gradient(90deg, transparent, rgba(142, 245, 255, 0.5), transparent);
  animation: carrier-sweep 4.2s linear infinite;
  pointer-events: none;
}

.bleed-close {
  appearance: none;
  display: none;
  width: 24px;
  height: 24px;
  padding: 0;
  align-items: center;
  justify-content: center;
  background: rgba(4, 12, 19, 0.88);
  border: 1px solid rgba(110, 244, 255, 0.34);
  color: #d8fbff;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.signal-bleed.is-pinned .bleed-close {
  display: inline-flex;
}

.bleed-close:hover,
.bleed-close:focus-visible {
  outline: none;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.65);
}

.bleed-nav {
  display: flex;
  flex-direction: column;
}

.bleed-nav-item {
  appearance: none;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  width: 100%;
  padding: 0.48rem 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(130, 203, 208, 0.24);
  color: rgba(204, 232, 234, 0.86);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.3vw, 2.15rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  text-shadow:
    0 0 2px rgba(176, 228, 232, 0.26),
    -1px 0 0 rgba(184, 55, 47, 0.28),
    1px 0 0 rgba(130, 203, 208, 0.32);
  transition: color 0.15s ease, border-color 0.15s ease, text-shadow 0.15s ease;
}

.bleed-nav-item:hover,
.bleed-nav-item:focus-visible,
.bleed-nav-item.is-active {
  outline: none;
  color: #d4ecee;
  border-bottom-color: rgba(130, 203, 208, 0.6);
  text-shadow:
    0 0 2px rgba(176, 228, 232, 0.38),
    -1px 0 0 rgba(184, 55, 47, 0.32),
    1px 0 0 rgba(130, 203, 208, 0.38);
}

.bleed-nav-code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: rgba(212, 196, 108, 0.84);
  text-shadow: none;
}

.bleed-nav-label {
  flex: 1 1 auto;
}

.bleed-nav-arrow {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
}

.bleed-nav-group {
  display: flex;
  flex-direction: column;
}

.bleed-nav-group.has-active-child>.bleed-nav-parent {
  color: #ffffff;
  border-bottom-color: rgba(142, 245, 255, 0.34);
}

.bleed-subnav {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
  pointer-events: none;
}

.bleed-nav-group.is-expanded .bleed-subnav {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
}

.bleed-subnav-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-left: 0.45rem;
  border-left: 1px solid rgba(142, 245, 255, 0.28);
}

.bleed-sub-item {
  padding: 0.34rem 0 0.34rem 0.95rem;
  font-size: clamp(0.95rem, 1.45vw, 1.28rem);
  font-weight: 600;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.bleed-sub-item .bleed-nav-code {
  font-size: 0.64rem;
  color: rgba(142, 245, 255, 0.65);
}

.bleed-sub-item .bleed-nav-arrow {
  font-size: 0.78rem;
}

.bleed-info {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bleed-summary {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(0.76rem, 0.95vw, 0.89rem);
  font-weight: 400;
  line-height: 1.46;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.82);
  cursor: crosshair;
}

.bleed-spec {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(148, 200, 204, 0.66);
  text-shadow: none;
  cursor: crosshair;
}

.bleed-cta {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 42px;
  padding: 0 1rem;
  border: 1px solid rgba(130, 203, 208, 0.34);
  background: var(--btn-slate);
  backdrop-filter: none;
  color: #cbe6e8;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  text-shadow: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.12s ease;
}

.bleed-cta::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  left: -45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: skewX(-18deg);
  transition: left 0.48s ease;
  pointer-events: none;
}

.bleed-cta:hover::before,
.bleed-cta:focus-visible::before {
  left: 120%;
}

.bleed-cta:hover,
.bleed-cta:focus-visible {
  outline: none;
  background: var(--btn-slate-hover);
  border-color: var(--phosphor-cyan);
  color: #d4ecee;
  box-shadow: none;
}

.bleed-cta:active {
  transform: translateY(1px);
}

/* Channel Switch CRT Portal Transition */
.crt-stage.is-stage-glitch {
  filter: url('#crt-text-glitch');
  animation: stage-jolt 0.08s steps(2, end) infinite;
}

@keyframes stage-jolt {
  0% {
    transform: translate3d(0, 0, 0);
  }

  25% {
    transform: translate3d(-3px, 1px, 0);
  }

  50% {
    transform: translate3d(4px, -1px, 0);
  }

  75% {
    transform: translate3d(-2px, 0, 0);
  }

  100% {
    transform: translate3d(2px, 1px, 0);
  }
}

.crt-portal-transition {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: transparent;
}

.crt-portal-transition.is-active {
  visibility: visible;
  pointer-events: all;
  opacity: 1;
  animation: portal-stage-fade 0.62s steps(1, end) forwards;
}

@keyframes portal-stage-fade {
  0% {
    background: rgba(2, 4, 6, 0.12);
  }

  18% {
    background: rgba(2, 4, 6, 0.34);
  }

  38% {
    background: rgba(2, 4, 6, 0.62);
  }

  58% {
    background: rgba(2, 4, 6, 0.88);
  }

  72% {
    background: #020406;
  }

  100% {
    background: #020406;
  }
}

.portal-static {
  position: absolute;
  inset: -6%;
  opacity: 0;
  background-image:
    repeating-linear-gradient(to bottom,
      rgba(255, 255, 255, 0.22) 0px,
      rgba(255, 255, 255, 0.22) 1px,
      rgba(0, 0, 0, 0.72) 2px,
      rgba(0, 0, 0, 0.72) 4px),
    repeating-linear-gradient(90deg,
      rgba(255, 255, 255, 0.08) 0px,
      rgba(0, 0, 0, 0.18) 3px,
      rgba(255, 255, 255, 0.05) 6px);
  mix-blend-mode: screen;
}

.crt-portal-transition.is-active .portal-static {
  animation: portal-static-jitter 0.62s steps(1, end) forwards;
}

@keyframes portal-static-jitter {
  0% {
    opacity: 0.32;
    transform: translate3d(-2%, 0, 0) scaleY(1.02);
  }

  14% {
    opacity: 0.72;
    transform: translate3d(3%, -2%, 0) skewX(3deg);
  }

  28% {
    opacity: 0.55;
    transform: translate3d(-4%, 2%, 0) skewX(-4deg);
  }

  44% {
    opacity: 0.85;
    transform: translate3d(2%, -1%, 0) scaleY(0.98);
  }

  62% {
    opacity: 0.4;
    transform: translate3d(-1%, 1%, 0);
  }

  72%,
  100% {
    opacity: 0;
    transform: translate3d(0, 0, 0);
  }
}

.portal-slices {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.portal-slice {
  position: absolute;
  left: -8%;
  width: 116%;
  opacity: 0;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.28) 18%,
      rgba(218, 224, 230, 0.86) 52%,
      rgba(255, 255, 255, 0.22) 84%,
      transparent 100%);
  box-shadow:
    -3px 0 0 rgba(255, 68, 108, 0.45),
    3px 0 0 rgba(142, 245, 255, 0.5);
  mix-blend-mode: exclusion;
}

.portal-slice:nth-child(1) {
  top: 14%;
  height: 3.5vh;
}

.portal-slice:nth-child(2) {
  top: 31%;
  height: 6.5vh;
}

.portal-slice:nth-child(3) {
  top: 49%;
  height: 4.5vh;
}

.portal-slice:nth-child(4) {
  top: 67%;
  height: 7vh;
}

.portal-slice:nth-child(5) {
  top: 83%;
  height: 3vh;
}

.crt-portal-transition.is-active .portal-slice {
  animation: portal-slice-tear 0.42s steps(1, end) forwards;
}

.crt-portal-transition.is-active .portal-slice:nth-child(2) {
  animation-delay: 0.03s;
}

.crt-portal-transition.is-active .portal-slice:nth-child(3) {
  animation-delay: 0.06s;
}

.crt-portal-transition.is-active .portal-slice:nth-child(4) {
  animation-delay: 0.02s;
}

.crt-portal-transition.is-active .portal-slice:nth-child(5) {
  animation-delay: 0.05s;
}

@keyframes portal-slice-tear {
  0% {
    opacity: 0.9;
    transform: translateX(-9%);
  }

  20% {
    opacity: 0.95;
    transform: translateX(11%) scaleY(1.25);
  }

  40% {
    opacity: 0.7;
    transform: translateX(-14%);
  }

  60% {
    opacity: 0.95;
    transform: translateX(8%) scaleY(0.8);
  }

  82% {
    opacity: 0.65;
    transform: translateX(-5%);
  }

  100% {
    opacity: 0;
    transform: translateX(0);
  }
}

.portal-beam {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  opacity: 0;
  transform: translateY(-50%) scaleX(1.04) scaleY(3);
  background: linear-gradient(90deg, transparent 2%, #ffffff 18%, #ffffff 82%, transparent 98%);
  box-shadow: 0 0 24px 6px rgba(255, 255, 255, 0.82);
}

.crt-portal-transition.is-active .portal-beam {
  animation: portal-beam-collapse 0.62s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes portal-beam-collapse {

  0%,
  56% {
    opacity: 0;
    transform: translateY(-50%) scaleX(1.04) scaleY(16);
  }

  62% {
    opacity: 1;
    transform: translateY(-50%) scaleX(1.04) scaleY(3);
  }

  78% {
    opacity: 1;
    transform: translateY(-50%) scaleX(0.32) scaleY(1.6);
  }

  90% {
    opacity: 1;
    transform: translateY(-50%) scaleX(0.015) scaleY(1.8);
  }

  100% {
    opacity: 0;
    transform: translateY(-50%) scaleX(0.002) scaleY(0.5);
  }
}

.portal-osd {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  opacity: 0;
  text-align: center;
  padding: 1rem;
}

.crt-portal-transition.is-active .portal-osd {
  animation: portal-osd-flash 0.62s steps(1, end) forwards;
}

@keyframes portal-osd-flash {
  0% {
    opacity: 0;
  }

  10% {
    opacity: 1;
    transform: translateX(-4px);
  }

  22% {
    opacity: 0.45;
    transform: translateX(5px);
  }

  34% {
    opacity: 1;
    transform: translateX(-2px);
  }

  48% {
    opacity: 0.9;
    transform: translateX(3px);
  }

  60%,
  100% {
    opacity: 0;
    transform: translateX(0);
  }
}

.portal-channel {
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.05vw, 0.88rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  text-shadow:
    -2px 0 0 rgba(255, 68, 108, 0.65),
    2px 0 0 rgba(142, 245, 255, 0.72);
}

.portal-target {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 4.2rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow:
    0 0 18px rgba(255, 255, 255, 0.35),
    -3px 0 0 rgba(255, 68, 108, 0.72),
    3px 0 0 rgba(142, 245, 255, 0.78);
}

.crt-portal-transition.is-calm.is-active {
  animation: none;
  background: #020406;
  opacity: 1;
  transition: opacity 0.16s ease;
}

.crt-portal-transition.is-calm .portal-static,
.crt-portal-transition.is-calm .portal-slices,
.crt-portal-transition.is-calm .portal-beam,
.crt-portal-transition.is-calm .portal-osd {
  display: none;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .comm-panel {
    left: auto;
    right: 1.5rem;
    bottom: 1.75rem;
    width: min(46vw, 460px);
  }

  .signal-bleed {
    right: 1.5rem;
    width: min(46vw, 460px);
  }
}

@media (hover: none) and (pointer: coarse),
(max-width: 820px) {

  .is-hero-glitch,
  .is-copy-glitch,
  .crt-stage.is-stage-glitch {
    filter: none !important;
    will-change: auto;
  }
}

@media (max-width: 820px),
(max-height: 520px) and (max-width: 960px) {

  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    overflow-x: clip;
  }

  .crt-stage {
    height: auto;
    min-height: 100svh;
    overflow-x: clip;
    overflow-y: visible;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
    padding:
      calc(env(safe-area-inset-top, 0px) + 0.7rem) max(0.85rem, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 0.7rem) max(0.85rem, env(safe-area-inset-left, 0px));
  }

  #crt-canvas,
  .crt-scanlines,
  .crt-vignette {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: translateZ(0);
  }

  .osd-top {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    flex: 0 0 auto;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }

  .osd-left {
    min-width: 0;
    gap: 0.45rem;
    white-space: nowrap;
  }

  .osd-right {
    flex-shrink: 0;
    gap: 0.32rem;
  }

  .osd-clock {
    display: none;
  }

  .osd-field {
    display: none;
  }

  .osd-bottom-left {
    position: relative;
    left: auto;
    bottom: auto;
    width: 100%;
    flex: 0 0 auto;
    min-height: 34px;
    padding-right: 6.4rem;
  }

  .osd-link {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.15rem;
  }

  .hero-title-anchor {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    padding: 0.5rem 0 0.5rem 0.25rem;
    min-height: 4.5rem;
    max-width: 100%;
  }

  .hero-title {
    font-size: clamp(2.05rem, 9.6vw, 4.1rem);
    max-width: 100%;
  }

  .comm-panel {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    flex: 0 0 auto;
    padding: 0.9rem 0.95rem 0.85rem;
    background: linear-gradient(180deg, rgba(2, 6, 9, 0.72) 0%, rgba(2, 6, 9, 0.90) 100%);
    backdrop-filter: none;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
  }

  .comm-manifesto {
    font-size: 0.79rem;
    margin-bottom: 1rem;
  }

  .input-shell input {
    font-size: 16px;
    letter-spacing: 0.04em;
  }

  .input-shell,
  .submit-btn,
  .bleed-cta {
    height: 44px;
  }

  .cookie-banner {
    left: max(0.75rem, env(safe-area-inset-left, 0px));
    right: max(0.75rem, env(safe-area-inset-right, 0px));
    bottom: calc(env(safe-area-inset-bottom, 0px) + 0.75rem);
    width: auto;
    max-height: calc(100dvh - 4rem);
    overflow-y: auto;
    z-index: 24;
  }

  .bleed-edge-cue {
    top: auto;
    transform: none;
    right: max(0.85rem, env(safe-area-inset-right, 0px));
    bottom: calc(env(safe-area-inset-bottom, 0px) + 0.7rem);
    z-index: 15;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.32rem 0.62rem;
    background: rgba(4, 6, 8, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
  }

  .bleed-edge-cue::after {
    content: ' MENU';
  }

  .signal-bleed {
    top: calc(env(safe-area-inset-top, 0px) + 3.25rem);
    left: max(0.75rem, env(safe-area-inset-left, 0px));
    right: max(0.75rem, env(safe-area-inset-right, 0px));
    width: auto;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 4.25rem);
    padding: 1rem;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    background: rgba(4, 6, 8, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.22);
    z-index: 22;
  }

  .signal-bleed::-webkit-scrollbar {
    display: none;
  }

  .bleed-close {
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
  }

  .bleed-nav-item {
    min-height: 48px;
    align-items: center;
    font-size: clamp(1.2rem, 5.2vw, 1.65rem);
  }

  .bleed-sub-item {
    min-height: 44px;
    font-size: clamp(1rem, 4.2vw, 1.3rem);
    padding: 0.4rem 0 0.4rem 1.05rem;
  }

  .signal-bleed.is-open .bleed-close {
    display: inline-flex;
  }
}

@media (max-width: 560px) {

  #btn-degauss,
  .osd-tag {
    display: none;
  }
}

@media (max-width: 480px) {
  .osd-top {
    font-size: 0.56rem;
    letter-spacing: 0.06em;
    gap: 0.35rem;
  }

  .osd-metric,
  .osd-key {
    display: none;
  }

  .osd-btn {
    padding: 0.3rem 0.42rem;
    font-size: 0.55rem;
    letter-spacing: 0.05em;
    min-height: 30px;
    white-space: nowrap;
  }

  .hero-title {
    font-size: clamp(1.5rem, 9.0vw, 2.7rem);
  }

  .comm-panel {
    padding: 0.8rem 0.85rem 0.75rem;
  }

  .comm-status {
    font-size: 0.62rem;
    margin-bottom: 0.5rem;
  }

  .comm-manifesto {
    font-size: 0.73rem;
    line-height: 1.4;
    margin-bottom: 0.85rem;
  }

  .portal-channel {
    font-size: clamp(0.6rem, 2.8vw, 0.82rem);
    letter-spacing: 0.08em;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .portal-target {
    font-size: clamp(1.75rem, 9vw, 3.2rem);
  }
}

@media (max-width: 360px) {
  .osd-tag {
    font-size: 0.52rem;
    letter-spacing: 0.04em;
  }

  .osd-btn {
    padding: 0.28rem 0.34rem;
    font-size: 0.52rem;
  }

  .hero-title {
    font-size: clamp(1.38rem, 8.8vw, 2.0rem);
  }
}

@media (prefers-reduced-motion: reduce) {

  .crt-boot,
  .crt-boot::after,
  .osd-dot,
  .comm-status::after,
  .bleed-eyebrow::after,
  .cookie-banner,
  .signal-bleed,
  .bleed-subnav,
  .bleed-edge-cue,
  .crt-portal-transition,
  .portal-static,
  .portal-slice,
  .portal-beam,
  .portal-osd,
  .crt-tune-in,
  .crt-tune-osd {
    animation: none !important;
    transition: none !important;
  }

  .crt-stage.is-stage-glitch,
  .is-hero-glitch,
  .is-copy-glitch {
    animation: none !important;
    filter: none !important;
  }

  .portal-static,
  .portal-slices,
  .portal-beam {
    display: none;
  }

  .crt-boot {
    display: none;
  }
}

.osd-btn.is-authed {
  border-color: rgba(90, 244, 255, 0.72);
  color: #e8f6ff;
  box-shadow: 0 0 10px rgba(90, 244, 255, 0.18);
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.osd-btn.is-authed::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--phosphor-cyan);
  box-shadow: 0 0 6px var(--phosphor-cyan);
}

.rm-vault-backdrop {
  --paper: #080c10;
  --field: #0d131a;
  --ink: #e8f6ff;
  --muted: rgba(212, 240, 246, 0.65);
  --rule: rgba(142, 245, 255, 0.22);
  --accent: #5af4ff;
  --font-sans: var(--font-display, "Archivo", sans-serif);
  --font-mono: var(--font-mono, "IBM Plex Mono", monospace);
}