/* ==============================
   THEME VARS
   ============================== */
:root{
  --bg:#0b0b0c;
  --text:#f2f2f2;
  --muted:#c8c8c8;
  --line:rgba(255,255,255,.12);
  --panel:rgba(255,255,255,.04);
  --panel-2:rgba(255,255,255,.06);
  --accent:#7dc7ff;
  --code-bg:#141417;
  --code-br:rgba(255,255,255,.1);
  --header-h:56px; /* updated by JS */
  --footer-h:56px; /* updated by JS */
}

/* ==============================
   BASE / TYPOGRAPHY
   ============================== */
*{box-sizing:border-box}
html{font-size:62.5%}
body{
  margin:0;background:var(--bg);color:var(--text);
  font:400 1.6rem/1.6 system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial,sans-serif;
  -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
  padding-top:var(--header-h);      /* reserve space for fixed header */
  padding-bottom:var(--footer-h);   /* reserve space for fixed footer */
}
a{color:var(--text);text-decoration:underline;text-underline-offset:.15em}
a:hover{text-decoration-thickness:2px}
a:focus-visible{outline:2px solid var(--accent);outline-offset:2px;text-decoration:none}
img{max-width:100%;display:block}
.profile-pic{max-width:50%;position:relative;margin:auto;image-rendering:auto;border-radius:50%}
h1,h2,h3{margin:.2rem 0 1rem}
h1{font-size:2.8rem;line-height:1.1}
h2{font-size:1.2rem;letter-spacing:.16em;text-transform:uppercase;color:var(--muted);font-weight:500}
h3{font-size:1.9rem}
p{margin:0 0 1.4rem}

/* Containers */
.container{width:100%;margin:0 auto;padding:0 2rem}
.container--narrow{max-width:80ch;margin:0 auto;padding:0 3rem}
@media (max-width:560px){.container--narrow{padding:0 1.6rem}}

/* Utilities */
.sr{will-change:transform,opacity}
.logo a{text-decoration:none}

hr.fart {
  border: none; /* remove default */
  height: 1px;  /* thickness */
  background-color: var(--line); /* use your theme var */
  margin: 2rem 0; /* spacing */
}

/* Example with gradient */
hr {
  border: none;
  height: 2px;
  background: linear-gradient(to right, var(--accent), transparent);
}

/* ==============================
   STICKY-REVEAL CHROME (HEADER/FOOTER)
   ============================== */
.site-header,
.site-footer{
  position:fixed;left:0;right:0;
  transition:transform .18s ease,box-shadow .18s ease,background .18s ease;
  backdrop-filter:saturate(120%) blur(6px);
  background:rgba(255,255,255,.04);
  z-index:60;
}
.site-header{top:0;transform:translateY(-100%);box-shadow:0 8px 24px rgba(0,0,0,.25)}
.site-header.is-visible{transform:translateY(0)}
.site-footer{bottom:0;transform:translateY(100%);box-shadow:0 -8px 24px rgba(0,0,0,.25);border-top:1px solid rgba(255,255,255,.08);z-index:50}
.site-footer.is-visible{transform:translateY(0)}
.site-header .container,
.site-footer .container{padding:.9rem 1.2rem}
@media (prefers-reduced-motion:reduce){.site-header,.site-footer{transition:none}}

/* Header simple nav (no hamburger) */
.header-flex{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap}
.site-nav ul{list-style:none;display:flex;gap:1.5rem;margin:0;padding:0}
.site-nav a{text-decoration:none;color:var(--text)}
.site-nav a:hover{color:var(--accent)}

/* ==============================
   POST CONTENT
   ============================== */
.post__meta{color:var(--muted);margin-bottom:1.6rem}
.post__content{isolation:isolate}
.post__content blockquote{
  margin:2rem 0;padding:1.2rem 1.6rem;border-left:.5rem solid var(--line);background:var(--panel)
}
.post__content pre{
  margin:1.6rem 0;padding:1.2rem 1.4rem;background:var(--code-bg);
  border:1px solid var(--code-br);border-radius:8px;overflow:auto
}
/* Inline code only (code not inside pre) */
.post__content :not(pre) > code {
  background: var(--code-bg);
  border: 1px solid var(--code-br);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 1.4rem;
}

