:root {
  --bg: #10131a;
  --bg-alt: #171b24;
  --border: #2a2f3a;
  --text: #e7e5e0;
  --muted: #8890a0;
  --amber: #e8a33d;
  --cyan: #7dd3fc;
  --ok: #8fbf7f;
  --font-display: "Space Grotesk", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 16px;
  overflow-x: hidden;
}

.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;
}

.scene {
  position: relative;
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 1;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(16, 19, 26, 0) 0%, rgba(8, 9, 13, 0.9) 100%);
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  background: repeating-linear-gradient(
    0deg,
    #fff,
    #fff 1px,
    transparent 1px,
    transparent 3px
  );
}

.masthead {
  text-align: center;
  margin-bottom: 4px;
}

.masthead h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  margin: 0;
  letter-spacing: -0.02em;
}

.masthead .role {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 0.9rem;
  margin: 6px 0 0;
}

.terminal {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #1b202b;
  border-bottom: 1px solid var(--border);
}

.term-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-r { background: #6b4141; }
.dot-y { background: #6b5c3a; }
.dot-g { background: #3f5c42; }

.term-path {
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: 4px;
}

.term-body {
  padding: 18px 20px 22px;
  min-height: 210px;
}

.term-log {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.85rem;
  line-height: 1.65;
}

.term-log .line-cmd { color: var(--cyan); }
.term-log .line-out { color: var(--text); }
.term-log .line-muted { color: var(--muted); }

.term-prompt {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 0.85rem;
}

.prompt-user { color: var(--amber); }
.prompt-sep { color: var(--muted); }
.prompt-path { color: var(--cyan); }

.cursor {
  width: 8px;
  height: 16px;
  background: var(--amber);
  margin-left: 4px;
  animation: blink 1s step-end infinite;
}

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

.status-panel {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.progress-pct {
  color: var(--amber);
}

.progress-track {
  height: 6px;
  background: #1c212b;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--amber), var(--cyan));
  transition: width 1.4s ease;
  border-radius: 999px;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.85rem;
}

.task-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.task-icon {
  font-size: 0.7rem;
  width: 14px;
}

.task-icon[data-state="pending"] { color: var(--muted); }
.task-icon[data-state="done"] { color: var(--ok); }

.links-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.links-row a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.links-row a:hover,
.links-row a:focus-visible {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .term-body { padding: 16px; min-height: 250px; }
  .status-panel { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; opacity: 1; }
  .progress-fill { transition: none; }
  .scanlines { display: none; }
}