/* v6: Dark theme, mixed image sizes — inline / paired / full-bleed */

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

:root {
  --max-w: 980px;
  --text: #e0e0e0;
  --text-dim: #888;
  --bg: #0a0a0a;
  --accent: #fff;
  --link: #e0e0e0;
  --link-hover: #fff;
  --border: #222;
  --code-bg: #151515;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  line-height: 1.7;
}

article {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 6rem 1.5rem 8rem;
}

h1 {
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

h2 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-top: 4rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 2.4rem;
  margin-bottom: 0.6rem;
}

p { margin-bottom: 1.2rem; }
strong { color: var(--accent); font-weight: 600; }
em { font-style: italic; }

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-color: #444;
  transition: text-decoration-color 0.2s;
}

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

header { margin-bottom: 3rem; }

.tagline {
  font-size: 1.3rem;
  color: var(--text);
  margin-top: 0.8rem;
  margin-bottom: 0.2rem;
  line-height: 1.5;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-top: 0.6rem;
}

.subtitle a { color: var(--link); text-decoration-color: #444; }
.subtitle a:hover { color: var(--link-hover); text-decoration-color: var(--link-hover); }

ol, ul { margin-bottom: 1.2rem; padding-left: 1.4rem; }
li { margin-bottom: 0.5rem; }
li::marker { color: var(--text-dim); }

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  margin-bottom: 1.4rem;
  font-size: 0.88rem;
  line-height: 1.6;
}

code { font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, monospace; font-size: 0.88em; }
p code { background: var(--code-bg); padding: 0.15em 0.4em; border-radius: 3px; border: 1px solid var(--border); }

/* ── Figures: shared ── */
figure {
  margin: 3rem 0;
}

figure img {
  width: 100%;
  height: auto;
  display: block;
}

figcaption {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.7rem;
  line-height: 1.5;
  text-align: center;
}

/* ── Inline images: column width ── */
figure.inline {
  border-radius: 4px;
  overflow: hidden;
}

figure.inline img {
  border-radius: 4px;
}

/* ── Small images: half column width, centered ── */
figure.small {
  max-width: 50%;
  margin-left: auto;
  margin-right: auto;
  border-radius: 4px;
  overflow: hidden;
}

figure.small img {
  border-radius: 4px;
}

/* ── Full-bleed images ── */
figure.full {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(-50vw + 50%);
}

figure.full img {
  border-radius: 0;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}


/* ── Stats Grid ── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem 1.5rem;
  margin: 2rem 0;
}

.stat { text-align: center; }
.stat-number { display: block; font-size: 2.2rem; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; line-height: 1.2; }
.stat-label { display: block; font-size: 0.85rem; color: var(--text-dim); margin-top: 0.2rem; }

.tech-list { padding-left: 1.4rem; columns: 2; column-gap: 2rem; }
.tech-list li { padding: 0.3rem 0; break-inside: avoid; }

.cta { margin-top: 4rem; }

footer { margin-top: 5rem; padding-top: 2.5rem; border-top: 1px solid var(--border); }
footer h2 { margin-top: 0; }
footer ul { padding-left: 1.4rem; }
footer li { margin-bottom: 0.6rem; }

/* ── Debug Views Slideshow ── */
.slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 4px;
  background: #111;
}


/* ── Captioned Slideshow ── */
.slideshow-captioned .slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.slideshow-captioned .slide:first-child {
  opacity: 1;
}

.slideshow-captioned .slide img {
  position: static;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  animation: none;
}

.slide-caption {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  background: rgba(0, 0, 0, 0.65);
  color: #e0e0e0;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  backdrop-filter: blur(4px);
}

/* ── Slideshow expanded (lightbox mode) ── */
.slideshow-expanded {
  position: fixed !important;
  inset: 0;
  z-index: 9999;
  max-width: none !important;
  margin: 0 !important;
  padding: 0;
  background: rgba(0, 0, 0, 0.92);
  border-radius: 0 !important;
  cursor: zoom-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slideshow-expanded .slideshow {
  width: min(94vw, 94vh * 16 / 9);
  height: min(94vh, 94vw * 9 / 16);
  aspect-ratio: auto;
}

.slideshow-expanded figcaption {
  display: none;
}

.slideshow-expanded .slideshow-close {
  display: block;
}

.slideshow-close {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  z-index: 10;
}

.slideshow-expanded .slideshow-nav {
  display: flex;
}

.slideshow-nav {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 5;
}

.slideshow-nav button {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  color: #fff;
  font-size: 2rem;
  padding: 1rem 1.2rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s;
}

.slideshow-nav button:hover {
  background: rgba(0, 0, 0, 0.7);
}

@media (max-width: 768px) {
  html { font-size: 16px; }
  article { padding: 3rem 1.2rem 5rem; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.35rem; }
  figure.full { width: 100vw; max-width: 100vw; margin-left: calc(-50vw + 50%); }
  .pair { grid-template-columns: 1fr; gap: 2rem; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }
  .tech-list { columns: 1; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.7rem; }
}
