/* ============================================================
   BERK · PHOSPHOR EDITION
   amber CRT terminal with editorial typography
   ============================================================ */

/* ============================================================
   CROSS-DOCUMENT VIEW TRANSITIONS
   Nav, status bar, and footer stay put; only <main> fades.
   Degrades silently in unsupported browsers (Firefox).
   ============================================================ */
@view-transition {
  navigation: auto;
}

::view-transition-old(page-content),
::view-transition-new(page-content) {
  animation-duration: 0.18s;
  animation-timing-function: ease-out;
}

::view-transition-old(page-content) {
  animation-name: vt-fade-out;
}

::view-transition-new(page-content) {
  animation-name: vt-fade-in;
}

@keyframes vt-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes vt-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   SELF-HOSTED FONTS — no Google CDN, DSGVO-konform
   latin + latin-ext covers all German characters (ä ö ü ß)
   ============================================================ */

/* IBM Plex Mono — normal 300 */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-latin-ext-300.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-latin-300.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Mono — italic 300 */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-latin-ext-300-italic.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-latin-300-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Mono — normal 400 */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-latin-ext-400.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Mono — italic 400 */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-latin-ext-400-italic.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-latin-400-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Mono — normal 500 */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-latin-ext-500.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-latin-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Mono — italic 500 */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-latin-ext-500-italic.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-latin-500-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Mono — normal 600 */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-latin-ext-600.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-latin-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* VT323 — bitmap terminal display face (self-hosted, DSGVO-konform).
   The italic faces point at the same files, so any existing
   `font-style: italic` rule renders upright VT323 — never a fake slant. */
@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/vt323-latin-ext-400.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/vt323-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'VT323';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/vt323-latin-ext-400.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'VT323';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/vt323-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   THEME TOKENS — default = cathode (cold white-phosphor CRT)
   Override via [data-theme="..."] on <html>.
   ============================================================ */
:root {
  /* surface */
  --paper: #070809;
  --paper-elev: #0e1013;
  --paper-deep: #040506;

  /* ink */
  --ink: #b9c2c4;
  --ink-dim: #717a7e;
  --ink-faint: #3c4448;
  --ink-ghost: #21282b;

  /* primary accent — white phosphor */
  --accent: #e6f0f0;
  --accent-glow: #ffffff;
  --accent-deep: #93a4a6;
  --accent-rgb: 230 240 240;

  /* secondary accent — warm caution */
  --accent-2: #d98a4a;
  --accent-2-rgb: 217 138 74;

  /* status */
  --ok: #7fae8a;
  --info: #7aa6b8;

  /* structure */
  --rule: #181d20;
  --rule-bright: #2a3236;
  --rule-soft: #0e1214;

  /* atmospheric multipliers (0..1) — light themes dim these */
  --glow-strength: 1;
  --scanline-on: 1;
  --grain-on: 1;
  --vignette-on: 1;

  /* chromatic-aberration text-shadow for VT323 display text.
     Self-gates to nothing when --glow-strength is 0 (light themes). */
  --crt-text:
    -1.2px 0 0 rgb(255 84 92 / calc(0.5 * var(--glow-strength))),
    1.2px 0 0 rgb(86 206 240 / calc(0.45 * var(--glow-strength))),
    0 0 calc(12px * var(--glow-strength)) rgb(var(--accent-rgb) / calc(0.32 * var(--glow-strength)));

  /* fonts */
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-display: 'VT323', 'IBM Plex Mono', ui-monospace, monospace;

  /* layout */
  --max-width: 880px;
  --nav-height: 40px;
  --status-height: 28px;
}

/* ============================================================
   THEME OVERRIDES
   ============================================================ */

/* 04 · FOUNDATION PRESS — paperback editorial */
html[data-theme="foundation"] {
  --paper: #efe8d8; --paper-elev: #e6deca; --paper-deep: #d8cdb6;
  --ink: #14110d; --ink-dim: #5a5347; --ink-faint: #9c9484; --ink-ghost: #d2c8b3;
  --accent: #c43d1f; --accent-glow: #e25036; --accent-deep: #9a2f17;
  --accent-rgb: 196 61 31;
  --accent-2: #2a4ba0; --accent-2-rgb: 42 75 160;
  --ok: #3a6a30; --info: #2a4ba0;
  --rule: #d8cdb6; --rule-bright: #c4b89e; --rule-soft: #e2d8c3;
  --glow-strength: 0; --scanline-on: 0; --grain-on: 0.4; --vignette-on: 0;
}

/* 06 · SUMI & VERMILION — washi + ink + seal */
html[data-theme="sumi"] {
  --paper: #ebe2cf; --paper-elev: #e0d6bf; --paper-deep: #d2c8b3;
  --ink: #161413; --ink-dim: #5a574d; --ink-faint: #8e8979; --ink-ghost: #c0b69c;
  --accent: #b6371d; --accent-glow: #c84a30; --accent-deep: #8a2914;
  --accent-rgb: 182 55 29;
  --accent-2: #7a8b6c; --accent-2-rgb: 122 139 108;
  --ok: #4a6a4a; --info: #3a5a8a;
  --rule: #d2c8b3; --rule-bright: #b8ad95; --rule-soft: #ddd3bd;
  --glow-strength: 0; --scanline-on: 0; --grain-on: 0.5; --vignette-on: 0;
}

/* 08 · KINTSUGI — persimmon-stain + repair-gold */
html[data-theme="kintsugi"] {
  --paper: #18130d; --paper-elev: #221b14; --paper-deep: #100a06;
  --ink: #e8ddc4; --ink-dim: #a09478; --ink-faint: #5a4f3c; --ink-ghost: #2e2620;
  --accent: #d4972b; --accent-glow: #e8a83a; --accent-deep: #a87320;
  --accent-rgb: 212 151 43;
  --accent-2: #8a3c25; --accent-2-rgb: 138 60 37;
  --ok: #708060; --info: #a09478;
  --rule: #221b14; --rule-bright: #2e2620; --rule-soft: #1a150f;
  --glow-strength: 0.7; --scanline-on: 0.4; --grain-on: 1; --vignette-on: 0.8;
}

