/* leecox.pro — retro 90s edition. The whole site is a Windows 95 window
   on a teal desktop. Hand-rolled, no frameworks, no external assets. */

:root {
  --desktop: #008080;            /* the immortal teal */
  --chrome: #c0c0c0;             /* window gray */
  --chrome-dark: #808080;
  --chrome-darker: #404040;
  --chrome-light: #ffffff;
  --titlebar-a: #000080;
  --titlebar-b: #1084d0;
  --paper: #ffffff;              /* sunken content field */
  --ink: #000000;
  --link: #0000ee;
  --visited: #551a8b;
  --accent-red: #cc0000;
  --lcd-bg: #001100;
  --lcd: #33ff33;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--desktop);
  /* subtle desktop dither */
  background-image: repeating-conic-gradient(#007878 0% 25%, #008080 0% 50%);
  background-size: 4px 4px;
  color: var(--ink);
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  padding: 14px 8px 40px;
}

/* ============ the window ============ */
.window {
  max-width: 900px;
  margin: 0 auto;
  background: var(--chrome);
  border: 2px solid;
  border-color: var(--chrome-light) var(--chrome-darker) var(--chrome-darker) var(--chrome-light);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.35);
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, var(--titlebar-a), var(--titlebar-b));
  color: #fff;
  padding: 4px 6px;
  font-family: Tahoma, Verdana, sans-serif;
  font-weight: bold;
  font-size: 13px;
}
.titlebar .title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titlebar .title a { color: #fff; text-decoration: none; }
.titlebar-buttons { display: flex; gap: 3px; }
.tb-btn {
  width: 18px; height: 16px;
  background: var(--chrome);
  border: 1px solid;
  border-color: var(--chrome-light) var(--chrome-darker) var(--chrome-darker) var(--chrome-light);
  font-size: 10px; line-height: 13px; text-align: center;
  color: #000; font-family: Tahoma, sans-serif; font-weight: bold;
  user-select: none;
}

/* menu-style nav */
.menubar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px 4px;
  border-bottom: 1px solid var(--chrome-dark);
}
.menubar a {
  color: #000;
  text-decoration: none;
  padding: 2px 10px;
  font-size: 13px;
}
.menubar a:hover {
  background: var(--titlebar-a);
  color: #fff;
}

/* scrolling ticker */
.ticker {
  overflow: hidden;
  background: #000;
  color: var(--lcd);
  font-family: "Courier New", monospace;
  font-size: 13px;
  white-space: nowrap;
  border-top: 1px solid var(--chrome-light);
  border-bottom: 2px solid var(--chrome-dark);
}
.ticker span {
  display: inline-block;
  padding: 3px 0;
  padding-left: 100%;
  animation: ticker 28s linear infinite;
}
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker span { animation: none; padding-left: 8px; }
}

/* content field */
.content {
  margin: 10px;
  background: var(--paper);
  border: 2px solid;
  border-color: var(--chrome-dark) var(--chrome-light) var(--chrome-light) var(--chrome-dark);
  padding: 18px 22px 26px;
}

