/* ---------------------------------------------
   Pascal Briner — TEKKIE theme
   Same markup, same structure as the magazine theme.
   Activated via html[data-theme="tekkie"].
   Overrides the shared CSS custom properties, then layers
   terminal/CRT-specific effects on top.
--------------------------------------------- */

html[data-theme="tekkie"] {
  --ink: #3dff9a;
  --ink-soft: #2fae6e;
  --paper: #06100c;
  --paper-alt: #0d1a14;
  --line: #124430;
  --accent: #ff2d6a;
  --warn: #ffb000;
  --grade-b: #9dff3d;
  --mono: "IBM Plex Mono", "Courier New", monospace;
  --serif: "IBM Plex Mono", "Courier New", monospace;
  --serif-text: "IBM Plex Mono", "Courier New", monospace;
  --sans: "IBM Plex Mono", "Courier New", monospace;
}

/* ---- base cleanup: no italics, no serif curves ---- */

html[data-theme="tekkie"] em,
html[data-theme="tekkie"] .pull-quote,
html[data-theme="tekkie"] .cover-deck,
html[data-theme="tekkie"] .deck,
html[data-theme="tekkie"] .toc-num,
html[data-theme="tekkie"] .timeline-item .years,
html[data-theme="tekkie"] .skill-index {
  font-style: normal;
}

html[data-theme="tekkie"] h1,
html[data-theme="tekkie"] h2,
html[data-theme="tekkie"] h3,
html[data-theme="girlie"] h1,
html[data-theme="girlie"] h2,
html[data-theme="girlie"] h3 {
  letter-spacing: 0;
  text-shadow: 0 0 1px currentColor, 0 0 14px color-mix(in srgb, var(--ink) 35%, transparent);
}

html[data-theme="tekkie"] .cover-name .last {
  font-weight: 700;
}

html[data-theme="tekkie"] .cover-name .last::after {
  content: "\2588";
  display: inline-block;
  margin-left: 0.12em;
  font-size: 0.55em;
  vertical-align: middle;
  color: var(--accent);
  animation: tek-blink 1s steps(1) infinite;
  text-shadow: 0 0 8px var(--accent);
}

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

html[data-theme="tekkie"] .type-cursor {
  display: inline-block;
  margin-left: 0.05em;
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent);
  animation: tek-blink 1s steps(1) infinite;
}

/* ---- hex-prefixed numerals (pure CSS, no markup changes) ---- */

html[data-theme="tekkie"] .section-head::before {
  content: "0x" attr(data-num);
  opacity: 0.08;
}

html[data-theme="tekkie"] .toc-num::before,
html[data-theme="tekkie"] .skill-index::before {
  content: "0x";
  opacity: 0.6;
}

/* ---- header: terminal window chrome ---- */

html[data-theme="tekkie"] .site-header {
  background: rgba(6, 16, 12, 0.88);
}

html[data-theme="tekkie"] .masthead-bar span:first-child::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 42px;
  border-radius: 50%;
  background: #ff5f56;
  box-shadow: 16px 0 0 #ffbd2e, 32px 0 0 #27c93f;
  vertical-align: middle;
}

html[data-theme="tekkie"] nav a:hover {
  text-shadow: -1px 0 var(--accent), 1px 0 #00e5ff;
}

/* ---- buttons / links glow ---- */

html[data-theme="tekkie"] .btn:hover,
html[data-theme="tekkie"] .text-link:hover,
html[data-theme="tekkie"] .toc-list a:hover .toc-title {
  text-shadow: 0 0 8px var(--accent);
}

/* ---- hero photo: green CRT duotone + scanlines ---- */

html[data-theme="tekkie"] .cover-figure img,
html[data-theme="tekkie"] .hobby-card img {
  filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5);
}

html[data-theme="tekkie"] .cover-figure .frame::after {
  background: linear-gradient(180deg, rgba(6, 16, 12, 0.1), rgba(6, 16, 12, 0.6) 100%);
}

