:root {
  --black: #000;            /* the same black as the neon drawing */
  --tube: #e6f3ff;          /* the white-hot centre of a lit tube */
  --neon: #2f8dff;          /* the glow */
  --sky: #6fb6ff;           /* neon, light enough for small text and lines */
  --text: #c7d6e6;
  --muted: #8fa3b8;
  --glow: 0 0 6px rgba(47, 141, 255, .9), 0 0 22px rgba(47, 141, 255, .55);
  --gutter: clamp(20px, 3.4vw, 48px);
}

* { box-sizing: border-box; }

html { background: var(--black); scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font: 400 1.125rem/1.55 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2 {
  margin: 0;
  font-family: 'Tilt Neon', 'Atkinson Hyperlegible Next', system-ui, sans-serif;
  font-weight: 400;
  color: var(--tube);
  text-shadow: var(--glow);
}

p { margin: 0; }

:focus-visible { outline: 2px solid var(--tube); outline-offset: 3px; }

/* The drawing leaves its top left and bottom right empty, so the words go there. */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--gutter);
}

.title { grid-area: 1 / 1; position: relative; z-index: 1; }

h1 {
  font-size: clamp(3.4rem, 7vw, 6.4rem);
  line-height: 1.02;
  letter-spacing: .01em;
}

.soon {
  margin-top: .7em;
  font-size: clamp(1.2rem, 1.9vw, 1.6rem);
  color: var(--sky);
}

.sign {
  grid-area: 1 / 1 / 3 / 3;
  position: relative;
  justify-self: center;
  align-self: center;
  width: min(100vh - 2 * var(--gutter), 66vw);
  width: min(100svh - 2 * var(--gutter), 66vw);
  aspect-ratio: 1;
}

.sign img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The tube with the power off, always there behind the lit layer. */
.sign .unlit { filter: grayscale(1) brightness(.2); }

.sign .lit { animation: strike 1.5s linear .35s backwards; }

/* A sign catching: two stutters, then it holds. */
@keyframes strike {
  0%, 9%   { opacity: 0; }
  10%, 17% { opacity: .85; }
  18%, 52% { opacity: .08; }
  53%, 60% { opacity: 1; }
  61%, 78% { opacity: .3; }
  79%, 100% { opacity: 1; }
}

.pitch {
  grid-area: 2 / 2;
  position: relative;
  z-index: 1;
  align-self: end;
  justify-self: end;
  max-width: 21em;
}

.pitch p + p { margin-top: .7em; }

.pitch .strong { color: var(--tube); font-weight: 600; }

.jump {
  display: inline-block;
  margin-top: 1.1em;
  color: var(--sky);
  font-weight: 600;
  text-underline-offset: .25em;
  text-decoration-thickness: 2px;
}

.jump:hover { color: var(--tube); }

/* Everything that slid off the table. */
.pieces {
  display: block;
  width: min(1100px, 100% - 2 * var(--gutter));
  margin: clamp(24px, 4vw, 56px) auto 0;
  overflow: visible;
  fill: none;
  stroke: var(--tube);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 3px var(--neon)) drop-shadow(0 0 10px rgba(47, 141, 255, .6));
}

.pieces .pip { fill: var(--tube); stroke: none; }

.pieces .front { fill: var(--black); }

.seat {
  width: min(44rem, 100% - 2 * var(--gutter));
  margin: clamp(64px, 9vw, 120px) auto 0;
  scroll-margin-top: 32px;
}

h2 {
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  line-height: 1.1;
}

.intro { margin-top: .8em; max-width: 34em; }

form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 24px;
  margin-top: 2rem;
}

form[hidden] { display: none; }

.field.wide { grid-column: 1 / -1; }

label {
  display: block;
  margin-bottom: .35em;
  color: var(--tube);
  font-size: 1rem;
}

label span { color: var(--muted); }

input, textarea {
  display: block;
  width: 100%;
  padding: .7em .85em;
  border: 2px solid #3a5a7d;
  border-radius: 10px;
  background: var(--black);
  color: var(--tube);
  font: inherit;
  transition: border-color .15s, box-shadow .15s;
}

textarea { resize: vertical; }

/* A field lights up when you're in it. */
input:focus, textarea:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: var(--glow);
}

.trap { position: absolute; left: -9999px; }

button {
  grid-column: 1 / -1;
  justify-self: start;
  padding: .7em 1.5em;
  border: 0;
  border-radius: 999px;
  background: var(--tube);
  color: var(--black);
  font: 600 1.125rem/1.3 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', system-ui, sans-serif;
  cursor: pointer;
  box-shadow: var(--glow);
  transition: box-shadow .15s;
}

button:hover { box-shadow: 0 0 10px rgba(47, 141, 255, 1), 0 0 34px rgba(47, 141, 255, .8); }

button:disabled { opacity: .7; cursor: wait; }

.kaomoji {
  font-family: system-ui, -apple-system, 'Segoe UI', 'Hiragino Sans', sans-serif;
  white-space: nowrap;
}

.done { margin-top: 2rem; color: var(--tube); outline: none; }

.done .kaomoji {
  margin-bottom: .3em;
  color: var(--sky);
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  text-shadow: var(--glow);
}

.failed:not(:empty) {
  margin-top: 1rem;
  padding: .7em .9em;
  border: 2px solid #ff9d6b;
  border-radius: 10px;
  color: #ffd2bb;
}

footer {
  width: min(44rem, 100% - 2 * var(--gutter));
  margin: clamp(64px, 9vw, 110px) auto 0;
  padding-bottom: 40px;
  color: var(--muted);
  font-size: 1rem;
}

footer .kaomoji { color: var(--sky); margin-bottom: .2em; }

/* On narrow screens the drawing's empty corners are too small to hold words. */
@media (max-width: 820px) {
  .hero {
    display: block;
    min-height: 0;
  }

  h1 { font-size: clamp(3.4rem, 15.5vw, 5.4rem); }

  .sign {
    width: min(100%, 560px);
    margin: 4px auto 0;
  }

  .pitch { max-width: 30em; margin-top: 4px; }

  form { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sign .lit { animation: none; }
  input, textarea, button { transition: none; }
}
