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

:root {
  --bg: #050605;
  --panel: #0b0f0b;
  --line: rgba(178, 213, 183, 0.12);
  --text: #d7e5d9;
  --muted: rgba(215, 229, 217, 0.48);
  --accent: #b9d1bc;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(185, 209, 188, 0.05), transparent 38%),
    linear-gradient(180deg, #020302 0%, #050605 100%);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  transition: filter 400ms ease, opacity 400ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 2px,
      transparent 4px
    );
  opacity: 0.4;
  z-index: 3;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle, transparent 46%, rgba(0, 0, 0, 0.7) 100%);
  z-index: 3;
}

.sleeping {
  filter: saturate(0.86) brightness(0.82);
}

.sleeping .shell {
  opacity: 0.72;
  transform: scale(0.996);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 10px 36px rgba(0, 0, 0, 0.72),
    0 0 12px rgba(185, 209, 188, 0.03);
}

.sleeping .editor-body {
  filter: blur(0.3px);
}

.whisper-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

.apparition {
  position: absolute;
  transform: translate(-50%, -50%);
  animation: apparitionFade 6.8s ease-in-out forwards;
}

.apparition.left-side {
  text-align: left;
}

.apparition.right-side {
  text-align: right;
}

.apparition.right-side .whisper {
  margin-left: auto;
}

.eye-mark {
  width: 74px;
  height: 28px;
  margin: 0 auto 14px;
  border: 1px solid rgba(215, 229, 217, 0.14);
  border-radius: 50% / 60%;
  position: relative;
  opacity: 0.58;
  filter: blur(0.2px);
}

.eye-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  bottom: -6px;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(215, 229, 217, 0.06), transparent);
}

.eye-pupil {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 10px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: rgba(215, 229, 217, 0.12);
  box-shadow: 0 0 12px rgba(215, 229, 217, 0.06);
  transition: transform 120ms linear;
}

.whisper {
  max-width: 240px;
  color: rgba(226, 235, 227, 0.34);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-shadow: 0 0 14px rgba(226, 235, 227, 0.11);
}

.shell-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 2;
}

.shell {
  width: min(980px, 94vw);
  height: min(680px, 86vh);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 19, 15, 0.94), rgba(9, 12, 9, 0.98));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 14px 60px rgba(0, 0, 0, 0.6),
    0 0 26px rgba(185, 209, 188, 0.05);
  overflow: hidden;
  transform-origin: center;
  position: relative;
  transition: opacity 300ms ease, transform 300ms ease, box-shadow 300ms ease;
}

.shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(226, 235, 227, 0.05);
  pointer-events: none;
  opacity: 0;
}

.music-on .shell::after {
  opacity: 1;
  animation: audioPulse 2.9s ease-in-out infinite;
}

.shell-bar {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.editor {
  height: calc(100% - 36px);
  display: flex;
  flex-direction: column;
}

.editor-header {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.015);
}

.editor-body {
  position: relative;
  flex: 1;
  padding: 28px 32px 78px;
  overflow: auto;
  transition: filter 300ms ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(215, 229, 217, 0.16) transparent;
}

.editor-body::-webkit-scrollbar {
  width: 8px;
}

.editor-body::-webkit-scrollbar-thumb {
  background: rgba(215, 229, 217, 0.12);
}

.type-layer {
  position: relative;
  z-index: 1;
}

.row {
  min-height: 1.85em;
  color: var(--accent);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.85;
  white-space: pre-wrap;
  letter-spacing: 0.01em;
  font-family: inherit;
  text-shadow: 0 0 10px rgba(229, 237, 230, 0.05);
}

.cursor {
  display: inline-block;
  margin-left: 3px;
  color: var(--text);
  animation: blink 900ms steps(1) infinite;
}

.command-line {
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(215, 229, 217, 0.08);
  background: linear-gradient(180deg, rgba(11, 15, 11, 0), rgba(11, 15, 11, 0.95) 38%);
  z-index: 2;
  opacity: 0.82;
}

.command-line.live {
  opacity: 1;
}

.prompt-mark {
  color: var(--accent);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.85;
}

.command-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.85;
  caret-color: var(--text);
}

.command-input::placeholder {
  color: rgba(215, 229, 217, 0.28);
}

.command-input:disabled {
  opacity: 0.6;
}

.watch-row {
  color: #dfe9e0;
  font-family: inherit;
  font-style: normal;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.85;
  letter-spacing: 0.01em;
  text-shadow: 0 0 10px rgba(229, 237, 230, 0.06);
}

.idle-row {
  color: rgba(229, 237, 230, 0.52);
  font-style: italic;
}

.command-row {
  color: #e6eee6;
}

.corrupt {
  color: rgba(245, 245, 245, 0.72);
}

