:root {
  color-scheme: dark;
  --bg: #070006;
  --panel: rgba(8, 8, 0, 0.91);
  --acid: #b6ff00;
  --goat: #00ff99;
  --pink: #ff3df2;
  --cyan: #00e7ff;
  --yellow: #fff200;
  --red: #ff213a;
  --dead: #8a8a5d;
  --paper: #d6d36a;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: #000;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--goat);
  font-family: "Courier New", Courier, monospace;
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(255, 61, 242, 0.08) 0 1px, transparent 1px 31px),
    repeating-linear-gradient(0deg, rgba(0, 231, 255, 0.05) 0 1px, transparent 1px 19px),
    radial-gradient(circle at 14% 17%, rgba(255, 61, 242, 0.24), transparent 15rem),
    radial-gradient(circle at 88% 72%, rgba(182, 255, 0, 0.18), transparent 19rem),
    linear-gradient(135deg, #190019 0%, #03130a 42%, #000 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.055) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, transparent, rgba(0,0,0,0.28), transparent);
  opacity: 0.58;
  mix-blend-mode: screen;
  z-index: 1;
}

body::after {
  content: "RG-95";
  position: fixed;
  right: 1.2rem;
  bottom: 0.8rem;
  color: rgba(255, 242, 0, 0.28);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  pointer-events: none;
  text-shadow: 2px 0 var(--pink), -2px 0 var(--cyan);
  z-index: 1;
}

.page-noise {
  position: fixed;
  top: 0.35rem;
  left: 0.75rem;
  width: calc(100vw - 1.5rem);
  color: rgba(255, 242, 0, 0.46);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  white-space: nowrap;
  transform: rotate(-1deg);
  text-shadow: 2px 0 rgba(255, 61, 242, 0.45);
  pointer-events: none;
}

.crt-shell {
  min-height: 100vh;
  display: block;
  padding: clamp(0.55rem, 2vw, 1.4rem);
}

.terminal-panel {
  position: relative;
  width: min(1380px, calc(100vw - 1.2rem));
  height: min(820px, calc(100vh - 1.2rem));
  margin: clamp(1.2rem, 3vh, 2.2rem) auto 0;
  display: flex;
  flex-direction: column;
  border: 3px ridge var(--acid);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.35), transparent 25%, rgba(255,61,242,0.08)),
    var(--panel);
  box-shadow:
    9px 9px 0 rgba(255, 61, 242, 0.35),
    -5px -4px 0 rgba(0, 231, 255, 0.22),
    0 0 2rem rgba(182, 255, 0, 0.18);
  overflow: hidden;
  transform: rotate(-0.35deg);
}

.terminal-panel::before {
  content: "missing: /goatdrop/map.exe   checksum: BAD   visitor class: PUBLIC";
  position: absolute;
  top: 4.35rem;
  right: -5.8rem;
  padding: 0.25rem 8rem;
  color: #000;
  background: var(--yellow);
  font-size: 0.72rem;
  font-weight: 700;
  transform: rotate(9deg);
  z-index: 3;
}

.terminal-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 45%, rgba(0,0,0,0.48));
  z-index: 4;
}

.terminal-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem 0.95rem;
  border-bottom: 3px double var(--acid);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.08) 0 2px, transparent 2px 7px),
    rgba(0, 0, 0, 0.56);
  z-index: 2;
}

.eyebrow {
  margin: 0 0 0.18rem;
  color: var(--paper);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 900;
  line-height: 0.95;
}

h1 {
  width: max-content;
  max-width: 100%;
  color: var(--yellow);
  font-size: clamp(1.8rem, 5.6vw, 4.2rem);
  letter-spacing: -0.09em;
  text-transform: uppercase;
  text-shadow:
    3px 0 var(--pink),
    -3px 0 var(--cyan),
    0 0 1rem rgba(255, 242, 0, 0.35);
  animation: title-damage 2.6s infinite steps(2, end);
}

.subhead {
  margin: 0.45rem 0 0;
  color: var(--goat);
  font-size: 0.85rem;
  text-transform: lowercase;
}

