:root {
  --ink: #1b1d21;
  --amber: #ffb81c;
  --green: #35c98a;
  --red: #ff6f59;
  --signal: var(--amber);
}

* { box-sizing: border-box; margin: 0; }

body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 4vw, 3.5rem);
  background: var(--signal);
  color: var(--ink);
  font: 500 1.25rem/1.4 Overpass, system-ui, sans-serif;
  transition: background-color .35s ease-out;
}

body[data-state="done"] { --signal: var(--green); }
body[data-state="stop"] { --signal: var(--red); }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.5rem;
}

.hero {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem 3rem;
}

h1 {
  font-size: clamp(4.5rem, min(19vw, 32vh), 20rem);
  font-weight: 900;
  line-height: .86;
  letter-spacing: -.045em;
}

.planet {
  flex: 1 1 18rem;
  max-width: 36rem;
  max-height: 60vh;
  overflow: visible;
}

.globe { fill: var(--ink); }
.ring, .ring-gap { fill: none; stroke: var(--ink); stroke-width: 9; }
.ring { stroke-linecap: round; }
.ring-gap { stroke: var(--signal); stroke-width: 23; transition: stroke .35s ease-out; }
.stars { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 0 1; }
.hand { stroke: var(--signal); stroke-linecap: round; transition: stroke .35s ease-out; }
.moon { fill: #fff; stroke: var(--ink); stroke-width: 5; }

.panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem 3rem;
}

.intro, .line {
  flex: 1 1 18rem;
  max-width: 32ch;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  text-wrap: balance;
}

.press { flex: 0 1 22rem; }
.press button { width: 100%; }
#line { margin-top: .75rem; min-height: 1.4em; }

a { color: inherit; text-underline-offset: .2em; }

button {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
  padding: 1rem 1.6rem 1rem 1.2rem;
  border: 0;
  border-radius: .9rem;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 1.5rem;
  cursor: pointer;
}

button:active:not([aria-disabled="true"]) { transform: translateY(2px); }
button[aria-disabled="true"] { cursor: wait; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }

.lamp {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #4a4e57;
}

[data-state="waiting"] .lamp { background: var(--amber); animation: blink 1s steps(1) infinite; }
[data-state="done"] .lamp { background: var(--green); }

@keyframes blink { 50% { background: #4a4e57; } }

footer { margin-top: 2.5rem; }
code { font: 500 1rem "Overpass Mono", ui-monospace, monospace; }

@media (prefers-reduced-motion: reduce) {
  body, .ring-gap, .hand { transition: none; }
  .lamp { animation: none !important; }
}
