:root {
  --bg: #000;
  --fg: #f2f2f2;
  --dim: #8a8a8a;
  --faint: #3a3a3a;
  --line: #2a2a2a;
  --glow: 0 0 6px rgba(255, 255, 255, 0.28);
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs: 15px;
  --lh: 1.6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: var(--fs);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
}

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

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover, .btn:hover, .tab:hover, .copy:hover, .mode:hover { background: var(--fg); color: var(--bg); text-shadow: none; }

/* ─────────── layout: a tall scroll track with a sticky terminal ─────────── */

#track { position: relative; }

#term {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  padding: 0;
  display: flex;
  justify-content: center;
}

.window {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #000;
}

/* CRT: scanlines + vignette */
.window::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.025) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.5) 100%);
  z-index: 5;
}

.titlebar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--dim);
  user-select: none;
}
.title { display: flex; align-items: center; gap: 8px; color: var(--fg); }
.mini-logo { width: 16px; height: 16px; border-radius: 3px; border: 1px solid #555; }
.dims { justify-self: end; }

.tabs {
  display: flex;
  gap: 2px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
  font-size: 12.5px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 6px 12px;
  color: var(--dim);
  white-space: nowrap;
  border-right: 1px solid var(--line);
}
.tab::before { content: attr(data-n) " "; color: var(--faint); }
.tab.active { background: var(--fg); color: var(--bg); }
.tab.active::before { color: #555; }

#viewport {
  position: relative;
  flex: 1;
  overflow: hidden;
}

#screen {
  padding: 18px clamp(14px, 3vw, 34px) 40vh;
  max-width: 96ch;
  will-change: transform;
  transition: transform 140ms cubic-bezier(.2, .7, .3, 1);
  text-shadow: var(--glow);
}

