@font-face {
  font-family: "PressStart2P";
  src: url("assets/fonts/PressStart2P-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --color-bg: #7bd8ff;
  --color-sky-deep: #27a7ef;
  --color-goose: #d8ff23;
  --color-goose-dark: #6b8f05;
  --color-beak: #ff7a18;
  --color-black: #050505;
  --color-window: #c7c7c7;
  --color-window-light: #f5f5f5;
  --color-window-dark: #757575;
  --color-blue: #012c9b;
  --color-blue-light: #1e77ef;
  --color-terminal: #06140b;
  --color-terminal-text: #baff55;
  --font-pixel: "PressStart2P", "Lucida Console", "Courier New", monospace;
  --font-ui: var(--font-pixel);
  --font-display: var(--font-pixel);
  --font-mono: var(--font-pixel);
  --cursor-default: url("assets/cursors/pixel-arrow.svg") 4 2, auto;
  --cursor-pointer: url("assets/cursors/pixel-hand.svg") 18 4, pointer;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body {
  margin: 0;
  color: var(--color-black);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  background: var(--color-bg);
  overflow-x: hidden;
  overscroll-behavior-y: auto;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-rendering: optimizeSpeed;
  cursor: var(--cursor-default);
}

button,
input,
a {
  font: inherit;
}

button,
input[type="range"],
.title-controls button,
.close-help,
[data-task] {
  cursor: var(--cursor-pointer);
}

a {
  color: inherit;
  cursor: var(--cursor-pointer);
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: #020302;
  color: var(--color-terminal-text);
  font-family: var(--font-mono);
  transition: opacity 400ms ease, visibility 400ms ease;
}

.boot-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.boot-box {
  width: min(210px, calc(100vw - 56px));
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  text-align: center;
  background: transparent;
  box-shadow: none;
}

.boot-logo-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 14px rgba(186, 255, 85, 0.42));
}

.boot-logo-shell::before {
  content: "";
  position: absolute;
  border-radius: 50%;
  aspect-ratio: 1;
  width: 112%;
  border: 3px solid rgba(186, 255, 85, 0.72);
  border-top-color: transparent;
  box-shadow: 0 0 20px rgba(186, 255, 85, 0.22);
  animation: spin 1.6s linear infinite;
}

.boot-logo-shell img {
  position: relative;
  z-index: 1;
  width: 78%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--color-terminal-text);
  background: #000;
  filter: saturate(1.1) contrast(1.08);
  animation: simpleLogoSpin 1.8s linear infinite;
}

.desktop {
  position: relative;
  min-height: 100vh;
  padding: 54px 18px 54px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.75) 0 6%, transparent 7%),
    linear-gradient(180deg, #42bdff 0%, #8fe5ff 45%, #bdfaa4 100%);
  isolation: isolate;
  overflow: hidden;
}

.desktop::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 50% 120%, rgba(216, 255, 35, 0.28), transparent 42%);
  mix-blend-mode: soft-light;
}

.sky-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.cloud {
  position: absolute;
  width: 170px;
  height: 58px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 42px -20px 0 2px #fff, 88px 1px 0 8px #fff, 24px 18px 0 -4px rgba(44, 151, 216, 0.38);
  opacity: 0.9;
  animation: drift 28s linear infinite;
}

.cloud-a {
  top: 15%;
  left: -220px;
}

.cloud-b {
  top: 58%;
  left: 15%;
  transform: scale(0.75);
  animation-duration: 34s;
}

.cloud-c {
  top: 35%;
  left: 82%;
  transform: scale(1.15);
  animation-duration: 42s;
}

.desktop-topbar,
.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 5px 8px;
  border-top: 2px solid var(--color-window-light);
  border-bottom: 2px solid var(--color-window-dark);
  background: var(--color-window);
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #3b3b3b;
}

.desktop-topbar {
  top: 0;
}

.taskbar {
  bottom: 0;
}

.start-button,
.taskbar button,
.button,
.command-line button {
  min-height: 28px;
  border: 2px solid;
  border-color: var(--color-window-light) var(--color-window-dark) var(--color-window-dark) var(--color-window-light);
  background: var(--color-window);
  color: #111;
  text-decoration: none;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #515151;
  cursor: var(--cursor-pointer);
}