html[data-theme="tekkie"] .cover-figure .frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(61, 255, 154, 0) 0px,
    rgba(61, 255, 154, 0) 2px,
    rgba(61, 255, 154, 0.07) 3px,
    rgba(61, 255, 154, 0.07) 4px
  );
  mix-blend-mode: screen;
  animation-name: tek-outage-1-noise;
  animation-duration: 5s;
  animation-iteration-count: infinite;
  animation-timing-function: steps(1, end);
  animation-delay: -2s;
}

/* ---- outage cycle on the hero photo: 5 rotating "modes" ----
   JS (initOutageEffects) picks a random data-outage value (1-5) on
   load and again on every animationiteration, so each 5s loop can
   show a different outage "flavor" without ever restarting
   mid-glitch (the swap happens right at the 0%/100% boundary, where
   every mode looks identical: the plain, undistorted photo). ---- */

html[data-theme="tekkie"] .cover-figure {
  position: relative;
}

html[data-theme="tekkie"] .cover-figure .frame img {
  animation-name: tek-outage-1-img;
  animation-duration: 5s;
  animation-iteration-count: infinite;
  animation-timing-function: steps(1, end);
  animation-delay: -2s;
}

html[data-theme="tekkie"] .cover-figure::after {
  content: "";
  position: absolute;
  z-index: 3;
  left: 28px;
  top: 28px;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 12px;
  background: rgba(6, 16, 12, 0.85);
  border: 1px solid currentColor;
  opacity: 0;
  animation-name: tek-outage-1-text;
  animation-duration: 5s;
  animation-iteration-count: infinite;
  animation-timing-function: steps(1, end);
  animation-delay: -2s;
}

/* mode 5 ("no signal") reads as a centered test-card message instead
   of a corner status chip */
html[data-theme="tekkie"] .cover-figure[data-outage="5"]::after {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 1rem;
  padding: 14px 22px;
}

html[data-theme="tekkie"] .cover-figure[data-outage="2"] .frame img { animation-name: tek-outage-2-img; }
html[data-theme="tekkie"] .cover-figure[data-outage="2"] .frame::before { animation-name: tek-outage-2-noise; }
html[data-theme="tekkie"] .cover-figure[data-outage="2"]::after { animation-name: tek-outage-2-text; }

html[data-theme="tekkie"] .cover-figure[data-outage="3"] .frame img { animation-name: tek-outage-3-img; }
html[data-theme="tekkie"] .cover-figure[data-outage="3"] .frame::before { animation-name: tek-outage-3-noise; }
html[data-theme="tekkie"] .cover-figure[data-outage="3"]::after { animation-name: tek-outage-3-text; }

html[data-theme="tekkie"] .cover-figure[data-outage="4"] .frame img { animation-name: tek-outage-4-img; }
html[data-theme="tekkie"] .cover-figure[data-outage="4"] .frame::before { animation-name: tek-outage-4-noise; }
html[data-theme="tekkie"] .cover-figure[data-outage="4"]::after { animation-name: tek-outage-4-text; }

html[data-theme="tekkie"] .cover-figure[data-outage="5"] .frame img { animation-name: tek-outage-5-img; }
html[data-theme="tekkie"] .cover-figure[data-outage="5"] .frame::before { animation-name: tek-outage-5-noise; }
html[data-theme="tekkie"] .cover-figure[data-outage="5"]::after { animation-name: tek-outage-5-text; }

/* ---- mode 1: VHS tracking tear — horizontal band shear + tearing ---- */