/* 09 · LINOTYPE HOT-METAL — lampblack + brass + ink-green */
html[data-theme="linotype"] {
  --paper: #161412; --paper-elev: #1f1c19; --paper-deep: #100e0c;
  --ink: #e8dccc; --ink-dim: #8a8170; --ink-faint: #4a4339; --ink-ghost: #2e2a26;
  --accent: #b8a672; --accent-glow: #c8b682; --accent-deep: #8a7c50;
  --accent-rgb: 184 166 114;
  --accent-2: #4a5d3e; --accent-2-rgb: 74 93 62;
  --ok: #4a5d3e; --info: #8a9aa8;
  --rule: #221f1c; --rule-bright: #2e2a26; --rule-soft: #1a1815;
  --glow-strength: 0.5; --scanline-on: 0.4; --grain-on: 1; --vignette-on: 0.8;
}

/* 11 · BRUTALIST MONO — true coal + lead-paint orange */
html[data-theme="brutalist"] {
  --paper: #0a0a0a; --paper-elev: #161616; --paper-deep: #050505;
  --ink: #f0f0ec; --ink-dim: #8a8a86; --ink-faint: #3a3a36; --ink-ghost: #232323;
  --accent: #d2401c; --accent-glow: #e8512a; --accent-deep: #a83014;
  --accent-rgb: 210 64 28;
  --accent-2: #c4a82e; --accent-2-rgb: 196 168 46;
  --ok: #7a8a4a; --info: #7a8a9c;
  --rule: #161616; --rule-bright: #232323; --rule-soft: #0e0e0e;
  --glow-strength: 0.4; --scanline-on: 0.2; --grain-on: 0.6; --vignette-on: 1;
}

/* 12 · OVERCAST — daylight light cousin of cathode */
html[data-theme="overcast"] {
  --paper: #e6e8e9; --paper-elev: #eef0f1; --paper-deep: #d8dbdd;
  --ink: #1b2125; --ink-dim: #5a646a; --ink-faint: #98a2a8; --ink-ghost: #ccd1d4;
  --accent: #2f6a86; --accent-glow: #3d80a0; --accent-deep: #234f64;
  --accent-rgb: 47 106 134;
  --accent-2: #b06a3a; --accent-2-rgb: 176 106 58;
  --ok: #4a7a52; --info: #3f6f8c;
  --rule: #d2d6d8; --rule-bright: #b9bfc3; --rule-soft: #dfe2e3;
  /* light/paper — no glow, no flicker; keeps a faint scanline as its one CRT tell */
  --glow-strength: 0; --scanline-on: 0.2; --grain-on: 0.4; --vignette-on: 0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

::selection {
  background: var(--accent);
  color: var(--paper);
  text-shadow: none;
}

html { scroll-behavior: smooth; }

/* smooth crossfade only while a theme swap is happening */
html.theme-changing,
html.theme-changing *,
html.theme-changing *::before,
html.theme-changing *::after {
  transition:
    background-color 0.32s ease,
    background-image 0.32s ease,
    color 0.32s ease,
    border-color 0.32s ease,
    fill 0.32s ease,
    stroke 0.32s ease,
    box-shadow 0.32s ease,
    text-shadow 0.32s ease,
    filter 0.32s ease,
    opacity 0.32s ease !important;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  font-feature-settings: "ss02", "ss03", "zero";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--nav-height);
  padding-bottom: calc(var(--status-height) + 16px);
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 70vw 50vh at 50% 0%, rgb(var(--accent-rgb) /0.045), transparent 60%),
    radial-gradient(ellipse 50vw 60vh at 100% 60%, rgb(var(--accent-2-rgb) /0.022), transparent 55%);
}

/* dot grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(242, 230, 207, 0.04) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 75% 75% at 50% 40%, black, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at 50% 40%, black, transparent 100%);
}

/* grain */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  opacity: calc(0.07 * var(--grain-on));
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.65'/></svg>");
  transition: opacity 0.4s ease;
}

/* scanlines */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    180deg,
    transparent 0px,
    transparent 2px,
    rgb(0 0 0 / 0.22) 3px
  );
  opacity: calc(0.45 * var(--scanline-on));
  transition: opacity 0.4s ease;
}

/* vignette */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9996;
  background: radial-gradient(ellipse 115% 115% at 50% 50%, transparent 52%, rgb(0 0 0 / calc(0.65 * var(--vignette-on))));
  transition: background 0.4s ease;
}

/* crt flicker — occasional brightness blips. opacity tracks
   --glow-strength, so light/paper themes show nothing. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9995;
  opacity: var(--glow-strength);
  animation: crt-flicker 7s steps(1, end) infinite;
}

@keyframes crt-flicker {
  0%, 49%, 52%, 74%, 76%, 100% { background: transparent; }
  50% { background: rgb(0 0 0 / 0.055); }
  51% { background: rgb(230 240 240 / 0.018); }
  75% { background: rgb(0 0 0 / 0.04); }
}

/* ============================================================
   NAV
   ============================================================ */
.top-nav {
  view-transition-name: top-nav;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  backdrop-filter: blur(8px) saturate(130%);
  -webkit-backdrop-filter: blur(8px) saturate(130%);
  border-bottom: 1px solid var(--rule);
  z-index: 1000;
  display: flex;
  justify-content: center;
}

.nav-container {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.nav-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  text-decoration: none;
  color: var(--ink-dim);
}


.brand-mark {
  color: var(--accent);
  text-shadow:
    0 0 6px  rgb(var(--accent-rgb) / calc(0.5 * var(--glow-strength))),
    0 0 18px rgb(var(--accent-rgb) / calc(0.2 * var(--glow-strength)));
}
.brand-text { color: var(--ink); letter-spacing: 0.02em; }
.brand-sep { color: var(--ink-faint); }

