@font-face {
  font-family: "Comic Neue";
  src: url("../../fonts/ComicNeue-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Comic Neue";
  src: url("../../fonts/ComicNeue-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: "Comic Neue";
  src: url("../../fonts/ComicNeue-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: "Comic Neue";
  src: url("../../fonts/ComicNeue-BoldItalic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
}

:root {
  --bg: #fffde7;
  --bg-alt: #fff9c4;
  --card: #ffffff;
  --border: #6a0dad;
  --heading: #6a0dad;
  --accent: #0000cc;
  --accent-bg: #e8e8ff;
  --hot: #cc0066;
  --text: #111111;
  --muted: #444444;
  --link-color: #0000ee;
  --link-visited: #551a8b;
  --btn-bg: #c0c0c0;
  --btn-hi: #ffffff;
  --btn-lo: #808080;
  --shadow: 4px 4px 0 #6a0dad;
  --code-bg: #000000;
  --code-text: #00ff41;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-alt: #0f0f1a;
  --card: #111122;
  --border: #00ff41;
  --heading: #ff00ff;
  --accent: #00ffff;
  --accent-bg: #001a00;
  --hot: #ff0066;
  --text: #e0e0e0;
  --muted: #aaaaaa;
  --link-color: #00ccff;
  --link-visited: #aa44ff;
  --btn-bg: #224422;
  --btn-hi: #44aa44;
  --btn-lo: #002200;
  --shadow: 3px 3px 0 #00ff41;
  --code-bg: #000000;
  --code-text: #00ff41;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Comic Neue", "Comic Sans", "Chalkboard SE", cursive;
  line-height: 1.6;
  background-color: var(--bg);
}

html[data-theme="dark"] body {
  background-color: var(--bg);
}

a { color: var(--link-color); }
a:visited { color: var(--link-visited); }
a:focus-visible {
  outline: 3px solid var(--hot);
  outline-offset: 3px;
}

.retro-header {
  padding: 24px 16px 20px;
  text-align: center;
  color: #ffff00;
  border-bottom: 6px double #ffff00;
  background: var(--heading);
}

html[data-theme="dark"] .retro-header {
  border-bottom-color: #ffff00;
}

.header-inner {
  max-width: 860px;
  margin: 0 auto;
}

.blink-badge {
  display: inline-block;
  padding: 2px 10px;
  margin-bottom: 8px;
  border-radius: 4px;
  background: #ff0000;
  color: #ffff00;
  font: 700 0.75rem "Comic Neue", cursive;
  letter-spacing: 0.1em;
  animation: idiot-blink 1.2s step-start infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .blink-badge { animation: none; }
}

.main-title {
  margin: 0;
  line-height: 1.1;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.35em;
  flex-wrap: wrap;
}

.title-primary,
.title-secondary,
.tagline,
.btn,
.theme-toggle,
h1, h2, h3, h4, h5, h6 {
  font-family: "Comic Neue", "Comic Sans", cursive;
}

.title-primary {
  font-size: clamp(2.8rem, 8vw, 5rem);
  color: #ffff00;
  text-shadow: 4px 4px 0 #000, -2px -2px 0 #ff00ff;
  font-weight: 900;
}

.title-secondary {
  font-size: clamp(1.8rem, 6vw, 3.2rem);
  color: #00ffff;
  text-shadow: 4px 4px 0 #000, -2px -2px 0 #ff6600;
  font-weight: 900;
}

.tagline {
  margin: 0 auto 4px;
  max-width: 760px;
  color: #ffff00;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 700;
  text-align: center;
}

.subtagline {
  margin: 0 auto;
  max-width: 760px;
  color: #ffffff;
  font-size: 0.9rem;
  font-family: Arial, Helvetica, sans-serif;
  text-align: center;
}

.idiot-nav {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.page-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.content-box {
  margin-bottom: 32px;
  padding: 24px;
  background: var(--card);
  border: 4px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 0;
}

.content-box h2 {
  margin: 0 0 16px;
  color: var(--heading);
  font-size: clamp(1.3rem, 3.5vw, 1.8rem);
  text-shadow: 2px 2px 0 var(--bg-alt);
  border-bottom: 3px dashed var(--border);
  padding-bottom: 8px;
}

p,
li,
.idiot-card p,
.idiot-prose,
.idiot-lede,
.subtagline {
  font-family: Arial, Helvetica, sans-serif;
}

.btn,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  min-height: 42px;
  min-width: 44px;
  border-top: 3px solid var(--btn-hi);
  border-left: 3px solid var(--btn-hi);
  border-right: 3px solid var(--btn-lo);
  border-bottom: 3px solid var(--btn-lo);
  background: var(--btn-bg);
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.btn:active,
.btn:focus-visible,
.theme-toggle:active,
.theme-toggle:focus-visible {
  border-top-color: var(--btn-lo);
  border-left-color: var(--btn-lo);
  border-right-color: var(--btn-hi);
  border-bottom-color: var(--btn-hi);
}

.btn-highlight {
  background: #ffff00;
  color: #0d0d0d;
}

html[data-theme="dark"] .btn-highlight {
  background: #00ff41;
  color: #001100;
}

.theme-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9999;
  padding: 6px 12px;
  font-size: 0.84rem;
}

.idiot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.idiot-list {
  display: grid;
  gap: 16px;
}

.idiot-card {
  background: var(--bg-alt);
  border: 3px solid var(--border);
  padding: 16px;
  border-radius: 0;
}

.idiot-card h3 {
  margin: 0 0 8px;
  color: var(--heading);
}

.idiot-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font: 700 0.82rem "Courier New", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.idiot-post-title {
  margin-top: 0;
}

.idiot-lede {
  font-size: 1.1rem;
  color: var(--muted);
}

.idiot-prose > :first-child { margin-top: 0; }
.idiot-prose > :last-child { margin-bottom: 0; }

.idiot-prose h3,
.idiot-prose h4 {
  color: var(--heading);
  margin-top: 1.6em;
}

.idiot-prose blockquote {
  margin: 1.4rem 0;
  padding: 0.8rem 1rem;
  border-left: 5px solid var(--hot);
  background: var(--bg-alt);
}

.idiot-prose code,
.idiot-prose pre {
  font-family: "Courier New", monospace;
}

.idiot-prose code {
  padding: 0.15em 0.35em;
  background: rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .idiot-prose code {
  background: rgba(255, 255, 255, 0.08);
}

.idiot-prose pre {
  overflow-x: auto;
  padding: 14px;
  background: var(--code-bg);
  color: var(--code-text);
  border: 2px solid var(--border);
}

.idiot-prose img {
  max-width: 100%;
  height: auto;
  border: 3px solid var(--border);
}

.idiot-prose table {
  width: 100%;
  border-collapse: collapse;
}

.idiot-prose th,
.idiot-prose td {
  border: 2px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

.idiot-meta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.retro-footer {
  text-align: center;
  padding: 12px 16px 28px;
  color: var(--muted);
}

.rainbow-hr {
  border: none;
  height: 5px;
  margin: 0 0 14px;
  background: linear-gradient(90deg, #ff2f2f, #ff9f1c, #fff275, #00c853, #00bcd4, #2979ff, #ff5ad9, #ff2f2f, #ff9f1c, #fff275, #00c853, #00bcd4, #2979ff, #ff5ad9);
  background-size: 200% 100%;
  animation: rainbow-slide 3s linear infinite;
}

@keyframes rainbow-slide {
  from { background-position: 0% 0%; }
  to   { background-position: 100% 0%; }
}

@media (prefers-reduced-motion: reduce) {
  .rainbow-hr { animation: none; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--border); }

@media (max-width: 760px) {
  .idiot-grid {
    grid-template-columns: 1fr;
  }

  .content-box {
    padding: 18px;
  }

  .theme-toggle {
    top: auto;
    bottom: 12px;
    right: 12px;
  }
}