:root {
  color-scheme: dark;
  --shell-black: #070a08;
  --shell-raised: #101411;
  --shell-edge: #333b35;
  --screen: #030c07;
  --screen-deep: #020704;
  --phosphor: #a7e898;
  --phosphor-bright: #c2f7b6;
  --phosphor-muted: #719a68;
  --phosphor-dim: #486346;
  --amber: #efbd58;
  --error: #e88e6c;
  --shadow: rgba(0, 0, 0, 0.85);
  --mono: "IBM Plex Mono", "Berkeley Mono", "SFMono-Regular", Consolas,
    "Liberation Mono", monospace;
  font-family: var(--mono);
  background: #020403;
  font-synthesis: none;
  text-rendering: geometricPrecision;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, #111913 0%, #070b08 42%, #020403 100%);
  color: var(--phosphor);
}

button,
input {
  font: inherit;
}

.recovery-shell {
  position: relative;
  display: grid;
  grid-template-rows: 78px minmax(0, 1fr) 58px;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.018), transparent 2%, transparent 98%, rgba(255, 255, 255, 0.018)),
    repeating-linear-gradient(93deg, rgba(255, 255, 255, 0.009) 0 1px, transparent 1px 7px),
    var(--shell-black);
  border: 1px solid #2c332e;
  box-shadow:
    inset 0 0 0 3px #0d110e,
    inset 0 0 40px rgba(0, 0, 0, 0.75);
}

.recovery-shell::before,
.recovery-shell::after {
  position: absolute;
  z-index: 5;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #555e57 0 10%, #171d19 24%, #050706 62%);
  border: 1px solid #454d47;
  box-shadow: 0 0 0 2px #050706, 0 1px 4px #000;
  content: "";
}

.recovery-shell::before {
  top: 14px;
  left: 14px;
}

.recovery-shell::after {
  top: 14px;
  right: 14px;
}

.system-rail,
.status-rail {
  position: relative;
  z-index: 2;
  display: grid;
  align-items: center;
  padding-inline: clamp(34px, 4.5vw, 72px);
  background: rgba(10, 14, 11, 0.92);
  text-transform: uppercase;
}

.system-rail {
  grid-template-columns: 1fr auto 1fr;
  border-bottom: 1px solid #3d463f;
  box-shadow: inset 0 -3px 0 #020403, 0 2px 6px #000;
}

.system-rail::after,
.status-rail::before {
  position: absolute;
  right: 10px;
  left: 10px;
  height: 1px;
  background: rgba(148, 180, 142, 0.13);
  content: "";
}

.system-rail::after {
  bottom: 5px;
}

.status-rail::before {
  top: 5px;
}

.wordmark {
  color: #94c984;
  font-size: clamp(1.25rem, 2vw, 1.85rem);
  font-weight: 800;
  letter-spacing: 0.34em;
  line-height: 1;
  text-shadow: 0 0 8px rgba(154, 226, 137, 0.27);
}

.console-id {
  color: var(--phosphor-muted);
  font-size: clamp(0.68rem, 1.2vw, 0.94rem);
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.console-id span {
  padding-inline: 0.45em;
  color: var(--phosphor-dim);
}

.air-gap-status {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 10px;
  color: var(--amber);
  font-size: clamp(0.72rem, 1.2vw, 0.98rem);
  letter-spacing: 0.11em;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(239, 189, 88, 0.2);
}

.air-gap-status.connected {
  color: var(--phosphor-bright);
}

.status-light {
  width: 7px;
  height: 7px;
  background: currentColor;
  box-shadow: 0 0 7px currentColor;
}

.terminal-bezel {
  min-height: 0;
  margin: 12px 14px 9px;
  padding: clamp(15px, 1.6vw, 25px);
  overflow: hidden;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.025), transparent 25%),
    #090d0a;
  border: 1px solid #404840;
  box-shadow:
    inset 0 0 0 3px #030504,
    inset 0 0 0 5px #1c221d,
    0 0 0 2px #030504,
    0 4px 20px #000;
}

.terminal-screen {
  position: relative;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--phosphor-dim) transparent;
  scrollbar-width: thin;
  background:
    radial-gradient(ellipse at 48% 35%, rgba(31, 72, 39, 0.24), transparent 58%),
    linear-gradient(rgba(3, 14, 8, 0.9), rgba(2, 8, 4, 0.96));
  border: 1px solid #354039;
  border-radius: 13px;
  box-shadow:
    inset 0 0 0 3px #020403,
    inset 0 0 0 5px #111913,
    inset 0 0 52px rgba(0, 0, 0, 0.68),
    0 0 12px #000;
  padding: clamp(30px, 4.4vw, 66px) clamp(28px, 4.5vw, 68px) 50px;
  color: var(--phosphor);
  font-size: clamp(0.91rem, 1.38vw, 1.28rem);
  line-height: 1.62;
  letter-spacing: 0.015em;
  text-shadow:
    0 0 5px rgba(173, 243, 156, 0.33),
    0 0 13px rgba(96, 194, 83, 0.12);
}