@keyframes tek-outage-1-img {
  0%, 79% {
    filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5);
    clip-path: inset(0 0 0 0);
    transform: translateX(0);
  }
  80% {
    filter: grayscale(1) brightness(1.6) contrast(2) sepia(1) hue-rotate(68deg) saturate(6);
    clip-path: inset(12% 0 42% 0);
    transform: translateX(-10px);
  }
  81% { filter: brightness(0.05); clip-path: inset(0 0 0 0); transform: translateX(0); }
  82% {
    filter: grayscale(1) brightness(1.7) contrast(2.2) hue-rotate(68deg) saturate(3);
    clip-path: inset(55% 0 8% 0);
    transform: translateX(9px);
  }
  83% { filter: brightness(0.05); clip-path: inset(0 0 0 0); transform: translateX(0); }
  84% {
    filter: grayscale(1) brightness(1.8) contrast(2) hue-rotate(68deg) saturate(5);
    clip-path: inset(22% 0 50% 0);
    transform: translateX(-7px);
  }
  85%, 86% { filter: brightness(0.04); clip-path: inset(0 0 0 0); transform: translateX(0); }
  87% {
    filter: grayscale(1) brightness(1.5) contrast(2) hue-rotate(68deg) saturate(5);
    clip-path: inset(38% 0 15% 0);
    transform: translateX(6px);
  }
  88% {
    filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5);
    clip-path: inset(0 0 0 0);
    transform: translateX(-3px);
  }
  89% { clip-path: inset(48% 0 18% 0); transform: translateX(5px); }
  90%, 94% {
    filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5);
    clip-path: inset(0 0 0 0);
    transform: translateX(0);
  }
  95% { transform: translateX(3px); }
  96% { transform: translateX(-2px); }
  97% { filter: grayscale(1) brightness(1.5) contrast(1.6) hue-rotate(68deg) saturate(5); transform: translateX(0); }
  98%, 100% {
    filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5);
    clip-path: inset(0 0 0 0);
    transform: translateX(0);
  }
}

@keyframes tek-outage-1-noise {
  0%, 79% { opacity: 1; }
  80%, 87% { opacity: 1; background-size: 100% 3px; mix-blend-mode: difference; }
  88%, 100% { opacity: 1; }
}

@keyframes tek-outage-1-text {
  0%, 79% { content: ""; opacity: 0; color: var(--accent); }
  80%, 86% { content: "LINK UNSTABLE"; opacity: 1; color: var(--accent); }
  87%, 89% { content: "SIGNAL LOST"; opacity: 1; color: var(--accent); }
  90%, 95% { content: "RECONNECTING\2026"; opacity: 1; color: var(--accent); }
  96%, 99% { content: "LINK RE-ESTABLISHED"; opacity: 1; color: var(--ink); }
  100% { content: ""; opacity: 0; color: var(--ink); }
}

/* ---- mode 2: chromatic aberration — RGB channels desyncing ---- */

@keyframes tek-outage-2-img {
  0%, 79% {
    filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5);
    transform: translateX(0);
  }
  80% { filter: hue-rotate(260deg) saturate(8) contrast(1.6); transform: translateX(-4px); }
  81% { filter: hue-rotate(-200deg) saturate(10) contrast(1.8); transform: translateX(4px); }
  82% { filter: brightness(0.05); transform: translateX(0); }
  83% { filter: hue-rotate(140deg) saturate(9) contrast(1.5); transform: translateX(-5px); }
  84% { filter: hue-rotate(-140deg) saturate(9) contrast(1.5); transform: translateX(5px); }
  85%, 86% { filter: brightness(0.04); transform: translateX(0); }
  87% { filter: hue-rotate(90deg) saturate(7) contrast(1.4); transform: translateX(-3px); }
  88% {
    filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5);
    transform: translateX(-2px);
  }
  89% { filter: hue-rotate(-60deg) saturate(6); transform: translateX(3px); }
  90%, 94% {
    filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5);
    transform: translateX(0);
  }
  95% { filter: hue-rotate(20deg) saturate(5); transform: translateX(1px); }
  96% { filter: hue-rotate(-20deg) saturate(5); transform: translateX(-1px); }
  97%, 100% {
    filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5);
    transform: translateX(0);
  }
}

@keyframes tek-outage-2-noise {
  0%, 79% { opacity: 1; }
  80%, 89% { opacity: 1; background-size: 100% 2px; mix-blend-mode: difference; }
  90%, 100% { opacity: 1; }
}