.status {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 4px 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
  user-select: none;
}
.status .inv { padding: 0 4px; }
.seg-r { display: flex; gap: 14px; align-items: center; }
.hint { color: #fff; animation: pulse 2.2s ease-in-out infinite; overflow: hidden; text-overflow: ellipsis; }
.mode { color: var(--dim); border: 1px solid #444; padding: 0 6px; border-radius: 2px; }
.mode::before { content: "mode: "; color: #555; }
@keyframes pulse { 50% { opacity: .72; } }

/* ─────────── terminal content ─────────── */

.blk { margin: 0 0 2.2em; }
.ln { margin: 0; min-height: calc(var(--fs) * var(--lh)); }
.ln + .ln { margin-top: .15em; }

.cmd { margin-top: 1.1em !important; margin-bottom: .35em; }
.blk > .cmd:first-child { margin-top: 0 !important; }
.ps1 { color: var(--dim); }
.c { font-weight: 700; color: #fff; }

.art {
  font-family: var(--mono);
  font-size: clamp(7px, 1.4vw, 10.5px);
  line-height: 1.08;
  margin: .6em 0 .8em;
  color: #fff;
  text-shadow: 0 0 8px rgba(255,255,255,.35);
  overflow: hidden;
}

.big {
  font-size: clamp(30px, 6vw, 60px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: .25em 0 .25em !important;
  text-shadow: 0 0 18px rgba(255,255,255,.35);
}
.sub { font-size: 1.15em; margin-bottom: .9em !important; }

.inv { background: var(--fg); color: var(--bg); padding: 0 .35em; text-shadow: none; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.big .inv { padding: 0 .12em; }
.dim { color: var(--dim); }
b { font-weight: 700; color: #fff; }

.li { padding-left: 2ch; }
.note { margin-top: .9em !important; padding-left: 0; }
.ind { padding-left: 4ch; color: #cfcfcf; }
.btns { margin-top: 1.1em !important; display: flex; flex-wrap: wrap; gap: .6em 1.4em; }
.btn { font-weight: 700; text-decoration: none; color: #fff; padding: 0 .1em; }
.cta-row {
  width: 100%;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}
.cta-row::-webkit-scrollbar { display: none; }
.cta-row .btn { flex: none; white-space: nowrap; padding: 0; }
.hero-cta-row { font-size: clamp(8px, 2vw, 15px); }

.h { font-size: 1em; font-weight: 700; margin: .2em 0 .8em !important; letter-spacing: .06em; }

.box {
  border: 1px solid var(--fg);
  padding: .8em 1em;
  margin: 1em 0 1.3em !important;
  position: relative;
}
.box::before { content: "stdin"; position: absolute; top: -.75em; left: .8em; background: #000; padding: 0 .4em; font-size: 11px; color: var(--dim); }
.prompt-to { color: var(--dim); }
#instruction { color: #fff; font-weight: 500; word-break: break-word; }
.copy { color: var(--dim); margin-left: .4em; font-weight: 700; }
#copy[data-copied="true"]::after { content: " ✓ copied"; color: #fff; }

.step { margin-top: 1em !important; font-weight: 700; }
.code { margin: .2em 0 1em !important; padding-left: 2ch; word-break: break-all; color: #fff; }
code { font-family: inherit; }
code.u { border-bottom: 1px dashed #888; }

.row { display: grid; grid-template-columns: 26ch 1fr; gap: 1ch; padding: .1em 0; border-bottom: 1px dotted #222; }
.row.head { color: var(--dim); border-bottom: 1px solid #666; margin-top: 1em !important; }
.row.last { border-bottom: 1px solid #666; margin-bottom: 1em; }
.row .k { color: #fff; font-weight: 500; }
.row:not(.head) .k::before { content: "› "; color: #555; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2em; margin-top: 1em; }
.card { border: 1px solid #555; padding: 1.1em 1.2em 1.3em; }
.card .big { font-size: clamp(30px, 5.2vw, 56px); }

.chk { margin-top: .8em !important; }
.ok { color: #fff; font-weight: 700; }
.warn { margin-top: 1.3em !important; color: #ddd; }
.warn .inv { margin-right: .6em; font-weight: 700; }

/* ─────────── typing machinery ─────────── */

.js:not(.static) .ln:not(.on) { visibility: hidden; }
.hid { color: transparent !important; text-shadow: none !important; }
.inv .hid { color: transparent; }

#cursor { position: relative; display: inline-block; width: 0; height: 1em; vertical-align: baseline; }
#cursor::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.22em;
  width: .62em;
  height: 1.25em;
  background: #fff;
  box-shadow: 0 0 10px rgba(255,255,255,.6);
  mix-blend-mode: difference;
}
#cursor.blink::after { animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ─────────── static mode (no animation, normal scrolling) ─────────── */

.static #track { height: auto !important; }
.static #term { position: static; height: auto; padding-bottom: 0; }
.static .window { height: auto; overflow: visible; }
.static .titlebar, .static .tabs { position: sticky; top: 0; z-index: 6; background: #000; }
.static .tabs { top: 34px; }
.static #viewport { overflow: visible; }
.static #screen { transform: none !important; padding-bottom: calc(3em + 2rem); }
.static .status { position: fixed; left: 0; right: 0; bottom: 0; background: #000; z-index: 6; }

/* ─────────── small screens ─────────── */

@media (max-width: 720px) {
  :root { --fs: 13.5px; }
  .dims { visibility: hidden; }
  .row { grid-template-columns: 1fr; gap: 0; }
  .row .d { padding-left: 2ch; color: #bbb; }
  .row.head .d { display: none; }
  .cards { grid-template-columns: 1fr; }
  .ind { padding-left: 2ch; }
  .seg-l { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #screen { transition: none; }
  .hint { animation: none; }
}

/* reverse-video spans grow with the typed text instead of appearing as a full bar */
#screen .inv { background: none; color: inherit; padding: 0; }
#screen .iv { background: var(--fg); color: var(--bg); text-shadow: none; padding: 0 .3em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
#screen .big .iv { padding: 0 .1em; }
#screen .iv:empty { display: none; }
.static .blk { scroll-margin-top: 80px; }

/* neofetch hero */
.fetch { display: flex; align-items: center; gap: clamp(16px, 4vw, 48px); margin: .4em 0 .2em; }
.fetch .art { flex: none; margin: 0; }
.spec .ln + .ln { margin-top: 0; }
.spec .key { display: inline-block; width: 11ch; font-weight: 700; color: #fff; }
.spec .key::after { content: ":"; }
.swatch { margin-top: .6em !important; display: flex; gap: 0; min-height: 0; }
.swatch i { width: 2.2ch; height: 1.1em; display: block; }
.swatch i:nth-child(1) { background: #000; outline: 1px solid #333; }
.swatch i:nth-child(2) { background: #222; }
.swatch i:nth-child(3) { background: #444; }
.swatch i:nth-child(4) { background: #666; }
.swatch i:nth-child(5) { background: #888; }
.swatch i:nth-child(6) { background: #aaa; }
.swatch i:nth-child(7) { background: #d4d4d4; }
.swatch i:nth-child(8) { background: #fff; }
@media (max-width: 720px) {
  .fetch { flex-direction: column; align-items: flex-start; }
  .art { font-size: 7.4px; }
}
.cmt { margin-top: 1.2em !important; }

/* full-screen terminal: no browser scrollbar outside it */
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }

/* Section actions blink with the terminal cursor; focus and hover hold them solid. */
.cta-row .btn .sg > span:first-child { padding: .1em 0; }
.idle .cta-row .btn .sg > span:first-child { animation: btnflash 1.05s steps(1) infinite; }
.cta-row .btn:hover .sg > span:first-child,
.cta-row .btn:focus-visible .sg > span:first-child { animation: none; }
.cta-row .btn:focus-visible { background: var(--fg); color: var(--bg); text-shadow: none; outline: none; }
@keyframes btnflash {
  0% { background: var(--fg); color: var(--bg); text-shadow: none; }
  50% { background: transparent; color: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  .cta-row .btn .sg > span:first-child { animation: none; }
}