.brand-dim {
  color: var(--ink-faint);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0;
  line-height: 1;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links { display: flex; gap: 18px; }

.nav-links a {
  position: relative;
  font-size: 11px;
  color: var(--ink-dim);
  text-decoration: none;
  letter-spacing: 0.04em;
  line-height: var(--nav-height);
  transition: color 0.18s ease;
}

.nav-links a::before {
  content: "/";
  color: var(--ink-faint);
  margin-right: 3px;
  transition: color 0.18s ease;
}

.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::before { color: var(--accent-deep); }

.nav-links a.active { color: var(--ink); }
.nav-links a.active::before { color: var(--accent); }

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 0;
  bottom: 9px;
  height: 1px;
  background: linear-gradient(to right, var(--accent), transparent);
  box-shadow: 0 0 6px rgb(var(--accent-rgb) /0.5);
}

.nav-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px currentColor;
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.82); }
}

/* ============================================================
   THEME PICKER
   ============================================================ */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--rule-bright);
  background: transparent;
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  text-transform: lowercase;
  height: 24px;
  line-height: 1;
}

.theme-toggle:hover,
.theme-toggle[aria-expanded="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.05);
}

.theme-toggle-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 calc(6px * var(--glow-strength)) rgb(var(--accent-rgb) / calc(0.55 * var(--glow-strength)));
  flex-shrink: 0;
}

.theme-toggle-label {
  letter-spacing: 0.04em;
}

.theme-toggle-caret {
  font-size: 8px;
  color: var(--ink-faint);
  transition: transform 0.2s ease, color 0.15s ease;
}

.theme-toggle[aria-expanded="true"] .theme-toggle-caret {
  transform: rotate(180deg);
  color: var(--accent);
}

.theme-panel {
  position: fixed;
  top: 50px;
  right: 28px;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--paper-elev);
  border: 1px solid var(--rule-bright);
  z-index: 1100;
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.6), 0 2px 8px rgb(0 0 0 / 0.4);
  font-family: var(--font-mono);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  animation: panel-in 0.18s ease-out;
}

.theme-panel[hidden] { display: none; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.theme-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px 10px;
  border-bottom: 1px dashed var(--rule-bright);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.theme-panel-header strong {
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.22em;
}

.theme-panel-close {
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.15s ease;
  font-family: var(--font-mono);
}

.theme-panel-close:hover { color: var(--accent); }

.theme-group {
  padding: 6px 0 10px;
}

.theme-group + .theme-group {
  border-top: 1px dashed var(--rule);
}

.theme-group-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 8px 14px 4px;
}

.theme-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.theme-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 9px 14px 9px 16px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-mono);
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}

.theme-item::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0;
  box-shadow: 0 0 calc(6px * var(--glow-strength)) rgb(var(--accent-rgb) / calc(0.55 * var(--glow-strength)));
  transition: opacity 0.15s ease;
}

.theme-item:hover {
  background: rgb(var(--accent-rgb) / 0.05);
}

.theme-item.is-active {
  background: rgb(var(--accent-rgb) / 0.06);
}

.theme-item.is-active::before { opacity: 1; }

.theme-swatches {
  display: inline-flex;
  height: 14px;
  border: 1px solid rgb(0 0 0 / 0.2);
  flex-shrink: 0;
}

.theme-swatches > span {
  width: 10px;
  height: 100%;
  display: inline-block;
}