@keyframes tek-outage-2-text {
  0%, 79% { content: ""; opacity: 0; color: var(--accent); }
  80%, 86% { content: "CHROMA DESYNC"; opacity: 1; color: var(--accent); }
  87%, 89% { content: "RGB CHANNELS MISALIGNED"; opacity: 1; color: var(--accent); }
  90%, 95% { content: "REALIGNING COLOR\2026"; opacity: 1; color: var(--accent); }
  96%, 99% { content: "COLOR LOCKED"; opacity: 1; color: var(--ink); }
  100% { content: ""; opacity: 0; color: var(--ink); }
}

/* ---- mode 3: static / snow burst — grain and brightness flicker, no tearing ---- */

@keyframes tek-outage-3-img {
  0%, 79% { filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5); }
  80% { filter: grayscale(1) contrast(3) brightness(1.4); }
  81% { filter: grayscale(1) contrast(4) brightness(0.3); }
  82% { filter: grayscale(1) contrast(2.5) brightness(1.7); }
  83% { filter: brightness(0.05); }
  84% { filter: grayscale(1) contrast(3.5) brightness(1.2); }
  85%, 86% { filter: brightness(0.05); }
  87% { filter: grayscale(1) contrast(3) brightness(1.5); }
  88% { filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5); }
  89% { filter: grayscale(1) contrast(2) brightness(1.3); }
  90%, 94% { filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5); }
  95% { filter: contrast(1.8) brightness(1.2) hue-rotate(68deg); }
  96% { filter: contrast(1.3) hue-rotate(68deg); }
  97%, 100% { filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5); }
}

@keyframes tek-outage-3-noise {
  0%, 79% { opacity: 1; }
  80%, 89% { opacity: 1; background-size: 100% 1px; mix-blend-mode: difference; }
  90%, 100% { opacity: 1; }
}

@keyframes tek-outage-3-text {
  0%, 79% { content: ""; opacity: 0; color: var(--accent); }
  80%, 86% { content: "STATIC DETECTED"; opacity: 1; color: var(--accent); }
  87%, 89% { content: "SNR CRITICAL"; opacity: 1; color: var(--accent); }
  90%, 95% { content: "FILTERING NOISE\2026"; opacity: 1; color: var(--accent); }
  96%, 99% { content: "SIGNAL CLEAN"; opacity: 1; color: var(--ink); }
  100% { content: ""; opacity: 0; color: var(--ink); }
}

/* ---- mode 4: vertical-hold roll — picture rolls like a CRT out of sync ---- */

@keyframes tek-outage-4-img {
  0%, 79% {
    filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5);
    transform: translateY(0);
  }
  80% { filter: brightness(1.3) contrast(1.4) hue-rotate(68deg) grayscale(1) sepia(1); transform: translateY(-18%); }
  81% { transform: translateY(10%); }
  82% { filter: brightness(0.05); transform: translateY(0); }
  83% { filter: brightness(1.3) hue-rotate(68deg) grayscale(1) sepia(1); transform: translateY(-25%); }
  84% { transform: translateY(15%); }
  85%, 86% { filter: brightness(0.04); transform: translateY(0); }
  87% { filter: brightness(1.2) hue-rotate(68deg) grayscale(1) sepia(1); transform: translateY(-12%); }
  88% {
    filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5);
    transform: translateY(0);
  }
  89% { transform: translateY(8%); }
  90%, 94% {
    filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5);
    transform: translateY(0);
  }
  95% { transform: translateY(-4%); }
  96% { transform: translateY(2%); }
  97%, 100% {
    filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5);
    transform: translateY(0);
  }
}

@keyframes tek-outage-4-noise {
  0%, 79% { opacity: 1; }
  80%, 89% { opacity: 1; background-size: 100% 6px; mix-blend-mode: screen; }
  90%, 100% { opacity: 1; }
}