.status-light {
  color: #000;
  background: var(--pink);
  border: 2px outset var(--yellow);
  padding: 0.25rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
  transform: rotate(2deg);
}

.status-light span {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  margin-right: 0.35rem;
  border-radius: 0;
  background: var(--acid);
  box-shadow: 0 0 0.75rem var(--acid);
  animation: pulse 0.7s infinite steps(2, jump-none);
}

.marquee {
  position: relative;
  z-index: 2;
  overflow: hidden;
  border-bottom: 1px dashed var(--paper);
  background: #160016;
  color: var(--yellow);
  font-size: 0.78rem;
  padding: 0.22rem 0;
}

.marquee span {
  display: inline-block;
  min-width: 100%;
  white-space: nowrap;
  animation: crawl 16s linear infinite;
}

.terminal-output {
  position: relative;
  z-index: 2;
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.15rem 1.4rem;
  line-height: 1.35;
  font-size: clamp(0.9rem, 1.8vw, 1.08rem);
  scrollbar-color: var(--pink) #080008;
}

.line {
  margin: 0 0 0.22rem;
  max-width: 88ch;
  white-space: pre-wrap;
  word-break: break-word;
}

.line::selection, #command-input::selection {
  color: #000;
  background: var(--yellow);
}

.line.ok { color: var(--goat); }
.line.muted { color: var(--dead); }
.line.warn { color: var(--yellow); background: rgba(255, 242, 0, 0.07); }
.line.err { color: var(--red); text-shadow: 2px 0 rgba(255, 61, 242, 0.8); }
.line.accent { color: var(--cyan); text-shadow: 1px 0 rgba(255, 61, 242, 0.75); }
.line.prompt-line { color: var(--paper); }

.terminal-link {
  display: inline-block;
  color: #000;
  background: var(--cyan);
  text-decoration: none;
  border: 2px outset var(--paper);
  padding: 0.1rem 0.35rem;
  margin-top: 0.2rem;
  font-weight: 900;
}

.terminal-link:hover, .terminal-link:focus {
  background: var(--yellow);
  color: #000;
}

.terminal-form {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem 0.85rem;
  border-top: 3px double var(--acid);
  background: rgba(0, 0, 0, 0.72);
}

.prompt {
  color: var(--yellow);
  background: rgba(255, 61, 242, 0.18);
  white-space: nowrap;
}

#command-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--goat);
  font: inherit;
  caret-color: var(--yellow);
  text-shadow: 2px 0 rgba(255, 61, 242, 0.65);
}

.terminal-modal {
  max-width: min(620px, calc(100vw - 2rem));
  border: 3px ridge var(--yellow);
  border-radius: 0;
  background: #12000f;
  color: var(--goat);
  box-shadow: 8px 8px 0 rgba(0, 231, 255, 0.32), -5px -5px 0 rgba(255, 61, 242, 0.32);
}

.terminal-modal::backdrop { background: rgba(0, 0, 0, 0.78); }
.terminal-modal article { position: relative; padding: 1.2rem; }

.modal-close {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  border: 2px outset var(--yellow);
  background: var(--pink);
  color: #000;
  font-size: 1.4rem;
  font-weight: 900;
  cursor: pointer;
}

.modal-image {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  margin: 1rem 0;
  border: 3px inset var(--acid);
  image-rendering: pixelated;
}

#modal-body { color: var(--paper); white-space: pre-wrap; }
.modal-buttons { margin-top: 1.25rem; }

.modal-buttons button {
  border: 2px outset var(--acid);
  background: #000;
  color: var(--acid);
  padding: 0.45rem 0.7rem;
  font: inherit;
  cursor: pointer;
}

@keyframes pulse { 50% { opacity: 0.25; transform: translateX(2px); } }
@keyframes crawl { from { transform: translateX(100%); } to { transform: translateX(-100%); } }
@keyframes title-damage { 50% { transform: skewX(-7deg) translateX(3px); filter: contrast(1.5); } }

