:root{
  color-scheme: dark;

  /* Dark corporate (security + AI) */
  --bg: #070b12;
  --bg2:#0b1020;
  --fg: #eaf0ff;
  --muted: rgba(234,240,255,.72);
  --border: rgba(234,240,255,.14);
  --card: rgba(234,240,255,.045);
  --card2: rgba(234,240,255,.065);
  --link: #eaf0ff;
  --focus: #9ec3ff;
  --accent: #6ea8ff;
  --shadow: 0 14px 40px rgba(0,0,0,.35);
}

:root[data-theme="retro"]{
  color-scheme: dark;
  --bg:#000000;
  --bg2:#000000;
  --fg:#b7ffb7;
  --muted: rgba(183,255,183,.74);
  --border: rgba(183,255,183,.35);
  --card: rgba(183,255,183,.06);
  --card2: rgba(183,255,183,.09);
  --link:#b7ffb7;
  --focus:#b7ffb7;
  --accent:#b7ffb7;
  --shadow:none;
}

:root[data-theme="retro"] body{
  background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color:var(--fg);
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
  font-size:17px;
  line-height:1.65;
}

a{
  color:var(--link);
  text-decoration: none;
}

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

a:focus{ outline:2px solid var(--focus); outline-offset:3px; }

.wrap{max-width:1120px;margin:0 auto;padding:54px 18px}

header.site{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:28px;
  padding:14px 16px;
  border:1px solid var(--border);
  border-radius:16px;
  background:rgba(234,240,255,.04);
  backdrop-filter: blur(10px);
}

/* Post body card */
article.post{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  padding:24px 26px;
}

.post-meta{margin:6px 0 18px}

.post-content, .post{
  font-size:1rem;
}

.post-content ul, .post ul{margin-top:12px}

/* Ad slot styling (when inserted) */
.ad-slot{
  border:1px dashed var(--border);
  border-radius:14px;
  padding:18px;
  margin:22px 0;
  text-align:center;
  color:var(--muted);
}

/* Related posts block (if added) */
.related-posts{margin-top:28px}
.related-posts .posts-grid{margin-top:10px}

.brand a{
  font-weight:850;
  letter-spacing:-.02em;
  text-decoration:none;
}

nav.small a{margin-left:14px;text-decoration:none;color:var(--muted)}
nav.small a:hover{color:var(--fg);text-decoration:none}

.card{background:var(--card);border:1px solid var(--border);border-radius:16px;padding:18px;margin:16px 0;box-shadow:none}

.muted{color:var(--muted)}
.small{font-size:14px}

h1{margin:0 0 14px;font-size:50px;letter-spacing:-.04em;line-height:1.08}

h2{margin:34px 0 14px;font-size:24px;letter-spacing:-.02em}

h3{margin:0 0 10px;font-size:19px;letter-spacing:-.01em}

p{line-height:1.65}

ul,ol{margin:10px 0 0 20px;line-height:1.55}
li{margin:6px 0}

hr{border:0;border-top:1px solid var(--border);margin:24px 0}

footer{margin-top:40px;padding-top:18px;border-top:1px solid var(--border)}

.badge{
  display:inline-flex;
  align-items:center;
  padding:3px 10px;
  border:1px solid rgba(110,168,255,.25);
  border-radius:999px;
  background:rgba(110,168,255,.10);
  font-size:12px;
  color:var(--fg);
}

.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}

/* Posts index */
.posts-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px;margin-top:14px}
.post-card{margin:0;padding:18px;background:var(--card);transition:transform .12s ease, background .12s ease, border-color .12s ease}
.post-card:hover{transform:translateY(-2px);background:var(--card2);border-color: rgba(110,168,255,.25)}
.post-title{margin:0 0 10px;font-size:18px;line-height:1.25;letter-spacing:-.01em}
.post-title a{color:var(--fg)}
.post-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:13px;color:var(--muted)}
.post-author{font-style:italic;color:var(--muted);opacity:.85}

.pills{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:14px 0 0}
.pill{
  display:inline-flex;
  gap:6px;
  align-items:baseline;
  padding:6px 10px;
  border:1px solid var(--border);
  border-radius:999px;
  background:transparent;
  font-size:13px;
  color:var(--fg);
  text-decoration:none;
}
.pill:hover{background:var(--card)}
.pill{border-color: rgba(234,240,255,.16); color: var(--muted)}
.pill:hover{background:rgba(234,240,255,.06); color: var(--fg)}
.pill.active{border-color: rgba(110,168,255,.45); color: var(--fg); background: rgba(110,168,255,.10)}