@keyframes tek-outage-4-text {
  0%, 79% { content: ""; opacity: 0; color: var(--accent); }
  80%, 86% { content: "VERTICAL SYNC LOST"; opacity: 1; color: var(--accent); }
  87%, 89% { content: "PICTURE ROLLING"; opacity: 1; color: var(--accent); }
  90%, 95% { content: "ADJUSTING HOLD\2026"; opacity: 1; color: var(--accent); }
  96%, 99% { content: "SYNC LOCKED"; opacity: 1; color: var(--ink); }
  100% { content: ""; opacity: 0; color: var(--ink); }
}

/* ---- mode 5: total blackout — a longer, deliberate "no signal" card ---- */

@keyframes tek-outage-5-img {
  0%, 79% {
    filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5);
  }
  80%, 89% { filter: brightness(0.03); }
  90%, 94% { filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5); }
  95% { filter: brightness(1.4) contrast(1.3) hue-rotate(68deg) grayscale(1) sepia(1); }
  96% { filter: brightness(1.15) hue-rotate(68deg) grayscale(1) sepia(1); }
  97%, 100% { filter: grayscale(1) brightness(0.95) contrast(1.35) sepia(1) hue-rotate(68deg) saturate(4.5); }
}

@keyframes tek-outage-5-noise {
  0%, 79% { opacity: 1; }
  80%, 89% { opacity: 0; }
  90%, 100% { opacity: 1; }
}

@keyframes tek-outage-5-text {
  0%, 79% { content: ""; opacity: 0; color: var(--accent); }
  80%, 82% { content: "CARRIER LOST"; opacity: 1; color: var(--accent); }
  83%, 93% { content: "NO SIGNAL"; opacity: 1; color: var(--accent); }
  94%, 99% { content: "CARRIER RESTORED"; opacity: 1; color: var(--ink); }
  100% { content: ""; opacity: 0; color: var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="tekkie"] .cover-figure .frame img,
  html[data-theme="tekkie"] .cover-figure .frame::before,
  html[data-theme="tekkie"] .cover-figure::after {
    animation: none;
  }
  html[data-theme="tekkie"] .cover-figure::after {
    opacity: 0;
  }
}

/* ---- hobby number badges ---- */

html[data-theme="tekkie"] .hobby-num {
  background: rgba(6, 16, 12, 0.75);
  color: var(--ink);
  border: 1px solid var(--ink);
  text-shadow: 0 0 6px var(--ink);
}

/* ---- ASCII-style LED progress bars ---- */

html[data-theme="tekkie"] .skill-bar {
  height: 10px;
  background: repeating-linear-gradient(
    90deg,
    var(--line) 0px,
    var(--line) 3px,
    transparent 3px,
    transparent 6px
  );
}

html[data-theme="tekkie"] .skill-bar span {
  background: var(--ink);
  box-shadow: 0 0 8px var(--ink);
}

/* ---- blueprint grid reads as a circuit board ---- */

html[data-theme="tekkie"] body::before {
  opacity: 0.5;
}

/* ---- CRT scanline + flicker overlay ---- */

html[data-theme="tekkie"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 1px,
    rgba(0, 0, 0, 0.2) 2px,
    rgba(0, 0, 0, 0.2) 3px
  );
  mix-blend-mode: overlay;
  opacity: 0.5;
  animation: tek-flicker 6s infinite;
}

@keyframes tek-flicker {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.55; }
  52% { opacity: 0.3; }
  54% { opacity: 0.5; }
}

/* ---- selection + scrollbar ---- */

html[data-theme="tekkie"] ::selection,
html[data-theme="girlie"] ::selection {
  background: var(--accent);
  color: var(--paper);
}

html[data-theme="tekkie"] ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
html[data-theme="tekkie"] ::-webkit-scrollbar-track {
  background: var(--paper);
}
html[data-theme="tekkie"] ::-webkit-scrollbar-thumb {
  background: var(--ink-soft);
  border: 2px solid var(--paper);
}
html[data-theme="tekkie"] ::-webkit-scrollbar-thumb:hover {
  background: var(--ink);
}