/* status bar footer */
.statusbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 10px 10px;
  padding: 3px 8px;
  font-size: 11px;
  background: var(--chrome);
  border: 2px solid;
  border-color: var(--chrome-dark) var(--chrome-light) var(--chrome-light) var(--chrome-dark);
}
.statusbar a { color: #000; }

/* ============ typography ============ */
h1, h2, h3 {
  font-family: "Times New Roman", Times, serif;
  line-height: 1.25;
  margin: 0.4em 0 0.5em;
}
h1 { font-size: 30px; }
h2 { font-size: 22px; border-bottom: 2px groove var(--chrome); padding-bottom: 4px; }
h3 { font-size: 17px; font-family: Verdana, sans-serif; }

a { color: var(--link); }
a:visited { color: var(--visited); }
a:hover { color: var(--accent-red); }

hr, .post-content hr {
  border: none;
  border-top: 2px groove var(--chrome);
  margin: 22px 0;
}

blockquote, .post-content blockquote {
  margin: 16px 0;
  padding: 8px 14px;
  background: #ffffcc;
  border: 1px solid #999966;
  color: #333;
}

code, pre {
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
}
code {
  background: #e8e8e8;
  padding: 0 3px;
  border: 1px solid #d0d0d0;
}
pre {
  background: #000;
  color: var(--lcd);
  padding: 12px 14px;
  overflow-x: auto;
  border: 2px solid;
  border-color: var(--chrome-dark) var(--chrome-light) var(--chrome-light) var(--chrome-dark);
  line-height: 1.5;
}
pre code { background: none; border: none; color: inherit; }

img, .post-content img {
  max-width: 100%;
  height: auto;
  border: 2px solid;
  border-color: var(--chrome-dark) var(--chrome-light) var(--chrome-light) var(--chrome-dark);
}

table, .post-content table {
  border-collapse: collapse;
  width: 100%;
  display: block;
  overflow-x: auto;
  font-size: 13px;
}
th, td, .post-content th, .post-content td {
  border: 1px solid var(--chrome-dark);
  padding: 5px 8px;
  text-align: left;
}
th, .post-content th { background: var(--titlebar-a); color: #fff; }

/* ============ home ============ */
.hero { text-align: center; padding: 6px 0 2px; }
.hero h1 {
  margin-bottom: 6px;
  text-shadow: 2px 2px 0 var(--chrome);
}
.lede {
  font-size: 13px;
  max-width: 620px;
  margin: 0 auto 8px;
  color: #222;
}

.counter-row {
  text-align: center;
  margin: 12px 0 4px;
  font-size: 11px;
  color: #444;
}
.counter {
  display: inline-block;
  background: var(--lcd-bg);
  color: var(--lcd);
  font-family: "Courier New", monospace;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 3px;
  padding: 2px 8px;
  border: 2px solid;
  border-color: var(--chrome-dark) var(--chrome-light) var(--chrome-light) var(--chrome-dark);
}

.newbang {
  color: var(--accent-red);
  font-weight: bold;
  font-size: 11px;
  animation: blinker 1.2s step-start infinite;
}
@keyframes blinker { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .newbang { animation: none; } }

/* directory (topics) */
.directory {
  margin: 18px 0;
  border: 2px solid;
  border-color: var(--chrome-light) var(--chrome-darker) var(--chrome-darker) var(--chrome-light);
  background: var(--chrome);
  padding: 10px 14px;
}
.directory h2 {
  margin-top: 0;
  font-size: 16px;
  font-family: Verdana, sans-serif;
  border-bottom: none;
}
.directory ul {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 24px;
}
.directory li { margin: 3px 0; break-inside: avoid; font-size: 13px; }
.directory .dir-count { color: #555; font-size: 11px; }
@media (max-width: 560px) { .directory ul { columns: 1; } }

/* post list table */
.post-table { width: 100%; border: 1px solid var(--chrome-dark); display: table; }
.post-table td { vertical-align: top; }
.post-table tr:nth-child(even) td { background: #f0f0f0; }
.post-table .pt-date { white-space: nowrap; font-size: 11px; color: #333; width: 82px; }
.post-table .pt-topic { white-space: nowrap; font-size: 11px; width: 120px; }
.post-table .pt-title a { font-weight: bold; }
.post-table .pt-desc { font-size: 12px; color: #333; }

/* topic chip = beveled button */
.chip {
  display: inline-block;
  background: var(--chrome);
  color: #000 !important;
  border: 2px solid;
  border-color: var(--chrome-light) var(--chrome-darker) var(--chrome-darker) var(--chrome-light);
  padding: 0 8px;
  font-size: 11px;
  text-decoration: none;
  white-space: nowrap;
}
.chip:active { border-color: var(--chrome-darker) var(--chrome-light) var(--chrome-light) var(--chrome-darker); }
.chip:hover { color: var(--accent-red) !important; }

/* ============ posts ============ */
.post-header h1 { margin-top: 0; }
.post-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #444;
  margin-bottom: 4px;
}
.post-content { margin-top: 14px; }
.post-footer { margin-top: 26px; font-size: 12px; }

/* under construction */
.constructo {
  text-align: center;
  font-weight: bold;
  color: #000;
  background: repeating-linear-gradient(45deg, #ffcc00 0 14px, #000 14px 28px);
  padding: 2px;
  margin: 14px 0;
}
.constructo span {
  display: block;
  background: #ffffcc;
  padding: 6px;
  font-size: 13px;
}

/* badges */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 14px 0 4px;
}
.badge {
  width: 88px;
  height: 31px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: "Courier New", monospace;
  font-size: 9px;
  font-weight: bold;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  border: 1px solid #000;
  padding: 1px;
}
.badge small { font-size: 8px; font-weight: normal; }
.b-jekyll  { background: #000; color: #ff6600; }
.b-any     { background: #003399; color: #fff; }
.b-rss     { background: #ff6600; color: #fff; }
.b-gh      { background: #333; color: #7fff7f; }
.b-y2k     { background: #c0c0c0; color: #000; border-style: outset; border-width: 2px; }
.b-agents  { background: #300a24; color: #34e2e2; }

/* topic pages */
.topic-head { margin-bottom: 10px; }
.topic-head .blurb { font-size: 13px; color: #333; }

.center { text-align: center; }
.small { font-size: 11px; color: #444; }

/* PDF viewer frame */
.pdf-frame {
  width: 100%;
  height: 78vh;
  min-height: 420px;
  border: 2px solid;
  border-color: var(--chrome-dark) var(--chrome-light) var(--chrome-light) var(--chrome-dark);
  background: #666;
}

/* contact form */
.mailform {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 12px;
  align-items: start;
  max-width: 560px;
  background: var(--chrome);
  border: 2px solid;
  border-color: var(--chrome-light) var(--chrome-darker) var(--chrome-darker) var(--chrome-light);
  padding: 14px 16px;
  margin: 14px 0;
}
.mailform label { font-size: 13px; padding-top: 3px; }
.mailform input, .mailform textarea {
  width: 100%;
  font-family: Verdana, sans-serif;
  font-size: 13px;
  padding: 3px 5px;
  background: #fff;
  border: 2px solid;
  border-color: var(--chrome-dark) var(--chrome-light) var(--chrome-light) var(--chrome-dark);
}
.mailform-actions { grid-column: 2; display: flex; gap: 8px; }
.btn95 {
  font-family: Verdana, sans-serif;
  font-size: 13px;
  padding: 3px 14px;
  background: var(--chrome);
  border: 2px solid;
  border-color: var(--chrome-light) var(--chrome-darker) var(--chrome-darker) var(--chrome-light);
  cursor: pointer;
}
.btn95:active { border-color: var(--chrome-darker) var(--chrome-light) var(--chrome-light) var(--chrome-darker); }
@media (max-width: 560px) {
  .mailform { grid-template-columns: 1fr; }
  .mailform-actions { grid-column: 1; }
}

@media (max-width: 600px) {
  body { padding: 6px 2px 30px; }
  .content { margin: 6px; padding: 12px; }
  h1 { font-size: 24px; }
  .post-table .pt-topic { display: none; }
}

/* ==========================================================================
   MODERN THEME ("Dark Mode" toggle) — clean dark blog, same structure,
   zero nostalgia. Activated via <html data-theme="modern">.
   ========================================================================== */

:root[data-theme="modern"] {
  --m-bg: #14181d;
  --m-raised: #1b2129;
  --m-text: #e6e3dc;
  --m-muted: #9aa4af;
  --m-accent: #4cc4bc;
  --m-accent-soft: #4cc4bc22;
  --m-border: #2b333d;
  --m-code-bg: #10141a;
}

[data-theme="modern"] body {
  background: var(--m-bg);
  background-image: none;
  color: var(--m-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  padding: 0 0 3rem;
}

/* window chrome dissolves into a plain page */
[data-theme="modern"] .window {
  max-width: 46rem;
  background: transparent;
  border: none;
  box-shadow: none;
}
[data-theme="modern"] .titlebar {
  background: transparent;
  color: var(--m-text);
  padding: 1.4rem 1.25rem 0;
  font-size: 1.15rem;
}
[data-theme="modern"] .titlebar .title a { color: var(--m-text); font-weight: 700; letter-spacing: -0.01em; }
[data-theme="modern"] .tb-icon,
[data-theme="modern"] .titlebar-buttons { display: none; }

[data-theme="modern"] .menubar {
  border-bottom: 1px solid var(--m-border);
  padding: 0.4rem 1.25rem 0.8rem;
  gap: 0.4rem;
}
[data-theme="modern"] .menubar a {
  color: var(--m-muted);
  font-size: 0.95rem;
  padding: 2px 8px;
  border-radius: 6px;
}
[data-theme="modern"] .menubar a:hover { background: var(--m-accent-soft); color: var(--m-accent); }
[data-theme="modern"] .menubar a u { text-decoration: none; }

/* gags off */
[data-theme="modern"] .ticker,
[data-theme="modern"] .counter-row,
[data-theme="modern"] .badges,
[data-theme="modern"] .badges + .center,
[data-theme="modern"] .newbang { display: none; }

/* content field becomes the page itself */
[data-theme="modern"] .content {
  margin: 0;
  background: transparent;
  border: none;
  padding: 1.5rem 1.25rem 2rem;
}

[data-theme="modern"] .statusbar {
  margin: 0;
  background: transparent;
  border: none;
  border-top: 1px solid var(--m-border);
  color: var(--m-muted);
  font-size: 0.85rem;
  padding: 1rem 1.25rem 0;
}
[data-theme="modern"] .statusbar a { color: var(--m-muted); }
[data-theme="modern"] .statusbar a:hover { color: var(--m-accent); }

/* typography */
[data-theme="modern"] h1,
[data-theme="modern"] h2,
[data-theme="modern"] h3 {
  font-family: inherit;
  letter-spacing: -0.02em;
}
[data-theme="modern"] h1 { font-size: 1.9rem; line-height: 1.2; text-shadow: none; }
[data-theme="modern"] h2 { font-size: 1.4rem; border-bottom: 1px solid var(--m-border); padding-bottom: 0.4rem; }
[data-theme="modern"] h3 { font-size: 1.1rem; }

[data-theme="modern"] a { color: var(--m-accent); }
[data-theme="modern"] a:visited { color: var(--m-accent); }
[data-theme="modern"] a:hover { color: var(--m-text); }

[data-theme="modern"] hr,
[data-theme="modern"] .post-content hr {
  border-top: 1px solid var(--m-border);
}

[data-theme="modern"] blockquote,
[data-theme="modern"] .post-content blockquote {
  background: var(--m-raised);
  border: none;
  border-left: 3px solid var(--m-accent);
  border-radius: 0 6px 6px 0;
  color: var(--m-muted);
}

[data-theme="modern"] code {
  background: var(--m-code-bg);
  border: 1px solid var(--m-border);
  border-radius: 4px;
  color: var(--m-text);
}
[data-theme="modern"] pre {
  background: var(--m-code-bg);
  color: #d4e8e6;
  border: 1px solid var(--m-border);
  border-radius: 8px;
}

[data-theme="modern"] img,
[data-theme="modern"] .post-content img {
  border: none;
  border-radius: 8px;
}

[data-theme="modern"] table th,
[data-theme="modern"] .post-content th { background: var(--m-raised); color: var(--m-text); }
[data-theme="modern"] table th, [data-theme="modern"] table td,
[data-theme="modern"] .post-content th, [data-theme="modern"] .post-content td {
  border-color: var(--m-border);
}

/* hero + lede */
[data-theme="modern"] .hero { text-align: left; padding: 1.5rem 0 0.25rem; }
[data-theme="modern"] .lede { color: var(--m-muted); margin: 0 0 0.5rem; max-width: none; font-size: 1.05rem; }
[data-theme="modern"] .small { color: var(--m-muted); font-size: 0.85rem; }

/* directory becomes a clean card */
[data-theme="modern"] .directory {
  background: var(--m-raised);
  border: 1px solid var(--m-border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}
[data-theme="modern"] .directory .dir-count { color: var(--m-muted); }

/* post table becomes a clean list */
[data-theme="modern"] .post-table { border: none; }
[data-theme="modern"] .post-table tr:nth-child(even) td { background: transparent; }
[data-theme="modern"] .post-table td {
  border: none;
  border-bottom: 1px solid var(--m-border);
  padding: 0.8rem 0.6rem;
}
[data-theme="modern"] .post-table .pt-date { color: var(--m-muted); }
[data-theme="modern"] .post-table .pt-title a { color: var(--m-text); text-decoration: none; font-size: 1.05rem; }
[data-theme="modern"] .post-table .pt-title a:hover { color: var(--m-accent); }
[data-theme="modern"] .post-table .pt-desc { color: var(--m-muted); }

/* chips become pills */
[data-theme="modern"] .chip {
  background: var(--m-accent-soft);
  color: var(--m-accent) !important;
  border: none;
  border-radius: 999px;
  padding: 0.05rem 0.65rem;
}
[data-theme="modern"] .chip:hover { filter: brightness(1.15); }

/* meta rows */
[data-theme="modern"] .post-row-meta { color: var(--m-muted); }

/* under construction becomes a quiet note */
[data-theme="modern"] .constructo {
  background: var(--m-raised);
  border: 1px dashed var(--m-border);
  border-radius: 8px;
  padding: 0;
}
[data-theme="modern"] .constructo span {
  background: transparent;
  color: var(--m-muted);
}

/* forms */
[data-theme="modern"] .mailform {
  background: var(--m-raised);
  border: 1px solid var(--m-border);
  border-radius: 10px;
}
[data-theme="modern"] .mailform input,
[data-theme="modern"] .mailform textarea {
  background: var(--m-bg);
  color: var(--m-text);
  border: 1px solid var(--m-border);
  border-radius: 6px;
}
[data-theme="modern"] .btn95 {
  background: var(--m-accent);
  color: #0b2422;
  border: none;
  border-radius: 6px;
  font-weight: 600;
}
[data-theme="modern"] .btn95:active { filter: brightness(0.9); border: none; }

/* pdf frame */
[data-theme="modern"] .pdf-frame {
  border: 1px solid var(--m-border);
  border-radius: 8px;
  background: #000;
}

/* footer nav links in posts */
[data-theme="modern"] .post-footer { color: var(--m-muted); }
