@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/familjen-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/familjen-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/familjen-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --alu-hi: #EEF0F2;
  --alu: #D6D9DD;
  --alu-lo: #B4B8BE;
  --graphite: #24272C;
  --graphite-soft: #5B6068;
  --rail: #9AA0A7;
  --hole: #6C7178;
  --page: #E4ECF6;
  --grid-minor: rgba(47,110,220,.09);
  --grid-major: rgba(47,110,220,.18);
  --glow: rgba(90,160,255,.30);
  --floor: rgba(24,54,104,.10);
  --focus: #2F7CF6;
  --grille-ball: #FFFFFF;
  --grille-shade: #000000;
  --grille-opacity: .55;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --alu-hi: #5A5E64;
    --alu: #45494F;
    --alu-lo: #33363B;
    --graphite: #ECEEF1;
    --graphite-soft: #A4A9B0;
    --rail: #2A2D31;
    --hole: #17191C;
    --page: #0A111D;
    --grid-minor: rgba(90,170,255,.06);
    --grid-major: rgba(90,170,255,.13);
    --glow: rgba(40,130,255,.20);
    --floor: rgba(0,0,0,.45);
    --focus: #6FA6FF;
    --grille-opacity: .35;
  }
}
:root[data-theme="dark"] {
  --alu-hi: #5A5E64; --alu: #45494F; --alu-lo: #33363B;
  --graphite: #ECEEF1; --graphite-soft: #A4A9B0;
  --rail: #2A2D31; --hole: #17191C; --page: #0A111D;
  --grid-minor: rgba(90,170,255,.06); --grid-major: rgba(90,170,255,.13);
  --glow: rgba(40,130,255,.20); --floor: rgba(0,0,0,.45);
  --focus: #6FA6FF; --grille-opacity: .35;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  /* Network-schematic backdrop: blueprint grid, cold-aisle glow behind the rack, darker floor */
  background-color: var(--page);
  background-image:
    radial-gradient(ellipse 65% 50% at 50% 45%, var(--glow), transparent 72%),
    linear-gradient(180deg, transparent 55%, var(--floor)),
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: center, center, center top, center top, center top, center top;
  background-attachment: fixed;
  color: var(--graphite);
  font-family: "Familjen Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Brushed aluminium: fine horizontal streaks over a soft vertical sheen */
.brushed {
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.06) 0 1px, rgba(0,0,0,.035) 1px 2px, transparent 2px 4px),
    linear-gradient(180deg, var(--alu-hi), var(--alu) 45%, var(--alu-lo));
}