.start-button,
.taskbar button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-weight: 700;
  font-size: 11px;
}

.start-mark {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  background: var(--color-goose);
  border: 1px solid #111;
}

.topbar-links {
  display: flex;
  gap: 4px;
}

.topbar-links a {
  padding: 5px 8px;
  color: #111;
  text-decoration: none;
  font-size: 11px;
}

.topbar-links a:hover,
.start-button:hover,
.taskbar button:hover,
.button:hover,
.command-line button:hover {
  filter: brightness(1.04);
}

.tray {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 330px;
  justify-content: flex-end;
  padding: 4px 8px;
  border: 1px solid;
  border-color: var(--color-window-dark) var(--color-window-light) var(--color-window-light) var(--color-window-dark);
  font-family: var(--font-mono);
  font-size: 8px;
  white-space: nowrap;
}

.tray-light {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-goose);
  box-shadow: 0 0 8px var(--color-goose);
}

.market-readout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 160px;
  color: #111;
}

.market-readout span {
  display: inline-block;
}

.market-readout.is-stale {
  color: #8a3100;
}

.desktop-grid {
  width: min(1160px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  grid-template-areas:
    "hero meter"
    "hero meme"
    "story terminal"
    "runner terminal"
    "gallery terminal"
    "flock terminal";
  gap: 14px;
  align-items: start;
}

.window {
  position: relative;
  border: 2px solid;
  border-color: var(--color-window-light) #303030 #303030 var(--color-window-light);
  background: var(--color-window);
  box-shadow: 8px 10px 0 rgba(0, 0, 0, 0.28), inset 1px 1px 0 #fff;
}

.draggable {
  touch-action: none;
}

.window.is-front {
  z-index: 12;
}

.hero-window {
  grid-area: hero;
}

.meter-window {
  grid-area: meter;
}

.meme-window {
  grid-area: meme;
}

.story-window {
  grid-area: story;
}

.terminal-window {
  grid-area: terminal;
}

.runner-window {
  grid-area: runner;
}

.gallery-window {
  grid-area: gallery;
}

.flock-window {
  grid-area: flock;
}

.title-bar {
  display: flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 5px;
  background: linear-gradient(90deg, var(--color-blue), var(--color-blue-light));
  color: white;
  font-weight: 700;
  font-size: 10px;
  cursor: var(--cursor-pointer);
  user-select: none;
}

.title-bar:active {
  cursor: var(--cursor-pointer);
}

.title-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.title-controls {
  margin-left: auto;
  display: flex;
  gap: 3px;
}

.title-controls button,
.close-help {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 2px solid;
  border-color: #fff #555 #555 #fff;
  background: var(--color-window);
}

.close-help {
  margin-left: auto;
  color: #111;
  cursor: var(--cursor-pointer);
}

.title-controls button:nth-child(1)::before {
  content: "";
  display: block;
  width: 8px;
  height: 2px;
  margin: 10px auto 0;
  background: #111;
}

.title-controls button:nth-child(2)::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin: 2px auto;
  border: 1px solid #111;
}

.title-controls button:nth-child(3)::before {
  content: "x";
  display: block;
  line-height: 12px;
  color: #111;
  font-size: 12px;
}

.window-body {
  margin: 4px;
  border: 1px solid;
  border-color: var(--color-window-dark) var(--color-window-light) var(--color-window-light) var(--color-window-dark);
  background: #ececec;
}

.hero-body {
  display: grid;
  grid-template-columns: 42% 1fr;
  gap: 22px;
  min-height: 470px;
  padding: 24px;
  align-items: center;
  background:
    linear-gradient(rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.42)),
    radial-gradient(circle at 24% 20%, #ffffff 0 8%, transparent 9%),
    linear-gradient(150deg, #27a7ef 0%, #85ddff 52%, #d8ff23 53%, #a9e00f 100%);
}

.logo-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: min(360px, 100%);
  margin: 0 auto;
}

.logo-orbit::before {
  content: "";
  position: absolute;
  width: 104%;
  aspect-ratio: 1;
  border: 3px dashed rgba(5, 5, 5, 0.48);
  border-radius: 50%;
  animation: spin 22s linear infinite;
}

