* { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0;
  background: var(--canvas-background);
  color: var(--text-primary);
  font: 1rem/1.6 var(--font-sans);
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0 0 1rem; }
a { color: var(--accent-interactive); text-underline-offset: .2em; }
a:hover { color: var(--accent-primary); }
:focus-visible { outline: 3px solid var(--accent-interactive); outline-offset: 3px; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--surface-card); padding: .6rem 1rem; z-index: 10;
}
.skip:focus { left: .5rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

.site-head, .site-foot {
  max-width: 1100px; margin-inline: auto; padding: 1rem 1.25rem;
}
main {
  display: block; max-width: 1100px; margin-inline: auto;
  padding: 0 1.25rem 3rem;
}
.site-head {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: baseline; justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}
.brand { font-weight: 600; margin: 0; }
.brand a { color: var(--text-primary); text-decoration: none; }
.brand span {
  display: block; font: .78rem var(--font-mono);
  color: var(--text-muted);
}
.site-head nav, .site-foot nav { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.site-head nav a, .site-foot nav a { text-decoration: none; font-weight: 600; }
.site-foot { border-top: 1px solid var(--border-subtle); color: var(--text-muted); font-size: .92rem; }
.site-foot .fine { font-size: .8rem; }

*, *::before, *::after {
  transition: background-color 0.2s ease, color 0.2s ease,
              border-color 0.2s ease, box-shadow 0.2s ease;
}

#theme-toggle {
  font: 1rem var(--font-sans); padding: .35rem .7rem;
  border: 1px solid var(--border-subtle); border-radius: 8px;
  background: var(--surface-card); color: var(--text-primary); cursor: pointer;
}

.btn {
  display: inline-block; padding: .6rem 1.1rem; font-weight: 600;
  border: 1px solid var(--border-subtle); border-radius: 8px;
  background: var(--surface-card); color: var(--text-primary);
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--surface-hover); }
.btn.primary { background: var(--accent-brand); border-color: var(--accent-brand); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(0.9); background: var(--accent-brand); }
/* White on the light-theme orange is 3.56:1; this shade clears 4.5:1. */
:root[data-theme="light"] .btn.primary { background: #C2410C; border-color: #C2410C; }
:root[data-theme="light"] .btn.primary:hover { background: #C2410C; }
.cta-row { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }
.link-plain { font-weight: 600; text-decoration: none; }
.link-plain:hover { text-decoration: underline; }

.mono {
  font-family: var(--font-mono); font-size: .78rem;
  color: var(--text-muted);
}
.section-head {
  font: 600 .82rem var(--font-mono); letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.fine { color: var(--text-muted); font-size: .85rem; }
.tool-meta {
  display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center;
  font-family: var(--font-mono); font-size: .78rem; color: var(--text-muted);
  margin-bottom: .6rem;
}
.tag {
  color: var(--text-primary); border: 1px solid var(--accent-brand);
  border-radius: 4px; padding: 0 .35rem;
}

.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 110px;
  margin-block: 2rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card);
}
.ad-slot--leaderboard { height: 110px; margin-top: 2.5rem; }
.ad-slot--footer { height: 90px; margin: 1.5rem auto 0; }
.ad-slot--inline { height: 110px; margin-block: 2rem; }
.ad-slot--blocked {
  border: 1px solid var(--border-subtle); border-radius: var(--radius);
  background: var(--surface-card); min-height: 80px;
}
.ad-slot__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0;
}
.site-foot .ad-slot { max-width: 1100px; }

.page-hero { padding: 2rem 0 1rem; max-width: 60ch; }
.page-hero h1 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); line-height: 1.18; letter-spacing: -.02em; }
.lede { font-size: 1.08rem; color: var(--text-muted); }
/* ===== Stats line (rendered near top of page, not buried in footer) ===== */
.stats-line {
  font-family: var(--font-mono); font-size: .82rem; color: var(--text-muted);
  margin: 0 0 1.5rem; padding: .6rem 1rem; border: 1px solid var(--border-subtle);
  border-radius: 8px; background: var(--surface-card); display: inline-block;
}
.stats-line strong { color: var(--text-primary); font-weight: 600; }

.prose { max-width: 68ch; }
.prose h1 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); line-height: 1.18; letter-spacing: -.02em; }
.prose h2 { font-size: 1.1rem; margin-top: 1.6rem; }
.prose .section-head { margin-top: 2rem; }

.project-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
}
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 768px) {
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1200px) {
  .portfolio-grid { grid-template-columns: repeat(3, 1fr); }
}
.ad-status {
  font: .75rem var(--font-mono);
  color: var(--text-muted);
  margin: .25rem 0 0;
}
.adblock-notice {
  font-size: .85rem;
  color: var(--text-muted);
  margin: .25rem 0 0;
  max-width: 60ch;
  text-align: center;
}
.project-card {
  display: grid; overflow: hidden;
  border: 1px solid var(--border-subtle); border-radius: var(--radius);
  background: var(--surface-card);
}
.project-card__media {
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.project-card__media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.project-card__body { display: grid; gap: .5rem; align-content: start; padding: 1rem; }
.project-card__name { font-size: 1.15rem; margin: 0; }
.project-card__name a { color: var(--text-primary); text-decoration: none; }
.project-card__name a:hover { color: var(--accent-primary); text-decoration: underline; }
.project-card__tagline { margin: 0; color: var(--text-muted); }
.project-card__desc { margin: 0; }
.project-card__links { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; margin: 0; font-weight: 600; }
.project-card__links a { text-decoration: none; }
.project-card__links a:hover { text-decoration: underline; }
.project-card--full .project-card__name { font-size: 1.45rem; }

@media (min-width: 900px) {
  .project-card__media {
    border-bottom: 1px solid var(--border-subtle);
    aspect-ratio: 16 / 9;
  }
  .project-card__media img {
    width: 100%; height: 100%; object-fit: contain;
  }
  .project-card__body { padding: 1rem; }
}

/* ===== Click-to-zoom image overlay (static/js/lightbox.js) =====
   Any image on the site opens here at full size. The overlay is built by the
   script on first click, so nothing in the templates carries it. */
.zoomable { cursor: zoom-in; }
html.lightbox-open { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .75rem;
  padding: 1.5rem;
  background: rgba(6, 8, 12, .94);
}
.lightbox[hidden] { display: none; }
.lightbox__img {
  max-width: min(94vw, 1600px); max-height: 82vh;
  width: auto; height: auto; object-fit: contain;
  border-radius: 10px; background: var(--surface-card);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .55);
  cursor: default;
}
.lightbox__caption {
  margin: 0; max-width: 70ch; text-align: center;
  font: .82rem var(--font-mono); color: #e8eaee;
}
.lightbox__caption[hidden] { display: none; }
.lightbox__close {
  position: absolute; top: .75rem; right: .75rem;
  width: 2.6rem; height: 2.6rem; padding: 0;
  font-size: 1.5rem; line-height: 1;
  border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer;
}
.lightbox__close:hover { background: rgba(255, 255, 255, .2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* ===== Icons (inline SVG, see the i-* partials in layout.html) ===== */
.icon {
  width: 1.15em; height: 1.15em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -.2em;
}
.btn .icon, .shots__btn .icon { transition: transform .25s var(--ease, ease); }
.btn:hover .icon-nudge-x, .btn:hover .icon { transform: none; }
