/* ~*~ retro web stylesheet ~*~
   html[data-theme] = wired (default, dark CRT, pale blue and red), or the other apps' looks: 98, aero, vapor,
   midnight, classic (the original starfield). The picker lives in theme.js. */

/* ======================================================================
   Shared variables. Each theme overrides these.
   ====================================================================== */
:root {
  --dk: #0a0a0a;          /* bevel: darkest edge */
  --sh: #808080;          /* bevel: shadow */
  --lt: #dfdfdf;          /* bevel: light */
  --hi: #ffffff;          /* bevel: highlight */
  --face: #c0c0c0;        /* window body */
  --well: #ffffff;        /* sunken areas (tables, counters) */
  --pressed: #d4d4d4;
  --t1: #000080;          /* title bar gradient */
  --t2: #1084d0;
  --title-text: #ffffff;
  --text: #000000;
  --muted: #444444;
  --link: #0000ee;
  --visited: #551a8b;
  --h2: #000080;
  --h3: #800080;
  --ok: #008000;
  --bad: #c00000;
  --led-ok: #22dd44;
  --led-bad: #ff3030;
  --row-alt: rgba(0, 0, 0, 0.05);
  --line: #808080;
  --ticker-bg: #000000;
  --ticker-fg: #00ff00;
  --radius: 0;
  --body-font: Tahoma, Verdana, "Segoe UI", sans-serif;
  --display-font: "Courier New", Courier, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: #008080; }

body {
  margin: 0;
  padding: 16px;
  color: var(--text);
  font: 15px/1.5 var(--body-font);
  background: transparent;
  min-height: 100vh;
}

a { color: var(--link); }
a:visited { color: var(--visited); }
a:hover { text-decoration-style: wavy; }

h1, h2, h3, .pixel { font-family: var(--display-font); font-weight: bold; }
h1 { font-size: 2.6rem; margin: 0; line-height: 1.05; letter-spacing: 2px; }
h2 { font-size: 1.35rem; margin: 0 0 8px; color: var(--h2); }
h3 { font-size: 1.1rem; margin: 14px 0 2px; color: var(--h3); }

/* ---------- layout ---------- */
.wrap { max-width: 920px; margin: 0 auto; }

.grid {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

@media (max-width: 680px) {
  body { padding: 10px 16px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 2rem; }
}

/* ---------- banner ---------- */
.header {
  text-align: center;
  padding: 20px 12px 16px;
  margin-bottom: 12px;
  background-color: #000;
  background-image:
    radial-gradient(#fff 1px, transparent 1px),
    radial-gradient(#ff0 1px, transparent 1px);
  background-size: 23px 23px, 41px 41px;
  background-position: 3px 5px, 11px 17px;
  border: 2px solid;
  border-color: var(--sh) var(--hi) var(--hi) var(--sh);
  border-radius: var(--radius);
}
.header h1 { color: #ff66cc; text-shadow: 2px 2px #6600cc, 4px 4px #00ccff; }
.tagline { color: #7fffd4; font-style: italic; margin-top: 6px; }

/* ---------- windows ---------- */
.box {
  background: var(--face);
  border: 2px solid;
  border-color: var(--hi) var(--dk) var(--dk) var(--hi);
  box-shadow: inset 1px 1px var(--lt), inset -1px -1px var(--sh);
  border-radius: var(--radius);
  padding: 3px 3px 12px;
  margin-bottom: 12px;
}
.box > :not(.box-title) { margin-left: 11px; margin-right: 11px; }
.box > .box-title + * { margin-top: 10px; }

.box-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  height: 22px;
  padding: 0 3px 0 6px;
  background: linear-gradient(90deg, var(--t1), var(--t2));
  color: var(--title-text);
  font: bold 13px Tahoma, Verdana, sans-serif;
  border-radius: max(0px, calc(var(--radius) - 3px)) max(0px, calc(var(--radius) - 3px)) 0 0;
}
.box-title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the minimise / maximise / close buttons */
.box-title .controls { display: flex; gap: 2px; flex: none; }
.box-title .controls i {
  width: 16px;
  height: 14px;
  display: grid;
  place-items: center;
  font: normal bold 10px/1 Tahoma, sans-serif;
  color: #000;
  background: #c0c0c0;
  border: 1px solid;
  border-color: #fff #0a0a0a #0a0a0a #fff;
  letter-spacing: 0;
  text-transform: none;
  text-shadow: none;
}
.box-title .controls i:last-child { margin-left: 2px; }

.box.inset > :not(.box-title) {
  background: var(--well);
  border: 2px solid;
  border-color: var(--sh) var(--hi) var(--hi) var(--sh);
  padding: 6px 8px;
}

/* ---------- sidebar nav ---------- */
.nav a {
  display: block;
  margin: 6px 11px;
  padding: 3px 8px;
  background: var(--face);
  border: 2px solid;
  border-color: var(--hi) var(--dk) var(--dk) var(--hi);
  box-shadow: inset 1px 1px var(--lt), inset -1px -1px var(--sh);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
.nav a:hover { background: var(--pressed); }
.nav a:active,
.nav a[aria-current="page"] {
  border-color: var(--dk) var(--hi) var(--hi) var(--dk);
  box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--lt);
  background: var(--pressed);
  font-weight: bold;
}

/* ---------- theme picker ---------- */
.theme-pick { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.theme-pick select {
  font: inherit;
  color: var(--text);
  background: var(--well);
  border: 2px solid;
  border-color: var(--sh) var(--hi) var(--hi) var(--sh);
  border-radius: var(--radius);
  padding: 2px 4px;
  width: 100%;
}

/* ---------- bits & bobs ---------- */
marquee, .ticker {
  display: block;
  background: var(--ticker-bg);
  color: var(--ticker-fg);
  border-top: 2px ridge #888;
  border-bottom: 2px ridge #888;
  font: bold 15px var(--display-font);
  padding: 3px 0;
  margin-bottom: 12px;
  border-radius: var(--radius);
}

.blink { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

.construction {
  height: 16px;
  margin: 10px 11px;
  background: repeating-linear-gradient(-45deg, #ffcc00 0 14px, #111 14px 28px);
  border: 2px solid #111;
}
.construction-label { text-align: center; font: bold 15px var(--display-font); color: var(--h3); }

hr.sparkle {
  border: 0;
  height: 14px;
  margin: 14px 11px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14'%3E%3Cpath d='M7 1l1.5 4.5L13 7l-4.5 1.5L7 13l-1.5-4.5L1 7l4.5-1.5z' fill='%23ff66cc'/%3E%3C/svg%3E") repeat-x center;
}

/* 88x31 buttons keep their own loud colours in every theme */
.buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.btn88 {
  width: 88px;
  height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font: bold 13px/1 var(--display-font);
  text-decoration: none;
  border: 2px outset #ccc;
  color: #fff !important;
  overflow: hidden;
}
.btn88:hover { border-style: inset; }
.b1 { background: linear-gradient(#ff66cc, #990066); }
.b2 { background: linear-gradient(#33cc33, #005500); }
.b3 { background: linear-gradient(#3399ff, #002266); }
.b4 { background: #000; color: #33ff66 !important; }
.b5 { background: linear-gradient(#ffcc00, #cc5500); color: #000 !important; }
.b6 { background: repeating-linear-gradient(90deg, #444 0 2px, #222 2px 4px); }

.projects { list-style: none; padding: 0; }
.projects li { padding: 6px 0; border-bottom: 1px dotted var(--line); }
.projects li:last-child { border-bottom: 0; }
.projects b { color: var(--h3); }

.updates { list-style: none; padding: 0; }
.updates li { padding: 4px 0; border-bottom: 1px dotted var(--line); }
.updates li:last-child { border-bottom: 0; }
.updates .date { color: var(--h2); font: bold 14px var(--display-font); margin-right: 6px; }

.counter {
  display: inline-block;
  background: #000;
  color: #ff3333;
  font: bold 16px "Courier New", monospace;
  letter-spacing: 3px;
  padding: 1px 6px;
  border: 2px solid;
  border-color: var(--sh) var(--hi) var(--hi) var(--sh);
}

.footer {
  text-align: center;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
  font-size: 13px;
  padding: 12px;
}
.footer a { color: inherit; }

.small { font-size: 13px; color: var(--muted); }

/* ---------- status page ---------- */
.status-table {
  width: calc(100% - 22px);
  border-collapse: collapse;
  font-size: 14px;
  background: var(--well);
}
.status-table th, .status-table td {
  border: 1px solid var(--line);
  padding: 5px 8px;
  text-align: left;
  vertical-align: top;
}
.status-table th {
  background: var(--face);
  color: var(--text);
  font-size: 13px;
  box-shadow: inset 1px 1px var(--hi), inset -1px -1px var(--sh);
}
.status-table tr:nth-child(even) td { background: var(--row-alt); }
.status-table code { color: var(--link); word-break: break-all; }

.led {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
  border: 1px solid rgba(0, 0, 0, 0.6);
}
.led.up { background: var(--led-ok); box-shadow: 0 0 5px var(--led-ok); }
.led.down { background: var(--led-bad); box-shadow: 0 0 5px var(--led-bad); animation: blink 1s steps(2, start) infinite; }
.led.unknown { background: #888; }

.state-up { color: var(--ok); font-weight: bold; }
.state-down { color: var(--bad); font-weight: bold; }
.state-unknown { color: var(--muted); }

.summary { font: bold 1.25rem var(--display-font); text-align: center; padding: 6px; }

.warn {
  background: #fff2f2;
  border: 2px dashed var(--bad);
  color: #800;
  padding: 8px;
  margin-bottom: 12px;
}

@media (max-width: 680px) {
  .status-table .hide-sm { display: none; }
}

/* ======================================================================
   Windows 98 / Neocities (default)
   ====================================================================== */
html[data-theme="98"],
html:not([data-theme]) {
  background-color: #008080;
  background-image:
    radial-gradient(#ffffff 1px, transparent 1.5px),
    radial-gradient(#7fffd4 1px, transparent 1.5px);
  background-size: 34px 34px;
  background-position: 0 0, 17px 17px;
}

/* ======================================================================
   Aero: Bliss sky, frosted glass, glossy blue
   ====================================================================== */
html[data-theme="aero"] {
  --face: rgba(255, 255, 255, 0.42);
  --well: rgba(255, 255, 255, 0.75);
  --pressed: rgba(255, 255, 255, 0.85);
  --text: #0b2d4d;
  --muted: #3d5d7a;
  --link: #0a6cc4;
  --visited: #6a3fb0;
  --h2: #0a5aa8;
  --h3: #d0306a;
  --ok: #1b8a34;
  --bad: #c42d18;
  --line: rgba(11, 45, 77, 0.2);
  --row-alt: rgba(255, 255, 255, 0.35);
  --radius: 12px;
  --body-font: "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
  --display-font: "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
  --gloss: linear-gradient(#bfe9ff, #49a9f0 50%, #1b7fd6 51%, #6fd0ff);
  background:
    radial-gradient(circle at 12% 22%, rgba(255, 255, 255, 0.55) 0 16px, transparent 17px),
    radial-gradient(circle at 84% 14%, rgba(255, 255, 255, 0.35) 0 30px, transparent 31px),
    radial-gradient(circle at 68% 48%, rgba(255, 255, 255, 0.3) 0 11px, transparent 12px),
    radial-gradient(circle at 30% 64%, rgba(255, 255, 255, 0.22) 0 24px, transparent 25px),
    radial-gradient(ellipse 120% 40% at 50% 108%, #5fc63a 0 45%, transparent 46%),
    radial-gradient(ellipse 140% 50% at 25% 115%, #8fdf58 0 50%, transparent 51%),
    linear-gradient(#1e8fe8 0%, #6cc6ff 40%, #d6f3ff 75%, #eafaff 100%) fixed;
  background-attachment: fixed;
}
html[data-theme="aero"] .box,
html[data-theme="aero"] .header {
  background-color: var(--face);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 30px rgba(0, 50, 110, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
html[data-theme="aero"] .header { background-image: none; background-color: rgba(255, 255, 255, 0.35); }
html[data-theme="aero"] .header h1 { color: #fff; text-shadow: 0 2px 6px rgba(0, 60, 130, 0.55), 0 0 18px rgba(120, 200, 255, 0.9); }
html[data-theme="aero"] .tagline { color: #0b2d4d; }
html[data-theme="aero"] .box { padding-top: 0; }
html[data-theme="aero"] .box-title {
  height: 28px;
  margin: 0 0 0;
  background: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.15));
  color: #0b2d4d;
  font: 600 13px "Segoe UI", system-ui, sans-serif;
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 11px 11px 0 0;
  padding: 0 8px 0 12px;
}
html[data-theme="aero"] .box-title .controls i {
  background: linear-gradient(rgba(255, 255, 255, 0.95), rgba(180, 215, 245, 0.95));
  border: 1px solid rgba(40, 90, 140, 0.5);
  border-radius: 4px;
  color: #0b2d4d;
}
html[data-theme="aero"] .box-title .controls i:last-child {
  width: 26px;
  background: linear-gradient(#ffb3a8, #e0533f 50%, #c42d18 51%, #f08a6e);
  border-color: #8a1f10;
  color: #fff;
}
html[data-theme="aero"] .box.inset > :not(.box-title),
html[data-theme="aero"] .counter,
html[data-theme="aero"] .theme-pick select {
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  box-shadow: inset 0 1px 3px rgba(0, 40, 90, 0.2);
}
html[data-theme="aero"] .nav a {
  background: var(--gloss);
  color: #fff;
  border: 1px solid #0d5ea8;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 3px rgba(0, 40, 90, 0.3);
  text-shadow: 0 1px 1px rgba(0, 40, 90, 0.6);
}
html[data-theme="aero"] .nav a:hover { filter: brightness(1.1); }
html[data-theme="aero"] .nav a[aria-current="page"],
html[data-theme="aero"] .nav a:active {
  background: linear-gradient(#9fd8ff, #2d8fe0 50%, #0f68bd 51%, #4fb8f5);
  border-color: #0a4c8a;
  box-shadow: inset 0 2px 4px rgba(0, 30, 70, 0.45);
}
html[data-theme="aero"] marquee {
  background: rgba(10, 40, 80, 0.55);
  color: #bff1ff;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  backdrop-filter: blur(8px);
}
html[data-theme="aero"] .status-table { border-radius: 6px; overflow: hidden; }
html[data-theme="aero"] .status-table th { background: rgba(255, 255, 255, 0.6); box-shadow: none; }
html[data-theme="aero"] .footer { color: #0b2d4d; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); }

/* ======================================================================
   Vaporwave: pastel 98, marble, palm, checker floor
   ====================================================================== */
html[data-theme="vapor"] {
  --dk: #5d4a74;
  --sh: #b9a6cf;
  --lt: #fbf6ff;
  --face: #ece0f7;
  --well: #fbf6ff;
  --pressed: #e3d3f2;
  --t1: #ff8fd0;
  --t2: #7fe3e3;
  --text: #2b1d3a;
  --muted: #6e5a85;
  --link: #c2408f;
  --visited: #7a4fb0;
  --h2: #7a4fb0;
  --h3: #c2408f;
  --ok: #1f9e72;
  --bad: #d23a6a;
  --line: #d6c6e6;
  --row-alt: rgba(194, 64, 143, 0.06);
  --ticker-bg: #fbf6ff;
  --ticker-fg: #c2408f;
  --body-font: "MS PGothic", Arial, "Noto Sans CJK JP", "Hiragino Kaku Gothic ProN", sans-serif;
  --display-font: "Times New Roman", Georgia, serif;
  background: linear-gradient(180deg, #ffb6df 0%, #e7bbff 34%, #b9d4ff 58%, #a6f2ea 68%, #ffd9ef 68.2%) fixed;
}
html[data-theme="vapor"] body::before {
  /* marble sphere, palm, column */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 200'><path d='M62 200C58 150 70 110 64 70' fill='none' stroke='%237a4fb0' stroke-width='7' stroke-linecap='round'/><g fill='%237a4fb0'><path d='M64 70C40 52 18 58 4 76C24 64 44 66 64 74Z'/><path d='M64 70C50 40 30 30 10 34C34 38 50 52 62 74Z'/><path d='M64 70C66 40 80 22 100 18C84 32 72 50 66 74Z'/><path d='M64 70C88 56 106 62 118 80C100 70 84 70 66 76Z'/><path d='M64 70C78 70 96 84 102 104C88 90 76 82 64 76Z'/><path d='M64 70C50 74 34 90 30 110C42 94 52 84 64 76Z'/></g></svg>") left 2vw bottom 22vh / auto 46vh no-repeat,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 240'><g fill='%23f6f0fc' stroke='%23b9a6cf' stroke-width='1.5'><path d='M2 4h76v10H2z'/><path d='M8 14h64v10H8z'/><path d='M14 24h52v192H14z'/><path d='M8 216h64v10H8z'/><path d='M3 226h74v12H3z'/></g><path d='M24 28v184M34 28v184M46 28v184M56 28v184' stroke='%23dccfeb' stroke-width='2'/></svg>") right 4vw bottom 24vh / auto 40vh no-repeat,
    radial-gradient(circle at 74% 24%, #fff 0 1.2vmin, #ffe3f4 3vmin, #d6b4ff 9vmin, #8fdfe6 14vmin, transparent 14.3vmin);
  opacity: 0.9;
}
html[data-theme="vapor"] body::after {
  /* checkerboard floor */
  content: "";
  position: fixed;
  z-index: -2;
  left: -50%;
  right: -50%;
  bottom: 0;
  height: 34vh;
  pointer-events: none;
  background: conic-gradient(#ff9ad5 25%, #fff6fb 0 50%, #ff9ad5 0 75%, #fff6fb 0) 0 0 / 72px 72px;
  transform: perspective(260px) rotateX(58deg);
  transform-origin: top;
  -webkit-mask: linear-gradient(transparent, #000 25%);
  mask: linear-gradient(transparent, #000 25%);
}
html[data-theme="vapor"] .box-title .controls i { background: #ece0f7; color: #5d4a74; border-color: #fbf6ff #5d4a74 #5d4a74 #fbf6ff; }
html[data-theme="vapor"] .box { box-shadow: inset 1px 1px var(--lt), inset -1px -1px var(--sh), 8px 8px 0 rgba(122, 79, 176, 0.22); }
html[data-theme="vapor"] .box-title {
  background: linear-gradient(90deg, #ff8fd0, #b49bff 55%, #7fe3e3);
  font: italic 700 12px "Times New Roman", serif;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 rgba(122, 79, 176, 0.55);
}
html[data-theme="vapor"] .header {
  background: linear-gradient(#fff5fd, #ece0f7);
  border-color: var(--hi) var(--dk) var(--dk) var(--hi);
  box-shadow: 8px 8px 0 rgba(122, 79, 176, 0.22);
}
html[data-theme="vapor"] .header h1 {
  font: italic 700 2.6rem/1.1 "Times New Roman", Georgia, serif;
  letter-spacing: 0.18em;
  background: linear-gradient(180deg, #ff5fb9, #7a5af5 60%, #129a9a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}
html[data-theme="vapor"] .header h1.name::after { content: "ストレロク"; display: block; font-size: 1rem; letter-spacing: 0.4em; color: #c2408f; -webkit-text-fill-color: #c2408f; }
html[data-theme="vapor"] .tagline { color: #6e5a85; }
html[data-theme="vapor"] marquee { border-top: 1px solid #b9a6cf; border-bottom: 1px solid #b9a6cf; font-style: italic; letter-spacing: 0.15em; }
html[data-theme="vapor"] .counter { background: #2b1d3a; color: #ff8fd0; }
html[data-theme="vapor"] .footer { color: #5d4a74; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7); }

/* ======================================================================
   Midnight: plain, dark, rounded
   ====================================================================== */
html[data-theme="midnight"] {
  --face: #1c1e23;
  --well: #121316;
  --pressed: #262930;
  --text: #e6e7ea;
  --muted: #9a9ea8;
  --link: #6aa7ff;
  --visited: #b08cff;
  --h2: #e6e7ea;
  --h3: #8fc1ff;
  --ok: #7ee08a;
  --bad: #ff7a7a;
  --led-ok: #7ee08a;
  --led-bad: #ff7a7a;
  --line: #33363e;
  --row-alt: rgba(255, 255, 255, 0.03);
  --ticker-bg: #1c1e23;
  --ticker-fg: #9a9ea8;
  --radius: 10px;
  --body-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #121316;
  color-scheme: dark;
}
html[data-theme="midnight"] .box,
html[data-theme="midnight"] .header,
html[data-theme="midnight"] .nav a,
html[data-theme="midnight"] .counter,
html[data-theme="midnight"] .theme-pick select,
html[data-theme="midnight"] .box.inset > :not(.box-title) {
  border: 1px solid #33363e;
  box-shadow: none;
}
html[data-theme="midnight"] .box { padding-top: 0; }
html[data-theme="midnight"] .box-title {
  height: auto;
  padding: 10px 14px 0;
  background: none;
  color: var(--muted);
  font: 600 12px system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
html[data-theme="midnight"] .box-title .controls { display: none; }
html[data-theme="midnight"] .box.inset > :not(.box-title) { border-radius: 8px; }
html[data-theme="midnight"] .header { background: #1c1e23; }
html[data-theme="midnight"] .header h1 { color: #e6e7ea; text-shadow: none; letter-spacing: 0; }
html[data-theme="midnight"] .tagline { color: var(--muted); font-style: normal; }
html[data-theme="midnight"] .nav a { border-radius: 8px; }
html[data-theme="midnight"] .nav a[aria-current="page"] { background: #262930; color: var(--link); }
html[data-theme="midnight"] marquee { border: 1px solid #33363e; font: 14px system-ui, sans-serif; }
html[data-theme="midnight"] .construction-label { color: var(--muted); }
html[data-theme="midnight"] .status-table th { box-shadow: none; background: #262930; }
html[data-theme="midnight"] .warn { background: #2a1416; color: #ffb3b3; }
html[data-theme="midnight"] .footer { color: var(--muted); text-shadow: none; }

/* ======================================================================
   Classic: the site's original starfield look
   ====================================================================== */
html[data-theme="classic"] {
  --dk: #2a2a70;
  --sh: #2a2a70;
  --lt: #9fa8ff;
  --hi: #9fa8ff;
  --face: #10103a;
  --well: #1a1a55;
  --pressed: #000080;
  --text: #e8e8ff;
  --muted: #a9a9d9;
  --link: #66ffff;
  --visited: #ff88ff;
  --h2: #ffff66;
  --h3: #ff66cc;
  --ok: #33ff66;
  --bad: #ff4444;
  --led-ok: #33ff66;
  --led-bad: #ff4444;
  --line: #2a2a70;
  --row-alt: rgba(255, 255, 255, 0.03);
  --body-font: "Trebuchet MS", Verdana, Geneva, sans-serif;
  background-color: #000022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Crect width='120' height='120' fill='%23000022'/%3E%3Ccircle cx='10' cy='14' r='1' fill='%23fff'/%3E%3Ccircle cx='54' cy='40' r='.7' fill='%23ccf'/%3E%3Ccircle cx='96' cy='22' r='1.2' fill='%23fff'/%3E%3Ccircle cx='30' cy='78' r='.8' fill='%23fcf'/%3E%3Ccircle cx='80' cy='92' r='1' fill='%23fff'/%3E%3Ccircle cx='112' cy='66' r='.6' fill='%23cff'/%3E%3Ccircle cx='66' cy='110' r='.7' fill='%23fff'/%3E%3C/svg%3E");
  color-scheme: dark;
}
html[data-theme="classic"] .header { background: transparent; border: 0; }
html[data-theme="classic"] .header h1 {
  background: linear-gradient(90deg, #ff4d4d, #ffb84d, #ffff66, #66ff66, #66ffff, #6699ff, #cc66ff, #ff4d4d);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  animation: shimmer 4s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }
html[data-theme="classic"] .tagline { color: var(--muted); }
html[data-theme="classic"] .box { border: 3px outset #9fa8ff; box-shadow: none; }
html[data-theme="classic"] .nav a { border: 2px outset #9fa8ff; box-shadow: none; background: #1a1a55; }
html[data-theme="classic"] .nav a[aria-current="page"] { border-style: inset; color: #ffff66; }
html[data-theme="classic"] .status-table th { background: #000080; color: #fff; box-shadow: none; }
html[data-theme="classic"] .warn { background: #330000; color: #ffaaaa; }
html[data-theme="classic"] .footer { color: var(--muted); text-shadow: none; }

/* ======================================================================
   Wired (default): a dark CRT screen. Pale blue and a little red,
   title-card serif headings, terminal labels, power lines in the distance.
   ====================================================================== */
html[data-theme="wired"] {
  --dk: #000;
  --sh: #262b33;
  --lt: #262b33;
  --hi: #262b33;
  --face: rgba(13, 15, 19, 0.92);
  --well: #07080a;
  --pressed: #151920;
  --text: #d5dbe2;
  --muted: #7c8794;
  --link: #9cc8ee;
  --visited: #b4a7d6;
  --h2: #eef2f6;
  --h3: #9cc8ee;
  --ok: #8fdcb4;
  --bad: #e2372f;
  --led-ok: #8fdcb4;
  --led-bad: #e2372f;
  --line: #262b33;
  --row-alt: rgba(255, 255, 255, 0.025);
  --ticker-bg: #07080a;
  --ticker-fg: #9cc8ee;
  --radius: 0;
  --body-font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --display-font: Consolas, "Cascadia Mono", "Courier New", monospace;
  --serif: "Times New Roman", Times, Georgia, serif;
  background:
    radial-gradient(ellipse 60% 45% at 85% 0%, rgba(156, 200, 238, 0.10), transparent 70%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(226, 55, 47, 0.06), transparent 70%),
    #0b0c0e;
  background-attachment: fixed;
  color-scheme: dark;
}
html[data-theme="wired"] body::before {
  /* scanlines */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: repeating-linear-gradient(rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px);
}
html[data-theme="wired"] body::after {
  /* a utility pole and sagging wires */
  content: "";
  position: fixed;
  z-index: -1;
  right: 0;
  bottom: 0;
  width: min(70vw, 760px);
  height: 70vh;
  pointer-events: none;
  opacity: 0.55;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 300' preserveAspectRatio='xMaxYMax meet'><g fill='none' stroke='%23303844' stroke-width='2'><path d='M300 300V30'/><path d='M262 52h76M270 74h60'/><path d='M0 120Q150 170 262 52M0 150Q160 200 270 74M0 175Q170 215 300 74'/><path d='M338 52Q370 80 400 70M330 74Q368 104 400 100'/></g></svg>") right bottom / contain no-repeat;
}

html[data-theme="wired"] h2 {
  font: 700 1.6rem/1.1 var(--serif);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
html[data-theme="wired"] h3 { font: 600 13px var(--display-font); text-transform: uppercase; letter-spacing: 0.12em; }

/* header: a title card */
html[data-theme="wired"] .header {
  text-align: left;
  padding: 26px 22px 18px;
  background: #000;
  border: 1px solid var(--line);
  border-left: 3px solid var(--bad);
}
html[data-theme="wired"] .header h1 {
  display: inline-block;
  font: 900 3.6rem/1 var(--serif);
  color: #f3f5f7;
  letter-spacing: -0.01em;
  text-shadow: 0 0 18px rgba(156, 200, 238, 0.25);
  transform: scale(0.86, 1.22);
  transform-origin: left bottom;
  animation: none;
  background: none;
}
html[data-theme="wired"] .tagline {
  margin-top: 14px;
  color: var(--muted);
  font: 12px var(--display-font);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.25em;
}

/* windows: flat panels with terminal labels */
html[data-theme="wired"] .box {
  background: var(--face);
  border: 1px solid var(--line);
  box-shadow: none;
  padding: 0 0 12px;
}
html[data-theme="wired"] .box-title {
  height: 28px;
  padding: 0 8px 0 11px;
  background: none;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font: 11px var(--display-font);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
html[data-theme="wired"] .box-title > span:first-child::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  background: var(--bad);
  vertical-align: 1px;
}
html[data-theme="wired"] .box-title .controls i {
  width: 12px;
  height: 12px;
  background: none;
  border: 1px solid #3a414c;
  color: #59626e;
  font-size: 8px;
}
html[data-theme="wired"] .box.inset > :not(.box-title),
html[data-theme="wired"] .theme-pick select,
html[data-theme="wired"] .counter {
  border: 1px solid var(--line);
  box-shadow: none;
}

/* nav: terminal menu */
html[data-theme="wired"] .nav a {
  background: none;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  box-shadow: none;
  color: var(--text);
  font: 13px var(--display-font);
  letter-spacing: 0.05em;
}
html[data-theme="wired"] .nav a:hover { border-color: var(--line); color: var(--link); background: none; }
html[data-theme="wired"] .nav a[aria-current="page"],
html[data-theme="wired"] .nav a:active {
  border-color: var(--line);
  border-left-color: var(--bad);
  background: var(--pressed);
  box-shadow: none;
  font-weight: normal;
  color: #fff;
}

html[data-theme="wired"] marquee {
  border: 1px solid var(--line);
  font: 12px var(--display-font);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding: 5px 0;
}

/* hazard stripe in red and black */
html[data-theme="wired"] .construction {
  height: 8px;
  border: 0;
  background: repeating-linear-gradient(-45deg, var(--bad) 0 10px, transparent 10px 20px);
  opacity: 0.85;
}
html[data-theme="wired"] .construction-label {
  color: var(--bad);
  font: 11px var(--display-font);
  text-transform: uppercase;
  letter-spacing: 0.3em;
}
html[data-theme="wired"] hr.sparkle {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(156, 200, 238, 0.4), transparent);
}
html[data-theme="wired"] .btn88 { filter: grayscale(0.85) contrast(1.1); border: 1px solid #3a414c; }
html[data-theme="wired"] .btn88:hover { filter: none; }
html[data-theme="wired"] .counter { background: var(--well); color: var(--bad); font-weight: normal; }
html[data-theme="wired"] .projects b { font: 600 13px var(--display-font); text-transform: uppercase; letter-spacing: 0.12em; color: var(--link); }
html[data-theme="wired"] .updates .date { color: var(--muted); font-weight: normal; font-size: 12px; }
html[data-theme="wired"] .summary { font: 700 1.4rem var(--serif); text-transform: uppercase; }
html[data-theme="wired"] .status-table th {
  background: var(--pressed);
  box-shadow: none;
  color: var(--muted);
  font: 11px var(--display-font);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
html[data-theme="wired"] .warn { background: #1a0b0b; color: #ffb0aa; }
html[data-theme="wired"] .footer {
  color: var(--muted);
  text-shadow: none;
  font: 11px var(--display-font);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

@media (max-width: 680px) {
  html[data-theme="wired"] .header h1 { font-size: 2.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .blink, .led.down, html[data-theme="classic"] .header h1 { animation: none; }
}
