:root {
  --bg: #07050d;
  --panel: rgba(13, 10, 24, 0.88);
  --panel-strong: rgba(18, 13, 34, 0.96);
  --border: rgba(187, 134, 252, 0.18);
  --border-strong: rgba(120, 220, 255, 0.42);
  --text: #eee9ff;
  --muted: #9b93b7;
  --purple: #b793ff;
  --violet: #8d63ff;
  --pink: #ff78c6;
  --cyan: #74e4ff;
  --green: #7fffd4;
  --gold: #ffd479;
  --danger: #ff7c9f;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 22% 18%, rgba(124, 74, 255, 0.14), transparent 30%),
    radial-gradient(circle at 85% 78%, rgba(0, 210, 255, 0.08), transparent 28%),
    linear-gradient(145deg, #05030a, #0b0714 44%, #08050f);
  font-family: "Cascadia Code", "JetBrains Mono", "Fira Code", Consolas, monospace;
}

button,
input {
  font: inherit;
}

.nebula {
  position: fixed;
  z-index: 0;
  width: 42vw;
  aspect-ratio: 1;
  filter: blur(90px);
  opacity: 0.22;
  pointer-events: none;
  border-radius: 50%;
  animation: drift 14s ease-in-out infinite alternate;
}

.nebula--one {
  top: -16vw;
  left: -8vw;
  background: conic-gradient(from 60deg, var(--violet), transparent, var(--pink), transparent);
}

.nebula--two {
  right: -12vw;
  bottom: -20vw;
  background: conic-gradient(from 180deg, var(--cyan), transparent, var(--violet), transparent);
  animation-delay: -7s;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.17;
  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: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1500px, calc(100vw - 36px));
  height: min(930px, calc(100vh - 36px));
  margin: 18px auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(20, 14, 38, 0.94), rgba(7, 5, 13, 0.94));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 8, 20, 0.86);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.window-controls {
  display: flex;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 18px currentColor;
}

.dot--pink { color: var(--pink); background: currentColor; }
.dot--gold { color: var(--gold); background: currentColor; }
.dot--cyan { color: var(--cyan); background: currentColor; }

.topbar__title {
  color: var(--muted);
}

.topbar__title span {
  color: var(--cyan);
}

.topbar__status {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
}

.status-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 16px currentColor;
  animation: pulse 1.8s ease-in-out infinite;
}

.workspace {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  min-height: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 28px 22px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(28, 18, 52, 0.76), rgba(9, 7, 17, 0.92)),
    radial-gradient(circle at top left, rgba(255, 120, 198, 0.10), transparent 40%);
}

.sidebar__section {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(183, 147, 255, 0.10);
}

.sidebar__section--bottom {
  margin-top: auto;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--pink);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.08em;
  text-shadow: 0 0 36px rgba(183, 147, 255, 0.35);
}

.cursor-mark {
  color: var(--cyan);
  animation: blink 1s step-end infinite;
}

.muted {
  color: var(--muted);
  line-height: 1.65;
}

.path-card {
  padding: 12px 14px;
  overflow: hidden;
  color: var(--cyan);
  border: 1px solid rgba(116, 228, 255, 0.16);
  border-radius: 10px;
  background: rgba(116, 228, 255, 0.045);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-map {
  display: grid;
  gap: 8px;
  font-size: 0.82rem;
}

.map-row {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  color: var(--muted);
}

.map-row--current {
  color: var(--cyan);
}

.map-row--dir {
  color: var(--purple);
}

.command-cheatsheet {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px 12px;
  align-items: baseline;
  font-size: 0.76rem;
}

.command-cheatsheet span {
  color: var(--cyan);
}

.command-cheatsheet small {
  color: var(--muted);
}

.session-line {
  display: flex;
  justify-content: space-between;
  margin: 7px 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.session-line strong {
  color: var(--green);
  font-weight: 600;
}

.terminal-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-width: 0;
  min-height: 0;
  background:
    linear-gradient(rgba(7, 5, 13, 0.40), rgba(7, 5, 13, 0.75)),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.012),
      rgba(255, 255, 255, 0.012) 1px,
      transparent 1px,
      transparent 4px
    );
}

.terminal-output {
  min-height: 0;
  padding: 32px clamp(24px, 4vw, 58px);
  overflow-y: auto;
  scroll-behavior: smooth;
}

.boot-sequence {
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
}

.boot-sequence p {
  margin: 2px 0;
}

.accent { color: var(--purple); }
.success { color: var(--green); }

.page-view {
  max-width: 920px;
  animation: reveal 320ms ease-out;
}

.page-view h2,
.page-view h3 {
  margin: 0;
  color: var(--text);
  letter-spacing: -0.04em;
}

