/* RV Labs: a DOS-style shelf of small apps. One page, no build step.
   Themes only change the tokens below; pick one with <html data-theme="…">. */
@font-face {
  font-family: "VT323";
  src: url("assets/fonts/VT323.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #0000a8;      /* screen */
  --fg: #ffffff;      /* text */
  --hi: #fefe54;      /* titles, logo */
  --ac: #54fefe;      /* accents, selection */
  --bar: #a8a8a8;     /* menu and status bars */
  --bar-fg: #000000;
  --hot: #a80000;     /* shortcut letters on the bars */
  --sel-fg: #000000;  /* text on the selection */
  --btn: #00a800;
  --btn-fg: #ffffff;
  --shadow: #000000;
  --font: "VT323", ui-monospace, Menlo, Consolas, monospace;
}
[data-theme="amber"] { --bg: #170d00; --fg: #ffb000; --hi: #ffd76a; --ac: #ff8a00; --bar: #ffb000; --bar-fg: #170d00; --hot: #7a2a00; --sel-fg: #170d00; --btn: #ffb000; --btn-fg: #170d00; --shadow: #000; }
[data-theme="phosphor"] { --bg: #021407; --fg: #39ff6a; --hi: #b6ffc6; --ac: #18c94a; --bar: #39ff6a; --bar-fg: #021407; --hot: #0a5a20; --sel-fg: #021407; --btn: #39ff6a; --btn-fg: #021407; --shadow: #000; }
[data-theme="c64"] { --bg: #40318d; --fg: #a5a5ff; --hi: #ffffff; --ac: #7abfc7; --bar: #7869c4; --bar-fg: #ffffff; --hot: #fefe54; --sel-fg: #20184a; --btn: #7abfc7; --btn-fg: #20184a; --shadow: #1b1447; }
[data-theme="paper"] { --bg: #f5ecd9; --fg: #241c12; --hi: #9b2d20; --ac: #b8862b; --bar: #241c12; --bar-fg: #f5ecd9; --hot: #f2d58a; --sel-fg: #241c12; --btn: #2f6b3f; --btn-fg: #ffffff; --shadow: #241c12; }

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 48px; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: 24px; line-height: 1.15;
  -webkit-font-smoothing: none; text-rendering: optimizeSpeed;
}
a { color: inherit; }
p { margin: 0 0 .6em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
:focus-visible { outline: 3px dashed var(--hi); outline-offset: 2px; }

/* ---------- bars ---------- */
.bar, .status {
  background: var(--bar); color: var(--bar-fg);
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 22px; padding: 3px 16px;
  position: sticky; z-index: 5;
}
.bar { top: 0; }
.status { bottom: 0; margin-top: auto; }
.bar a { text-decoration: none; padding: 0 4px; }
.bar a:hover, .status button:hover { background: var(--bar-fg); color: var(--bar); }
.bar b, .status b { color: var(--hot); font-weight: 400; }
.bar a:hover b, .status button:hover b { color: inherit; }
.clock { margin-left: auto; }
.status button { font: inherit; color: inherit; background: none; border: 0; padding: 0 4px; cursor: pointer; }

/* ---------- windows ---------- */
main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 14px 16px 28px; }
.win { border: 4px double var(--fg); margin: 26px 0 0; padding: 26px 20px 18px; position: relative; }
.win-title {
  position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
  background: var(--bg); padding: 0 10px; margin: 0;
  font-size: inherit; font-weight: 400; white-space: nowrap;
}

/* ---------- hero ---------- */
.logo {
  font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
  font-size: clamp(6.5px, 1.72vw, 17px); line-height: 1.05;
  color: var(--hi); margin: 0 0 16px; text-shadow: .22em .22em 0 var(--shadow);
  overflow: hidden;
}
.tag { color: var(--ac); font-size: 1.35em; margin: 0 0 4px; }
.prompt { margin: 0; min-height: 1.15em; }
.cur { display: inline-block; width: .55em; height: .9em; background: var(--fg); vertical-align: -2px; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.parade { display: flex; align-items: flex-end; gap: clamp(6px, 3vw, 30px); margin-top: 22px; }
.parade button {
  background: none; border: 0; padding: 0; cursor: pointer; width: clamp(48px, 13vw, 92px);
  animation: step .9s steps(2) infinite; animation-delay: var(--d);
}
.parade img { display: block; width: 100%; height: auto; filter: drop-shadow(4px 4px 0 var(--shadow)); }
.parade button:hover, .parade button.on { animation: hop .45s ease-in-out infinite; }
@keyframes step { 50% { transform: translateY(-5px); } }
@keyframes hop { 50% { transform: translateY(-14px) rotate(4deg); } }

/* ---------- projects ---------- */
.split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 24px; align-items: start; }
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; gap: 12px; padding: 1px 8px; cursor: pointer; white-space: nowrap; overflow: hidden; }
.files li:hover { color: var(--hi); }
.files li[aria-selected="true"] { background: var(--ac); color: var(--sel-fg); }

.pane { display: none; }
.pane.on { display: block; animation: wipe .28s steps(6); }
@keyframes wipe { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
.pane-top { display: flex; gap: 18px; align-items: center; }
.tile {
  flex: 0 0 132px; height: 142px; background: var(--c); border: 3px solid var(--shadow);
  box-shadow: 8px 8px 0 var(--shadow); display: grid; place-items: center; cursor: pointer; padding: 0;
}
.tile img { width: 108px; max-height: 122px; animation: step 1.1s steps(2) infinite; }
.tile.jump img { animation: jump .6s ease-out; }
@keyframes jump { 30% { transform: translateY(-26px) rotate(-8deg) scale(1.08); } 60% { transform: translateY(0) rotate(4deg); } 80% { transform: translateY(-8px); } }
.pane h3 { margin: 0; color: var(--hi); font-size: 1.4em; font-weight: 400; line-height: 1; }
.pane .host { color: var(--ac); margin: 2px 0 6px; }
.pane .blurb { margin: 0 0 12px; }
.actions { margin: 0; display: flex; flex-wrap: wrap; gap: 12px 18px; }
.btn {
  display: inline-block; background: var(--btn); color: var(--btn-fg); text-decoration: none;
  padding: 1px 14px; box-shadow: 6px 6px 0 var(--shadow); white-space: nowrap;
}
.btn.alt { background: var(--bar); color: var(--bar-fg); }
.btn:hover, .btn:focus-visible { background: var(--hi); color: var(--sel-fg); }
.btn:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--shadow); }

.shots { display: flex; gap: 18px; align-items: flex-end; margin-top: 24px; flex-wrap: wrap; }
.shots figure { margin: 0; }
.shots img {
  display: block; height: 300px; width: auto; max-width: 100%;
  border: 3px solid var(--shadow); box-shadow: 8px 8px 0 var(--shadow); background: var(--shadow);
}
.shots img.wide { height: auto; width: 300px; }
.shots figcaption { margin-top: 10px; color: var(--ac); font-size: .8em; }

/* ---------- about ---------- */
#about p { max-width: 46ch; }

/* ---------- CRT layer: scanlines, a soft vignette and a slow flicker ---------- */
.crt {
  position: fixed; inset: 0; pointer-events: none; z-index: 20;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .15) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .38) 100%);
  animation: flicker 5s steps(1) infinite;
}
@keyframes flicker { 0%, 100% { opacity: 1; } 47% { opacity: .86; } 49% { opacity: 1; } 82% { opacity: .92; } 83% { opacity: 1; } }
html:not([data-crt="off"]) body { text-shadow: 0 0 6px color-mix(in srgb, currentColor 45%, transparent); }
[data-crt="off"] .crt { display: none; }

/* ---------- boot screen: once per visit, a tap or a key skips it ---------- */
.boot-screen { display: none; }
.boot .boot-screen {
  display: block; position: fixed; inset: 0; z-index: 30; background: #000; color: #c8c8c8;
  padding: 22px 20px; cursor: pointer;
}
.boot-screen pre { font: inherit; margin: 0; white-space: pre-wrap; }
.boot-skip { position: absolute; bottom: 18px; left: 20px; margin: 0; opacity: .5; }
.boot body { overflow: hidden; }

/* ---------- the party (try the Konami code) ---------- */
.party { position: fixed; top: -140px; width: 90px; z-index: 25; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(calc(100vh + 300px)) rotate(var(--spin)); } }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  body { font-size: 21px; }
  .split { grid-template-columns: 1fr; gap: 18px; }
  .win { padding: 24px 12px 16px; }
  main { padding: 10px 10px 24px; }
  .tile { flex-basis: 104px; height: 112px; }
  .tile img { width: 84px; max-height: 96px; }
  .shots img { height: 240px; }
  .shots img.wide { width: 240px; height: auto; }
  .keys { display: none; }
  .win-title { font-size: .9em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; }
}
