/* ------------------------------------------------------------------
   casperjuel.dk — plain CSS. No reset library, no utility classes.
   ------------------------------------------------------------------ */

:root {
  --bg: #ffffff;
  --fg: #000000;
  --muted: #6b6b6b;
  --line: #000000;
  --accent: #0b00ff;
  --accent-fg: #ffffff;
  --wrong: #ff3b00;
  --scene-ink: #8a8a8a;        /* the dither's "on" colour: grey, not full black */
  --scene-opacity: 0.85;

  --font-sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1400px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a;
    --fg: #f2f2f2;
    --muted: #8a8a8a;
    --line: #f2f2f2;
    --accent: #3d33ff;
    --scene-ink: #6a6a6a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --fg: #f2f2f2;
  --muted: #8a8a8a;
  --line: #f2f2f2;
  --accent: #3d33ff;
  --scene-ink: #6a6a6a;
  color-scheme: dark;
}
/* phones: the shape sits behind the headline, so fade it further */
@media (max-width: 720px) {
  :root { --scene-opacity: 0.45; }
}

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

/* reset.css sets display:block on <figure>, <details> etc., which outranks the
   browser's own [hidden] { display:none }. Put it back, with force. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  padding: 0.1em 0.35em;
  border-radius: 3px; /* 3px. Not 50%. See demo 01. */
}

em { font-style: italic; }

/* ---------- type scale ---------- */