.pagination{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;align-items:center;margin:22px 0 0}
.pagination .page{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:36px;
  padding:6px 10px;
  border:1px solid var(--border);
  border-radius:10px;
  background:transparent;
  color:var(--fg);
  font-size:14px;
  text-decoration:none;
}
.pagination .page:hover{background:var(--card)}
.pagination .page.current{background:var(--card)}
.pagination .dots{color:var(--muted);padding:0 4px}

/* Home hero + CTA */
.hero{margin:0 0 8px;padding:10px 0 2px}
.hero p{max-width:70ch}
.hero-cta{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:11px 14px;
  border-radius:14px;
  border:1px solid rgba(110,168,255,.35);
  background:rgba(110,168,255,.16);
  color:var(--fg);
  text-decoration:none;
  font-weight:700;
}
.btn:hover{background:rgba(110,168,255,.22)}
.btn.secondary{border-color:rgba(234,240,255,.18);background:rgba(234,240,255,.04);color:var(--muted)}
.btn.secondary:hover{background:rgba(234,240,255,.07);color:var(--fg)}
.section-title{margin-top:26px}




/* Retro toggle UI + overrides */
:root[data-theme="retro"] body{
  background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

:root[data-theme="retro"] a{
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
:root[data-theme="retro"] a:hover{ text-decoration-thickness: 2px; color: var(--fg); }

:root[data-theme="retro"] .posts-grid{display:block}

/* Newspaper-style columns for the main feed */
:root[data-theme="retro"] .latest-grid{
  column-count: 1;
  column-gap: 16px;
}
@media (min-width: 820px){
  :root[data-theme="retro"] .latest-grid{ column-count: 2; }
}
@media (min-width: 1100px){
  :root[data-theme="retro"] .latest-grid{ column-count: 3; }
}

:root[data-theme="retro"] .latest-grid .post-card{
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  page-break-inside: avoid;
  margin: 0 0 14px;
  transform:none;
}

:root[data-theme="retro"] .top-grid{display:block}
:root[data-theme="retro"] .top-grid .post-card{border-radius:0;margin:0 0 14px;transform:none}

:root[data-theme="retro"] .post-card:hover{transform:none;background:transparent;border-color:var(--border)}

:root[data-theme="retro"] .btn{border-radius:0;background:transparent;color:var(--fg);border-color:var(--border)}
:root[data-theme="retro"] .btn:hover{background:transparent}

.theme-toggle{
  margin-left:14px;
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  padding:8px 12px 8px 10px;
  min-width:132px;

  /* "CRT device" body */
  border-radius:14px;
  border:2px solid rgba(40,40,45,.95);
  background: linear-gradient(180deg, rgba(30,30,34,.98), rgba(12,12,14,.98));
  color: rgba(235,245,255,.92);

  box-shadow:
    0 10px 26px rgba(0,0,0,.32),
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 -1px 0 rgba(0,0,0,.65);

  cursor:pointer;
  font: inherit;
  font-weight:900;
  letter-spacing:-.01em;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}

/* little "knob" */
.theme-toggle::before{
  content:"";
  width:10px;
  height:10px;
  border-radius:999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.35), rgba(255,255,255,.05) 35%, rgba(0,0,0,.65) 70%);
  border:1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  flex:0 0 auto;
}

.theme-toggle .theme-screen{
  position:relative;
  width:28px;
  height:22px;
  border-radius:7px;
  background: radial-gradient(120% 120% at 35% 30%, rgba(80,150,255,.22), rgba(20,25,40,.92));
  border:1px solid rgba(180,200,255,.18);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.55),
    inset 0 10px 18px rgba(0,0,0,.45);
  overflow:hidden;
  flex:0 0 auto;
}

/* scanlines on the screen */
.theme-toggle .theme-screen::after{
  content:"";
  position:absolute;
  inset:0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,.35) 0px,
    rgba(0,0,0,.35) 1px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0) 4px
  );
  mix-blend-mode: multiply;
  pointer-events:none;
  opacity:.55;
}

/* ----- connect/disconnect vibes (like plugging a console) ----- */
.theme-toggle .theme-screen .theme-ico{transform:translateZ(0)}