.logo-orbit::after {
  content: "";
  position: absolute;
  width: 112%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, rgba(5, 5, 5, 0.55) 0deg 5deg, transparent 5deg 12deg);
  mask: radial-gradient(circle, transparent 0 47%, #000 48% 51%, transparent 52%);
  -webkit-mask: radial-gradient(circle, transparent 0 47%, #000 48% 51%, transparent 52%);
  animation: spin 14s linear infinite reverse;
  pointer-events: none;
}

.logo-orbit img {
  position: relative;
  z-index: 1;
  width: min(320px, 100%);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid #050505;
  background: #000;
  box-shadow: 9px 12px 0 rgba(0, 0, 0, 0.24);
}

.hero-copy {
  min-width: 0;
}

.kicker {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 8px;
  border: 2px solid #111;
  background: var(--color-goose);
  font-weight: 800;
  font-size: 10px;
  line-height: 1.55;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1.18;
  letter-spacing: 0;
  text-transform: uppercase;
  font-family: var(--font-display);
  font-weight: 900;
  text-shadow: 4px 4px 0 #fff, 8px 8px 0 rgba(0, 0, 0, 0.16);
}

h2 {
  margin-bottom: 10px;
  font-size: 18px;
  line-height: 1.4;
  font-family: var(--font-ui);
}

.ticker {
  display: inline-block;
  margin: 0 0 18px;
  padding: 6px 12px;
  background: var(--color-black);
  color: var(--color-goose);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
}

.tagline {
  max-width: 520px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.65;
  font-weight: 900;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 116px;
  padding: 7px 12px;
  font-weight: 900;
  font-size: 10px;
  line-height: 1.5;
}

.button.primary {
  background: var(--color-goose);
}

.compact-body,
.meme-body,
.text-body,
.terminal-body,
.flock-body {
  padding: 14px;
}

.compact-body label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

.range-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 9px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--color-goose);
}

output {
  display: block;
  margin-top: 12px;
  padding: 6px;
  border: 1px solid #111;
  background: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
}

.meme-body {
  display: grid;
  gap: 10px;
  place-items: center;
  text-align: center;
  background: #fff;
}

.meme-body img {
  width: min(185px, 100%);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid #111;
}

.meme-body p {
  margin: 0;
  font-weight: 800;
  font-size: 10px;
  line-height: 1.7;
}

.text-body {
  background:
    linear-gradient(rgba(255, 255, 255, 0.91), rgba(255, 255, 255, 0.91)),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.04) 0 1px, transparent 1px 6px);
  line-height: 1.75;
  font-size: 10px;
}

.text-body p:last-child {
  margin-bottom: 0;
}

.terminal-body {
  display: grid;
  min-height: 334px;
  grid-template-rows: 1fr auto;
  gap: 12px;
  background: var(--color-terminal);
  color: var(--color-terminal-text);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

.runner-body {
  display: grid;
  gap: 10px;
  padding: 10px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px 4px);
}

.runner-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 86 / 30;
  min-height: 220px;
  border: 2px solid #111;
  background: linear-gradient(180deg, #dff6ff 0%, #f8ffe2 62%, #c7ff62 63%, #a7d83d 100%);
  overflow: hidden;
}

#runnerCanvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  cursor: var(--cursor-pointer);
  touch-action: pan-y;
}

.runner-controls {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.runner-controls output {
  margin: 0;
}

.runner-button {
  min-height: 30px;
  padding: 6px 10px;
  border: 2px solid;
  border-color: var(--color-window-light) var(--color-window-dark) var(--color-window-dark) var(--color-window-light);
  background: var(--color-window);
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #515151;
  font-size: 9px;
  font-weight: 700;
  cursor: var(--cursor-pointer);
  touch-action: manipulation;
  user-select: none;
}

.runner-button:active {
  border-color: var(--color-window-dark) var(--color-window-light) var(--color-window-light) var(--color-window-dark);
  background: var(--color-goose);
  transform: translate(1px, 1px);
}

.runner-status span {
  min-width: 0;
}

.gallery-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  padding: 12px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92)),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 7px);
}

.gallery-body figure {
  margin: 0;
  min-width: 0;
  padding: 5px;
  border: 2px solid;
  border-color: var(--color-window-dark) var(--color-window-light) var(--color-window-light) var(--color-window-dark);
  background: #f8f8f8;
  box-shadow: inset 1px 1px 0 #fff;
}

