:root {
  --ink: #1b232c;
  --mist: #dae0e3;
  --brass: #7f8d8a;
  --teal: #2f5d55;
  --sunset: #3b5d56;
  --diesel: #5f686f;
  --copper: #5f7077;
  --slate: #34424f;
  --deepgreen: #1f3d38;
  --steel: #8b969f;
  --glass: rgba(255, 255, 255, 0.7);
  --line: rgba(31, 39, 50, 0.15);
  --needle-angle: -45deg;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 3.1rem;
  color: var(--ink);
  font-family: "Outfit", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 18%, rgba(59, 93, 86, 0.22), transparent 44%),
    radial-gradient(circle at 82% 8%, rgba(31, 61, 56, 0.25), transparent 42%),
    linear-gradient(150deg, #c7cfd6 0%, #919ca5 50%, #78838d 100%);
  overflow-x: hidden;
}

.skyline-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      -12deg,
      transparent 0,
      transparent 24px,
      rgba(58, 74, 92, 0.07) 24px,
      rgba(58, 74, 92, 0.07) 30px
    );
  mask-image: linear-gradient(to bottom, black 10%, transparent 90%);
}

.skyline-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 0, rgba(143, 159, 164, 0.18), transparent 65%),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 46px,
      rgba(31, 39, 50, 0.05) 46px,
      rgba(31, 39, 50, 0.05) 48px
    );
  opacity: 0.75;
}

.steam-haze {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.steam-haze::before,
.steam-haze::after {
  content: "";
  position: absolute;
  width: 52vw;
  height: 52vw;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(232, 240, 241, 0.2), rgba(232, 240, 241, 0));
  filter: blur(12px);
  animation: steam-drift 15s ease-in-out infinite;
}

.steam-haze::before {
  left: -14vw;
  bottom: -18vw;
}

.steam-haze::after {
  right: -16vw;
  bottom: -24vw;
  animation-delay: 4s;
}

.error-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2.5rem 1.25rem;
  gap: 1.25rem;
  position: relative;
  z-index: 1;
}

.crest {
  width: min(65vw, 320px);
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(31, 39, 50, 0.18));
}

.brand-plate {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 1.1rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(36, 48, 58, 0.4);
  background:
    linear-gradient(160deg, rgba(220, 227, 232, 0.96), rgba(142, 151, 158, 0.86)),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.18) 0,
      rgba(255, 255, 255, 0.18) 5px,
      rgba(45, 58, 71, 0.08) 5px,
      rgba(45, 58, 71, 0.08) 10px
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 8px 22px rgba(31, 39, 50, 0.18);
  text-align: left;
}

.brand-badge {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.brand-badge-shell {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  flex: 0 0 68px;
  background: linear-gradient(135deg, #46665f, #2b4842);
  box-shadow:
    inset 0 1px 0 rgba(230, 239, 242, 0.35),
    0 0 0 2px rgba(31, 39, 50, 0.16),
    0 10px 18px rgba(31, 39, 50, 0.2);
}

.brand-badge-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.06) 35%, rgba(0, 0, 0, 0.18) 100%),
    linear-gradient(135deg, rgba(70, 102, 95, 0.36), rgba(43, 72, 66, 0.16));
  pointer-events: none;
}

.brand-top,
.brand-sub {
  margin: 0;
}

.brand-top {
  font-family: "Racing Sans One", "Trebuchet MS", sans-serif;
  letter-spacing: 0.08em;
  font-size: clamp(1.05rem, 2.8vw, 1.3rem);
  color: #243240;
}

.brand-sub {
  margin-top: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.66rem;
  color: rgba(36, 50, 64, 0.8);
}

.error-card {
  width: min(92vw, 760px);
  text-align: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 1.8rem;
  background:
    linear-gradient(140deg, rgba(236, 243, 246, 0.92), rgba(180, 190, 198, 0.78)),
    linear-gradient(120deg, rgba(95, 112, 119, 0.26), rgba(31, 61, 56, 0.18));
  box-shadow:
    0 25px 55px rgba(31, 39, 50, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(3px);
  position: relative;
}

.error-card::before,
.error-card::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #d9e2e6, #68747c 70%);
  box-shadow:
    0 0 0 1px rgba(31, 39, 50, 0.25),
    0 2px 5px rgba(31, 39, 50, 0.24);
}

.error-card::before {
  top: 14px;
  left: 14px;
}

.error-card::after {
  bottom: 14px;
  right: 14px;
}

.status-label {
  margin: 0;
  letter-spacing: 0.35rem;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--slate);
}