.display {
  font-size: clamp(2.6rem, 9vw, 9rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 500;
  margin: 0;
  text-wrap: balance;
}
.display em { font-style: italic; font-weight: 400; }

/* hero: name on its own, payoff below it */
.name { margin-bottom: 0.75rem; }
.name + .label { margin-bottom: 0.25rem; }
.payoff {
  font-size: clamp(1.8rem, 4.5vw, 4.5rem);
  font-weight: 400;
  color: var(--muted);
  max-width: 14ch;
}
.payoff em, .payoff .px, .payoff .bits { color: var(--fg); }

/* "pixels", set in a bitmap font. The only web font on the page. */
.px {
  font-family: "Silkscreen", var(--font-mono);
  font-size: 0.78em;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: lowercase;
  vertical-align: 0.04em;
}

/* "bits", in mono, decoded from binary by main.js */
.bits {
  font-family: var(--font-mono);
  font-size: 0.85em;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  display: inline-block;
  min-width: 4ch;
}
.bits.is-bin { color: var(--accent); }
.bin { margin-top: 0.5rem; letter-spacing: 0.05em; }
.bin .on { color: var(--accent); }

.big {
  font-size: clamp(1.4rem, 3vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 24ch;
  text-wrap: pretty;
}

.lede {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  max-width: 44ch;
  margin: 1.25rem 0 1rem;
}

.label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.label a { color: var(--fg); }

.h2 {
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
}
/* the "underline made of dashes" device */
.h2::after {
  content: "––––––––";
  display: block;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: -0.1em;
  margin-top: 0.25rem;
}

/* ---------- layout ---------- */

.skip {
  position: absolute; left: 8px; top: -100px;
  background: var(--accent); color: var(--accent-fg);
  padding: 8px 12px; z-index: 100;
}
.skip:focus { top: 8px; }

.top {
  position: sticky; top: 0; z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 12px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  mix-blend-mode: normal;
}
.wordmark { font-weight: 600; text-decoration: none; letter-spacing: -0.02em; }
.nav { grid-column: 4; justify-self: end; display: flex; gap: 1.25rem; align-items: center; font-family: var(--font-mono); font-size: 13px; }
.coords { display: none; }
@media (min-width: 720px) { .coords { display: inline; } }

/* ---------- web 1.0 links ----------
   The browser's own defaults, written out so they survive reset.css:
   blue, underlined, purple when visited, and the dashed focus ring. */
.web1 {
  color: #0000ee;
  text-decoration: underline;
  font-family: var(--font-sans);
  font-size: 1rem;
  cursor: pointer;
  outline: 1px dashed transparent;
  outline-offset: 4px;
}
.web1:visited { color: #551a8b; }
.web1:hover, .web1:focus-visible, .menu[open] > summary { outline-color: #3cff3c; }
:root[data-theme="dark"] .web1, :root[data-theme="dark"] .web1:visited { color: #8ab4ff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .web1, :root:not([data-theme="light"]) .web1:visited { color: #8ab4ff; }
}
.web1 sup { font-size: 0.65em; vertical-align: super; font-family: var(--font-mono); color: inherit; }

/* ---------- native <details> menu ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; display: inline-block; padding: 2px 6px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 10px);
  min-width: 160px;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 6px 6px 0 var(--accent);
  padding: 6px 0;
  z-index: 30;
}
.menu-list li { padding: 6px 14px; }
.menu-list li + li { border-top: 1px dotted var(--muted); }
.menu-list .web1 { display: block; outline-offset: 2px; }

.link {
  font: inherit; font-family: var(--font-mono); font-size: 13px;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--fg);
}
.link:hover { color: var(--accent); }

.block {
  padding: clamp(4rem, 10vw, 9rem) var(--gutter);
  border-bottom: 1px solid var(--line);
  max-width: var(--max);
}
/* #who is floats. The .clearfix lives in reset.css. */
.float-left { float: left; width: 100%; }
.float-right { float: right; width: 100%; margin: 0 0 2rem; }
@media (min-width: 900px) {
  .float-left { width: 62%; }
  .float-right { width: 30%; margin: 0.5rem 0 0 2rem; }
}
.plain { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.plain li { padding: 0.5rem 0; border-top: 1px solid color-mix(in srgb, var(--fg) 20%, transparent); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh; /* svh on purpose: no jump when the toolbar hides. See demo 03. */
  display: grid;
  align-content: center;
  padding: 5rem var(--gutter) 4rem;
  border-bottom: 1px solid var(--line);
  overflow: clip;
}
#scene {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: pan-y;
  opacity: var(--scene-opacity);
}
.hero-copy { position: relative; z-index: 1; max-width: var(--max); }
.hero-copy .label { margin-bottom: 1rem; }
kbd { font-family: var(--font-mono); font-size: 0.9em; border: 1px solid var(--muted); border-radius: 3px; padding: 0 0.3em; }
.hero-hint { position: absolute; right: var(--gutter); bottom: 1rem; z-index: 1; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.btn {
  font: inherit;
  font-size: 1rem;
  padding: 0.9em 1.6em;
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  cursor: pointer;
  border-radius: 9999px; /* the pill. */
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--fg); }
.btn.ghost:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ---------- miniterm ---------- */

.miniterm {
  /* a <dialog>, pinned bottom-left like a real terminal window */
  position: fixed;
  inset: auto auto var(--gutter) var(--gutter);
  margin: 0;
  padding: 0;
  width: min(720px, calc(100vw - 2 * var(--gutter)));
  max-height: min(70vh, 560px);
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg);
  background: var(--bg);
  box-shadow: 8px 8px 0 var(--accent); /* hard offset shadow: edgy. */
}
.miniterm:not([open]) { display: none; }
.miniterm::backdrop { background: rgba(0,0,0,0.15); backdrop-filter: blur(2px); }
.miniterm[open] { animation: term-in 0.18s cubic-bezier(.2,.8,.2,1); }
@keyframes term-in { from { transform: translateY(12px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .miniterm[open] { animation: none; } }
.miniterm-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 12px; border-bottom: 1px solid var(--line);
}
.miniterm-out {
  margin: 0; padding: 12px; min-height: 120px; flex: 1; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
}
.miniterm-out b { color: var(--accent); font-weight: 600; cursor: pointer; }
.miniterm-out b:hover { text-decoration: underline; }
.miniterm-out a { color: var(--fg); text-decoration: underline dotted; }
.miniterm-out a:hover { color: var(--accent); }
.miniterm-in { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); }
.miniterm-in input {
  flex: 1; font: inherit; background: none; border: 0; color: inherit; outline: none;
}
.prompt { color: var(--accent); }

/* ---------- reboot ----------
   `reboot` in the terminal: the body collapses like a CRT switching off,
   a boot log types out on <html> itself, then the body snaps back. */
html.booting { background: #000; overflow: hidden; }
html.booting body {
  transform-origin: 50% 50%;
  animation: crt-off 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}
html.booting.back body { animation: crt-on 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) forwards; }
@keyframes crt-off {
  0%   { transform: scale(1, 1);     filter: brightness(1); }
  55%  { transform: scale(1, 0.006); filter: brightness(4); }
  100% { transform: scale(0, 0.006); filter: brightness(0); }
}
@keyframes crt-on {
  0%   { transform: scale(0, 0.006); filter: brightness(0); }
  45%  { transform: scale(1, 0.006); filter: brightness(4); }
  100% { transform: scale(1, 1);     filter: brightness(1); }
}
@media (prefers-reduced-motion: reduce) {
  html.booting body { animation: none; opacity: 0; }
  html.booting.back body { opacity: 1; transition: opacity 0.2s; }
}
.crt {
  position: fixed; inset: 0; z-index: 100;
  margin: 0; padding: 2rem var(--gutter);
  background: #000; color: #9f9;
  font-family: var(--font-mono); font-size: 14px; line-height: 1.5;
  white-space: pre-wrap;
  text-shadow: 0 0 6px rgba(150,255,150,0.5);
  overflow: hidden;
}
/* scanlines, because of course */
.crt::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.25) 0 1px, transparent 1px 3px);
}
.crt::before { content: ""; display: block; height: 0; }

