:root {
  color-scheme: light dark;
  --paper: #f4f3ee;
  --surface: #fcfbf6;
  --ink: #292d27;
  --muted: #62665d;
  --line: #d9dbd0;
  --grid: #d1d4c7;
  --depth: #dce0d1;
  --accent: #c2ef74;
  --accent-ink: #292d27;
  --shadow: #292d2710;
  --page-gutter: clamp(1.5rem, 4.5vw, 4rem);
  background: var(--paper);
  color: var(--ink);
  font-family: "Courier New", Courier, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151715;
    --surface: #20241f;
    --ink: #e6e9df;
    --muted: #a7b09f;
    --line: #353d32;
    --grid: #46513e;
    --depth: #343e2e;
    --accent: #c2ef74;
    --accent-ink: #20261b;
    --shadow: #00000033;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-inline-size: 0;
  min-block-size: 100vh;
  min-block-size: 100svh;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(var(--grid) 0.7px, transparent 0.7px);
  background-size: 22px 22px;
  content: "";
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 66%);
  pointer-events: none;
}

.masthead {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.5rem, 3.4vw, 3rem) var(--page-gutter);
}

.wordmark {
  font-size: clamp(1.15rem, 1.5vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.075em;
  line-height: 1;
}

.wordmark-dot {
  color: var(--muted);
}

.work-mark {
  inline-size: 28px;
  block-size: 14px;
  color: var(--muted);
}

main {
  display: grid;
  min-block-size: 100vh;
  min-block-size: 100svh;
  padding: 6.5rem var(--page-gutter);
  place-items: center;
}

.parking {
  display: flex;
  inline-size: 100%;
  max-inline-size: 40rem;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 2.8vw, 1.8rem);
}

.illustration {
  display: block;
  inline-size: clamp(15rem, min(44vw, 58svh), 28rem);
  max-inline-size: 100%;
  block-size: auto;
  overflow: visible;
}

h1 {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.65rem, 1.15vw, 0.8rem);
  font-weight: 400;
  letter-spacing: 0.2em;
  line-height: 1.8;
  text-align: center;
  text-wrap: balance;
}

.orbit-guide {
  stroke: var(--line);
  stroke-dasharray: 2 7;
  stroke-width: 1;
}

.guide-ticks {
  stroke: var(--line);
  stroke-width: 1.5;
}

.orbit {
  transform-origin: 220px 180px;
  animation: orbit 28s linear infinite;
}

.orbit-dot {
  fill: var(--muted);
}

.ground-shadow {
  fill: var(--shadow);
  transform-origin: 222px 319px;
  animation: shadow-breathe 5s ease-in-out infinite;
}

.window-float {
  animation: levitate 5s ease-in-out infinite;
}

.window-body {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 2.5;
}

.window-depth {
  fill: var(--depth);
  stroke: var(--ink);
  stroke-width: 2.5;
}

.window-line,
.window-minimize {
  stroke: var(--ink);
  stroke-width: 2;
}

.window-minimize {
  stroke-linecap: round;
}

.window-controls {
  fill: var(--ink);
}

.face {
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4.5;
}

.face-failed {
  animation: failure 10s ease-in-out infinite;
}

.face-recovered {
  opacity: 0;
  animation: recovery 10s ease-in-out infinite;
}

.cheek {
  opacity: 0.45;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 3;
}

.badge-depth {
  fill: var(--ink);
  stroke: var(--ink);
  stroke-width: 2;
}

.badge-body {
  fill: var(--accent);
  stroke: var(--accent-ink);
  stroke-width: 2.5;
}

.upgrade-arrow {
  stroke: var(--accent-ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.5;
  animation: upgrade 2.5s ease-in-out infinite;
}

.spark {
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  animation: sparkle 5s ease-in-out infinite;
}

.spark-two {
  animation-delay: -2.5s;
}

.loose-pixel {
  animation: levitate 5s -2.5s ease-in-out infinite;
}

.pixel {
  fill: var(--accent);
  stroke: var(--accent-ink);
  stroke-width: 1.5;
}

.activity-track {
  fill: var(--line);
}

.activity-slide {
  fill: var(--muted);
  animation: activity 2.5s ease-in-out infinite alternate;
}

.registration-marks {
  position: fixed;
  inset-inline: var(--page-gutter);
  inset-block-end: clamp(1.5rem, 3.4vw, 3rem);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.registration-marks svg {
  inline-size: 14px;
  block-size: 14px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1;
  opacity: 0.5;
}

@keyframes levitate {
  0%, 100% { transform: translateY(3px); }
  50% { transform: translateY(-9px); }
}

@keyframes shadow-breathe {
  0%, 100% { transform: scaleX(1); opacity: 1; }
  50% { transform: scaleX(0.8); opacity: 0.6; }
}

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

@keyframes failure {
  0%, 46%, 96%, 100% { opacity: 1; }
  52%, 90% { opacity: 0; }
}

@keyframes recovery {
  0%, 46%, 96%, 100% { opacity: 0; }
  52%, 90% { opacity: 1; }
}

@keyframes upgrade {
  0%, 100% { transform: translateY(2px); }
  50% { transform: translateY(-3px); }
}

@keyframes sparkle {
  0%, 100% { transform: scale(0.8) rotate(0deg); opacity: 0.5; }
  50% { transform: scale(1) rotate(90deg); opacity: 1; }
}

@keyframes activity {
  to { transform: translateX(48px); }
}

@media (max-height: 500px) and (min-width: 480px) {
  main { padding-block: 4rem 2.5rem; }
  .illustration { inline-size: min(43vh, 16rem); }
  .parking { gap: 0.5rem; }
}

/* Keep a complete, friendly illustration when the OS requests less motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .face-failed { opacity: 0; }
  .face-recovered { opacity: 1; }
  .activity-slide { transform: translateX(24px); }
}