/* ---- background canvases: matrix rain + cursor trail ---- */

#matrix-rain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;
  display: none;
}

#cursor-trail {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  display: none;
}

html[data-theme="tekkie"] #matrix-rain,
html[data-theme="tekkie"] #cursor-trail {
  display: block;
}

/* ---- boot sequence overlay ---- */

#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--paper);
  display: none;
  flex-direction: column;
  align-items: flex-start;
  padding: 48px;
  opacity: 1;
  transition: opacity 0.6s ease;
}

html[data-theme="tekkie"] #boot-screen.boot-active,
html[data-theme="girlie"] #boot-screen.boot-active {
  display: flex;
}

#boot-screen.boot-done {
  opacity: 0;
  pointer-events: none;
}

#boot-log {
  margin: 0;
  color: var(--ink);
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  white-space: pre-wrap;
  text-shadow: 0 0 6px color-mix(in srgb, var(--ink) 50%, transparent);
}

.boot-disclaimer {
  display: inline-block;
  animation: boot-disclaimer-morph 1.8s ease forwards;
}

@keyframes boot-disclaimer-morph {
  0% { color: var(--ink); text-shadow: 0 0 6px color-mix(in srgb, var(--ink) 50%, transparent); }
  100% { color: var(--accent); text-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .boot-disclaimer {
    animation: none;
    color: var(--accent);
  }
}

.boot-ascii {
  display: block;
  line-height: 1.05;
  white-space: pre;
  font-size: 0.5rem;
}

@media (max-width: 600px) {
  #boot-screen {
    padding: 20px;
  }
  .boot-ascii {
    font-size: 0.26rem;
  }
}

/* ---- login screen ---- */

#login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--paper);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px;
}

#login-screen.login-active {
  display: flex;
}

#login-log {
  margin: 0 0 4px;
  width: min(520px, 100%);
  color: var(--ink);
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  white-space: pre-wrap;
  text-shadow: 0 0 6px color-mix(in srgb, var(--ink) 50%, transparent);
}

.login-input-row {
  display: flex;
  width: min(520px, 100%);
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.85rem;
  color: var(--ink);
  text-shadow: 0 0 6px color-mix(in srgb, var(--ink) 50%, transparent);
}

#login-prompt-label {
  white-space: pre;
}

#login-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: inherit;
  font: inherit;
  text-shadow: inherit;
  caret-color: var(--ink);
}

/* ---- scrolling status ticker ---- */

.ticker-bar {
  display: none;
  overflow: hidden;
  height: 26px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 60%, transparent);
}

html[data-theme="tekkie"] .ticker-bar,
html[data-theme="girlie"] .ticker-bar {
  display: block;
}

.ticker-track {
  display: inline-flex;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  line-height: 26px;
  animation: tek-ticker 38s linear infinite;
  will-change: transform;
}

.ticker-track span {
  padding: 0 1.5em;
}

.ticker-track span::after {
  content: "//";
  margin-left: 1.5em;
  color: var(--accent);
}

@keyframes tek-ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---- uptime counter ---- */

.uptime-counter {
  font-variant-numeric: tabular-nums;
}

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

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  width: 100%;
}

/* ---- terminal widget ---- */

/* Neon glow on the corner buttons (terminal toggle + theme switchers)
   -- also applied to girlie (reskinned via the shared color vars, same
   as the rest of girlie's "keep the fun stuff, just recolor it"
   approach), deliberately not to easy mode's flat/plain look. */
html[data-theme="tekkie"] .corner-btn,
html[data-theme="girlie"] .corner-btn {
  box-shadow: 0 0 14px color-mix(in srgb, var(--ink) 25%, transparent);
}

html[data-theme="tekkie"] .corner-btn:hover,
html[data-theme="girlie"] .corner-btn:hover {
  box-shadow: 0 0 20px color-mix(in srgb, var(--ink) 45%, transparent);
}