/* ---------- marquee ---------- */

/* A real <marquee>. Styled like it's not. */
.marquee {
  display: block;
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0;
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
}
@media (prefers-reduced-motion: reduce) {
  .marquee { white-space: normal; padding-inline: var(--gutter); }
}

/* Project tags. NEW! blinks because <blink> was removed in 2013 and CSS cannot be stopped. */
.tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  vertical-align: super; margin-left: 0.25em;
}
.tag.blink { color: var(--wrong); animation: blink 1s steps(1) infinite; }
.tag.hot { color: var(--accent); }
.tag.hot::before { content: "★ "; }
.tag.wip { color: var(--muted); animation: blink 2s steps(1) infinite; }
.tag.wip::before { content: "⚠ "; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .blink { animation: none; } }

/* ---------- projects ---------- */

.projects {
  list-style: none; padding: 0; margin: 0 0 2rem;
  counter-reset: p;
  border-top: 1px solid var(--line);
}
.projects li { counter-increment: p; border-bottom: 1px solid var(--line); }
.project {
  display: grid;
  grid-template-columns: 3rem 1fr;
  grid-template-areas: "n name" "n desc" "n meta";
  gap: 0.25rem 1rem;
  padding: 1.25rem 0;
  text-decoration: none;
  position: relative;
}
@media (min-width: 900px) {
  .project {
    grid-template-columns: 4rem 1.2fr 2fr 1fr;
    grid-template-areas: "n name desc meta";
    align-items: baseline;
  }
}
.project::before {
  content: "[" counter(p, decimal-leading-zero) "]";
  grid-area: n;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.p-name { grid-area: name; font-size: clamp(1.3rem, 2.4vw, 2rem); letter-spacing: -0.02em; font-weight: 500; }
.p-desc { grid-area: desc; max-width: 48ch; text-wrap: pretty; }
.p-meta { grid-area: meta; font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-transform: uppercase; }
a.project:hover { color: inherit; }
a.project:hover .p-name { color: var(--accent); }
a.project:hover .p-name::after { content: " ↗"; }
a.project:hover::before { color: var(--accent); }
span.project { opacity: 0.75; }

/* ---------- sandbox demos ---------- */

.demos {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 2rem 0;
}
@media (min-width: 900px) { .demos { grid-template-columns: 1fr 1fr; } }
.demo { background: var(--bg); padding: 1.25rem; display: grid; gap: 1rem; align-content: start; }
.demo-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.demo-stage {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 1rem;
  background:
    linear-gradient(color-mix(in srgb, var(--fg) 8%, transparent) 1px, transparent 1px) 0 0 / 100% 16px,
    linear-gradient(90deg, color-mix(in srgb, var(--fg) 8%, transparent) 1px, transparent 1px) 0 0 / 16px 100%;
  padding: 1.5rem;
}
.demo-note { margin: 0; font-size: 0.95rem; max-width: 52ch; color: var(--muted); text-wrap: pretty; }
.demo-note code { color: var(--fg); }

/* 01 */
.pill {
  font: inherit; font-size: 1.25rem; cursor: pointer;
  padding: 1.6em 3em;
  background: var(--accent); color: var(--accent-fg); border: 0;
  border-radius: 9999px;
  transition: border-radius 0.4s cubic-bezier(.2,.8,.2,1);
}
.pill.is-wrong { border-radius: 50%; }

/* 02 */
.nest-outer {
  --pad: 24px; --rad: 32px;
  width: min(100%, 260px); aspect-ratio: 1.4;
  padding: var(--pad);
  background: var(--fg);
  border-radius: var(--rad);
  transition: border-radius 0.2s;
}
.nest-inner {
  width: 100%; height: 100%;
  background: var(--accent);
  border-radius: var(--rad); /* wrong by default */
  transition: border-radius 0.2s;
}
.nest-outer.is-fixed .nest-inner { border-radius: max(0px, calc(var(--rad) - var(--pad))); }
.sliders { display: grid; gap: 0.5rem; width: 100%; font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; }
.sliders label { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 0.5rem; }
.sliders .check { grid-template-columns: auto 1fr; justify-content: start; }
.sliders input[type="range"] { width: 100%; accent-color: var(--accent); }
.sliders input[type="checkbox"] { accent-color: var(--accent); }

/* 03 */
.vh-stage { align-items: end; grid-template-columns: repeat(3, 1fr); }
.vh-bar {
  width: 100%;
  background: var(--fg); color: var(--bg);
  font-family: var(--font-mono); font-size: 12px;
  display: grid; place-items: end center; padding-bottom: 0.5rem;
  min-height: 2rem;
}
.vh-bar.vh  { height: calc(100vh / 6); }
.vh-bar.dvh { height: calc(100dvh / 6); background: var(--accent); color: var(--accent-fg); }
.vh-bar.svh { height: calc(100svh / 6); }

/* 04: the glass button. Eleven layers, two pointer variables, no images. */
.glass-stage { background-color: #000; background-image: none; }
.glass {
  --mx: 0; --my: 0;
  --g1: #f00; --g2: #ff0; --g3: #0f0; --g4: #0ff; --g5: #00f; --g6: #f0f;
  --rainbow: linear-gradient(180deg, var(--g1), var(--g2), var(--g3), var(--g4), var(--g5), var(--g6), var(--g1), var(--g2));
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 28px;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: #fff; text-decoration: none;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s, border-color 0.3s;
}
.glass:hover { border-color: transparent; transform: translateY(-2px); }
.glass:active { transform: translateY(2px) scale(0.96); }
.glass > span { pointer-events: none; }
.glass .g-glow, .glass .g-rim, .glass .g-highlight { opacity: 0; transition: opacity 0.3s; }
.glass:hover .g-glow, .glass:hover .g-rim, .glass:hover .g-highlight,
.glass:focus-visible .g-glow, .glass:focus-visible .g-rim, .glass:focus-visible .g-highlight { opacity: 1; }

@keyframes g-shift { 0% { background-position: 0% 0%; } 50% { background-position: 0% 100%; } 100% { background-position: 0% 0%; } }

.g-glow {
  position: absolute; inset: -6px; z-index: -1; border-radius: 9999px;
  background: var(--rainbow); background-size: 100% 300%;
  filter: blur(12px);
  transform: translate(calc(var(--mx) * -3px), calc(var(--my) * -3px));
  animation: g-shift 8s linear infinite;
}
.g-rim {
  position: absolute; inset: 0; border-radius: 9999px; padding: 1.5px;
  background: var(--rainbow); background-size: 100% 300%;
  animation: g-shift 8s linear infinite;
}
.g-body { display: block; position: relative; width: 100%; height: 100%; border-radius: 9999px; background: #000; overflow: hidden; }
.g-inner {
  position: absolute; inset: 0; border-radius: 9999px;
  background: var(--rainbow); background-size: 100% 300%;
  opacity: 0.2; mix-blend-mode: screen; filter: blur(4px);
  transform: translate(calc(var(--mx) * 2px), calc(var(--my) * 2px));
  animation: g-shift 8s linear infinite;
}
.g-sheen {
  position: absolute; inset: 0; opacity: 0.5; filter: blur(2px);
  background: linear-gradient(90deg, transparent 30%, rgba(0,255,255,0.3) 50%, transparent 70%);
  transform: scaleX(1.5) translateX(calc(var(--mx) * 15%));
}
.g-depth { position: absolute; inset: 0; z-index: 2; border-radius: 9999px; box-shadow: inset 0 0 10px 3px rgba(0,0,0,0.75); }
.g-specular {
  position: absolute; top: 50%; left: 50%; width: 100%; height: 60%; z-index: 10;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.3) 30%, transparent 60%);
  filter: blur(4px); mix-blend-mode: overlay;
  transform: translate(-50%, -50%) rotate(-10deg) translate(calc(var(--mx) * 10px), calc(var(--my) * 15px));
}
.g-secondary {
  position: absolute; bottom: 15%; left: 50%; width: 60%; height: 20%; z-index: 11;
  background: #fff; border-radius: 50%; filter: blur(15px); mix-blend-mode: screen;
  transform: translate(calc(-50% + var(--mx) * 20px), calc(var(--my) * 30px));
}
/* the ring highlight: a 4px band masked out of a slightly larger pill */
.g-highlight {
  position: absolute; inset: -2px; border-radius: 9999px; padding: 4px;
  -webkit-mask-image: linear-gradient(#fff 0 0), linear-gradient(#fff 0 0);
  -webkit-mask-clip: content-box, border-box;
  -webkit-mask-composite: xor;
  mask-image: linear-gradient(#fff 0 0), linear-gradient(#fff 0 0);
  mask-clip: content-box, border-box;
  mask-composite: exclude;
  overflow: hidden;
}
.g-highlight::before, .g-highlight::after {
  content: ""; position: absolute; transform: translate(-50%, -50%);
}
.g-highlight::before {
  top: calc(50% + var(--my) * 50%); left: calc(50% + var(--mx) * 50%);
  width: 50%; height: 80%; filter: blur(4px);
  background: radial-gradient(#fff 0%, rgba(255,255,255,0.6) 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
}
.g-highlight::after {
  top: calc(50% + var(--my) * 48%); left: calc(50% + var(--mx) * 48%);
  width: 20%; height: 30%; filter: blur(2px);
  background: radial-gradient(#fff 0%, rgba(255,255,255,0.8) 30%, transparent 70%);
}
.g-text { position: relative; z-index: 20; font-size: 1.1rem; letter-spacing: 0.02em; }
@media (prefers-reduced-motion: reduce) {
  .g-glow, .g-rim, .g-inner { animation: none; }
}

/* ---------- hover preview ---------- */
.peek {
  position: fixed; left: 0; top: 0; z-index: 40;
  width: min(360px, 40vw);
  margin: 0; padding: 0;
  border: 1px solid var(--line);
  background: var(--bg);
  box-shadow: 8px 8px 0 var(--accent);
  pointer-events: none;
  transform: translate(var(--px, 0px), var(--py, 0px)) rotate(-1.5deg);
  transition: opacity 0.15s;
}
.peek img { display: block; width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; }
.peek::after {
  content: attr(data-label);
  position: absolute; left: 0; bottom: 0;
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  background: var(--bg); color: var(--fg); padding: 2px 6px; border-top: 1px solid var(--line); border-right: 1px solid var(--line);
}
@media (hover: none) { .peek { display: none !important; } }

/* ---------- graveyard ---------- */
.stones {
  list-style: none; padding: 0; margin: 2.5rem 0 1.5rem;
  display: grid; gap: 1.5rem 1rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  align-items: end;
}
.stone {
  position: relative;
  display: grid; gap: 0.5rem; align-content: start;
  padding: 2rem 1rem 1rem;
  border: 1px solid var(--line);
  border-bottom-width: 4px;
  /* a headstone. the slash syntax, finally earning its keep. */
  border-radius: 50% 50% 4px 4px / 28% 28% 4px 4px;
  background: color-mix(in srgb, var(--fg) 4%, var(--bg));
  text-align: center;
  transition: transform 0.2s;
}
.stone:nth-child(3n) { transform: rotate(1deg); }
.stone:nth-child(5n) { transform: rotate(-1.2deg); }
.stone:hover { transform: rotate(0) translateY(-3px); }
.stone::before {
  content: "✝"; display: block;
  font-size: 1.1rem; color: var(--muted);
}
.s-name {
  font-family: var(--font-mono); font-size: 0.95rem; font-weight: 600;
  background: none; padding: 0; color: var(--fg); word-break: break-word;
}
.s-years { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.05em; }
.s-cause { font-size: 0.9rem; color: var(--muted); text-wrap: pretty; }
.s-cause code { font-size: 0.85em; }
.stone details { text-align: left; margin-top: 0.25rem; }
.stone summary {
  list-style: none; cursor: pointer; text-align: center;
  font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; color: var(--fg);
}
.stone summary::-webkit-details-marker { display: none; }
.stone summary:hover { color: var(--accent); }
.stone details[open] summary { color: var(--accent); }
.stone pre {
  margin: 0.75rem -1rem -1rem; padding: 0.75rem 1rem;
  border-top: 1px dashed var(--line);
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
  color: var(--fg);
  background: color-mix(in srgb, var(--fg) 6%, var(--bg));
  border-radius: 0 0 4px 4px;
}
/* the one that refuses to die */
.stone.undead { border-color: var(--accent); border-style: dashed; }
.stone.undead::before { content: "☠"; color: var(--accent); animation: blink 3s steps(1) infinite; }

/* ---------- toolkit ---------- */

.tech {
  list-style: none; padding: 0; margin: 2rem 0 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.tech li {
  padding: 1rem;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; gap: 0.75rem; align-items: baseline;
  font-size: 1.1rem;
}

/* ---------- contact ---------- */

.contact .mail {
  display: inline-block;
  text-decoration: none;
  font-size: clamp(1.6rem, 6vw, 6rem);
  word-break: break-all;
  margin: 0.5rem 0 2rem;
}
.contact .mail:hover { color: var(--accent); font-style: italic; }
.social { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 1.5rem; font-family: var(--font-mono); font-size: 14px; }
.social a { text-decoration: none; }
.social a:hover { text-decoration: underline; }

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

.foot { padding: 3rem var(--gutter) 4rem; }
.foot center { display: grid; gap: 1.5rem; justify-items: center; }
.foot .label { text-transform: none; }

/* The "under construction" banner. Animated stripes instead of a GIF. */
.construction {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
  color: #000; background: #ffd400; padding: 6px 16px;
  border: 4px solid;
  border-image: repeating-linear-gradient(-45deg, #ffd400 0 8px, #000 8px 16px) 4;
}
.construction::before, .construction::after { content: " ⚠ "; }

/* 88×31 badges. The sacred dimensions. */
.badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.badge {
  width: 88px; height: 31px;
  display: grid; align-content: center; justify-items: center; line-height: 1;
  font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.04em;
  color: #fff; background: #333; border: 1px solid #000;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.35), inset -1px -1px 0 rgba(0,0,0,0.6);
  image-rendering: pixelated;
  text-transform: uppercase;
  user-select: none;
}
.badge b { display: block; font-size: 11px; margin-top: 2px; }
.b-html { background: linear-gradient(#f16529, #e44d26); }
.b-css { background: linear-gradient(#2965f1, #264de4); }
.b-js { background: linear-gradient(#f7df1e, #e6c700); color: #000; }
.b-no { background: linear-gradient(#111, #000); color: #ff3b00; }
.b-valid { background: linear-gradient(#fff, #ddd); color: #000; }
.b-mac { background: linear-gradient(#e6e6e6, #bdbdbd); color: #000; }
.b-ns { background: linear-gradient(#00a, #006); }

.counter { font-size: 13px; }
.odometer {
  display: inline-block; font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.15em;
  background: #000; color: #0f0; padding: 2px 6px 2px 8px; border: 2px inset #888;
}

/* ---------- 1999 mode (Konami code) ---------- */
body.y2k {
  --bg: #c0c0c0; --fg: #000080; --accent: #ff00ff; --accent-fg: #fff; --line: #000080; --muted: #008080;
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", cursive;
  cursor: crosshair;
  background-image:
    radial-gradient(circle at 20% 30%, #fff 0 2px, transparent 3px),
    radial-gradient(circle at 70% 60%, #fff 0 2px, transparent 3px);
  background-size: 120px 120px;
}
body.y2k .display, body.y2k .big, body.y2k .h2, body.y2k .p-name { font-family: "Times New Roman", Times, serif; font-weight: 700; }
body.y2k .label, body.y2k .nav, body.y2k code, body.y2k .miniterm { font-family: "Courier New", Courier, monospace; }
body.y2k .btn, body.y2k .pill { border: 2px outset #ddd; border-radius: 0 !important; background: #c0c0c0; color: #000; font-family: inherit; box-shadow: none; }
body.y2k a { color: #0000ee; }
body.y2k a:visited { color: #551a8b; }
body.y2k #scene { filter: hue-rotate(90deg) saturate(3); }
body.y2k .top { background: #000080; color: #fff; }
body.y2k .top .wordmark, body.y2k .top .label, body.y2k .top .link { color: #fff; }
body.y2k .block { border-bottom: 3px ridge #808080; }

/* ---------- selection, because why not ---------- */
::selection { background: var(--accent); color: var(--accent-fg); }