.theme-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.theme-name {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.theme-item:hover .theme-name,
.theme-item.is-active .theme-name {
  color: var(--accent);
}

.theme-desc {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 0;
  line-height: 1.2;
}

/* Per-theme description accent colors in the picker */
.theme-item[data-theme="cathode"]    .theme-desc { color: #c2d0d2; }
.theme-item[data-theme="kintsugi"]   .theme-desc { color: #d4972b; }
.theme-item[data-theme="linotype"]   .theme-desc { color: #b8a672; }
.theme-item[data-theme="brutalist"]  .theme-desc { color: #d2401c; }
.theme-item[data-theme="foundation"] .theme-desc { color: #c43d1f; }
.theme-item[data-theme="sumi"]       .theme-desc { color: #b6371d; }
.theme-item[data-theme="overcast"]   .theme-desc { color: #2f6a86; }

/* ============================================================
   MAIN
   ============================================================ */
.terminal-container {
  view-transition-name: page-content;
  width: 100%;
  max-width: var(--max-width);
  padding: 24px 28px 96px;
  flex-grow: 1;
  position: relative;
  z-index: 1;
}

.block {
  margin-bottom: 40px;
  position: relative;
}

/* page-load reveal — runs only on the FIRST arrival of a browser session,
   not on subsequent same-session navigations between pages.
   The `animate-load` class is set by the inline <head> script when no
   sessionStorage flag is present; the script then sets the flag so further
   page loads (within the same tab) skip the animation. */
html.animate-load .block {
  animation: rise 0.9s ease-out both;
}

html.animate-load .block:nth-child(1) { animation-delay: 0.04s; }
html.animate-load .block:nth-child(2) { animation-delay: 0.14s; }
html.animate-load .block:nth-child(3) { animation-delay: 0.24s; }
html.animate-load .block:nth-child(4) { animation-delay: 0.34s; }
html.animate-load .block:nth-child(5) { animation-delay: 0.44s; }
html.animate-load .block:nth-child(6) { animation-delay: 0.54s; }
html.animate-load .block:nth-child(7) { animation-delay: 0.64s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); filter: blur(3px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* command row */
.command {
  margin-bottom: 26px;
  font-size: 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink);
  flex-wrap: wrap;
}

.prompt {
  color: var(--accent);
  font-weight: 500;
  text-shadow: 0 0 8px rgb(var(--accent-rgb) /0.45);
}

.cmd-name { color: var(--ink); font-weight: 500; }
.cmd-arg { color: var(--accent-glow); font-style: italic; }
.cmd-flag { color: var(--info); }
.cmd-dim { color: var(--ink-faint); }
.pipe { color: var(--ink-faint); }
.subtle { color: var(--ink-faint); }

.inline-cmd {
  color: var(--accent);
  border: 1px solid var(--rule-bright);
  padding: 1px 7px;
  background: rgb(var(--accent-rgb) /0.06);
  font-size: 12px;
}

.cursor {
  display: inline-block;
  width: 9px;
  height: 16px;
  background: var(--accent);
  box-shadow: 0 0 10px rgb(var(--accent-rgb) /0.55);
  vertical-align: -3px;
  margin-left: 4px;
  animation: blink 1.05s step-end infinite;
}

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

/* ============================================================
   INIT / HERO BLOCK
   ============================================================ */
.init-block {
  border: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--paper-elev) 0%, var(--paper-deep) 120%);
  padding: 9px 20px 11px;
  position: relative;
  overflow: hidden;
}

.init-block::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 35% 45% at 0% 0%, rgb(var(--accent-rgb) /0.1), transparent 70%),
    radial-gradient(ellipse 35% 45% at 100% 100%, rgb(var(--accent-2-rgb) /0.06), transparent 70%);
  pointer-events: none;
}

/* corner ticks inside the init frame */
.init-block::after {
  content: "";
  position: absolute;
  top: 6px; left: 6px; right: 6px; bottom: 6px;
  background:
    linear-gradient(90deg, var(--accent) 0 12px, transparent 12px) top left / 12px 1px no-repeat,
    linear-gradient(180deg, var(--accent) 0 12px, transparent 12px) top left / 1px 12px no-repeat,
    linear-gradient(270deg, var(--accent) 0 12px, transparent 12px) top right / 12px 1px no-repeat,
    linear-gradient(180deg, var(--accent) 0 12px, transparent 12px) top right / 1px 12px no-repeat,
    linear-gradient(90deg, var(--accent) 0 12px, transparent 12px) bottom left / 12px 1px no-repeat,
    linear-gradient(0deg, var(--accent) 0 12px, transparent 12px) bottom left / 1px 12px no-repeat,
    linear-gradient(270deg, var(--accent) 0 12px, transparent 12px) bottom right / 12px 1px no-repeat,
    linear-gradient(0deg, var(--accent) 0 12px, transparent 12px) bottom right / 1px 12px no-repeat;
  opacity: 0.55;
  pointer-events: none;
}

.init-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--rule-bright);
  margin-bottom: 7px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
  gap: 12px;
}

.init-tag {
  color: var(--accent);
  background: rgb(var(--accent-rgb) /0.09);
  padding: 3px 9px;
  letter-spacing: 0.22em;
  border: 1px solid rgb(var(--accent-rgb) /0.22);
}

.init-meta { font-size: 10px; color: var(--ink-faint); }

.init-content { position: relative; z-index: 1; }

.init-content .line {
  padding: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-dim);
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.status-ok { color: var(--ok); font-weight: 500; letter-spacing: 0.02em; }
.status-info { color: var(--info); font-weight: 500; letter-spacing: 0.02em; }
.status-warn { color: var(--accent-2); font-weight: 500; letter-spacing: 0.02em; }

.highlight-amber {
  color: var(--accent);
  text-shadow: 0 0 6px rgb(var(--accent-rgb) /0.35);
}

/* ============================================================
   WHOIS
   ============================================================ */
.profile-layout {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 38px;
  align-items: flex-start;
  margin-bottom: 28px;
}

.id-card { position: relative; margin: 0; }

.id-frame {
  position: relative;
  padding: 12px;
  border: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--paper-elev), var(--paper-deep));
  transition: box-shadow 0.3s ease;
}

.id-frame::before,
.id-frame::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--rule-bright) 0 4px, transparent 4px 8px);
}

.id-frame::before { top: 6px; }
.id-frame::after { bottom: 6px; }

.id-frame:hover {
  box-shadow: 0 0 30px rgb(var(--accent-rgb) /0.15);
}

.id-art {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 calc(8px * var(--glow-strength)) rgb(var(--accent-rgb) / calc(0.2 * var(--glow-strength))));
  transition: filter 0.3s ease;
}

.id-frame:hover .id-art {
  filter: drop-shadow(0 0 calc(14px * var(--glow-strength)) rgb(var(--accent-rgb) / calc(0.35 * var(--glow-strength))));
}

/* brand-mark diamond — re-colors with theme */
.id-art .mk-ring { fill: none; stroke: var(--accent); stroke-width: 2.4; }
.id-art .mk-core { fill: var(--accent); }
.id-art .mk-corner path { stroke: var(--ink-dim); fill: none; }

.id-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 12px;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.id-line { color: var(--accent); }
.id-line-dim { color: var(--ink-faint); font-size: 9px; }

.profile-data {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
  margin: 0;
}

.data-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 6px 0;
}

.data-row .label {
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  margin: 0;
}

.data-row .dots {
  border-bottom: 1px dotted var(--ink-ghost);
  transform: translateY(-3px);
  min-width: 60px;
}

.data-row .value {
  color: var(--ink);
  text-align: right;
  font-size: 12.5px;
  margin: 0;
}

.val-bold {
  font-weight: 400;
  color: var(--accent) !important;
  font-family: var(--font-display);
  font-size: 26px;
  font-style: italic;
  letter-spacing: 0;
  line-height: 1;
  text-shadow: var(--crt-text);
}

.arrow-inline { color: var(--accent-deep); margin: 0 4px; }

.chip {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--rule-bright);
  background: rgb(var(--accent-rgb) /0.05);
  color: var(--accent-glow);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  margin-left: 4px;
}

.chip:first-child { margin-left: 0; }

/* tagline */
.tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink);
  padding: 22px 28px;
  border-top: 1px dashed var(--rule-bright);
  border-bottom: 1px dashed var(--rule-bright);
  margin-top: 22px;
  position: relative;
  letter-spacing: -0.005em;
  text-shadow: var(--crt-text);
}

.tagline::before {
  content: "tagline";
  position: absolute;
  top: -7px;
  left: 18px;
  text-shadow: none;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 9px;
  color: var(--ink-faint);
  background: var(--paper);
  padding: 0 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.tagline .quote-glyph {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 0;
  vertical-align: -8px;
  margin: 0 2px 0 -4px;
  opacity: 0.75;
}

.tagline .quote-glyph-close { margin: 0 -4px 0 2px; }

/* ============================================================
   ABOUT
   ============================================================ */
.text-content p {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.75;
}

.text-content p:last-child { margin-bottom: 0; }

.text-content em {
  color: var(--accent-glow);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  letter-spacing: -0.01em;
  line-height: 0.8;
}

.drop-cap {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 44px;
  color: var(--accent);
  line-height: 0.85;
  float: left;
  padding: 8px 10px 0 0;
  text-shadow: var(--crt-text);
}

/* ============================================================
   NOW
   ============================================================ */
.now-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--paper-elev), var(--paper-deep));
}