.status-code {
  margin: 0.25rem 0 0;
  font-family: "Racing Sans One", "Trebuchet MS", sans-serif;
  font-size: clamp(4rem, 18vw, 8rem);
  line-height: 1;
  color: var(--ink);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.8),
    0 14px 30px rgba(31, 61, 56, 0.22);
}

.headline {
  margin: 0.7rem 0 0;
  font-family: "Racing Sans One", "Trebuchet MS", sans-serif;
  font-size: clamp(1.3rem, 4.7vw, 2.2rem);
  letter-spacing: 0.03em;
  color: var(--deepgreen);
}

.machine-label {
  margin: 0.45rem 0 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
  color: rgba(31, 45, 55, 0.82);
  font-weight: 700;
}

.copy {
  margin: 1rem auto 0;
  max-width: 58ch;
  color: #2f3b47;
  font-size: 1.02rem;
  line-height: 1.65;
}

.gauge-row {
  margin-top: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(31, 39, 50, 0.18);
  border-radius: 999px;
  background: rgba(232, 237, 240, 0.72);
}

.gauge {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 2px solid rgba(31, 39, 50, 0.72);
  background: radial-gradient(circle at 30% 28%, #f1f4f5 0, #c1c9cf 75%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.needle {
  position: absolute;
  bottom: 50%;
  left: 50%;
  width: 2px;
  height: 12px;
  border-radius: 2px;
  background: #a84e34;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(var(--needle-angle));
  transition: transform 600ms cubic-bezier(0.23, 0.73, 0.2, 1);
}

.gauge::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #2d3a47;
}

.gauge-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: rgba(27, 35, 44, 0.82);
  font-weight: 700;
}

.actions {
  margin-top: 1.7rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.82rem 1.25rem;
  min-width: 150px;
  border-radius: 0.45rem;
  border: 1px solid rgba(27, 35, 44, 0.45);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 8px 14px rgba(27, 35, 44, 0.24);
}

.btn:focus-visible {
  outline: 3px solid rgba(63, 115, 105, 0.5);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, #46665f, #2b4842);
  color: #e7eeef;
}

.btn-ghost {
  background: linear-gradient(135deg, rgba(190, 200, 208, 0.9), rgba(131, 143, 151, 0.9));
  color: #18212a;
}

.btn:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: rgba(31, 61, 56, 0.75);
}

.btn-primary:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 14px 22px rgba(31, 61, 56, 0.38);
}

.rail-note {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(31, 39, 50, 0.66);
}

.status-ticker {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.4rem;
  overflow: hidden;
  border-top: 1px solid rgba(24, 33, 42, 0.45);
  background:
    linear-gradient(90deg, rgba(28, 42, 50, 0.96), rgba(41, 58, 67, 0.96)),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 4px,
      rgba(27, 35, 44, 0.04) 4px,
      rgba(27, 35, 44, 0.04) 8px
    );
  box-shadow: 0 -5px 14px rgba(20, 28, 34, 0.34);
  z-index: 2;
}

.ticker-track {
  margin: 0;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.ticker-track span {
  display: inline-block;
  color: #ced8db;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.68rem;
  padding-left: 100%;
  animation: ticker-run 18s linear infinite;
}

body.status-404 {
  --needle-angle: -62deg;
}

body.status-500 {
  --needle-angle: 46deg;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
}

body.ready .reveal {
  animation: rise-in 500ms cubic-bezier(0.2, 0.7, 0.15, 1) forwards;
}

body.ready .reveal:nth-child(2) {
  animation-delay: 60ms;
}

body.ready .reveal:nth-child(3) {
  animation-delay: 140ms;
}

body.ready .reveal:nth-child(4) {
  animation-delay: 220ms;
}

body.ready .reveal:nth-child(5) {
  animation-delay: 300ms;
}

@keyframes rise-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes steam-drift {
  0% {
    transform: translate(0, 22px) scale(0.9);
    opacity: 0.35;
  }
  50% {
    transform: translate(14px, -12px) scale(1.05);
    opacity: 0.52;
  }
  100% {
    transform: translate(0, -34px) scale(1.12);
    opacity: 0.26;
  }
}

@keyframes ticker-run {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

@media (max-width: 540px) {
  .brand-plate {
    flex-direction: column;
    text-align: center;
  }

  .error-card {
    border-radius: 1.2rem;
  }

  .copy {
    font-size: 0.98rem;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .gauge-row {
    width: 100%;
    justify-content: center;
  }

  .btn {
    width: 100%;
  }

  .status-ticker {
    height: 2.6rem;
  }
}