/* Code blocks (inside pre) */
.post__content pre code {
  background: transparent; /* let pre handle the background */
  border: none;            /* remove per-line borders */
  padding: 0;               /* avoid double padding */
  color: inherit;           /* let highlighter control text color */
  font-size: 1.4rem;
}
.post__content table{
  width:100%;border-collapse:separate;border-spacing:0;background:transparent;color:var(--text);
  border:1px solid var(--line);border-radius:8px;overflow:hidden
}
.post__content thead th{background:var(--panel);border-bottom:1px solid var(--line)}
.post__content th,.post__content td{padding:.9rem 1.2rem;border-top:1px solid var(--line);text-align:left}
.post__content tbody tr:nth-child(even) td,
.post__content tbody tr:nth-child(even) th{background:var(--panel)}

/* ==============================
   FOOTER PAGER
   ============================== */
.footer-inner{display:flex;flex-wrap:wrap;justify-content:space-between;gap:1rem}
.footer-pager{display:flex;gap:1rem}
.footer-pager a{
  display:block;text-decoration:none;color:var(--text);
  background:var(--panel);border:1px solid var(--line);border-radius:8px;
  padding:.6rem 1rem;width:37ch;
  transition:transform .12s ease,background .12s ease,border-color .12s ease
}
.footer-pager a:hover{background:var(--panel-2);border-color:rgba(255,255,255,.18);transform:translateY(-1px)}
.footer-pager .h2{display:block;font-size:.9rem;letter-spacing:.08em;color:var(--muted);margin-bottom:.25rem}

/* ==============================
   HOME PAGE
   ============================== */
