

html.crt-mode {
  font-size: 135%;
}

body.crt-mode {


  line-height: 1.5;


  font-weight: 400;
  color: #e8c37a;
  background-color: #0d0a04;
  --crt-phosphor: #ffb000;
  --crt-phosphor-dim: #a87200;
  --crt-glow: rgba(255, 176, 0, 0.35);
  --crt-scan: rgba(0, 0, 0, 0.28);
  --crt-tint-mix: rgba(255, 176, 0, 0.09);
}

body.crt-mode.crt-green {
  color: #9fe89b;
  background-color: #041004;
  --crt-phosphor: #33ff66;
  --crt-phosphor-dim: #1e9940;
  --crt-glow: rgba(51, 255, 102, 0.3);
  --crt-scan: rgba(0, 0, 0, 0.3);
  --crt-tint-mix: rgba(51, 255, 102, 0.08);
}

body.crt-mode h1,
body.crt-mode h2,
body.crt-mode h3,
body.crt-mode h4,
body.crt-mode h5,
body.crt-mode h6,
body.crt-mode a,
body.crt-mode strong,
body.crt-mode code {
  color: var(--crt-phosphor) !important;
  text-shadow: 0 0 6px var(--crt-glow);
  font-weight: 400;
}

body.crt-mode h1 { font-size: 2.2rem; }
body.crt-mode h2 { font-size: 1.7rem; }
body.crt-mode h3 { font-size: 1.4rem; }

body.crt-mode .cm-desc {
  font-size: 0.9rem;
  line-height: 1.5;
}

body.crt-mode *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6) {
  font-family: "VT323", "Fira Code", ui-monospace, monospace !important;
}

body.crt-mode {
  font-family: "VT323", "Fira Code", "OCR A Std", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace !important;
}

body.crt-mode h1,
body.crt-mode h2,
body.crt-mode h3,
body.crt-mode h4,
body.crt-mode h5,
body.crt-mode h6 {
  font-family: "OCR A Std", "Fira Code", ui-monospace, monospace !important;
}

.crt-trigger,
.crt-overlay {
  font-family: "VT323", "Fira Code", ui-monospace, monospace;
}

body.crt-mode .hero-card-desc {
  font-size: 1.15rem;
  line-height: 1.6;
}

body.crt-mode a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

body.crt-mode .btn,
body.crt-mode button {
  background-color: transparent !important;
  border: 1px solid var(--crt-phosphor-dim) !important;
  color: var(--crt-phosphor) !important;
  box-shadow: none !important;
  text-shadow: 0 0 5px var(--crt-glow);
}

body.crt-mode .btn:hover,
body.crt-mode button:hover {
  background-color: var(--crt-tint-mix) !important;
}

body.crt-mode .card,
body.crt-mode .list-group-item,
body.crt-mode .aside-card,
body.crt-mode .featured-section > * {
  background-color: #120d03 !important;
  border-color: var(--crt-phosphor-dim) !important;
}

body.crt-mode hr {
  border-color: var(--crt-phosphor-dim);
  opacity: 0.5;
}

body.crt-mode .text-muted,
body.crt-mode .text-secondary,
body.crt-mode small,
body.crt-mode footer {
  color: var(--crt-phosphor-dim) !important;
}

body.crt-mode .hero-card,
body.crt-mode .cm-card,
body.crt-mode .project-main,
body.crt-mode .project-hero--no-image,
body.crt-mode .cm-ribbon,
body.crt-mode header {
  background-color: #120d03 !important;
}

body.crt-mode .hero-card-thumb,
body.crt-mode .cm-thumb,
body.crt-mode .project-hero {
  background-color: #050302 !important;
}

body.crt-mode .project-hero-overlay {
  background-color: #050302 !important;
}

body.crt-mode .badge-pill {
  background-color: transparent !important;
  border: 1px solid var(--crt-phosphor-dim);
  color: var(--crt-phosphor) !important;
  text-shadow: 0 0 5px var(--crt-glow);
}