@media (max-width: 640px) {
  body { overflow: auto; }
  .crt-shell { padding: 0.45rem; }
  .terminal-panel {
    width: calc(100vw - 0.9rem);
    height: calc(100vh - 0.9rem);
    margin: 0.45rem 0 0;
    transform: rotate(0deg);
  }
  .terminal-panel::before { display: none; }
  .terminal-header { flex-direction: column; }
  h1 { font-size: clamp(2rem, 15vw, 4rem); }
  .terminal-form { align-items: flex-start; flex-direction: column; }
  #command-input { width: 100%; }
}

/* 🐐 ravegoat.com v3 mobile framing patch */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

@supports (height: 100svh) {
  body {
    min-height: 100svh;
  }
}

img,
video,
canvas {
  max-width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  body {
    min-height: 100svh;
    overflow: hidden;
  }

  body::after {
    right: 0.55rem;
    bottom: 0.35rem;
    font-size: 0.58rem;
    letter-spacing: 0.18em;
  }

  .page-noise {
    left: 0.45rem;
    width: calc(100vw - 0.9rem);
    max-width: calc(100vw - 0.9rem);
    overflow: hidden;
    font-size: 0.56rem;
    letter-spacing: 0.12em;
  }

  .crt-shell {
    width: 100%;
    min-height: 100svh;
    padding: 0.5rem;
  }

  .terminal-panel {
    width: calc(100vw - 1rem);
    max-width: calc(100vw - 1rem);
    height: calc(100svh - 1rem);
    max-height: calc(100svh - 1rem);
    margin: 0;
    transform: none;
    box-shadow:
      4px 4px 0 rgba(255, 61, 242, 0.32),
      -2px -2px 0 rgba(0, 231, 255, 0.2),
      0 0 1.25rem rgba(182, 255, 0, 0.14);
  }

  .terminal-panel::before {
    display: none;
  }

  .terminal-header {
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.62rem 0.68rem 0.72rem;
  }

  .eyebrow {
    font-size: 0.6rem;
    letter-spacing: 0.045em;
  }

  h1 {
    width: auto;
    max-width: 100%;
    font-size: clamp(2rem, 13.5vw, 3.35rem);
    letter-spacing: -0.075em;
    overflow-wrap: anywhere;
  }

  .subhead {
    margin-top: 0.35rem;
    font-size: 0.74rem;
  }

  .status-light {
    align-self: flex-start;
    font-size: 0.62rem;
    transform: none;
  }

  .marquee {
    font-size: 0.68rem;
  }

  .terminal-output {
    padding: 0.72rem 0.74rem 0.9rem;
    font-size: 0.92rem;
    line-height: 1.32;
    overflow-x: hidden;
    overscroll-behavior: contain;
  }

  .line {
    max-width: 100%;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .terminal-form {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 0.58rem 0.68rem 0.72rem;
  }

  .prompt {
    width: max-content;
    max-width: 100%;
    font-size: 0.84rem;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  #command-input {
    width: 100%;
    min-height: 2.1rem;
    font-size: 16px;
  }

  .terminal-modal {
    width: calc(100vw - 1rem);
    max-width: calc(100vw - 1rem);
    max-height: calc(100svh - 1rem);
  }

  .terminal-modal article {
    padding: 1rem 0.82rem;
  }
}

@media (max-width: 420px) {
  .crt-shell {
    padding: 0.35rem;
  }

  .terminal-panel {
    width: calc(100vw - 0.7rem);
    max-width: calc(100vw - 0.7rem);
    height: calc(100svh - 0.7rem);
    max-height: calc(100svh - 0.7rem);
    border-width: 2px;
  }

  .terminal-header {
    padding: 0.5rem 0.55rem 0.58rem;
  }

  h1 {
    font-size: clamp(1.75rem, 13vw, 2.75rem);
  }

  .terminal-output {
    padding: 0.58rem 0.58rem 0.75rem;
    font-size: 0.86rem;
  }

  .terminal-form {
    padding: 0.5rem 0.55rem 0.58rem;
  }

  .prompt {
    font-size: 0.76rem;
  }
}