.terminal-screen::before {
  position: fixed;
  z-index: 4;
  inset: calc(78px + 12px + 25px) calc(14px + 25px) calc(58px + 9px + 25px);
  pointer-events: none;
  border-radius: 10px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(0, 0, 0, 0.17) 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.58;
  content: "";
}

.terminal-screen::after {
  position: fixed;
  z-index: 4;
  inset: calc(78px + 12px + 25px) calc(14px + 25px) calc(58px + 9px + 25px);
  pointer-events: none;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.1), transparent 4%, transparent 96%, rgba(0, 0, 0, 0.18));
  content: "";
}

.terminal-output {
  white-space: pre-wrap;
  word-break: break-word;
}

.line {
  min-height: 1.62em;
}

.line.boot-title {
  color: var(--phosphor-bright);
  text-transform: uppercase;
}

.line.muted,
.line.meta {
  color: var(--phosphor-muted);
}

.line.error {
  color: var(--error);
}

.line.narrative {
  color: #91bd88;
  font-style: italic;
}

.line.warning {
  color: var(--amber);
  text-shadow: 0 0 8px rgba(239, 189, 88, 0.25);
}

.line.chapter-complete {
  color: var(--phosphor-bright);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px rgba(167, 232, 152, 0.45);
}

.line.command-history {
  margin-top: 1.2em;
  color: var(--phosphor-bright);
}

.line.listing-dir {
  color: var(--phosphor-bright);
}

.line.listing-file {
  color: var(--phosphor);
}

.command-line {
  display: flex;
  align-items: baseline;
  min-width: 0;
  margin-top: 1.2em;
  color: var(--phosphor-bright);
}

.prompt {
  flex: 0 0 auto;
  white-space: nowrap;
}

.input-wrap {
  position: relative;
  flex: 1;
  min-width: 3ch;
}

.command-input {
  position: relative;
  z-index: 2;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 0 0 0.6ch;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--phosphor-bright);
  caret-color: transparent;
  line-height: inherit;
  letter-spacing: inherit;
  text-shadow: inherit;
}

.block-caret {
  position: absolute;
  top: 0.29em;
  left: 0.62ch;
  width: 0.63em;
  height: 1.12em;
  background: var(--phosphor-bright);
  box-shadow: 0 0 8px rgba(167, 232, 152, 0.8);
  opacity: 0.85;
  animation: caret-blink 1.05s steps(1, end) infinite;
}

.input-wrap:has(.command-input:not(:placeholder-shown)) .block-caret {
  display: none;
}

.command-input:focus-visible + .block-caret {
  background: #d2ffc8;
}

@keyframes caret-blink {
  0%, 48% { opacity: 0.88; }
  49%, 100% { opacity: 0; }
}

.status-rail {
  grid-template-columns: 1fr auto;
  border-top: 1px solid #374039;
  box-shadow: inset 0 3px 0 #020403, 0 -2px 8px #000;
}

.signal-track {
  display: flex;
  align-items: end;
  width: min(360px, 50vw);
  height: 16px;
  gap: 24px;
  padding-inline: 8px;
  border-right: 1px solid var(--phosphor-dim);
  border-left: 1px solid var(--phosphor-dim);
  opacity: 0.5;
}

.signal-track span {
  width: 1px;
  height: 5px;
  background: var(--phosphor-muted);
}

.signal-track span:nth-child(3n + 1) {
  height: 10px;
}

.key-hints {
  color: var(--phosphor-muted);
  font-size: clamp(0.7rem, 1.1vw, 0.89rem);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  white-space: nowrap;
}

.key-hints span {
  color: var(--phosphor);
}

.key-hints i {
  padding-inline: 0.55em;
  color: var(--phosphor-dim);
  font-style: normal;
}

@media (max-width: 720px) {
  .recovery-shell {
    grid-template-rows: 62px minmax(0, 1fr) 46px;
    border: 0;
  }

  .recovery-shell::before,
  .recovery-shell::after,
  .console-id,
  .signal-track {
    display: none;
  }

  .system-rail {
    grid-template-columns: 1fr auto;
    padding-inline: 20px;
  }

  .wordmark {
    font-size: 1.04rem;
    letter-spacing: 0.25em;
  }

  .air-gap-status {
    gap: 7px;
    font-size: 0.65rem;
  }

  .terminal-bezel {
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .terminal-screen {
    border: 0;
    border-radius: 0;
    padding: 25px 20px 42px;
    font-size: clamp(0.77rem, 3.5vw, 0.96rem);
    line-height: 1.55;
  }

  .terminal-screen::before,
  .terminal-screen::after {
    inset: 62px 0 46px;
    border-radius: 0;
  }

  .status-rail {
    display: flex;
    justify-content: flex-end;
    padding-inline: 18px;
  }

  .key-hints {
    font-size: 0.64rem;
  }
}

@media (max-width: 430px) {
  .air-gap-status {
    letter-spacing: 0.06em;
  }

  .status-light {
    width: 5px;
    height: 5px;
  }

  .key-hints i {
    padding-inline: 0.3em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .block-caret {
    animation: none;
  }
}