.now-item {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-right: 1px dashed var(--rule-bright);
  border-bottom: 1px dashed var(--rule-bright);
  transition: background 0.2s ease;
}

.now-item:hover { background: rgb(var(--accent-rgb) /0.03); }

.now-item:nth-child(2n) { border-right: none; }
.now-item:nth-last-child(-n+2) { border-bottom: none; }

.now-label {
  font-size: 9.5px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.now-value {
  font-size: 13px;
  color: var(--ink);
}

.now-value em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent-glow);
  font-size: 16px;
  letter-spacing: -0.005em;
}

.tabular {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

/* ============================================================
   LINKS
   ============================================================ */
.links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--paper-elev), var(--paper-deep));
}

.btn-link {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-right: 1px dashed var(--rule-bright);
  border-bottom: 1px dashed var(--rule-bright);
  color: var(--ink);
  text-decoration: none;
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease;
  font-size: 13px;
  position: relative;
  overflow: hidden;
}

.btn-link:nth-child(2n) { border-right: none; }
.btn-link:nth-last-child(-n+2) { border-bottom: none; }

.btn-link::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: translateX(-3px);
  transition: transform 0.25s ease;
  box-shadow: 0 0 8px rgb(var(--accent-rgb) /0.5);
}

.btn-link:hover {
  background: rgb(var(--accent-rgb) /0.05);
  color: var(--accent);
}

.btn-link:hover::before { transform: translateX(0); }

.btn-link:hover .btn-icon,
.btn-link:hover .btn-meta { color: var(--accent); }

.btn-link:hover .btn-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* Disabled state — link exists but no URL yet */
.btn-link--disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}
.btn-link--disabled::before { display: none; }
.btn-link--disabled .btn-meta { visibility: hidden; }

.btn-icon {
  color: var(--ink-dim);
  font-size: 13px;
  transition: color 0.2s ease;
}

.btn-label { color: inherit; letter-spacing: 0.02em; }

.btn-meta {
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: 0;
  text-align: right;
  font-style: italic;
  font-family: var(--font-display);
  font-size: 14px;
  transition: color 0.2s ease;
}

.btn-arrow {
  color: var(--ink-faint);
  font-size: 13px;
  transition: transform 0.2s ease, color 0.2s ease;
}

/* ============================================================
   UPDATES / PROJECTS  ·  unified list with status badges
   ============================================================ */
.ps-unified {
  border-top: 1px solid var(--rule-bright);
  border-bottom: 1px solid var(--rule-bright);
}

.ps-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 16px;
  padding: 13px 6px;
  border-bottom: 1px dashed var(--rule);
  align-items: baseline;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  transition: background 0.2s ease, padding 0.25s ease;
}
.ps-row:last-child { border-bottom: none; }
.ps-row:hover {
  background: rgb(var(--accent-rgb) /0.04);
  padding-left: 12px;
}
.ps-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.2s ease;
  box-shadow: 0 0 8px rgb(var(--accent-rgb) /0.5);
}
.ps-row--live:hover::before { transform: scaleY(1); }

.ps-status {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  padding: 3px 0;
  text-align: center;
  border: 1px solid currentColor;
}
.ps-row--live    .ps-status { color: var(--ok); }
.ps-row--build   .ps-status { color: var(--accent-2); }
.ps-row--shelved .ps-status { color: var(--ink-dim); border-color: var(--rule-bright); }

.ps-title-cell {
  font-size: 13.5px;
  min-width: 0;
}
.ps-title-cell .ps-name {
  color: var(--ink);
  transition: color 0.2s ease;
}
.ps-row--live    .ps-name { color: var(--accent-glow); }
.ps-row--shelved .ps-name { color: var(--ink-dim); }
.ps-row:hover    .ps-name { color: var(--accent-glow); }

.ps-title-cell .ps-ext {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  margin-left: 6px;
}
.ps-row--live:hover .ps-ext { color: var(--accent); }

.ps-title-cell .ps-desc {
  display: inline;
  color: var(--ink-dim);
  font-size: 12px;
  margin-left: 10px;
}

.ps-platform {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
}

.ps-trail-lab {
  margin-top: 22px;
  padding: 14px 6px 4px;
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  line-height: 1.75;
  border-top: 1px dashed var(--rule);
}
.ps-trail-lab .ps-trail-label {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-right: 14px;
}
.ps-trail-lab .ps-trail-aside {
  color: var(--ink-ghost);
  font-size: 10.5px;
  margin-left: 1px;
}

@media (max-width: 720px) {
  .ps-row { grid-template-columns: 80px 1fr auto; gap: 12px; }
}
@media (max-width: 480px) {
  .ps-row { grid-template-columns: 72px 1fr; }
  .ps-row .ps-platform { display: none; }
}

/* ============================================================
   LIVE-ROW HOVER PREVIEW  ·  shell + bezel + soft settle
   Wraps .ps-row--live; on desktop hover the shell expands a tray
   holding a small terminal-window bezel with the site URL and a
   thumbnail. Touch devices keep the row as a plain link.
   ============================================================ */
.ps-live-shell {
  display: grid;
  grid-template-rows: auto 0fr;
  transition: grid-template-rows 0.48s cubic-bezier(0.25, 1, 0.5, 1);
  border-bottom: 1px dashed var(--rule);
}
.ps-live-shell .ps-row { border-bottom: none; }
.ps-unified > .ps-live-shell:last-child { border-bottom: none; }

.ps-tray {
  min-height: 0;
  overflow: hidden;
}
.ps-tray-inner { padding: 8px 6px 16px; }

.ps-shot {
  position: relative;
  width: 100%;
  max-width: 420px;
}