/* Mac Pro lattice grille */
.grille {
  position: relative;
  background-color: var(--alu-lo);
}
.grille::before {
  content: "";
  position: absolute; inset: 0;
  opacity: var(--grille-opacity);
  background-image: url("grille.svg");
  background-size: 22px 22px;
  pointer-events: none;
}

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header ---------- */
/* ---------- Terminal header ---------- */
header.top { padding: 40px 0 28px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.term {
  --t-bg: #0B1019;
  --t-ink: #D7E3F4;
  --t-dim: #6F7F98;
  --t-green: #30D158;
  --t-cyan: #64D2FF;
  --t-violet: #8C97FF;
  --t-red: #FF6B6B;
  border-radius: 12px;
  overflow: hidden;
  background: var(--t-bg);
  color: var(--t-ink);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 20px 50px -12px rgba(0,0,0,.55), 0 0 60px -20px rgba(64,140,255,.35);
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
.term-bar {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #232A37, #1A202B);
  border-bottom: 1px solid rgba(0,0,0,.5);
  font-family: "Familjen Grotesk", system-ui, sans-serif;
  font-size: .8125rem; color: #9AA6B8;
}
.lights { display: inline-flex; gap: 8px; }
.lights i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.35); }
.lights .r { background: #FF5F57; } .lights .y { background: #FEBC2E; } .lights .g { background: #28C840; }
.term-title { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term-clock { font-variant-numeric: tabular-nums; white-space: nowrap; }

.term-body {
  padding: 20px 24px 18px;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse 80% 60% at 30% 0%, rgba(100,140,255,.08), transparent 70%),
    var(--t-bg);
}
.banner {
  margin: 0 0 14px;
  font-family: "Cascadia Mono", Menlo, Consolas, "DejaVu Sans Mono", ui-monospace, monospace;
  font-size: min(14px, calc((100vw - 92px) / 68));
  line-height: 1.02;
  white-space: pre;
  overflow: hidden;
  background: linear-gradient(90deg, #30D158 0%, #64D2FF 45%, #8C97FF 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(100,210,255,.25));
}
.t-line { margin: 0; font-size: .875rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.t-dim { color: var(--t-dim); }
.t-ok { color: var(--t-green); }
.t-err { color: var(--t-red); }

.t-prompt {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px;
  font-size: .9375rem;
}
.t-prompt label { white-space: nowrap; cursor: text; }
.t-user { color: var(--t-green); }
.t-path { color: var(--t-cyan); }
.t-sym { color: var(--t-ink); }
#term-input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: 0; padding: 4px 0;
  font: inherit; color: #FFFFFF;
  caret-color: var(--t-green);
}
#term-input::placeholder { color: #45526A; }
.t-hint {
  font-family: inherit; font-size: .75rem; color: var(--t-dim);
  border: 1px solid #2A3446; border-radius: 4px; padding: 1px 7px;
}
.t-prompt:focus-within .t-hint { visibility: hidden; }
.term:focus-within { box-shadow: 0 0 0 1px rgba(48,209,88,.5), 0 20px 50px -12px rgba(0,0,0,.55), 0 0 60px -16px rgba(48,209,88,.35); }

.t-out { min-height: 0; margin-top: 4px; }
.t-out:not(:empty) { margin-top: 8px; }
.t-result { cursor: pointer; display: grid; grid-template-columns: 1.4em minmax(0, 14em) 1fr; gap: 8px; color: var(--t-dim); }
.t-result .t-name { color: var(--t-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-result.is-cur .t-arrow, .t-result.is-cur .t-name { color: var(--t-green); }
.t-result:hover .t-name { text-decoration: underline; text-underline-offset: 3px; }
.t-host { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-help { display: grid; grid-template-columns: 11em 1fr; gap: 12px; color: var(--t-dim); }
.t-cmd { color: var(--t-cyan); }

.term.is-exited .t-prompt { opacity: .4; }

/* Rack highlighting while searching */
.rack.searching #rack > li:not(.match) { opacity: .25; filter: grayscale(.85); }
#rack > li { transition: opacity .25s ease, filter .25s ease; }
#rack > li.current .unit { filter: drop-shadow(0 0 16px color-mix(in srgb, var(--accent) 60%, transparent)); }
#rack > li.current .face { box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- Rack ---------- */
.rack {
  position: relative;
  padding: 14px 0;
  border-radius: 14px;
  background: var(--rail);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.35), 0 1px 0 rgba(255,255,255,.4);
}
.rack ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.unit {
  --face: var(--alu);
  --ink: var(--graphite);
  --muted: var(--graphite-soft);
  --accent: var(--graphite);
  --accent2: var(--graphite);
  --grid: rgba(0,0,0,.1);
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  min-height: 168px;
  color: var(--ink);
  text-decoration: none;
  outline: none;
}

/* Rack ears with mounting screws */
.ear {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  padding: 22px 0;
  border-radius: 6px;
}
.ear.l { border-radius: 6px 0 0 6px; }
.ear.r { border-radius: 0 6px 6px 0; }
.screw {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fafafa, #9da2a8 60%, #5d6167);
  box-shadow: 0 0 0 2px var(--hole), inset 0 -1px 1px rgba(0,0,0,.4);
  position: relative;
}
.screw::after {
  content: ""; position: absolute; left: 3px; right: 3px; top: 6px; height: 2px;
  background: rgba(40,42,46,.7); border-radius: 1px; transform: rotate(var(--rot, 20deg));
}

.face {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 38%) 1fr auto;
  align-items: stretch;
  background: var(--face);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -1px 0 rgba(0,0,0,.4);
  overflow: hidden;
}

.display {
  position: relative;
  border-right: 1px solid var(--grid);
  overflow: hidden;
}
.display canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.monogram {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-weight: 700; font-size: 4.5rem; letter-spacing: -0.04em;
  color: var(--accent);
  background:
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    repeating-linear-gradient(135deg, var(--grid) 0 1px, transparent 1px 14px);
}

/* Private Chat Relay display (matches chat.macgeekpro.dev) */
.chat {
  position: absolute; inset: 12px 16px;
  display: flex; flex-direction: column;
  border: 1px solid #26303B; border-radius: 9px;
  background: #141920;
  overflow: hidden;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  box-shadow: 0 8px 20px rgba(0,0,0,.4);
}
.chat-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid #26303B;
  font-size: .6875rem;
}
.chat-title { font-weight: 500; }
.chat-r { color: var(--ink); }
.chat-s { color: var(--accent); }
.chat-meta { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .625rem; }
.chat-lock { position: relative; width: 8px; height: 6px; margin-top: 3px; border-radius: 1px; background: var(--accent); }
.chat-lock::before {
  content: ""; position: absolute; left: 1px; top: -4px; width: 4px; height: 4px;
  border: 1.5px solid var(--accent); border-bottom: 0; border-radius: 3px 3px 0 0;
}
.chat-log {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  padding: 6px 10px 2px;
  overflow: hidden;
}
.chat-msg { display: flex; gap: 8px; font-size: .6875rem; line-height: 1.5; white-space: nowrap; animation: chat-in .2s ease-out; }
@keyframes chat-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.chat-who { flex: none; min-width: 3.2em; }
.chat-who::after { content: " \203A"; color: var(--muted); }
.chat-txt { color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.chat-txt.enc { color: color-mix(in srgb, var(--muted) 70%, transparent); letter-spacing: .02em; }
.chat-prompt { padding: 3px 10px 7px; font-size: .6875rem; color: var(--accent); }
.chat-caret { display: inline-block; width: 6px; height: 11px; vertical-align: -1px; background: var(--accent); animation: dvt-blink 1s steps(1) infinite; }
@media (max-width: 720px) {
  .display:has(.chat) { height: 150px; }
  .chat { inset: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-msg, .chat-caret { animation: none; }
}

/* File Transfer Relay display */
.rly {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: 1fr 58px 1fr; align-items: center; gap: 6px;
  padding: 14px 14px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  background:
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 22px);
}
.rly-term {
  border-radius: 7px; overflow: hidden;
  background: #030B0F;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  box-shadow: 0 6px 16px rgba(0,0,0,.45);
  min-width: 0;
}
.rly-bar { display: flex; align-items: center; gap: 6px; padding: 4px 6px; background: #0B1A21; }
.rly-dots { display: inline-flex; gap: 3px; }
.rly-dots i { width: 5px; height: 5px; border-radius: 50%; background: #FF5F57; }
.rly-dots i:nth-child(2) { background: #FEBC2E; } .rly-dots i:nth-child(3) { background: #28C840; }
.rly-label { font-size: .5625rem; color: var(--muted); }
.rly-body { height: 66px; padding: 5px 7px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.rly-line { font-size: .625rem; line-height: 1.55; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rly-line.dim { color: var(--muted); }
.rly-line.ok { color: var(--accent); }
.rly-pipe { position: relative; height: 66px; display: grid; place-items: center; }
.rly-lane {
  position: absolute; left: -6px; right: -6px; top: 50%; height: 2px; margin-top: -1px;
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--accent) 40%, transparent) 0 4px, transparent 4px 8px);
}
.rly-pkt {
  position: absolute; top: -4px; left: 0;
  width: 10px; height: 10px; border-radius: 2px;
  background: var(--accent2);
  box-shadow: 0 0 8px var(--accent2);
  opacity: 0;
}
.rly.flowing .rly-pkt { animation: rly-move 1s linear infinite; animation-delay: calc(var(--i) * .25s); }
@keyframes rly-move {
  0% { left: 0; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { left: calc(100% - 10px); opacity: 0; }
}
.rly-node {
  position: relative; z-index: 1;
  display: grid; justify-items: center; gap: 2px;
  padding: 6px 6px 4px; border-radius: 8px;
  background: var(--face);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 0 12px -2px color-mix(in srgb, var(--accent) 50%, transparent);
}
.rly.flowing .rly-node { box-shadow: 0 0 18px 0 color-mix(in srgb, var(--accent) 70%, transparent); }
.rly-lock { /* padlock drawn in CSS */
  position: relative; width: 12px; height: 9px; margin-top: 6px; border-radius: 2px; background: var(--accent);
}
.rly-lock::before {
  content: ""; position: absolute; left: 2px; top: -6px; width: 6px; height: 6px;
  border: 2px solid var(--accent); border-bottom: 0; border-radius: 5px 5px 0 0;
}
.rly-node-label { font-size: .5rem; color: var(--muted); letter-spacing: .06em; }

/* "In development" tag + slow-blinking port light */
.build-tag {
  align-self: flex-start; white-space: nowrap;
  margin-top: 4px; padding: 1px 7px; border-radius: 4px;
  font-family: "Familjen Grotesk", system-ui, sans-serif; font-size: .6875rem; font-weight: 600;
  color: #1A1405; background: #FEBC2E;
}
.unit.is-building .port-led { animation: build-blink 1.6s steps(1) infinite; }
@keyframes build-blink { 50% { opacity: .25; } }
@media (max-width: 720px) {
  .display:has(.rly) { height: 150px; }
  .rly { grid-template-columns: 1fr 46px 1fr; padding: 12px 10px; gap: 4px; }
  .rly-line { font-size: .5625rem; }
}
@media (prefers-reduced-motion: reduce) {
  .rly.flowing .rly-pkt, .unit.is-building .port-led { animation: none; }
}

/* Dev tools display (matches tools.macgeekpro.dev) */
.dvt {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  padding: 14px 18px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
.dvt-search {
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px;
  border: 1px solid #202C44; border-radius: 8px;
  background: #11192B;
  font-size: .8125rem; color: var(--ink);
}
.dvt-mag {
  width: 11px; height: 11px; border: 2px solid var(--accent); border-radius: 50%;
  position: relative; flex: none; margin-right: 2px;
}
.dvt-mag::after {
  content: ""; position: absolute; width: 2px; height: 5px; background: var(--accent);
  right: -4px; bottom: -4px; transform: rotate(-45deg); border-radius: 1px;
}
.dvt-caret { width: 7px; height: 14px; background: var(--accent); margin-left: -6px; animation: dvt-blink 1s steps(1) infinite; }
@keyframes dvt-blink { 50% { opacity: 0; } }
.dvt-count {
  margin-left: auto; font-size: .625rem; color: var(--muted);
  border: 1px solid #202C44; border-radius: 4px; padding: 1px 6px;
}
.dvt-list { display: grid; gap: 4px; min-height: calc(3 * 26px + 8px); align-content: start; }
.dvt-row {
  display: flex; align-items: center; gap: 9px;
  height: 26px; padding: 0 8px;
  border-radius: 6px;
  font-size: .75rem; color: var(--ink);
  animation: dvt-in .18s ease-out;
}
.dvt-row.top { background: rgba(57,255,136,.08); box-shadow: inset 2px 0 0 var(--accent); }
.dvt-row.ghost { background: rgba(255,255,255,.02); animation: none; }
@keyframes dvt-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.dvt-ic {
  flex: none; width: 20px; height: 20px; border-radius: 5px;
  display: grid; place-items: center;
  font-size: .5625rem; font-weight: 500;
  color: var(--ic);
  background: color-mix(in srgb, var(--ic) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ic) 45%, transparent);
}
.dvt-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dvt-badge {
  flex: none; font-size: .5625rem; letter-spacing: .06em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 4px;
}
.dvt-badge.local { color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.dvt-badge.server { color: var(--accent2); border: 1px solid color-mix(in srgb, var(--accent2) 45%, transparent); }
@media (max-width: 720px) {
  .display:has(.dvt) { height: 150px; }
  .dvt { padding: 12px 14px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .dvt-caret, .dvt-row { animation: none; }
}

/* Wordle checker display (matches wordle.macgeekpro.dev) */
.wdl {
  --w-green: #538D4E; --w-yellow: #B59F3B; --w-gray: #3A3A3C;
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px;
  padding: 14px 18px;
  background-image: radial-gradient(circle, var(--grid) 1.2px, transparent 1.6px);
  background-size: 18px 18px;
}
.wdl-row { display: flex; gap: 6px; perspective: 400px; }
.wdl-tile {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 2px solid #3A3A3C;
  background: var(--face);
  font-family: "Familjen Grotesk", system-ui, sans-serif; font-weight: 700; font-size: 1.5rem;
  text-transform: uppercase; color: var(--ink);
}
.wdl-tile.filled { border-color: #6B6B70; }
.wdl-tile.pop { animation: wdl-pop .1s ease-out; }
@keyframes wdl-pop { 50% { transform: scale(1.1); } }
.wdl-tile.v-green { --tc: var(--w-green); }
.wdl-tile.v-yellow { --tc: var(--w-yellow); }
.wdl-tile.v-gray { --tc: var(--w-gray); }
.wdl-tile.flip { animation: wdl-flip .5s ease-in-out var(--d) forwards; }
@keyframes wdl-flip {
  0% { transform: rotateX(0); }
  49% { transform: rotateX(90deg); }
  50% { transform: rotateX(90deg); background: var(--tc); border-color: var(--tc); color: #fff; }
  100% { transform: rotateX(0); background: var(--tc); border-color: var(--tc); color: #fff; }
}
.wdl-tile.shown { background: var(--tc); border-color: var(--tc); color: #fff; }
.wdl-verdict {
  min-height: 1.9em;
  padding: 4px 14px; border-radius: 999px;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .8125rem;
  color: #fff;
  opacity: 0; transform: translateY(4px);
  transition: opacity .25s ease, transform .25s ease;
}
.wdl-verdict.on { opacity: 1; transform: none; }
.wdl-verdict.v-green { background: var(--w-green); }
.wdl-verdict.v-yellow { background: var(--w-yellow); color: #121213; }
.wdl-verdict.v-gray { background: var(--w-gray); }
@media (max-width: 720px) {
  .wdl-tile { width: 38px; height: 38px; font-size: 1.25rem; }
  .display:has(.wdl) { height: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  .wdl-tile.pop, .wdl-tile.flip { animation: none; }
  .wdl-verdict { transition: none; }
}

/* YouTube-to-MP3 display */
.display:has(.aud-hud) {
  background: repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 4px);
}
.aud-hud {
  position: absolute; top: 14px; left: 22px; right: 22px; z-index: 1;
  display: flex; justify-content: space-between;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .75rem;
  color: var(--muted);
}
.aud-pct { color: var(--ink); font-variant-numeric: tabular-nums; }
.aud-file {
  position: absolute; left: 22px; bottom: 14px; z-index: 1;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .8125rem;
  color: var(--muted);
  transition: color .2s ease;
}
.aud-file.done { color: var(--accent); }
.aud-file.done::before { content: "\2713  "; }

/* PDF converter display */
.pdfx {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px;
  padding: 14px 20px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  background-image: radial-gradient(circle, var(--grid) 1.2px, transparent 1.6px);
  background-size: 18px 18px;
}
.pdfx-row { display: flex; align-items: center; gap: 14px; }
.pdfx-page {
  position: relative;
  width: 64px; height: 82px;
  border-radius: 4px 14px 4px 4px;
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  box-shadow: 0 6px 16px rgba(0,0,0,.4);
  padding: 22px 9px 8px;
}
.pdfx-page::after {   /* folded corner */
  content: ""; position: absolute; top: 0; right: 0;
  width: 14px; height: 14px;
  background: linear-gradient(225deg, transparent 50%, color-mix(in srgb, var(--ink) 60%, #000) 50%);
  border-radius: 0 0 0 3px;
}
.pdfx-tag {
  position: absolute; top: 6px; left: 6px;
  padding: 1px 5px; border-radius: 3px;
  font-size: .5625rem; font-weight: 500; letter-spacing: .04em;
  color: #fff; background: var(--tag, #666);
}
.pdfx-page.out .pdfx-tag { --tag: var(--accent); color: var(--onAccent, #fff); }
.pdfx-lines { display: grid; gap: 5px; }
.pdfx-lines .ln { height: 4px; border-radius: 2px; background: rgba(0,0,0,.18); }
.pdfx-lines .ln:nth-child(2) { width: 85%; } .pdfx-lines .ln:nth-child(4) { width: 70%; } .pdfx-lines .ln:nth-child(5) { width: 55%; }
.pdfx-page.out .ln { background: color-mix(in srgb, var(--accent) 70%, #000); transform-origin: left; transform: scaleX(0); }
.pdfx.static .pdfx-page.out .ln { transform: none; }
.pdfx.run .pdfx-page.out .ln { animation: pdf-line .3s ease-out forwards; }
.pdfx.run .pdfx-page.out .ln:nth-child(1) { animation-delay: 1.0s; }
.pdfx.run .pdfx-page.out .ln:nth-child(2) { animation-delay: 1.15s; }
.pdfx.run .pdfx-page.out .ln:nth-child(3) { animation-delay: 1.3s; }
.pdfx.run .pdfx-page.out .ln:nth-child(4) { animation-delay: 1.45s; }
.pdfx.run .pdfx-page.out .ln:nth-child(5) { animation-delay: 1.6s; }
@keyframes pdf-line { to { transform: scaleX(1); } }
.pdfx.run .pdfx-page.src { animation: pdf-src .5s ease-out; }
@keyframes pdf-src { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.pdfx-arrow {
  position: relative; width: 56px; height: 4px; border-radius: 2px;
  background: var(--grid); overflow: hidden;
}
.pdfx-arrow::after {
  content: ""; position: absolute; right: -2px; top: -4px;
  border: 6px solid transparent; border-left-color: var(--accent); border-right: 0;
}
.pdfx-arrow .flow {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 14px);
  transform: translateX(-100%);
}
.pdfx.run .pdfx-arrow .flow { animation: pdf-flow 1s linear .3s 1 forwards; }
@keyframes pdf-flow { to { transform: translateX(0); } }
.pdfx.static .pdfx-arrow .flow { transform: none; }
.pdfx-arrow { overflow: visible; }
.pdfx-name { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (max-width: 720px) {
  .pdfx { gap: 8px; }
  .pdfx-page { width: 50px; height: 64px; padding-top: 19px; }
  .pdfx-lines { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .pdfx.run .pdfx-page.out .ln, .pdfx.run .pdfx-page.src, .pdfx.run .pdfx-arrow .flow { animation: none; transform: none; }
}

/* GUID generator display (matches guid.macgeekpro.dev) */
.guid {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  padding: 16px 22px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  background-image: radial-gradient(circle, var(--grid) 1.1px, transparent 1.5px);
  background-size: 20px 20px;
}
.guid-chrome {
  position: absolute; top: 12px; left: 16px; right: 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.guid-dots { display: inline-flex; gap: 6px; }
.guid-dots .d { width: 8px; height: 8px; border-radius: 50%; }
.guid-dots .r { background: #FF6B81; }
.guid-dots .y { background: #FFC27A; }
.guid-dots .g { background: #5CF2B4; }
.guid-tag { font-size: .6875rem; color: var(--muted); opacity: .8; }
.guid-now { margin-top: 14px; display: grid; gap: 6px; }
.guid-line { display: flex; align-items: flex-start; white-space: nowrap; }
.grp { display: inline-flex; flex-direction: column; align-items: center; }
.grp .chars { font-size: 1.3rem; line-height: 1.25; color: #4E4F75; }
.grp .lbl {
  margin-top: 3px; padding-top: 2px;
  font-size: .5625rem; letter-spacing: .08em; text-transform: uppercase;
  color: #5D5F85;
  border-top: 1px solid var(--gc);
  align-self: stretch; text-align: center;
}
.g0 { --gc: #9AA4FF; } .g1 { --gc: #C79BFF; } .g2 { --gc: #FF9EC7; } .g3 { --gc: #FFC27A; } .g4 { --gc: #7FE3FF; }
.grp .lbl { border-top-color: color-mix(in srgb, var(--gc) 45%, transparent); }
.guid-c.locked { color: var(--gc); }
.guid-c.locked.ver { color: #5CF2B4; text-shadow: 0 0 10px rgba(92,242,180,.6); }
.guid .dash { font-size: 1.3rem; line-height: 1.25; color: #8B8DB8; padding: 0 3px; }
.guid-prev { font-size: .6875rem; color: var(--muted); opacity: .55; overflow-wrap: anywhere; min-height: 1.2em; }
@media (max-width: 720px) {
  .display:has(.guid) { height: 150px; }
  .display:has(.aud-hud) { height: 150px; }
  .display:has(.pdfx) { height: 140px; }
  .guid { padding: 14px 16px; }
  .grp .chars, .guid .dash { font-size: 1.15rem; }
}

/* URL shortener display (matches url.macgeekpro.dev) */
.shorten {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 14px;
  padding: 18px 24px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  background-image: radial-gradient(circle, var(--grid) 1.2px, transparent 1.6px);
  background-size: 22px 22px;
  background-position: 11px 11px;
}
.shorten-from {
  align-self: stretch;
  padding: 10px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--face) 70%, #000);
  border: 1px solid var(--grid);
  font-size: .8125rem; line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
  transition: opacity .3s ease;
}
/* clamp the text itself, not the padded field */
.shorten-text {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden;
}
.shorten-to {
  min-height: 2.1em;
  font-size: .9375rem; line-height: 1.3;
  overflow-wrap: anywhere;
}
.shorten.is-done .shorten-from,
.shorten.is-static .shorten-from { opacity: .45; }
.shorten.is-done .shorten-to,
.shorten.is-static .shorten-to {
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--onAccent, var(--face));
}
.shorten.is-done .shorten-to { animation: link-pop .35s cubic-bezier(.2,.9,.3,1.3); transform-origin: left center; }
@keyframes link-pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (max-width: 720px) {
  .shorten { padding: 14px 18px; gap: 10px; }
  .shorten-to { font-size: .875rem; }
}
@media (prefers-reduced-motion: reduce) {
  .shorten-from { transition: none; }
}

.meta {
  padding: 26px 28px;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  min-width: 0;
}
.meta h2 {
  margin: 0;
  font-size: 1.85rem; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em;
}
.meta p { margin: 0; color: var(--muted); max-width: 46ch; }
.host {
  margin-top: 6px;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .8125rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.led {
  flex: none;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent), 0 0 10px var(--accent);
}

.launch {
  align-self: center;
  margin-right: 28px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--onAccent, var(--face));
  font-weight: 600; font-size: 1rem;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease;
}
.unit:hover .launch { transform: translateX(3px); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.unit:active .launch { transform: translateX(1px) scale(.98); }
.unit:focus-visible .face { box-shadow: inset 0 0 0 3px var(--focus); }
.unit:focus-visible .ear { box-shadow: 0 0 0 3px var(--focus); }

/* Blank filler panel */
.blank {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  min-height: 96px;
}
.blank .vent {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), inset 0 -1px 0 rgba(0,0,0,.25);
}

footer.wrap {
  padding: 40px 16px 48px;
  color: var(--graphite-soft);
  font-size: .875rem;
  display: flex; justify-content: flex-end;
}
/* Luke / Vader theme switch */
.saber-switch {
  --blade: #4FA8FF;
  --blade-glow: rgba(79,168,255,.65);
  display: inline-flex; align-items: center; gap: 12px;
  font: inherit; font-size: .9375rem; color: var(--graphite-soft);
  background: none; border: 0; padding: 6px 4px; cursor: pointer;
  border-radius: 8px;
}
.saber-switch[data-side="vader"] {
  --blade: #FF3B3B;
  --blade-glow: rgba(255,59,59,.65);
}
.saber-switch .side { transition: color .2s ease; }
.saber-switch[data-side="luke"] .luke,
.saber-switch[data-side="vader"] .vader { color: var(--graphite); font-weight: 600; }
.saber {
  display: inline-flex; align-items: center; width: 92px; height: 14px;
  transform: rotate(0deg);                 /* blade points right, at Vader */
}
.saber-switch[data-side="luke"] .saber { transform: rotate(180deg); }   /* blade points left, at Luke */
.saber-switch.is-ready .saber { transition: transform .55s cubic-bezier(.45,-0.25,.3,1.35); }
.hilt {
  flex: none; width: 24px; height: 8px; border-radius: 2px;
  background:
    repeating-linear-gradient(90deg, transparent 0 3px, rgba(0,0,0,.45) 3px 4px) 6px 0 / 12px 100% no-repeat,
    linear-gradient(180deg, #E4E6E9, #8D9198 55%, #50545A);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.35);
}
.blade {
  flex: 1; height: 4px; margin-left: 1px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--blade), #fff 50%, var(--blade));
  box-shadow: 0 0 6px 1px var(--blade-glow), 0 0 14px 2px var(--blade-glow);
  transform-origin: left center;
}
.saber-switch:hover .blade { box-shadow: 0 0 8px 2px var(--blade-glow), 0 0 20px 4px var(--blade-glow); }
.saber-switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.empty {
  padding: 40px 28px; text-align: center; color: var(--graphite-soft);
}


/* ---------- Animated network layer ---------- */
#net {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
header.top, main, footer.wrap { position: relative; z-index: 1; }

/* Port LEDs on the rack ears */
.port-led {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4A4F56;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.5);
}
.unit .port-led {
  background: color-mix(in srgb, var(--accent) 55%, #000);
  box-shadow: 0 0 4px color-mix(in srgb, var(--accent) 60%, transparent);
}
.unit .port-led.act {
  background: color-mix(in srgb, var(--accent) 60%, #fff);
  box-shadow: 0 0 6px 1px var(--accent), 0 0 12px var(--accent);
}
.blank .port-led.act { background: #C8A53A; box-shadow: 0 0 6px #C8A53A; }




/* ---------- initiatehack popup ---------- */
body.hack-open { overflow: hidden; }
.hack {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(0, 4, 10, .72);
  backdrop-filter: blur(3px);
  animation: hack-in .18s ease-out;
}
@keyframes hack-in { from { opacity: 0; } to { opacity: 1; } }
.hack-win {
  width: min(880px, 100%);
  border-radius: 12px; overflow: hidden;
  background: #020604;
  box-shadow: 0 0 0 1px rgba(48,209,88,.45), 0 30px 80px rgba(0,0,0,.7), 0 0 80px -10px rgba(48,209,88,.45);
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
.hack-bar {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 9px 12px;
  background: linear-gradient(180deg, #1E2420, #141815);
  font-family: "Familjen Grotesk", system-ui, sans-serif; font-size: .8125rem; color: #8FA394;
}
.hack-title { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hack-close {
  width: 28px; height: 28px; border-radius: 6px;
  border: 0; background: transparent; color: #B7C7BB;
  font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.hack-close:hover { background: rgba(255,255,255,.08); }
.hack-close:focus-visible { outline: 2px solid #30D158; outline-offset: 1px; }
.hack-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    repeating-linear-gradient(0deg, rgba(48,209,88,.05) 0 1px, transparent 1px 3px),
    #020604;
}
.hack-log {
  margin: 0; padding: 14px 16px;
  font: inherit; font-size: .75rem; line-height: 1.45;
  color: #30D158;
  text-shadow: 0 0 6px rgba(48,209,88,.55);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.hack-cmd { color: #E6FFE9; }
.hack-ok { color: #9DFFB5; font-weight: 500; }
.hack-granted {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: clamp(1.75rem, 7vw, 4rem); font-weight: 500; letter-spacing: .12em;
  color: #30D158;
  text-shadow: 0 0 18px #30D158, 0 0 40px rgba(48,209,88,.6);
  background: rgba(2,6,4,.78);
  animation: granted .32s steps(2) 4;
}
@keyframes granted { 50% { opacity: 0; } }
.hack-screen.is-video { background: #000; }
.hack-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 720px) {
  .hack-title { display: none; }
  .hack-bar { grid-template-columns: auto 1fr; }
  .hack-close { justify-self: end; }
  .hack-screen { aspect-ratio: 9 / 12; }
  .hack-screen.is-video { aspect-ratio: 16 / 9; }
}
@media (prefers-reduced-motion: reduce) {
  .hack, .hack-granted { animation: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  header.top { padding: 20px 0 20px; }
  .term-body { padding: 16px 14px 14px; }
  .term-title { display: none; }
  .term-bar { grid-template-columns: auto 1fr; }
  .term-clock { justify-self: end; }
  .t-prompt { font-size: .875rem; gap: 8px; }
  .t-hint { display: none; }
  .t-result { grid-template-columns: 1.4em 1fr; }
  .t-result .t-host { display: none; }
  .t-help { grid-template-columns: 9.5em 1fr; font-size: .8125rem; }
  .unit, .blank { grid-template-columns: 22px 1fr 22px; }
  .ear { padding: 14px 0; }
  .screw { width: 10px; height: 10px; }
  .screw::after { left: 2px; right: 2px; top: 4px; }
  .face { grid-template-columns: 1fr; }
  .display { height: 120px; border-right: 0; border-bottom: 1px solid var(--grid); }
  .meta { padding: 18px 18px 8px; }
  .meta h2 { font-size: 1.5rem; }
  .launch { justify-self: start; margin: 8px 18px 20px; }
  .blank { min-height: 64px; }
  .saber-switch { padding: 6px 14px; border-radius: 999px; background: var(--page); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
}

@media (prefers-reduced-motion: reduce) {
  #rack > li { transition: none; }
  .launch { transition: none; }
  .saber-switch.is-ready .saber { transition: none; }
}