.boot {
  animation: boot-shift 180ms steps(2) 2;
}

.jolt {
  animation: jolt 90ms steps(2) 1;
}

.hard-jolt {
  animation: hardJolt 240ms steps(2) 1;
}

.micro {
  transform: translateX(1px);
}

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

@keyframes boot-shift {
  0% { transform: translate(0); }
  50% { transform: translate(-2px, 1px); }
  100% { transform: translate(0); }
}

@keyframes jolt {
  0% { transform: translate(0); }
  30% { transform: translate(1px, -1px); }
  60% { transform: translate(-2px, 1px); }
  100% { transform: translate(0); }
}

@keyframes hardJolt {
  0% { transform: translate(0); }
  20% { transform: translate(-5px, 2px); }
  40% { transform: translate(5px, -2px); }
  60% { transform: translate(-4px, 1px); }
  80% { transform: translate(4px, -1px); }
  100% { transform: translate(0); }
}

@keyframes apparitionFade {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(0, 4px) scale(0.98);
  }
  18% {
    opacity: 1;
  }
  70% {
    opacity: 0.85;
    transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(calc(var(--dx) * 1.2), calc(var(--dy) * 1.2)) scale(1.02);
  }
}

@keyframes audioPulse {
  0%, 100% {
    box-shadow:
      inset 0 0 0 1px rgba(226, 235, 227, 0.03),
      0 0 0 rgba(226, 235, 227, 0.02);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(226, 235, 227, 0.08),
      0 0 28px rgba(226, 235, 227, 0.04);
  }
}

@media (max-width: 640px) {
  .shell {
    height: 84vh;
  }

  .shell-bar {
    font-size: 0.66rem;
  }

  .editor-body {
    padding: 18px 18px 74px;
  }

  .editor-header {
    letter-spacing: 0.09em;
  }

  .whisper {
    max-width: 180px;
    font-size: 0.92rem;
  }

  .eye-mark {
    width: 58px;
    height: 22px;
  }

  .eye-pupil {
    width: 14px;
    height: 8px;
  }

  .command-line {
    left: 18px;
    right: 18px;
    bottom: 14px;
  }
}


.sigil {
  position: fixed;
  transform: translate(-50%, -50%);
  color: rgba(255, 75, 75, 0.72);
  font-size: clamp(1.4rem, 3vw, 2.6rem);
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 0 16px rgba(255, 40, 40, 0.26);
  animation: sigilDrift 4.2s ease-out forwards;
  z-index: 6;
}

.hell-row {
  color: #ff9e9e;
}

.hell-mode {
  background:
    radial-gradient(circle at center, rgba(160, 0, 0, 0.16), transparent 36%),
    linear-gradient(180deg, #120303 0%, #1f0606 100%);
}

.hell-mode .shell {
  border-color: rgba(255, 88, 88, 0.2);
  background: linear-gradient(180deg, rgba(26, 8, 8, 0.96), rgba(18, 5, 5, 0.98));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 14px 60px rgba(0, 0, 0, 0.72),
    0 0 36px rgba(255, 60, 60, 0.10);
}

.hell-mode .shell-bar,
.hell-mode .editor-header {
  border-color: rgba(255, 88, 88, 0.16);
  color: rgba(255, 200, 200, 0.62);
}

.hell-mode .row,
.hell-mode .prompt-mark,
.hell-mode .command-input,
.hell-mode .watch-row {
  color: #ffb0b0;
  text-shadow: 0 0 10px rgba(255, 64, 64, 0.10);
}

.hell-mode .command-input::placeholder {
  color: rgba(255, 176, 176, 0.32);
}

.hell-mode .shell::after {
  border-color: rgba(255, 90, 90, 0.10);
}

.hell-mode.music-on .shell::after,
.hell-mode .shell::after {
  opacity: 1;
  animation: audioPulseHell 2.2s ease-in-out infinite;
}

.hell-mode .whisper {
  color: rgba(255, 170, 170, 0.42);
  text-shadow: 0 0 18px rgba(255, 80, 80, 0.14);
}

.hell-mode .eye-mark {
  border-color: rgba(255, 96, 96, 0.22);
  opacity: 0.68;
}

.hell-mode .eye-pupil {
  background: rgba(255, 120, 120, 0.22);
  box-shadow: 0 0 12px rgba(255, 65, 65, 0.16);
}

@keyframes sigilDrift {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(0, 6px) scale(0.9);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--sx), var(--sy)) scale(1.08);
  }
}

@keyframes audioPulseHell {
  0%, 100% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 116, 116, 0.04),
      0 0 0 rgba(255, 50, 50, 0.02);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 120, 120, 0.12),
      0 0 30px rgba(255, 50, 50, 0.08);
  }
}