.ps-bezel {
  position: relative;
  width: 100%;
  border: 1px solid var(--rule-bright);
  background: var(--paper-deep);
  box-shadow:
    0 0 0 1px rgb(var(--accent-rgb) / 0.04),
    0 14px 40px -16px rgb(0 0 0 / 0.55);
  opacity: 0;
  transform: perspective(1100px) rotateX(-9deg) translateY(-10px) scale(0.985);
  transform-origin: 50% 0%;
  transition:
    opacity 0.48s cubic-bezier(0.25, 1, 0.5, 1),
    transform 0.52s cubic-bezier(0.25, 1, 0.5, 1);
}

.ps-bezel-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--rule-bright);
  background: color-mix(in srgb, var(--paper-elev) 80%, transparent);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}
.ps-bezel-dots { display: inline-flex; gap: 5px; }
.ps-bezel-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
  opacity: 0.7;
}
.ps-bezel-dots span:nth-child(1) { background: var(--accent); opacity: 0.85; }
.ps-bezel-dots span:nth-child(2) { background: var(--accent-2); opacity: 0.65; }
.ps-bezel-url {
  flex: 1;
  text-align: center;
  color: var(--ink);
  font-feature-settings: "tnum";
}
.ps-bezel-url .scheme { color: var(--ink-faint); }
.ps-bezel-meta {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.ps-bezel-body {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.ps-bezel-body svg,
.ps-bezel-body img {
  display: block;
  width: 100%;
  height: 100%;
}

.ps-tray-meta {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.22s ease 0.20s, transform 0.22s ease 0.20s;
}
.ps-tray-meta .meta-url { color: var(--accent); font-family: var(--font-mono); }
.ps-tray-meta .meta-sep { color: var(--ink-ghost); }

/* Small screens have no hover, so the same tray open/close the desktop plays
   on hover is driven by scroll instead: IntersectionObserver (main.js) toggles
   .is-revealed as each live row moves in and out of the central reading zone,
   expanding and collapsing the bezel both ways. Reuses the desktop grid + tilt
   so the motion signature matches. Scoped to mobile, so desktop is untouched. */
@media (max-width: 560px) {
  /* No-JS fallback: leave previews open + static so they're never hidden. */
  .ps-live-shell { grid-template-rows: auto 1fr; }
  .ps-bezel      { opacity: 1; transform: none; }
  .ps-tray-meta  { opacity: 1; transform: none; }

  /* JS on (.js set pre-paint): collapse each live row by default... */
  .js .ps-live-shell { grid-template-rows: auto 0fr; }
  .js .ps-live-shell .ps-bezel {
    opacity: 0;
    transform: perspective(1100px) rotateX(-9deg) translateY(-10px) scale(0.985);
  }
  .js .ps-live-shell .ps-tray-meta { opacity: 0; transform: translateY(-2px); }

  /* ...then expand it while it's in view (collapses again when .is-revealed
     is removed — symmetric with the desktop hover-out). */
  .js .ps-live-shell.is-revealed { grid-template-rows: auto 1fr; }
  .js .ps-live-shell.is-revealed > .ps-row { background: rgb(var(--accent-rgb) / 0.04); }
  .js .ps-live-shell.is-revealed > .ps-row::before { transform: scaleY(1); }
  .js .ps-live-shell.is-revealed .ps-bezel {
    opacity: 1;
    transform: perspective(1100px) rotateX(0) translateY(0) scale(1);
    transition-delay: 0.04s;
  }
  .js .ps-live-shell.is-revealed .ps-tray-meta {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (hover: hover) and (pointer: fine) {
  .ps-live-shell:hover {
    grid-template-rows: auto 1fr;
  }
  /* keep the row's own hover styling lit while the cursor is inside the tray */
  .ps-live-shell:hover > .ps-row {
    background: rgb(var(--accent-rgb) / 0.04);
    padding-left: 12px;
  }
  .ps-live-shell:hover > .ps-row::before { transform: scaleY(1); }
  .ps-live-shell:hover > .ps-row .ps-name { color: var(--accent-glow); }
  .ps-live-shell:hover > .ps-row .ps-ext  { color: var(--accent); }
  .ps-live-shell:hover .ps-bezel {
    opacity: 1;
    transform: perspective(1100px) rotateX(0) translateY(0) scale(1);
    transition-delay: 0.05s;
  }
  .ps-live-shell:hover .ps-tray-meta {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ps-live-shell,
  .ps-bezel,
  .ps-tray-meta {
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   PAGE INTRO  (used on /projects, /writing, /contact subpages)
   ============================================================ */
.page-intro {
  margin-bottom: 40px;
}

/* without the serif H1, the lead sits directly under the command */
.page-intro .page-lead {
  margin-top: 4px;
}

.page-h1 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(40px, 7vw, 64px);
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
  font-weight: 400;
  margin: 12px 0 18px;
  text-shadow: var(--crt-text);
}

.page-h1-dot {
  color: var(--accent-2);
  margin-left: -2px;
  display: inline-block;
}

.page-lead {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  color: var(--ink);
  line-height: 1.5;
  letter-spacing: -0.005em;
  margin: 0;
}

.page-lead em {
  color: var(--accent-glow);
  font-style: italic;
  font-family: var(--font-display);
}

@media (max-width: 720px) {
  .page-h1 { font-size: clamp(32px, 9vw, 44px); }
  .page-lead { font-size: 16px; }
}

/* ============================================================
   EDITOR  (readonly macOS-style window — used on /writing)
   ============================================================ */
.editor-block {
  /* hook only; inherits .block spacing + animation */
}

.editor-window {
  --editor-shadow-strength: var(--vignette-on);
  border: 1px solid var(--rule-bright);
  background: linear-gradient(180deg, var(--paper-elev) 0%, var(--paper-deep) 130%);
  box-shadow:
    inset 0 1px 0 rgb(var(--accent-rgb) / calc(0.06 * var(--glow-strength))),
    0 18px 50px -12px rgb(0 0 0 / calc(0.55 * var(--editor-shadow-strength) + 0.10)),
    0 4px 12px -4px rgb(0 0 0 / calc(0.35 * var(--editor-shadow-strength) + 0.06));
  overflow: hidden;
  position: relative;
}

/* —— TITLEBAR —————————————————————————————————————————————— */
.editor-titlebar {
  height: 30px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--paper-elev) 65%, var(--paper) 35%) 0%,
    var(--paper-elev) 100%);
  font-family: var(--font-mono);
}

.editor-traffic {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-self: start;
}

.tl {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.18),
    0 0 0 0.5px rgb(0 0 0 / 0.35);
}

.tl-close { background: var(--accent-2); }
.tl-min   { background: var(--accent); }
.tl-max   { background: var(--ok); }

/* linotype: --ok and --accent-2 collide; nudge max toward brass */
html[data-theme="linotype"] .tl-max {
  background: color-mix(in srgb, var(--ok) 70%, var(--accent) 30%);
}

.editor-filename {
  justify-self: center;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.editor-filename-name { color: var(--ink); }
.editor-filename-ext  { color: var(--ink-faint); }

.editor-modified {
  font-size: 8px;
  line-height: 1;
  color: var(--accent);
  transform: translateY(-1px);
  text-shadow: 0 0 calc(6px * var(--glow-strength)) rgb(var(--accent-rgb) / calc(0.55 * var(--glow-strength)));
  animation: pulse 2.4s ease-in-out infinite;
}

.editor-titlebar-spacer {
  width: 56px;
  justify-self: end;
}

/* —— BODY ——————————————————————————————————————————————— */
.editor-body {
  padding: 38px 56px 44px;
  min-height: 240px;
  font-family: var(--font-display);
  color: var(--ink);
  position: relative;
}

.editor-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 22px;
}

.editor-list {
  list-style: none;
  padding: 0;
  margin: 0 0 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.editor-list li {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 19px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--ink);
  padding: 0;
}

.editor-coda {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  line-height: 1.45;
  color: var(--ink-dim);
  margin: 0;
}

.editor-caret {
  display: inline-block;
  width: 8px;
  height: 18px;
  background: var(--accent);
  box-shadow: 0 0 calc(10px * var(--glow-strength)) rgb(var(--accent-rgb) / calc(0.55 * var(--glow-strength)));
  vertical-align: -3px;
  margin-left: 4px;
  animation: blink 1.05s step-end infinite;
}

/* —— STATUSBAR —————————————————————————————————————————— */
.editor-statusbar {
  border-top: 1px solid var(--rule);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: linear-gradient(180deg,
    var(--paper-elev) 0%,
    color-mix(in srgb, var(--paper-deep) 80%, var(--paper) 20%) 100%);
}

.editor-status-seg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.editor-status-sep    { color: var(--ink-ghost); }
.editor-status-spacer { flex: 1; }
.editor-status-mode   { color: var(--ink-dim); }

.editor-status-words {
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.editor-status-saved {
  color: var(--ok);
  letter-spacing: 0.18em;
}

.editor-status-dot {
  width: 5px;
  height: 5px;
  background: var(--ok);
  border-radius: 50%;
  box-shadow: 0 0 calc(5px * var(--glow-strength)) currentColor;
  display: inline-block;
}

/* —— FOOTNOTE (outside the window) —————————————————————— */
.editor-footnote {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-dim);
}

/* —— RESPONSIVE ————————————————————————————————————————— */
@media (max-width: 720px) {
  .editor-titlebar         { height: 28px; padding: 0 10px; }
  .tl                      { width: 11px; height: 11px; }
  .editor-traffic          { gap: 6px; }
  .editor-filename         { font-size: 10px; }
  .editor-titlebar-spacer  { width: 44px; }
  .editor-body             { padding: 26px 22px 30px; min-height: 200px; }
  .editor-list li,
  .editor-coda             { font-size: 17px; }
  .editor-statusbar        { padding: 5px 12px; font-size: 9px; letter-spacing: 0.1em; gap: 8px; }
  .editor-status-mode,
  .editor-status-words,
  .editor-status-sep       { display: none; }
}

@media (max-width: 480px) {
  .editor-body             { padding: 22px 18px 26px; }
  .editor-list li,
  .editor-coda             { font-size: 16px; }
}

/* Inline command-link — looks like a $-prefixed terminal command, but is a real link */
.cmd-link {
  font-family: var(--font-mono);
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
  transition: color 0.15s ease, border-color 0.15s ease;
  letter-spacing: 0;
}

.cmd-link::before {
  content: "$ ";
  color: var(--ink-faint);
  font-weight: 500;
}

.cmd-link:hover {
  color: var(--accent-glow);
}

.cmd-link:hover::before { color: var(--accent); }

/* ============================================================
   CONTACT META  (used on /contact)
   ============================================================ */
.contact-meta {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px dashed var(--rule);
}

.contact-meta-line {
  font-size: 12.5px;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
  max-width: 64ch;
  margin: 0;
  line-height: 1.7;
}

.contact-meta-line em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent-glow);
  font-size: 14.5px;
  letter-spacing: -0.005em;
}

