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

:root {
  --bg: #0c0c0b;
  --fg: #e9e4d8;
  --muted: #7d786e;
  --rule: rgba(233, 228, 216, 0.12);
  --hot: #c8f031;
  --pad: clamp(1.25rem, 2.6vw, 2.25rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 1px solid var(--hot);
  outline-offset: 3px;
}

.eyebrow,
.col h4,
.footer-base,
.hint {
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ─────────── Layout ─────────── */

.footer {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(200, 240, 49, 0.035), transparent 70%),
    var(--bg);
}

.footer-top {
  position: relative;
  z-index: 2;
  padding: var(--pad);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 1.25rem;
  row-gap: 2rem;
  border-bottom: 1px solid var(--rule);
}

.intro {
  grid-column: 1 / 6;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
}

.dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--hot);
  box-shadow: 0 0 12px rgba(200, 240, 49, 0.6);
}

.statement {
  max-width: 30ch;
  font-size: clamp(1.25rem, 1.9vw, 1.75rem);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 48;
}

.cols {
  grid-column: 7 / 13;
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 1.5rem;
}

.col h4 {
  margin-bottom: 1rem;
  font-weight: 400;
  color: var(--muted);
}

.col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.col a {
  position: relative;
  display: inline-block;
  font-size: 0.98rem;
  line-height: 1.35;
  transition: color 0.3s var(--ease), transform 0.4s var(--ease);
}

.col a::before {
  content: "→";
  position: absolute;
  left: -1.1rem;
  opacity: 0;
  color: var(--hot);
  transform: translateX(-0.4rem);
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
}

.col a:hover,
.col a:focus-visible {
  color: var(--hot);
  transform: translateX(1.1rem);
}

.col a:hover::before,
.col a:focus-visible::before {
  opacity: 1;
  transform: none;
}

.col sup {
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: 0.55rem;
  color: var(--muted);
  vertical-align: super;
}

.col-news p {
  font-size: 0.9rem;
  line-height: 1.35;
  color: #b7b1a5;
}

.news {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.5rem;
}

.news input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.8rem;
  font: inherit;
  font-size: 0.88rem;
  color: var(--fg);
  background: rgba(233, 228, 216, 0.05);
  border: 1px solid var(--rule);
  border-radius: 999px;
  outline: none;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

.news input::placeholder {
  color: #5f5a52;
}

.news input:focus {
  border-color: rgba(233, 228, 216, 0.4);
  background: rgba(233, 228, 216, 0.08);
}

.news.is-invalid input {
  border-color: #ff7a59;
}

.news button {
  padding: 0 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--bg);
  background: var(--fg);
  border-radius: 999px;
  transition: background-color 0.3s var(--ease);
}

.news button:hover {
  background: var(--hot);
}

.news-note {
  min-height: 1.4em;
  margin-top: 0.5rem;
  font-size: 0.78rem !important;
  color: #ff7a59 !important;
}

.news-note.is-ok {
  color: var(--hot) !important;
}

/* ─────────── Stage ─────────── */

.stage {
  position: relative;
  flex: 1;
  min-height: 46svh;
  cursor: crosshair;
  touch-action: pan-y;
  user-select: none;
}

.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hint {
  position: absolute;
  top: 1.1rem;
  right: var(--pad);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.35rem 0.35rem 0.35rem;
  color: var(--muted);
  transition: opacity 0.5s var(--ease), color 0.3s var(--ease);
}

.hint:hover {
  color: var(--fg);
}

.hint-key {
  padding: 0.3rem 0.55rem;
  color: var(--bg);
  background: var(--hot);
  border-radius: 999px;
}

.hint.is-quiet {
  opacity: 0.35;
}

/* ─────────── Base ─────────── */

.footer-base {
  position: relative;
  z-index: 2;
  padding: 1rem var(--pad);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
}

.readout {
  justify-self: end;
  font-variant-numeric: tabular-nums;
}

.readout span {
  color: var(--fg);
}

.phases {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.phases li {
  display: flex;
  gap: 0.45rem;
  transition: color 0.4s var(--ease);
}

.phases li span {
  color: #4c4943;
  transition: color 0.4s var(--ease);
}

.phases li.is-active {
  color: var(--fg);
}

.phases li.is-active span {
  color: var(--hot);
}

/* ─────────── Responsive ─────────── */

@media (max-width: 1000px) {
  .intro,
  .cols {
    grid-column: 1 / -1;
  }

  .statement {
    max-width: 34ch;
  }

  .footer-base {
    grid-template-columns: 1fr auto;
  }

  .footer-base > p:first-child {
    display: none;
  }
}

@media (max-width: 640px) {
  .cols {
    grid-template-columns: 1fr 1fr;
    row-gap: 1.75rem;
  }

  .col-news {
    grid-column: 1 / -1;
  }

  .stage {
    min-height: 34svh;
  }

  .hint {
    top: 0.75rem;
  }

  .footer-base {
    grid-template-columns: 1fr auto;
    row-gap: 0.75rem;
  }

  .footer-base > p:first-child {
    display: none;
  }

  .phases {
    gap: 0.9rem;
  }

  .phases li:not(.is-active) {
    color: #4c4943;
  }

  .phases li span {
    display: none;
  }

  .city {
    display: none;
  }
}
