:root {
  color-scheme: dark;
  --ink: #f2f1eb;
  --muted: #969b9a;
  --panel: #111416;
  --panel-2: #171b1d;
  --line: #303638;
  --acid: #d8ff3e;
  --danger: #ff4d33;
  --danger-deep: #bd210b;
  --bg: #080a0b;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --display: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 74% 13%, rgba(255, 77, 51, 0.09), transparent 29rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  width: min(100% - 40px, 1440px);
  min-height: 80px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.875rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--danger);
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  transform: rotate(-4deg);
}

.system-state {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-light {
  width: 8px;
  height: 8px;
  background: var(--danger);
  box-shadow: 0 0 16px rgba(255, 77, 51, 0.85);
  animation: pulse 1.35s infinite;
}

main {
  width: min(100% - 40px, 1440px);
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 80px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(500px, 1.1fr);
  gap: clamp(52px, 7vw, 120px);
  align-items: center;
  padding: 72px 0 90px;
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(4.5rem, 10vw, 9.5rem);
  font-weight: 900;
  line-height: 0.76;
  letter-spacing: -0.075em;
  text-transform: uppercase;
}

h1 span {
  display: block;
  color: var(--danger);
  font-style: italic;
  transform: translateX(0.13em);
}

.intro {
  max-width: 570px;
  margin: clamp(38px, 5vw, 62px) 0 34px;
  color: #c3c6c5;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  line-height: 1.48;
}

.restart-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 0 23px;
  border: 1px solid var(--danger);
  border-radius: 0;
  overflow: hidden;
  background: var(--danger);
  color: #100806;
  font: 800 0.92rem/1 var(--mono);
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.restart-button::before {
  position: absolute;
  inset: 0;
  background: #ff745f;
  content: "";
  transform: translateX(-102%);
  transition: transform 240ms ease;
}

.restart-button > * {
  position: relative;
}

.restart-button:hover::before {
  transform: translateX(0);
}

.restart-button:hover {
  box-shadow: 7px 7px 0 rgba(255, 77, 51, 0.2);
  transform: translate(-2px, -2px);
}

.restart-button:focus-visible {
  outline: 3px solid var(--acid);
  outline-offset: 4px;
}

.restart-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button-icon {
  font-size: 1.35rem;
}

.restart-button.is-loading .button-icon {
  animation: spin 0.65s linear infinite;
}

.fine-print {
  margin: 14px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.panic-window {
  position: relative;
  border: 1px solid #3b4244;
  background: rgba(14, 17, 18, 0.92);
  box-shadow:
    22px 22px 0 rgba(255, 77, 51, 0.075),
    0 32px 90px rgba(0, 0, 0, 0.4);
}

.panic-window::after {
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 68%;
  height: 68%;
  z-index: -1;
  border-right: 1px solid rgba(216, 255, 62, 0.27);
  border-bottom: 1px solid rgba(216, 255, 62, 0.27);
  content: "";
}

.window-bar {
  min-height: 46px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  color: #bcc0bf;
  font: 0.75rem/1 var(--mono);
  text-transform: uppercase;
}

.window-code {
  color: var(--danger);
}

.terminal {
  min-height: 430px;
  padding: clamp(22px, 4vw, 36px);
  overflow: hidden;
  color: #bcc3bf;
  font: clamp(0.72rem, 1.1vw, 0.86rem)/1.8 var(--mono);
}

.terminal-line {
  opacity: 0;
  animation: line-in 0.18s forwards;
}

.terminal-line:nth-child(2) { animation-delay: 0.12s; }
.terminal-line:nth-child(3) { animation-delay: 0.24s; }
.terminal-line:nth-child(4) { animation-delay: 0.36s; }
.terminal-line:nth-child(5) { animation-delay: 0.48s; }
.terminal-line:nth-child(6) { animation-delay: 0.6s; }
.terminal-line:nth-child(7) { animation-delay: 0.72s; }

.terminal .dim {
  color: #727977;
}

.terminal .warning {
  color: var(--acid);
}

.terminal .error {
  color: var(--danger);
}

.terminal .strong {
  margin-top: 17px;
  font-weight: 800;
}

.trace {
  margin-top: 18px;
  display: grid;
  color: #818886;
}

.cursor-line {
  margin-top: 18px;
  color: var(--acid);
  animation: blink 0.9s steps(2, end) infinite;
}

.recovery {
  min-height: 430px;
  padding: clamp(32px, 5vw, 54px);
  background:
    linear-gradient(135deg, rgba(216, 255, 62, 0.09), transparent 42%),
    var(--panel);
}

.recovery-label {
  color: var(--acid);
  font: 700 0.78rem/1 var(--mono);
  letter-spacing: 0.08em;
}

.recovery-title {
  max-width: 450px;
  margin: 60px 0 8px;
  color: var(--acid);
  font-size: clamp(3rem, 6vw, 5.2rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.065em;
  text-transform: uppercase;
}

.recovery-title + p {
  color: #b5bab7;
  font-family: var(--mono);
}

.uptime-row {
  margin-top: 74px;
  padding-top: 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 0.76rem/1 var(--mono);
}

.uptime-row strong {
  color: var(--ink);
  font-size: 1rem;
}

.protocol {
  padding: clamp(88px, 11vw, 160px) 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  align-items: end;
}

.section-heading .eyebrow {
  margin: 0 0 9px;
}

h2 {
  max-width: 880px;
  margin: 0;
  font-size: clamp(2.7rem, 5.8vw, 6.1rem);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.065em;
  text-transform: uppercase;
}

.steps {
  margin: clamp(60px, 8vw, 110px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
  counter-reset: none;
  border-top: 1px solid var(--line);
}

.steps li {
  min-height: 300px;
  padding: 26px clamp(20px, 3vw, 42px) 36px 0;
  border-right: 1px solid var(--line);
}

.steps li + li {
  padding-left: clamp(20px, 3vw, 42px);
}

.steps li:last-child {
  border-right: 0;
}

.step-number {
  color: var(--danger);
  font: 0.78rem/1 var(--mono);
}

h3 {
  margin: 68px 0 14px;
  font-size: clamp(1.65rem, 2.4vw, 2.35rem);
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.steps p {
  max-width: 360px;
  margin: 0;
  color: #aeb3b1;
  line-height: 1.65;
}

code {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.9em;
}

.quote {
  margin-bottom: clamp(86px, 12vw, 170px);
  padding: clamp(46px, 7vw, 90px);
  position: relative;
  overflow: hidden;
  background: var(--danger);
  color: #150806;
  transform: rotate(-0.7deg);
}

.quote::after {
  position: absolute;
  right: -0.1em;
  bottom: -0.47em;
  color: rgba(20, 5, 2, 0.12);
  content: "!";
  font-size: 20rem;
  font-weight: 900;
  line-height: 1;
  transform: rotate(6deg);
}

.quote p {
  position: relative;
  z-index: 1;
  max-width: 1050px;
  margin: 0;
  font-size: clamp(2.35rem, 5.5vw, 5.7rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.06em;
  text-transform: uppercase;
}

.quote span {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 30px;
  font: 700 0.8rem/1 var(--mono);
}

footer {
  width: min(100% - 40px, 1440px);
  min-height: 90px;
  margin: 0 auto;
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: #717775;
  font: 0.75rem/1.5 var(--mono);
}

.footer-code {
  color: var(--danger);
}

.is-recovered .status-light {
  background: var(--acid);
  box-shadow: 0 0 16px rgba(216, 255, 62, 0.7);
  animation: none;
}

.is-recovered .window-code {
  color: var(--acid);
}

.is-recovered .restart-button {
  border-color: var(--acid);
  background: var(--acid);
}

.is-recovered .restart-button::before {
  background: #e7ff87;
}

.is-recovered .restart-button:hover {
  box-shadow: 7px 7px 0 rgba(216, 255, 62, 0.18);
}

.is-shaking .panic-window {
  animation: shake 0.38s linear;
}

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

[hidden] {
  display: none !important;
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes line-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 70px;
    padding-top: 90px;
  }

  .hero-copy {
    max-width: 720px;
  }

  .panic-window {
    width: min(100%, 740px);
    justify-self: end;
  }

  .section-heading {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header,
  main,
  footer {
    width: min(100% - 28px, 1440px);
  }

  .site-header {
    min-height: 68px;
  }

  .system-state {
    font-size: 0;
  }

  .hero {
    min-height: auto;
    padding: 64px 0 86px;
  }

  h1 {
    font-size: clamp(4rem, 22vw, 7.2rem);
  }

  .panic-window::after {
    right: -8px;
    bottom: -8px;
  }

  .terminal,
  .recovery {
    min-height: 390px;
  }

  .terminal {
    overflow-x: auto;
    white-space: nowrap;
    font-size: 0.69rem;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .steps li,
  .steps li + li {
    min-height: auto;
    padding: 25px 0 44px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .steps li:last-child {
    border-bottom: 0;
  }

  h3 {
    margin-top: 40px;
  }

  footer {
    padding: 28px 0;
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