/* ============================================================
   STATUS BAR (tmux)
   ============================================================ */
.status-bar {
  view-transition-name: status-bar;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--status-height);
  background: color-mix(in srgb, var(--paper-elev) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--rule-bright);
  z-index: 1000;
  display: flex;
  justify-content: center;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.status-container {
  width: 100%;
  max-width: 1280px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.status-group {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--ink-dim);
}

.status-right { justify-content: flex-end; }

.status-seg { display: inline-flex; gap: 6px; align-items: center; }

.status-key {
  color: var(--ink-faint);
  text-transform: uppercase;
}

.status-host { color: var(--accent); letter-spacing: 0.1em; }

.bracket { color: var(--ink-faint); }

.status-time {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 6px rgb(var(--accent-rgb) /0.4);
  letter-spacing: 0.04em;
}

.spark {
  font-family: var(--font-mono);
  color: var(--accent-deep);
  font-size: 13px;
  letter-spacing: -0.1em;
  line-height: 1;
  white-space: nowrap;
  opacity: 0.75;
  transition: color 0.8s ease;
}

/* ============================================================
   INTERACTIVE TERMINAL
   ============================================================ */
.terminal-block {
  cursor: text;
  min-height: 60px;
}

.terminal-output {
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 12px;
  color: var(--ink);
}

