:root {
  /* Foundation — true black, like the cube */
  --color-bg: #000000;
  --color-surface: #111111;
  --color-surface-hover: #1a1a1a;
  --color-border: #222222;
  --color-text: #e8e8e8;
  --color-text-muted: #777777;

  /* The palette — NeXT-inspired, GIF-friendly */
  --color-pink: #d94090;
  --color-delight: #f5a623;
  --color-yellow: #e8b820;
  --color-green: #36a852;
  --color-orange: #d9712e;
  --color-glow: hsla(54, 100%, 92%, 1);

  /* Typography */
  --font-display: system-ui, -apple-system, sans-serif;
  --font-subtitle: system-ui, -apple-system, sans-serif;
  --font-body: system-ui, -apple-system, sans-serif;

  /* Font sizes */
  --qg-fs-md: 0.875rem;
  --qg-fs-base: 1rem;
  --qg-fs-lg: 1.125rem;
  --qg-fs-xl: 1.5rem;
  --qg-fs-2xl: 2rem;
  --qg-fs-3xl: 3rem;

  --qg-become-bar-h: 0rem;

  /* Spacing — multiples of 8 */
  --qg-space-xs: 0.25rem;
  --qg-space-sm: 0.5rem;
  --qg-space-md: 1rem;
  --qg-space-lg: 2rem;
  --qg-space-xl: 3rem;
  --qg-space-2xl: 4rem;

  /* Everything on the page lines up inside this, floating bits included */
  --qg-container: 800px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--qg-fs-base);
  line-height: 1.5;
  color: var(--color-text);
  /* Reaches almost to the corners so the whole viewport keeps a little lift —
     shadows need something above pure black to fall on. Fixed, so every
     screenful gets the same wash rather than only the top of the page. */
  background: radial-gradient(ellipse at 50% 0%, hsl(0, 0%, 14%) 0%, hsl(0, 0%, 0%) 100%) no-repeat
    fixed;
  background-color: #000;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--qg-container);
  margin: 0 auto;
  padding: 0 var(--qg-space-lg);
}

.header {
  position: sticky;
  top: var(--qg-become-bar-h);
  z-index: 100;
  padding: 1.5rem 0;
  background: rgba(5, 5, 7, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7);
  margin-bottom: var(--qg-space-lg);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hidden {
  display: none !important;
}

/* Links carry no decoration by default — every one of them is either a control
   or a card, and each states its own affordance. Prose links (.qg-help a,
   .qg-page-footer a) draw their own underline. */
a {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.1s;
}

a:hover {
  color: #fff;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--qg-fs-2xl);
  font-weight: 700;
}

h2 {
  font-size: var(--qg-fs-xl);
  font-weight: 700;
}

h3 {
  font-size: var(--qg-fs-lg);
  font-weight: 700;
}

p {
  margin: 0;
}

/* Wordmark */

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--qg-fs-3xl);
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.wordmark:hover {
  color: var(--color-text);
}

/* Separator */

.qg-icon-separator {
  width: 0.4em;
  height: 0.4em;
  fill: currentColor;
  vertical-align: middle;
}

/* Footer */

.footer {
  padding: var(--qg-space-2xl) 0 var(--qg-space-lg);
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--qg-fs-md);
  text-align: center;
}

/* Form Fields */

.qg-form {
  text-align: left;
}

.qg-field {
  margin-bottom: 1.25rem;
}

.qg-label {
  display: block;
  font-size: var(--qg-fs-md);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: var(--qg-space-sm);
}

.qg-input {
  width: 100%;
  font-family: inherit;
  font-size: var(--qg-fs-base);
  padding: 0.75rem var(--qg-space-md);
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
}

.qg-input:focus {
  border-color: rgba(255, 255, 255, 0.4);
}

.qg-input-error {
  border-color: var(--color-pink);
}

.qg-field-error {
  color: var(--color-pink);
  font-size: var(--qg-fs-md);
  margin-top: 0.4rem;
}

.qg-btn {
  width: 100%;
  font-family: inherit;
  font-size: var(--qg-fs-md);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.9em 2em;
  cursor: pointer;
  background: linear-gradient(180deg, #fff 0%, #e0e0e0 100%);
  color: #000;
  border: none;
  border-radius: 999px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 -1px 0 rgba(0, 0, 0, 0.1) inset,
    0 2px 6px rgba(0, 0, 0, 0.4);
  transition: background 0.2s;
}

.qg-btn:hover {
  background: linear-gradient(180deg, #fff 0%, #eee 100%);
}

/* Screen */

.screen {
  background: #000;
  border: 1px solid #000;
  border-radius: 8px;
  aspect-ratio: 3/2;
  animation: tv-flicker-screen 3s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

.screen video,
.screen img {
  border-radius: 8px;
}

@keyframes tv-flicker-screen {
  0% {
    box-shadow: 0 0 15px 1px hsla(54, 100%, 92%, 0.09);
  }
  15% {
    box-shadow: 0 0 18px 3px hsla(54, 100%, 92%, 0.12);
  }
  30% {
    box-shadow: 0 0 13px 0px hsla(54, 100%, 92%, 0.08);
  }
  45% {
    box-shadow: 0 0 16px 2px hsla(54, 100%, 92%, 0.11);
  }
  60% {
    box-shadow: 0 0 12px 1px hsla(54, 100%, 92%, 0.08);
  }
  75% {
    box-shadow: 0 0 17px 2px hsla(54, 100%, 92%, 0.1);
  }
  100% {
    box-shadow: 0 0 15px 1px hsla(54, 100%, 92%, 0.09);
  }
}

.screen video,
.screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

/* Inline placeholder paints on the screen until the still poster arrives */
.screen {
  background-size: cover;
  background-position: center;
}

/* Frost the tiny upscaled placeholder; the video/poster layers sit above */
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 8px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Source Credit */

.gif-source {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--qg-fs-md);
  text-align: center;
  margin-top: var(--qg-space-lg);
}

/* Flash Messages */

.flash {
  position: fixed;
  top: calc(5.5rem + var(--qg-become-bar-h));
  right: max(var(--qg-space-lg), calc(50vw - var(--qg-container) / 2 + var(--qg-space-lg)));
  z-index: 120;
  pointer-events: none;
  max-width: 32ch;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-green);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-green);
  font-size: var(--qg-fs-md);
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  animation:
    flash-in 0.2s ease-out,
    flash-out 0.4s ease-in 6s forwards;
}

.flash-error {
  border-color: var(--color-pink);
  color: var(--color-pink);
}

@keyframes flash-in {
  from {
    opacity: 0;
    translate: 0 -0.5rem;
  }
}

/* Nothing floating should outstay its welcome */
@keyframes flash-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* No room to float beside the content on a phone — sit it along the bottom */
@media (max-width: 600px) {
  .flash {
    top: auto;
    right: 1rem;
    bottom: 1.25rem;
    left: 1rem;
    max-width: none;
  }
}