.terminal-panel {
  position: fixed;
  right: 20px;
  bottom: 76px;
  z-index: 1002;
  width: min(520px, calc(100vw - 40px));
  height: 360px;
  background: color-mix(in srgb, var(--paper) 97%, transparent);
  border: 1px solid var(--ink);
  box-shadow: 0 0 28px color-mix(in srgb, var(--ink) 30%, transparent);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.terminal-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.terminal-header button {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.terminal-header button:hover {
  color: var(--accent);
}

.terminal-output {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
}

.terminal-output .cmd-line { color: var(--ink-soft); }
.terminal-output .cmd-line::before { content: "guest@briner-net:~$ "; color: var(--accent); }

.terminal-output a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.terminal-output a:hover { color: var(--accent); }

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
}

.terminal-prompt {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  white-space: nowrap;
}

.terminal-input-row input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.78rem;
  caret-color: var(--ink);
}

/* ---- konami easter egg ---- */

body.konami-active {
  animation: tek-konami 4s linear;
}

@keyframes tek-konami {
  0% { filter: hue-rotate(0deg) saturate(1); }
  50% { filter: hue-rotate(360deg) saturate(2.2); }
  100% { filter: hue-rotate(720deg) saturate(1); }
}

.tek-toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translate(-50%, 0);
  z-index: 2000;
  background: color-mix(in srgb, var(--paper) 95%, transparent);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding: 10px 18px;
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 40%, transparent);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.tek-toast.show {
  opacity: 1;
  transform: translate(-50%, -8px);
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track,
  body.konami-active {
    animation: none;
  }
  #matrix-rain,
  #cursor-trail {
    display: none !important;
  }
}

/* ---- header grew a 26px ticker row; re-offset dependents ---- */

html[data-theme="tekkie"] .cover {
  padding-top: 126px;
}

html[data-theme="tekkie"] .cover-grid {
  min-height: calc(100vh - 126px);
}

@media (max-width: 720px) {
  html[data-theme="tekkie"] nav {
    top: 126px;
  }
}

/* ---- Tools section: extra per-theme flourishes ----
   Structure/colors live in css/style.css (shared across themes); this
   just layers glow back on for the two themes that want it, and dark
   date-picker chrome for tekkie specifically (girlie/easy both want
   the browser's default light picker against their light pages). */

html[data-theme="tekkie"] .btc-tool-form button:hover,
html[data-theme="girlie"] .btc-tool-form button:hover {
  box-shadow: 0 0 14px color-mix(in srgb, var(--ink) 35%, transparent);
}

html[data-theme="tekkie"] .btc-invest-form input[type="date"] {
  color-scheme: dark;
}

html[data-theme="tekkie"] .mail-hop::before,
html[data-theme="girlie"] .mail-hop::before {
  box-shadow: 0 0 8px color-mix(in srgb, var(--ink) 30%, transparent);
}

html[data-theme="tekkie"] .ssl-grade,
html[data-theme="girlie"] .ssl-grade {
  text-shadow: 0 0 10px currentColor;
  box-shadow: 0 0 14px currentColor inset, 0 0 14px currentColor;
}

html[data-theme="tekkie"] .swatch-price,
html[data-theme="girlie"] .swatch-price { box-shadow: 0 0 4px var(--ink); }
html[data-theme="tekkie"] .swatch-ma50,
html[data-theme="girlie"] .swatch-ma50 { box-shadow: 0 0 4px var(--warn); }
html[data-theme="tekkie"] .swatch-ma200,
html[data-theme="girlie"] .swatch-ma200 { box-shadow: 0 0 4px var(--accent); }


/* iOS Safari auto-zooms the page when a focused input's font-size is
   under 16px. Bump these two up just on narrow viewports so tapping
   into the terminal or login prompt doesn't jolt-zoom the page.
   (Placed at the end of the file so it wins the cascade over the
   earlier same-specificity rules regardless of media-query order.) */
@media (max-width: 600px) {
  .terminal-input-row input,
  #login-input,
  .btc-tool-form input,
  .btc-tool-form textarea {
    font-size: 16px;
  }
}
