/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg:           #fafbfc;
  --surface:      #ffffff;
  --text:         #1a1a2e;
  --text-muted:   #5a6072;
  --text-light:   #888ea0;
  --accent:       #6c5ce7;
  --accent-light: #a29bfe;
  --cyan:         #00b4d8;
  --cyan-dark:    #0096c7;
  --border:       #e8eaef;
  --code-bg:      #f4f5f7;
  --shadow:       0 1px 3px rgba(26, 26, 46, 0.06), 0 8px 24px rgba(26, 26, 46, 0.08);
  --shadow-lg:    0 4px 12px rgba(26, 26, 46, 0.08), 0 24px 48px rgba(26, 26, 46, 0.12);
  --radius:       12px;
  --radius-lg:    16px;
  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --mono:         'JetBrains Mono', 'SF Mono', monospace;
  --max-width:    720px;
  --page-width:   1080px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

img, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--cyan-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

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

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.15em 0.45em;
  border-radius: 5px;
  color: var(--accent);
}

/* ── Layout ───────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container.narrow {
  max-width: var(--max-width);
}

/* ── Header ───────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 251, 252, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav a:hover {
  color: var(--text);
}

/* ── Post header (hero) ───────────────────────────────────────── */
.post-header {
  padding: 4rem 0 2.5rem;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan-dark);
  margin: 0 0 1rem;
}

.post-title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
  color: var(--text);
}

.post-deck {
  font-size: 1.1875rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.post-meta {
  font-size: 0.8125rem;
  color: var(--text-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.post-authors {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem;
}

.author-name {
  font-weight: 600;
  color: var(--text);
}

.author-collab {
  color: var(--text-muted);
}

/* ── Hero visual ──────────────────────────────────────────────── */
.hero-visual {
  margin-bottom: 3.5rem;
}

.hero-figure {
  margin: 0;
}

.media-frame--hero {
  aspect-ratio: 16 / 9;
}

/* ── Post body sections ───────────────────────────────────────── */
.post-body {
  padding-bottom: 4rem;
}

.section {
  margin-bottom: 3.5rem;
}

.section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  padding-top: 1rem;
}

.section p {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
}

.section p strong {
  color: var(--text);
  font-weight: 600;
}

.section-media {
  margin-top: 2rem;
  margin-bottom: 0;
}

.problem-list {
  margin: 1.5rem 0 1.75rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.problem-list li {
  padding: 1.125rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
  box-shadow: var(--shadow);
}

.problem-list strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text);
  font-weight: 600;
}

/* ── Feature grid ─────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 1.5rem;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.feature-card p {
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.55;
}

/* ── Media blocks ─────────────────────────────────────────────── */
.media-block {
  margin: 2.5rem 0;
}

.media-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #0f0f1a;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame video {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #0f0f1a;
}

.media-frame--video video:not([src=""]) {
  display: block;
}

/* Placeholder when asset missing */
.media-placeholder {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 2rem;
}

.media-frame--placeholder .media-placeholder {
  display: flex;
}

.media-frame--placeholder img,
.media-frame--placeholder video {
  display: none;
}

.placeholder-label {
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
}

.placeholder-hint {
  font-size: 0.8125rem;
  opacity: 0.65;
}

.placeholder-hint code {
  background: rgba(255, 255, 255, 0.1);
  color: var(--cyan);
}

.media-frame--video.media-frame--placeholder .media-placeholder {
  display: flex;
}

figcaption {
  margin-top: 0.875rem;
  font-size: 0.8125rem;
  color: var(--text-light);
  text-align: center;
  line-height: 1.5;
}

/* ── Output showcase ──────────────────────────────────────────── */
.output-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.output-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.output-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: rgba(108, 92, 231, 0.1);
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.output-badge--video {
  background: rgba(0, 180, 216, 0.1);
  color: var(--cyan-dark);
}

.output-card h3 {
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 500;
  margin: 0 0 0.625rem;
  color: var(--text);
}

.output-card p {
  font-size: 0.875rem;
  margin: 0 0 1rem;
}

.code-snippet {
  margin: 0;
  padding: 1rem 1.125rem;
  background: #1a1a2e;
  border-radius: var(--radius);
  overflow-x: auto;
}

.code-snippet code {
  background: none;
  padding: 0;
  color: #e0e0e0;
  font-size: 0.75rem;
  line-height: 1.6;
}

.output-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.output-list li {
  font-family: var(--mono);
  font-size: 0.8125rem;
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.output-list li:last-child {
  border-bottom: none;
}

/* ── Tech stack ───────────────────────────────────────────────── */
.tech-stack {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tech-stack li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.125rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease;
}

.tech-stack li:hover {
  border-color: var(--cyan);
}

.tech-stack strong {
  font-size: 0.9375rem;
  color: var(--text);
}

.tech-stack span {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  background: var(--surface);
}

.footer-inner {
  text-align: center;
}

.footer-inner p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-note {
  margin-top: 0.375rem !important;
  color: var(--text-light) !important;
  font-size: 0.75rem !important;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav {
    display: none;
  }

  .post-header {
    padding: 2.5rem 0 1.5rem;
  }

  .post-deck {
    font-size: 1.0625rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .output-showcase {
    grid-template-columns: 1fr;
  }
}