.page-view h2 {
  font-size: clamp(2rem, 4.7vw, 4.8rem);
  line-height: 0.98;
}

.page-view h3 {
  margin-top: 32px;
  font-size: 1.25rem;
  color: var(--cyan);
}

.page-view p,
.page-view li {
  color: #c7c0da;
  line-height: 1.8;
}

.page-view strong {
  color: var(--text);
}

.page-view code,
.inline-command {
  padding: 0.15em 0.45em;
  border: 1px solid rgba(116, 228, 255, 0.16);
  border-radius: 6px;
  color: var(--cyan);
  background: rgba(116, 228, 255, 0.055);
}

.hero-kicker {
  margin: 0 0 16px !important;
  color: var(--pink) !important;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-copy {
  max-width: 760px;
  margin-top: 24px;
  font-size: clamp(1rem, 1.7vw, 1.22rem);
}

.hero-name {
  background: linear-gradient(90deg, var(--text), var(--purple) 48%, var(--cyan));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 30px 0;
}

.info-card {
  min-height: 120px;
  padding: 18px;
  border: 1px solid rgba(183, 147, 255, 0.12);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(183, 147, 255, 0.06), rgba(116, 228, 255, 0.025));
}

.info-card span {
  display: block;
  margin-bottom: 16px;
  color: var(--pink);
  font-size: 0.67rem;
  letter-spacing: 0.18em;
}

.info-card strong {
  font-size: 1rem;
  line-height: 1.4;
}

.command-stack {
  display: grid;
  gap: 9px;
  margin-top: 24px;
}

.command-stack div {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 11px 13px;
  border-left: 2px solid var(--violet);
  background: rgba(141, 99, 255, 0.045);
}

.command-stack code {
  min-width: 132px;
  border: 0;
  background: transparent;
}

.command-stack span {
  color: var(--muted);
  font-size: 0.82rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.tag {
  padding: 7px 10px;
  border: 1px solid rgba(255, 120, 198, 0.18);
  border-radius: 999px;
  color: var(--pink);
  background: rgba(255, 120, 198, 0.045);
  font-size: 0.72rem;
}

.command-log {
  display: grid;
  gap: 12px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid rgba(183, 147, 255, 0.10);
}

.log-entry {
  font-size: 0.8rem;
}

.log-command {
  color: var(--text);
}

.log-command .log-path {
  color: var(--cyan);
}

.log-result {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-wrap;
}

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

.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.file-item {
  color: #c7c0da;
}

.file-item--dir {
  color: var(--purple);
}

.file-item--page {
  color: var(--cyan);
}

.command-line {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 0 clamp(24px, 4vw, 58px);
  border-top: 1px solid var(--border-strong);
  background: rgba(10, 7, 18, 0.98);
  box-shadow: 0 -18px 50px rgba(78, 41, 140, 0.12);
  font-size: 0.95rem;
}

.prompt-user { color: var(--pink); font-weight: 700; }
.prompt-at { color: var(--muted); }
.prompt-host { color: var(--purple); font-weight: 700; }
.prompt-path { margin-left: 9px; color: var(--cyan); }
.prompt-symbol { margin: 0 11px; color: var(--green); }

#command-input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--text);
  caret-color: var(--cyan);
  background: transparent;
}

#command-input::placeholder {
  color: #5e5871;
}

.command-hint {
  margin: 0;
  padding: 7px clamp(24px, 4vw, 58px) 10px;
  color: #625c77;
  background: rgba(10, 7, 18, 0.98);
  font-size: 0.65rem;
}

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

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

@keyframes pulse {
  50% { opacity: 0.35; transform: scale(0.75); }
}

@keyframes drift {
  to { transform: translate3d(6vw, 4vh, 0) scale(1.12); }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(8px); }
}

@media (max-width: 920px) {
  body {
    overflow: auto;
  }

  .shell {
    width: min(100% - 20px, 900px);
    height: auto;
    min-height: calc(100vh - 20px);
    margin: 10px auto;
  }

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

  .sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar__section,
  .sidebar__section--bottom {
    margin: 0;
    padding: 0;
    border: 0;
  }

  .terminal-output {
    min-height: 60vh;
  }
}

@media (max-width: 640px) {
  .topbar {
    grid-template-columns: auto 1fr;
  }

  .topbar__title {
    justify-self: center;
  }

  .topbar__status {
    display: none;
  }

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

  .sidebar__section:nth-child(n+3) {
    display: none;
  }

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

  .command-stack div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .command-stack code {
    min-width: 0;
  }

  .prompt-at,
  .prompt-host {
    display: none;
  }

  .command-line {
    padding-inline: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