body.crt-mode .badge-pill:hover {
  background-color: var(--crt-tint-mix) !important;
  color: var(--crt-phosphor) !important;
}

body.crt-mode .badge-pill.recent-pill {
  background-color: transparent !important;
  border: 1px solid var(--crt-phosphor-dim);
}

body.crt-mode .topic-chip {
  background-color: transparent !important;
  border: 1px solid var(--crt-phosphor-dim) !important;
  color: var(--crt-phosphor) !important;
}

body.crt-mode .topic-chip:hover {
  background-color: var(--crt-tint-mix) !important;
}

body.crt-mode .cyber,
body.crt-mode .year-heading {
  background-color: var(--crt-phosphor) !important;
  color: #0d0a04 !important;
  text-shadow: none !important;
}

body.crt-green .cyber,
body.crt-green .year-heading {
  background-color: var(--crt-phosphor) !important;
  color: #041004 !important;
}

body.crt-mode img,
body.crt-mode svg:not(.crt-unwarped) {
  image-rendering: pixelated;
  filter: sepia(0.6) saturate(1.8) hue-rotate(-18deg) contrast(1.15);
}

body.crt-mode img {
  box-shadow: 0 0 4px var(--crt-glow);
}

.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: var(--crt-tint-mix);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.35s ease;
}

body.crt-mode .crt-overlay {
  opacity: 1;
}

body.crt-mode .crt-overlay {
  backdrop-filter: url(#crt-barrel);
  -webkit-backdrop-filter: url(#crt-barrel);
}

.crt-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.55) 100%),
    repeating-linear-gradient(
      to bottom,
      var(--crt-scan) 0,
      var(--crt-scan) 1px,
      rgba(0, 0, 0, 0) 1px,
      rgba(0, 0, 0, 0) 3px
    );
}

.crt-overlay::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 18vh;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.045) 45%,
    rgba(255, 255, 255, 0.07) 50%,
    rgba(255, 255, 255, 0.045) 55%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: crt-roll 8s linear infinite;
}

@keyframes crt-roll {
  from { transform: translateY(-20vh); }
  to { transform: translateY(120vh); }
}

.crt-trigger {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.6s ease, transform 0.6s ease, visibility 0.6s;
}

.crt-trigger.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.crt-trigger button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 5px;
  border: 0;
  border-radius: 6px;
  background: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  filter: grayscale(1) brightness(1.6);
  transition: filter 0.25s ease, transform 0.12s ease;
}

.crt-trigger button:hover {
  filter: grayscale(0.2) brightness(1.15);
}

.crt-trigger button:active {
  transform: scale(0.88);
}

.crt-swatch-label {
  white-space: nowrap;
}

.crt-trigger button:focus-visible {
  outline: 2px solid #ffb000;
  outline-offset: 2px;
}

body.crt-mode .crt-toggle {
  filter: none;
}

.crt-swatch {
  gap: 6px;
  padding: 3px 9px 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.45);


  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1;
  color: #f0e6d2;


  filter: none;
}

.crt-swatch:hover {
  border-color: rgba(255, 255, 255, 0.85);
  background-color: rgba(255, 255, 255, 0.12);
  filter: none;
}

.crt-swatch-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffb000;
  box-shadow: 0 0 6px rgba(255, 176, 0, 0.8);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

body.crt-green .crt-swatch-dot {
  background: #33ff66;
  box-shadow: 0 0 6px rgba(51, 255, 102, 0.8);
}

.crt-trigger .visually-hidden-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .crt-overlay::after {
    animation: none;
    opacity: 0;
  }
  .crt-trigger,
  .crt-trigger button,
  .crt-swatch-dot {
    transition: none;
  }
}

@media (max-width: 480px) {
  .crt-trigger {
    top: 8px;
    right: 8px;
  }
  .crt-trigger button {
    font-size: 20px;
  }
}
