:root {
  color-scheme: light dark;
  --paper: #f4f7f2;
  --ink: #17352f;
  --muted: #4d665f;
  --line: #c9d8d0;
  --accent: #19745f;
  --accent-soft: #dbece5;
  --danger: #9d2f2f;
  --focus: #145dba;
  font-family: "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); }

.startup-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.25rem, 6vw, 5rem);
}

.startup-card {
  width: min(100%, 41rem);
  padding: clamp(1.5rem, 5vw, 3.5rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: color-mix(in srgb, var(--paper) 88%, white);
  box-shadow: 0 1.25rem 3.5rem rgb(23 53 47 / 10%);
}

.startup-mark {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.35rem;
  width: min(14rem, 70%);
  margin-bottom: clamp(2.25rem, 8vw, 4.5rem);
}

.startup-mark span {
  height: 0.55rem;
  border-radius: 999px;
  background: var(--line);
}

.startup-mark span:nth-child(1),
.startup-mark span:nth-child(2) { background: var(--accent); }

.startup-kicker {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-family: "Bahnschrift", "Arial Narrow", sans-serif;
  font-size: 0.85rem;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1 {
  max-width: 15ch;
  margin: 0;
  font-family: "Bahnschrift", "Arial Narrow", sans-serif;
  font-size: clamp(2rem, 7vw, 4.25rem);
  font-weight: 520;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.startup-message {
  max-width: 38rem;
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  line-height: 1.55;
}

.startup-progress {
  height: 0.25rem;
  margin-top: 2rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--accent-soft);
}

.startup-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  animation: startup-travel 1.8s ease-in-out infinite alternate;
}

.startup-card[data-state="error"] .startup-progress span {
  width: 100%;
  animation: none;
  background: var(--danger);
}

.startup-card[data-state="error"] .startup-kicker { color: var(--danger); }

.startup-retry {
  min-height: 2.75rem;
  margin-top: 1.75rem;
  padding: 0.7rem 1.1rem;
  border: 0;
  border-radius: 0.65rem;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.startup-retry:hover { background: var(--accent); }
.startup-retry:focus-visible {
  outline: 0.2rem solid var(--focus);
  outline-offset: 0.2rem;
}

.startup-help, .startup-noscript {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.startup-noscript { padding: 1rem; text-align: center; }

@keyframes startup-travel {
  from { transform: translateX(-8%); }
  to { transform: translateX(146%); }
}

@media (prefers-reduced-motion: reduce) {
  .startup-progress span { width: 100%; animation: none; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10231f;
    --ink: #edf7f2;
    --muted: #b9cbc3;
    --line: #3c554d;
    --accent: #77d5b8;
    --accent-soft: #27453c;
    --danger: #ff9e9e;
    --focus: #8bc4ff;
  }
  .startup-card {
    background: #162c26;
    box-shadow: 0 1.25rem 3.5rem rgb(0 0 0 / 28%);
  }
}