.home-section{margin:2.5rem 0 0}
.section-header{margin-bottom:1rem}
.card-grid{
  list-style:none;margin:0;padding:0;display:grid;gap:1rem;
  grid-template-columns:repeat(auto-fill,minmax(260px,1fr))
}
.card__link{display:block;text-decoration:none;color:var(--text)}
.card__media{
  position:relative;width:100%;aspect-ratio:16/9;overflow:hidden;border-radius:10px;
  border:1px solid var(--line);background:var(--panel)
}
.card__link:hover .card__media:before {background: rgba(0, 0, 0, 0.4);}
.card__media img,.card__media .thumb--title{width:100%;height:100%;object-fit:cover;display:block}
.card__media:has(img)::before {
  content: "";
  position: absolute;
  inset: 0;
  /* subtle global scrim to lift text contrast */
  background: rgba(0, 0, 0, 0.3);
  pointer-events: none;
}
.card__title,.card__meta {text-shadow: 0 1px 10px rgba(0,0,0,0.5);}
.overlay-text{position:absolute;inset:auto 0 0 0;padding:.9rem 1.2rem;background:linear-gradient(to top,rgba(0,0,0,.50),transparent 60%)}
.card__title{margin:0;font-size:1.4rem}
.card__meta.h2{display:block;margin-top:.25rem;color:var(--muted);font-variant-caps:all-small-caps;}
.thumb--title{display:grid;place-items:center;text-align:center;padding:1rem;color:#fff;font-weight:700}
.thumb-a{background:#3949ab}.thumb-b{background:#00897b}.thumb-c{background:#6d4c41}.thumb-d{background:#455a64}
.more-link{text-align:right;margin-top:1rem}
.more-link a{text-decoration:none;border:1px solid var(--line);padding:.6rem 1rem;border-radius:8px;background:var(--panel)}
.more-link a:hover{background:var(--panel-2);border-color:rgba(255,255,255,.18)}

/* ==============================
   GALLERY (GRID)  — replaces old float/mixins
   ============================== */
figure.gallery{margin:0;padding:10px 0}
figure.gallery .gallery__item{display:block}
figure.gallery img{margin-bottom:10px;border-radius:4px}

/* column presets via grid */
figure.gallery{display:grid;grid-template-columns:1fr;gap:8px}
figure.gallery.half{grid-template-columns:repeat(2,minmax(0,1fr))}
figure.gallery.third{grid-template-columns:repeat(3,minmax(0,1fr))}
figure.gallery.fourth{grid-template-columns:repeat(4,minmax(0,1fr))}
figure.gallery figcaption{grid-column:1/-1;margin-top:4px;color:var(--muted);font-size:1.4rem}

/* ==============================
   LIGHTBOX (MODAL)
   ============================== */
.lightbox{
  position:fixed;inset:0;display:grid;place-items:center;
  background:rgba(0,0,0,.75);backdrop-filter:blur(6px) saturate(120%);
  opacity:0;pointer-events:none;transform:scale(.98);
  transition:opacity .15s ease,transform .15s ease;z-index:80
}
.lightbox.is-open{opacity:1;pointer-events:auto;transform:none}
.lightbox__stage{
  position:relative;max-width:min(92vw,1200px);max-height:86vh;
  display:grid;grid-template-rows:1fr auto;gap:.6rem;
  background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:.8rem
}
.lightbox__img{max-width:100%;max-height:76vh;object-fit:contain;display:block}
.lightbox__caption{margin:0;color:var(--muted);text-align:center;font-size:1.4rem}
.lightbox__close,
.lightbox__nav{
  position:fixed;width:44px;height:44px;display:grid;place-items:center;
  color:var(--text);background:var(--panel);border:1px solid var(--line);
  border-radius:8px;cursor:pointer;transition:background .12s ease
}
.lightbox__close{top:1rem;right:1rem;font-size:2rem;line-height:1;width:40px;height:40px}
.lightbox__nav{top:50%;transform:translateY(-50%);font-size:2rem}
.lightbox__prev{left:1rem}.lightbox__next{right:1rem}
.lightbox__close:hover,.lightbox__nav:hover{background:var(--panel-2)}
.nav-open,.lb-open{overflow:hidden} /* prevent background scroll when menus/modals open */

/* CODE HIGHLIGHTING */
/* ===== Rouge (Jekyll) code blocks ===== */
.post__content .highlight {
  background: var(--code-bg);
  border: 1px solid var(--code-br);
  border-radius: 8px;
  overflow: auto;
  margin: 1.6rem 0;
}
.post__content .highlight pre { margin: 0; padding: 1.2rem 1.4rem; }
.post__content .highlight code { background: transparent; border: 0; padding: 0; }

/* Optional: line numbers (if you enable them later) */
.post__content .highlight .lineno {
  user-select: none;
  opacity: .55;
  padding-right: 1rem;
  display: inline-block;
  min-width: 2.2em;
  text-align: right;
}

/* ===== Rouge token colors (dark theme) ===== */
/* comments */
.highlight .c, .highlight .cm, .highlight .c1, .highlight .cs { color: #8b8b8b; font-style: italic; }
/* keywords */
.highlight .k, .highlight .kr, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kc, .highlight .kt { color: #7dc7ff; }
/* literals: numbers/booleans */
.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo, .highlight .mx,
.highlight .kc, .highlight .bp { color: #ffd580; }
/* strings */
.highlight .s, .highlight .sa, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .s1, .highlight .s2, .highlight .sh, .highlight .sx, .highlight .sr, .highlight .ss, .highlight .se { color: #a0e9a5; }
/* names: functions, classes, attrs, tags */
.highlight .nf, .highlight .fm { color: #a8c7ff; }
.highlight .nc, .highlight .nn, .highlight .no, .highlight .na { color: #ffc6a8; }
.highlight .nt, .highlight .gh { color: #ffd580; }
/* operators / punctuation */
.highlight .o, .highlight .ow, .highlight .p { color: #f2f2f2; }
/* emphasis */
.highlight .ge { font-style: italic; }
.highlight .gs { font-weight: 600; }
/* errors/diffs */
.highlight .err { color: #ff9aa2; background: rgba(255,154,162,.12); }
.highlight .gd { color: #ff9aa2; background: rgba(255,154,162,.08); }
.highlight .gi { color: #a0e9a5; background: rgba(160,233,165,.08); }