.terminal-output:empty {
  margin-bottom: 0;
}

.t-line {
  margin: 0;
  padding: 1px 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
}

.t-line-cmd {
  color: var(--ink);
  margin-top: 8px;
}

.t-line-cmd:first-child {
  margin-top: 0;
}

.t-line-cmd .prompt {
  color: var(--accent);
  font-weight: 500;
  margin-right: 6px;
  text-shadow: 0 0 calc(8px * var(--glow-strength)) rgb(var(--accent-rgb) / calc(0.45 * var(--glow-strength)));
}

.t-line-out { color: var(--ink); }
.t-line-info { color: var(--ink-dim); }
.t-line-err { color: var(--accent-2); }
.t-line-ok { color: var(--ok); }

.terminal-input-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  margin: 0;
  padding: 0;
}

.terminal-input-line .prompt {
  flex-shrink: 0;
  color: var(--accent);
  font-weight: 500;
  text-shadow: 0 0 calc(8px * var(--glow-strength)) rgb(var(--accent-rgb) / calc(0.45 * var(--glow-strength)));
}

#terminal-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  caret-color: var(--accent);
  padding: 0;
  margin: 0;
  letter-spacing: 0;
}

#terminal-input::selection {
  background: var(--accent);
  color: var(--paper);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  view-transition-name: site-footer;
  width: 100%;
  text-align: center;
  padding: 48px 24px 56px;
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  border-top: 1px solid var(--rule);
  position: relative;
  z-index: 1;
}

footer em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-dim);
  font-size: 12.5px;
  letter-spacing: 0;
}

footer p { color: var(--ink-faint); }

/* Footer — legal second line */
.footer-legal {
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-ghost);
}

.footer-legal a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-legal a:hover {
  color: var(--ink-dim);
}

/* ============================================================
   LEGAL PAGES  (impressum + datenschutz)
   ============================================================ */
.legal-section {
  margin-bottom: 36px;
}

.legal-section + .legal-section {
  padding-top: 28px;
  border-top: 1px solid var(--rule-soft);
}

.legal-h2 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.legal-h2::before {
  content: '//';
  color: var(--accent);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0;
  text-shadow: 0 0 8px rgb(var(--accent-rgb) / 0.4);
}

.legal-p {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  line-height: 1.8;
  max-width: 70ch;
  margin: 0 0 10px;
}

.legal-p:last-child {
  margin-bottom: 0;
}

.legal-link {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

.legal-link:hover {
  text-decoration: underline;
}

/* Placeholder — fill these in before going live */
.ph {
  color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.1);
  border-radius: 2px;
  padding: 0 3px;
}

/* Side-noted warning within legal copy */
.legal-note {
  color: var(--ink-dim);
  font-size: 11px;
  border-left: 2px solid rgb(var(--accent-rgb) / 0.35);
  padding-left: 12px;
  margin-top: 8px;
}

.legal-p code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-glow);
  background: rgb(var(--accent-rgb) / 0.08);
  border-radius: 2px;
  padding: 0 3px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  /* whois block becomes a 2-col grid so the tagline can sit beside the avatar */
  .whois-block {
    display: grid;
    grid-template-columns: 150px 1fr;
    column-gap: 20px;
    row-gap: 20px;
  }
  .whois-block > .command { grid-column: 1 / -1; margin-bottom: 0; }
  .profile-layout { display: contents; }
  .id-card        { grid-column: 1; grid-row: 2; max-width: 150px; }
  .id-meta        { display: none; }
  .tagline        { grid-column: 2; grid-row: 2; align-self: center; margin-top: 0; }
  .profile-data   { grid-column: 1 / -1; grid-row: 3; gap: 0; padding-top: 0; }
  .data-row       { padding: 2px 0; }

  .now-grid { grid-template-columns: 1fr; }
  .now-item { border-right: none; }
  .now-item:nth-child(-n+3) { border-bottom: 1px dashed var(--rule-bright); }
  .now-item:last-child { border-bottom: none; }

  .links-grid { grid-template-columns: 1fr; }
  .btn-link { border-right: none; border-bottom: 1px dashed var(--rule-bright); }
  .btn-link:last-child { border-bottom: none; }

  .nav-right { gap: 14px; }
  .nav-links { gap: 14px; }
  .nav-indicator { display: none; }
  .brand-dim { display: none; }

  .status-container { grid-template-columns: 1fr auto; gap: 14px; }
  .status-center { display: none; }
  .status-mode { display: none; }

  .tagline { font-size: 15px; padding: 14px 14px; line-height: 1.35; }
  .tagline::before { left: 12px; }
  .tagline .quote-glyph { font-size: 26px; vertical-align: -4px; }

  .val-bold { font-size: 18px; }
}

/* mobile: drop the brand, keep links + toggle on a single top row */
@media (max-width: 600px) {
  .nav-container {
    padding: 0 14px;
    gap: 12px;
  }

  .nav-brand { display: none; }

  .nav-right { gap: 10px; }
  .nav-links { gap: 10px; justify-content: flex-start; }

  .theme-panel { right: 14px; }
}

@media (max-width: 420px) {
  .nav-container { padding: 0 12px; gap: 10px; }
  .nav-right { gap: 10px; }
  .nav-links { gap: 12px; }
  .nav-links a::before { display: none; }
  .nav-links a.active::after { left: 0; }
  .theme-panel { right: 12px; }
}

@media (max-width: 340px) {
  .nav-container { padding: 0 10px; gap: 8px; }
  .nav-right { gap: 8px; }
  .nav-links { gap: 10px; }
  .theme-toggle { padding: 4px 6px; gap: 6px; }
  .theme-panel { right: 10px; }
}

@media (max-width: 480px) {
  .terminal-container { padding: 16px 18px 64px; }
  .block { margin-bottom: 32px; }
  .data-row { grid-template-columns: 58px 1fr auto; gap: 10px; }
  .init-block { padding: 9px 16px 11px; }
  .drop-cap { font-size: 36px; }
  .status-container .status-seg:nth-of-type(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
