:root {
  --bg: #0e110f;
  --panel: #141815;
  --line: #232a24;
  --ink: #d8e6d3;
  --bright: #f3f7f0;
  --dim: #74826f;
  --green: #9fe08a;
  --amber: #f0c674;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  font: 400 clamp(0.95rem, 1.4vw, 1.1rem) / 1.7 var(--mono);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background-image:
    radial-gradient(circle at 20% 10%, rgb(159 224 138 / 0.07), transparent 40%),
    radial-gradient(circle at 90% 90%, rgb(240 198 116 / 0.05), transparent 40%);
}

.wrap { width: min(46rem, 100%); }

/* ---------- Window ---------- */

.window {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 30px 80px -30px #000;
  overflow: hidden;
}

.titlebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.8rem;
}

.lights { display: flex; gap: 8px; }
.lights i { width: 11px; height: 11px; border-radius: 50%; background: #3a423b; }
.title { grid-column: 2; }

.screen { padding: clamp(1.25rem, 3vw, 2rem); }

.screen p { margin: 0; }
.gap { margin-top: 1.1rem !important; }

.prompt { color: var(--green); }
.cwd { color: var(--amber); }

.name {
  margin: 0.6rem 0 0.5rem;
  font-family: var(--serif);
  font-weight: 600;
  font-variation-settings: "opsz" 144;
  font-size: clamp(2.4rem, 7vw, 4.25rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--bright);
}

.comment { color: var(--dim); }

/* ---------- Links ---------- */

.links {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
}

.links a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dashed var(--dim);
}

.links a::after { content: "/"; color: var(--dim); }

.links a:hover {
  color: var(--bg);
  background: var(--green);
  border-color: var(--green);
}

.links a:hover::after { color: var(--bg); }

a:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

/* ---------- Cursor & reveal ---------- */

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--green);
  vertical-align: -0.2em;
  animation: blink 1.1s steps(1) infinite;
}

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

/* Lines print one after another, like command output */
.line { animation: print 0.35s ease-out both; }
.line:nth-child(2) { animation-delay: 0.15s; }
.line:nth-child(3) { animation-delay: 0.3s; }
.line:nth-child(4) { animation-delay: 0.5s; }
.line:nth-child(5) { animation-delay: 0.65s; }
.line:nth-child(6) { animation-delay: 0.85s; }

@keyframes print {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Interactive shell ---------- */

.screen.is-live {
  max-height: min(78vh, 46rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  cursor: text;
}

.output > * { margin: 0; }
.output .links { margin: 0.1rem 0 0.2rem; }

.echo { margin-top: 0.9rem !important; }
.echo .cmd { color: var(--ink); }

.out {
  white-space: pre-wrap;
  line-height: 1.55;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.out.dim { color: var(--dim); }
.out.err { color: #f2a08c; }
.out a { color: var(--ink); text-decoration: none; border-bottom: 1px dashed var(--dim); }
.out a:hover { color: var(--bg); background: var(--green); border-color: var(--green); }

.entry-dir { color: var(--green); }
.entry-file { color: var(--ink); }

.input-line {
  display: flex;
  align-items: baseline;
  gap: 0;
  margin-top: 1.1rem;
  animation: print 0.35s ease-out 0.85s both;
}

.ps { white-space: pre; }

.cmd {
  color: var(--ink);
}

input.cmd {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: max(16px, 1em); /* stops iOS zooming on focus */
  line-height: inherit;
  caret-color: var(--green);
  caret-shape: block;
}

input.cmd::placeholder { color: var(--dim); opacity: 0.6; }

.window:focus-within { border-color: #2f3a31; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.footer {
  margin-top: 1.5rem;
  color: var(--dim);
  font-size: 0.8rem;
}

@media (max-width: 480px) {
  .title { display: none; }
  .links { gap: 0.5rem 1.25rem; }
}

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