/* static/noise overlay */
.theme-toggle .theme-screen .crt-noise{
  position:absolute;
  inset:0;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,.12) 0px, rgba(255,255,255,.12) 1px, rgba(0,0,0,0) 2px, rgba(0,0,0,0) 5px),
    radial-gradient(circle at 40% 30%, rgba(255,255,255,.20), rgba(255,255,255,0) 55%),
    radial-gradient(circle at 65% 60%, rgba(255,255,255,.14), rgba(255,255,255,0) 60%);
  opacity:0;
  pointer-events:none;
  mix-blend-mode: screen;
}

/* "power line" collapse */
.theme-toggle .theme-screen .crt-line{
  position:absolute;
  left:0;
  right:0;
  top:50%;
  height:2px;
  background:rgba(255,255,255,.9);
  opacity:0;
  transform:scaleX(.2);
  filter: blur(.3px);
  pointer-events:none;
}

@keyframes crtConnectNoise{
  0%{opacity:0; transform:translateY(0)}
  10%{opacity:.85; transform:translateY(-2px)}
  35%{opacity:.55; transform:translateY(1px)}
  60%{opacity:.25; transform:translateY(-1px)}
  100%{opacity:0; transform:translateY(0)}
}

@keyframes crtConnectBloom{
  0%{filter:brightness(.85) contrast(1.05) saturate(1.1)}
  20%{filter:brightness(1.35) contrast(1.2) saturate(1.25)}
  55%{filter:brightness(1.05) contrast(1.1) saturate(1.2)}
  100%{filter:brightness(1) contrast(1.06) saturate(1.15)}
}

@keyframes crtDisconnectLine{
  0%{opacity:0; transform:scaleX(.2)}
  25%{opacity:1; transform:scaleX(1)}
  55%{opacity:1; transform:scaleX(1)}
  100%{opacity:0; transform:scaleX(.05)}
}

@keyframes crtDisconnectDim{
  0%{filter:brightness(1.1) contrast(1.1)}
  30%{filter:brightness(.75) contrast(1.2)}
  100%{filter:brightness(.92) contrast(1.05)}
}

/* Triggered by JS on click */
.theme-toggle.anim-connect .theme-screen{
  animation: crtConnectBloom 700ms ease-out;
}
.theme-toggle.anim-connect .theme-screen::after{
  opacity:.65;
}
.theme-toggle.anim-connect .theme-screen .crt-noise{
  opacity:1;
  animation: crtConnectNoise 700ms steps(6,end);
}

.theme-toggle.anim-disconnect .theme-screen{
  animation: crtDisconnectDim 700ms ease-out;
}
.theme-toggle.anim-disconnect .theme-screen .crt-line{
  opacity:1;
  animation: crtDisconnectLine 700ms ease-in-out;
}

/* glass glare */
.theme-toggle .theme-screen::before{
  content:"";
  position:absolute;
  inset:-10px -10px auto -10px;
  height:24px;
  background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,0));
  transform: rotate(-8deg);
  pointer-events:none;
  opacity:.6;
}

.theme-toggle .theme-ico{
  width:100%;
  height:100%;
  display:block;
  opacity:.95;
  image-rendering:auto;
}

.theme-toggle .theme-label{
  font-size:12px;
  opacity:.92;
  min-width:58px;
  text-align:left;
}

.theme-toggle:hover{
  transform: translateY(-1px);
  border-color: rgba(110,168,255,.55);
  box-shadow:
    0 14px 34px rgba(0,0,0,.38),
    inset 0 1px 0 rgba(255,255,255,.10),
    inset 0 -1px 0 rgba(0,0,0,.70);
}
.theme-toggle:active{transform:translateY(0px)}
.theme-toggle:focus{outline:2px solid var(--focus); outline-offset:3px}

/* When CRT mode is active, tint the device green-ish */
:root[data-theme="retro"] .theme-toggle{
  border-color: rgba(183,255,183,.55);
  color: rgba(183,255,183,.95);
}
:root[data-theme="retro"] .theme-toggle .theme-screen{
  background: radial-gradient(120% 120% at 35% 30%, rgba(183,255,183,.18), rgba(8,14,10,.92));
  border-color: rgba(183,255,183,.22);
}
:root[data-theme="retro"] .theme-toggle .theme-ico{image-rendering:pixelated}