.gallery-body img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid #111;
  background: #050505;
}

.terminal-lines {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 280px;
  padding-right: 8px;
}

.terminal-lines p {
  margin: 0 0 8px;
}

.command-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.command-line input {
  min-width: 0;
  height: 30px;
  border: 1px solid var(--color-terminal-text);
  background: #020302;
  color: var(--color-terminal-text);
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.flock-body {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #fff;
}

.flock-body div {
  min-height: 80px;
  padding: 10px;
  border: 2px solid #111;
  background: linear-gradient(180deg, #f8f8f8, #dadada);
  font-size: 9px;
  line-height: 1.6;
}

.flock-body strong,
.flock-body span {
  display: block;
}

.flock-body strong {
  margin-bottom: 8px;
}

.pending {
  color: #8a3100;
  font-family: var(--font-mono);
}

.contract-address {
  overflow-wrap: anywhere;
  word-break: break-word;
  color: #050505;
  font-family: var(--font-mono);
  font-size: 7px;
  line-height: 1.8;
}

.status-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 0 4px 4px;
}

.status-bar span {
  min-height: 22px;
  padding: 3px 6px;
  border: 1px solid;
  border-color: var(--color-window-dark) var(--color-window-light) var(--color-window-light) var(--color-window-dark);
  font-size: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status-button {
  min-height: 22px;
  padding: 3px 6px;
  border: 1px solid;
  border-color: var(--color-window-light) var(--color-window-dark) var(--color-window-dark) var(--color-window-light);
  background: var(--color-window);
  color: #111;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #515151;
  font-size: 8px;
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: var(--cursor-pointer);
}

.status-button:active,
.status-button.is-honking {
  border-color: var(--color-window-dark) var(--color-window-light) var(--color-window-light) var(--color-window-dark);
  background: var(--color-goose);
  color: #050505;
  transform: translate(1px, 1px);
}

.taskbar-marquee {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 9px;
}

.help-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.42);
}

.help-modal[hidden] {
  display: none;
}

.help-window {
  width: min(520px, 100%);
}

@keyframes boot {
  0% {
    width: 12%;
  }
  100% {
    width: 96%;
  }
}

@keyframes drift {
  0% {
    translate: -260px 0;
  }
  100% {
    translate: calc(100vw + 280px) 0;
  }
}

@keyframes spin {
  to {
    rotate: 360deg;
  }
}

@keyframes simpleLogoSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 920px) {
  html,
  body,
  .desktop,
  .window,
  .window-body,
  .title-bar,
  .draggable {
    touch-action: pan-y;
  }

  .desktop {
    padding-left: 10px;
    padding-right: 10px;
  }

  .desktop-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "meter"
      "meme"
      "story"
      "runner"
      "gallery"
      "terminal"
      "flock";
  }

  .hero-body {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 18px;
  }

  .logo-orbit img {
    width: min(260px, 72vw);
  }

  .logo-orbit {
    width: min(292px, 76vw);
  }

  .tagline {
    font-size: 11px;
  }

  .flock-body {
    grid-template-columns: repeat(2, 1fr);
  }

  .runner-screen {
    min-height: 190px;
  }

}

@media (max-width: 620px) {
  .desktop {
    padding-top: 92px;
  }

  .desktop-topbar {
    flex-wrap: wrap;
  }

  .tray {
    flex: 1;
    min-width: 230px;
    max-width: none;
    gap: 6px;
    font-size: 6px;
  }

  .market-readout {
    min-width: 118px;
    gap: 5px;
  }

  .topbar-links {
    order: 3;
    width: 100%;
  }

  .topbar-links a {
    flex: 1;
    text-align: center;
    padding: 4px 3px;
    font-size: 8px;
  }

  h1 {
    font-size: 26px;
  }

  .action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .runner-controls {
    grid-template-columns: 1fr 1fr;
  }

  .runner-controls output {
    grid-column: 1 / -1;
  }

  .runner-screen {
    min-height: 170px;
  }

  .status-bar {
    grid-template-columns: 1fr;
  }

  .flock-body {
    grid-template-columns: 1fr;
  }

  .taskbar button:nth-of-type(n + 3) {
    display: none;
  }
}

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