:root {
  --bg: #0D0E11;
  --bg-raised: #12141A;
  --border: #22252E;
  --text: #E2E8F0;
  --text-dim: #7C8494;
  --accent: #A855F7;
  --accent-soft: rgba(168, 85, 247, 0.14);
  --ok: #34D399;
  --warn: #FBBF24;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, sans-serif;
}

:root[data-accent="green"] {
  --accent: #00FF66;
  --accent-soft: rgba(0, 255, 102, 0.12);
}

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

html {
  color-scheme: dark;
}

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-soft), transparent);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

.accent {
  color: var(--accent);
}

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

/* ---- header / footer ---- */

.site-header {
  padding: 1.5rem 2rem;
}

.wordmark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  user-select: none;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem 3rem;
}

.site-footer {
  padding: 1.25rem 2rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  gap: 0.6rem;
  justify-content: center;
}

.site-footer a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s, border-color 0.15s;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

.tagline {
  margin-top: 1.5rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ---- terminal window ---- */

.terminal {
  width: 100%;
  max-width: 720px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 24px 60px -24px rgba(0, 0, 0, 0.8),
    0 0 80px -30px var(--accent-soft);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot-r { background: #FF5F57; }
.dot-y { background: #FEBC2E; }
.dot-g { background: #28C840; }

.terminal-title {
  margin-left: auto;
  margin-right: auto;
  padding-right: 45px; /* visually recenter against the dots */
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  user-select: none;
}

.terminal-body {
  padding: 1.1rem 1.25rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.75;
  min-height: 340px;
  max-height: 60svh;
  overflow-y: auto;
  cursor: text;
}

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

.terminal-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* ---- output lines ---- */

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

.line .ok { color: var(--ok); }
.line .warn { color: var(--warn); }
.line .dim { color: var(--text-dim); }
.line .cmd { color: var(--text); font-weight: 500; }

.line a {
  color: var(--accent);
  text-decoration: none;
}

.line a:hover {
  text-decoration: underline;
}

/* ---- prompt ---- */

.prompt-line {
  display: flex;
  align-items: baseline;
  gap: 0.6ch;
}

.prompt-line.hidden {
  display: none;
}

.prompt {
  color: var(--text-dim);
  white-space: nowrap;
  user-select: none;
}

#term-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font: inherit;
  caret-color: var(--accent);
}

/* typing cursor shown during the boot sequence */
.cursor {
  display: inline-block;
  width: 0.6ch;
  height: 1.05em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}

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

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

@media (max-width: 480px) {
  .terminal-body {
    font-size: 0.76rem;
    min-height: 300px;
  }
}

/* Touch devices: iOS Safari auto-zooms when focusing an input whose
   font is under 16px. Bump the input to 16px there (only) to stop it. */
@media (pointer: coarse) {
  #term-input {
    font-size: 16px;
  }
}
