@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Press+Start+2P&display=swap");

:root {
  --ink: #111015;
  --paper: #e8e7df;
  --acid: #b7f34b;
  --green: #7fd845;
  --violet: #8b67ff;
  --pink: #ff6fb1;
  --line: rgba(17, 16, 21, 0.22);
  --shadow: 6px 6px 0 var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Mono", monospace;
  overflow-x: hidden;
  cursor: crosshair;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black 0 82%, transparent);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 10;
  opacity: 0.06;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

#starfield { position: fixed; inset: 0; z-index: -2; width: 100%; height: 100%; }
a, button, input { font: inherit; }
a { color: inherit; }
button { color: inherit; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 4px; }

.skip-link { position: fixed; top: -80px; left: 16px; z-index: 30; background: var(--ink); color: white; padding: 12px; }
.skip-link:focus { top: 16px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 clamp(18px, 4vw, 64px);
  border-bottom: 3px solid var(--ink);
  background: rgba(232, 231, 223, 0.82);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 5;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: "Press Start 2P", monospace; font-size: 13px; }
.brand-dot { width: 12px; height: 12px; background: var(--acid); border: 2px solid var(--ink); animation: pulse 1.2s steps(2) infinite; }
.coordinates { display: flex; gap: 30px; font-size: 11px; letter-spacing: 0.1em; }
.blink { color: #317500; animation: blink 1.4s steps(1) infinite; }
.sound-button { border: 2px solid var(--ink); background: transparent; padding: 8px 10px; font-size: 10px; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.sound-button:active { transform: translate(3px, 3px); box-shadow: none; }

main { width: min(1460px, 100%); margin-inline: auto; padding: clamp(22px, 4vw, 64px); }
.hero { display: grid; grid-template-columns: minmax(0, 0.86fr) minmax(380px, 1.14fr); min-height: min(720px, calc(100vh - 105px)); align-items: center; gap: clamp(20px, 5vw, 90px); }
.hero-copy { position: relative; z-index: 2; }
.eyebrow { display: flex; justify-content: space-between; max-width: 550px; border-bottom: 2px solid var(--ink); padding-bottom: 9px; font-size: 11px; letter-spacing: 0.15em; }
h1 { margin: 35px 0 5px; font-family: "Press Start 2P", monospace; font-size: clamp(4rem, 10vw, 9.2rem); line-height: 0.86; letter-spacing: -0.07em; position: relative; }
h1::before, h1::after { content: attr(data-text); position: absolute; inset: 0; z-index: -1; }
h1::before { color: var(--violet); transform: translate(-5px, 5px); }
h1::after { color: var(--acid); transform: translate(5px, -5px); z-index: -2; }
.ticker { display: inline-block; margin: 18px 0 22px; padding: 8px 12px; border: 2px solid var(--ink); background: var(--acid); font-family: "Press Start 2P", monospace; font-size: clamp(12px, 2vw, 18px); transform: rotate(-1deg); box-shadow: 4px 4px 0 var(--ink); }
.intro { font-size: clamp(15px, 1.6vw, 20px); line-height: 1.65; max-width: 570px; }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.links a { display: flex; justify-content: space-between; min-width: 108px; padding: 13px 15px; border: 2px solid var(--ink); background: var(--paper); box-shadow: 4px 4px 0 var(--ink); text-decoration: none; font-size: 12px; font-weight: 500; transition: transform 120ms, background 120ms; }
.links a:hover { background: var(--pink); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.links a:active { transform: translate(4px, 4px); box-shadow: none; }

.specimen { position: relative; aspect-ratio: 1; max-height: 680px; display: grid; place-items: center; isolation: isolate; perspective: 800px; }
.specimen::before { content: ""; position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(circle, rgba(183,243,75,.68), rgba(139,103,255,.16) 50%, transparent 72%); filter: blur(18px); z-index: -1; animation: breathe 4s ease-in-out infinite; }
.specimen img { width: min(88%, 620px); height: auto; image-rendering: auto; filter: saturate(1.05) contrast(1.06); transform: translate(var(--rx, 0), var(--ry, 0)) rotate(var(--rr, 0deg)); transition: transform 100ms linear, filter .2s; user-select: none; -webkit-user-drag: none; }
.specimen:hover img { filter: saturate(1.2) contrast(1.08) drop-shadow(10px 10px 0 rgba(139,103,255,.35)); }
.orbit { position: absolute; border: 2px dashed var(--ink); border-radius: 50%; pointer-events: none; }
.orbit-one { inset: 8%; animation: orbit 18s linear infinite; }
.orbit-two { inset: 22%; animation: orbit 12s linear infinite reverse; border-color: var(--violet); }
.orbit i { display: block; width: 13px; height: 13px; background: var(--pink); border: 2px solid var(--ink); position: absolute; left: 12%; top: 12%; }
.orbit-two i { left: 75%; top: 86%; background: var(--acid); }
.scanline { position: absolute; left: 9%; right: 9%; top: 15%; height: 3px; background: var(--violet); box-shadow: 0 0 18px var(--violet); opacity: .5; animation: scan 4s steps(30) infinite; }
.target { position: absolute; font: 28px "Press Start 2P"; animation: blink 1s steps(1) infinite; }
.target-a { top: 18%; right: 13%; color: var(--pink); }
.target-b { bottom: 25%; left: 10%; color: var(--violet); animation-delay: .5s; }
.specimen-label { position: absolute; left: 0; right: 0; bottom: 4%; display: flex; justify-content: space-between; padding: 10px; border-top: 2px solid var(--ink); font-size: 10px; letter-spacing: .1em; }

.console { display: grid; grid-template-columns: .8fr 1.25fr 1fr; border: 3px solid var(--ink); box-shadow: var(--shadow); background: var(--paper); margin-top: clamp(20px, 6vw, 80px); }
.panel { min-width: 0; padding: 20px; border-right: 3px solid var(--ink); }
.panel:last-child { border-right: 0; }
.panel-title { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; letter-spacing: .12em; border-bottom: 2px solid var(--ink); padding-bottom: 10px; }
.radar { width: min(190px, 78%); aspect-ratio: 1; display: block; margin: 25px auto 14px; border: 3px solid var(--ink); border-radius: 50%; padding: 0; position: relative; overflow: hidden; cursor: pointer; background: repeating-radial-gradient(circle, transparent 0 20px, rgba(17,16,21,.16) 21px 22px), linear-gradient(90deg, transparent 49%, rgba(17,16,21,.2) 50%, transparent 51%), linear-gradient(transparent 49%, rgba(17,16,21,.2) 50%, transparent 51%), var(--acid); }
.radar-sweep { position: absolute; width: 50%; height: 50%; left: 50%; bottom: 50%; transform-origin: left bottom; background: linear-gradient(30deg, rgba(139,103,255,.55), transparent 70%); animation: radar 2.3s linear infinite; }
.radar-blip { position: absolute; width: 8px; height: 8px; background: var(--pink); border: 2px solid var(--ink); animation: blip 2s steps(2) infinite; }
.blip-one { top: 27%; left: 65%; }
.blip-two { top: 68%; left: 30%; animation-delay: .7s; }
.radar-center { position: absolute; width: 8px; height: 8px; background: var(--ink); top: calc(50% - 4px); left: calc(50% - 4px); }
.signal-panel > p { text-align: center; font-size: 9px; }
.message { margin: 28px 0 36px; min-height: 78px; padding: 18px; background: var(--ink); color: var(--acid); font: 13px/1.7 "Press Start 2P", monospace; display: flex; align-items: center; position: relative; }
.message::after { content: "_"; animation: blink .8s steps(1) infinite; }
.frequency-panel label { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; margin-bottom: 12px; }
input[type="range"] { width: 100%; appearance: none; height: 10px; background: var(--ink); cursor: ew-resize; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 22px; height: 28px; border: 3px solid var(--ink); background: var(--pink); box-shadow: 3px 3px 0 var(--violet); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 24px; border: 3px solid var(--ink); border-radius: 0; background: var(--pink); }
.meter { height: 13px; border: 2px solid var(--ink); margin-top: 24px; padding: 2px; }
.meter span { display: block; height: 100%; width: 36%; background: repeating-linear-gradient(90deg, var(--violet) 0 7px, transparent 7px 10px); transition: width 100ms; }
.contract-panel > p { margin-top: 30px; font-size: 10px; }
.copy-button { width: 100%; border: 2px solid var(--ink); background: var(--acid); display: flex; justify-content: space-between; gap: 10px; padding: 15px; margin: 9px 0 30px; cursor: pointer; box-shadow: 4px 4px 0 var(--ink); }
.copy-button:hover { background: var(--pink); }
.copy-button:active { transform: translate(4px, 4px); box-shadow: none; }
.copy-button code { overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.copy-button span { font-weight: 500; }
.tiny-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; height: 62px; align-items: end; }
.tiny-grid i { background: var(--ink); height: var(--h, 30%); animation: levels 1.2s steps(4) infinite alternate; }
.tiny-grid i:nth-child(2n) { animation-delay: -.3s; --h: 85%; }
.tiny-grid i:nth-child(3n) { animation-delay: -.7s; --h: 55%; background: var(--violet); }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 35px clamp(18px, 4vw, 64px); border-top: 3px solid var(--ink); font-size: 10px; letter-spacing: .1em; }
.cursor-dot { width: 16px; height: 16px; background: var(--pink); border: 2px solid var(--ink); position: fixed; top: 0; left: 0; z-index: 20; pointer-events: none; transform: translate(-100px, -100px); mix-blend-mode: multiply; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: 28px; transform: translate(-50%, 100px); background: var(--ink); color: var(--acid); border: 2px solid var(--acid); padding: 12px 16px; font-size: 11px; transition: transform .25s steps(3); }
.toast.show { transform: translate(-50%, 0); }

@keyframes pulse { 50% { background: var(--pink); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes breathe { 50% { transform: scale(1.08); opacity: .72; } }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes scan { 50% { top: 80%; } }
@keyframes radar { to { transform: rotate(360deg); } }
@keyframes blip { 50% { opacity: .15; transform: scale(.7); } }
@keyframes levels { from { height: 16%; } to { height: var(--h); } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 45px; }
  .hero-copy { text-align: center; }
  .eyebrow, .intro { margin-inline: auto; }
  .links { justify-content: center; }
  .specimen { max-width: 650px; margin-inline: auto; width: 100%; }
  .console { grid-template-columns: 1fr 1fr; }
  .contract-panel { grid-column: 1 / -1; border-top: 3px solid var(--ink); }
  .frequency-panel { border-right: 0; }
}

@media (max-width: 600px) {
  .topbar { min-height: 56px; }
  .coordinates { display: none; }
  main { padding: 18px; }
  .hero { min-height: auto; gap: 0; }
  .eyebrow { font-size: 8px; }
  h1 { margin-top: 28px; font-size: clamp(3.7rem, 22vw, 6rem); }
  .intro br { display: none; }
  .links a { flex: 1; min-width: 80px; }
  .specimen { margin-top: -8px; }
  .console { grid-template-columns: 1fr; margin-top: 20px; }
  .panel, .frequency-panel { border-right: 0; border-bottom: 3px solid var(--ink); }
  .contract-panel { grid-column: auto; border-top: 0; border-bottom: 0; }
  footer { flex-direction: column; align-items: center; text-align: center; }
  .cursor-dot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
