/* trampinheavy — static portfolio
   palette: acid green / cyan / off-white / charcoal / amber alerts
   no purple UI. artwork exempt. */

:root {
  --void: #040705;
  --panel: rgba(6, 14, 10, 0.88);
  --panel-hi: rgba(10, 24, 16, 0.92);
  --ink: #e9f5ec;
  --dim: #8fa898;
  --acid: #a6ff4d;
  --acid-dim: rgba(166, 255, 77, 0.32);
  --cyan: #45e8d8;
  --amber: #ffb347;
  --line: rgba(166, 255, 77, 0.22);
  --line-hi: rgba(69, 232, 216, 0.55);
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", SFMono-Regular,
    Menlo, Consolas, "Liberation Mono", monospace;
  --max: 62rem;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--void);
}

/* artwork backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(rgba(4, 7, 5, 0.78), rgba(4, 7, 5, 0.9)),
    url("images/ascii-bg.webp") center / cover no-repeat fixed;
}

/* scanlines */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.16) 0 1px,
    transparent 1px 3px
  );
  opacity: 0.5;
}

a { color: var(--cyan); }

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

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 40;
  padding: 0.5rem 0.9rem;
  background: var(--acid);
  color: var(--void);
  font-weight: 700;
  text-decoration: none;
  transition: top 120ms ease;
}

.skip-link:focus { top: 0.75rem; }

/* ── shell ─────────────────────────────────────────────── */

.site-header,
.site-main,
.site-footer {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1.1rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--acid);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand::before { content: "~/"; color: var(--dim); font-weight: 400; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  text-transform: lowercase;
}

.site-nav li + li::before {
  content: "/";
  margin-inline: 0.6rem;
  color: var(--dim);
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.15rem 0.35rem;
  background: rgba(6, 14, 10, 0.6);
  border: 1px solid transparent;
}

.site-nav a:hover { color: var(--acid); border-color: var(--line); }

.site-nav a[aria-current="page"] {
  color: var(--acid);
  border-color: var(--line);
}

.site-main { padding-block: 2.5rem 3.5rem; }

.site-footer {
  padding-block: 1.25rem 2rem;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.site-footer a { color: var(--dim); }
.site-footer a:hover { color: var(--acid); }

/* ── type ──────────────────────────────────────────────── */

h1, h2, h3 { line-height: 1.2; font-weight: 700; }

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: 0.04em;
  color: var(--ink);
}

h1 .prompt { color: var(--acid); user-select: none; }

h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}

h2::before { content: "## "; color: var(--dim); }

.lede { margin: 0 0 2rem; color: var(--dim); }

.stub { color: var(--amber); }
.stub::before { content: ""; }

/* subtle glitch on hover — headline only */
@media (prefers-reduced-motion: no-preference) {
  .glitch:hover {
    animation: glitch-jitter 320ms steps(2, jump-none) infinite;
    text-shadow: 2px 0 var(--cyan), -2px 0 var(--acid);
  }
  @keyframes glitch-jitter {
    0% { transform: translate(0); }
    50% { transform: translate(1px, -1px); }
    100% { transform: translate(-1px, 0); }
  }
}

/* ── command-link index ────────────────────────────────── */

.link-index {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cmd {
  display: grid;
  grid-template-columns: minmax(0, auto) 1fr auto;
  align-items: baseline;
  gap: 0.35rem 1rem;
  padding: 0.85rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--acid);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 0 0 rgba(166, 255, 77, 0);
  transition: transform 120ms ease, box-shadow 120ms ease,
    border-color 120ms ease, background 120ms ease;
}

.cmd:hover,
.cmd:focus-visible {
  background: var(--panel-hi);
  border-color: var(--line-hi);
  border-left-color: var(--cyan);
  transform: translate(3px, -2px);
  box-shadow: -3px 2px 0 rgba(69, 232, 216, 0.35);
}

.cmd-path { color: var(--acid); font-weight: 700; overflow-wrap: anywhere; }

.cmd-desc { color: var(--dim); font-size: 0.9rem; }

.cmd-arrow { color: var(--cyan); }

.cmd-note {
  display: block;
  grid-column: 1 / -1;
  color: var(--amber);
  font-size: 0.8rem;
}

.ext:not(.cmd)::after {
  content: "↗";
  margin-left: 0.4rem;
  color: var(--dim);
  font-size: 0.85em;
}

/* ── panels / prose ────────────────────────────────────── */

.panel {
  margin-block: 1.5rem;
  padding: 1.1rem 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--acid);
}

.bio-block {
  min-height: 8rem;
  display: block;
}

blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  color: var(--ink);
}

blockquote footer,
.quote-cite {
  margin-top: 0.6rem;
  color: var(--dim);
  font-size: 0.8rem;
}

blockquote p { margin: 0 0 0.8rem; }
blockquote p:last-child { margin-bottom: 0; }

pre {
  overflow-x: auto;
  padding: 0.9rem 1rem;
  background: rgba(2, 5, 3, 0.9);
  border: 1px solid var(--line);
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.88rem;
}

.source-view {
  margin: 1rem 0 0;
  padding: 1rem 1.15rem;
  tab-size: 4;
  line-height: 1.5;
  white-space: pre;
}

.source-view:focus-visible {
  outline-offset: 4px;
}

kbd {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  background: rgba(2, 5, 3, 0.9);
  border: 1px solid var(--line-hi);
  border-bottom-width: 2px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.85em;
}

figure { margin: 1.5rem 0; }

figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: var(--panel);
}

figcaption {
  margin-top: 0.45rem;
  color: var(--dim);
  font-size: 0.8rem;
}

figcaption::before { content: "// "; color: var(--acid-dim); }

/* ── demo page ─────────────────────────────────────────── */

.demo-frame {
  position: relative;
  margin: 1.5rem 0 0;
  border: 1px solid var(--line-hi);
  background: #000;
  box-shadow: 0 0 0 1px rgba(2, 5, 3, 0.9), 0 0 24px rgba(69, 232, 216, 0.12);
}

.demo-frame canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  background: #000;
  cursor: crosshair;
}

.demo-frame canvas:focus { outline: none; }
.demo-frame.is-focused { border-color: var(--acid); }

.demo-frame:fullscreen {
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  border: 0;
}

.demo-frame:fullscreen canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.demo-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  background: rgba(2, 5, 3, 0.85);
  color: var(--acid);
  letter-spacing: 0.1em;
  font-size: 0.9rem;
}

.demo-status[hidden] { display: none; }
.demo-status.is-error { color: var(--amber); }

.focus-hint {
  margin: 0.55rem 0 0;
  color: var(--amber);
  font-size: 0.85rem;
}

.focus-hint::before { content: "! "; color: var(--amber); }
.demo-frame.is-focused + .focus-hint { visibility: hidden; }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 1.25rem 0 0;
  padding: 0.9rem 1rem;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--dim);
}

.controls strong { color: var(--ink); font-weight: 400; }

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

@media (max-width: 40rem) {
  .cmd { grid-template-columns: 1fr auto; }
  .cmd-desc { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .cmd { transition: none; }
  .cmd:hover, .cmd:focus-visible { transform: none; box-shadow: none; }
}
