:root {
  color-scheme: dark;
  --dark: #020e11;
  --dark-2: #020e11;
  --ink: #dfffe9;
  --muted: #769586;
  --green: #45f485;
  --green-dim: rgba(69, 244, 133, 0.16);
  --blue: #121f9e;
  --line: rgba(69, 244, 133, 0.28);
  --header-h: 74px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background-color: var(--dark);
  background-image:
    radial-gradient(circle, rgba(223, 255, 233, 0.055) 0 0.7px, transparent 0.8px),
    radial-gradient(circle, rgba(69, 244, 133, 0.035) 0 0.55px, transparent 0.65px),
    radial-gradient(circle, rgba(255, 255, 255, 0.035) 0 0.45px, transparent 0.55px);
  background-position: 0 0, 3px 5px, 7px 2px;
  background-size: 5px 5px, 9px 9px, 13px 13px;
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  width: 100%;
  min-height: var(--header-h);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(69, 244, 133, 0.2);
  background: rgba(2, 4, 3, 0.88);
  backdrop-filter: blur(18px);
  overflow-x: clip;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  width: clamp(132px, 13vw, 188px);
  color: var(--ink);
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  filter:
    drop-shadow(0 0 8px rgba(69, 244, 133, 0.42))
    drop-shadow(0 0 18px rgba(69, 244, 133, 0.18));
}

.site-nav {
  display: flex;
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  position: relative;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid transparent;
  color: rgba(223, 255, 233, 0.78);
  font-family: "Courier New", ui-monospace, monospace;
  font-size: clamp(0.72rem, 1.4vw, 0.82rem);
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  border-color: rgba(69, 244, 133, 0.24);
  background: rgba(69, 244, 133, 0.07);
  color: var(--green);
  outline: none;
}

.hero-shell {
  min-height: 100vh;
  padding-top: 0;
}

.hero {
  position: relative;
  display: grid;
  min-height: 100vh;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  padding: 0;
  isolation: isolate;
}

.model-stage {
  position: relative;
  width: 100vw;
  min-width: 280px;
  height: 100vh;
  height: 100svh;
  aspect-ratio: auto;
  margin: auto;
  cursor: grab;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.model-stage.is-dragging {
  cursor: grabbing;
}

#tech-background-scene,
#logo-scene,
#ascii-scene,
#hud-scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

#tech-background-scene {
  z-index: 1;
  opacity: 1;
  mix-blend-mode: screen;
  pointer-events: none;
}

#logo-scene {
  z-index: 2;
  opacity: 0;
}

#ascii-scene {
  z-index: 2;
  mix-blend-mode: screen;
  opacity: 1;
  pointer-events: none;
}

#hud-scene {
  z-index: 3;
  mix-blend-mode: normal;
  opacity: 1;
  pointer-events: none;
}

.coming-soon-art {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: block;
  width: min(48%, 820px);
  height: auto;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
}

.coming-soon-logo {
  position: absolute;
  top: 160px;
  left: 50%;
  z-index: 5;
  display: block;
  width: 202px;
  height: auto;
  transform: translateX(-50%);
  pointer-events: none;
  user-select: none;
}

.model-status {
  position: absolute;
  right: 4%;
  bottom: 8%;
  z-index: 4;
  padding: 6px 8px;
  border: 1px solid rgba(69, 244, 133, 0.28);
  background: rgba(3, 5, 4, 0.76);
  color: var(--green);
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.model-status.is-hidden {
  display: none;
}

.dither-controls {
  display: none;
  position: fixed;
  top: calc(var(--header-h) + 16px);
  right: 18px;
  z-index: 12;
  width: min(286px, calc(100vw - 36px));
  border: 1px solid rgba(223, 255, 233, 0.22);
  background: rgba(2, 14, 17, 0.95);
  color: rgba(223, 255, 233, 0.82);
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 0.68rem;
}

.dither-controls summary {
  padding: 11px 12px;
  color: var(--green);
  cursor: pointer;
  text-transform: uppercase;
  user-select: none;
}

.dither-controls__body {
  max-height: calc(100vh - var(--header-h) - 70px);
  overflow-y: auto;
  padding: 0 12px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(69, 244, 133, 0.45) transparent;
}

.dither-controls h2 {
  margin: 12px 0 8px;
  color: rgba(223, 255, 233, 0.54);
  font: inherit;
  text-transform: uppercase;
}

.dither-controls label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  margin-bottom: 9px;
}

.dither-controls output {
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.dither-controls input[type="range"] {
  width: 100%;
  grid-column: 1 / -1;
  margin: 0;
  accent-color: var(--green);
}

.dither-controls button {
  width: 100%;
  min-height: 32px;
  border: 1px solid rgba(69, 244, 133, 0.45);
  border-radius: 0;
  background: transparent;
  color: var(--green);
  font: inherit;
  text-transform: uppercase;
  cursor: pointer;
}

.dither-controls button:hover,
.dither-controls button:focus-visible {
  background: rgba(69, 244, 133, 0.1);
  outline: none;
}

@media (max-width: 880px) {
  .site-header {
    position: sticky;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .brand-mark {
    width: 168px;
    justify-content: center;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .hero-shell {
    padding-top: 0;
  }

  .hero {
    min-height: 100vh;
    grid-template-rows: minmax(0, 1fr);
  }

  .model-stage {
    width: min(100vw, calc(100vh * 16 / 9), 1920px);
  }

  .dither-controls {
    top: auto;
    right: 12px;
    bottom: 12px;
  }
}

@media (max-aspect-ratio: 3 / 2) {
  body {
    overflow: hidden;
  }

  .hero-shell,
  .hero {
    min-height: 100vh;
    min-height: 100svh;
  }

  .model-stage {
    width: 100vw;
    min-width: 0;
    height: 100vh;
    height: 100svh;
    aspect-ratio: auto;
  }

  .coming-soon-art {
    width: min(72%, 680px);
  }

}

@media (max-width: 560px) {
  body {
    overflow: hidden;
  }

  .hero-shell,
  .hero {
    min-height: 100vh;
    min-height: 100svh;
  }

  .model-stage {
    width: 100vw;
    min-width: 0;
    height: 100vh;
    height: 100svh;
    aspect-ratio: auto;
  }

  .coming-soon-art {
    width: min(72%, 520px);
  }

  .model-status {
    right: 50%;
    transform: translateX(50%);
  }
}
