/* ============================================
   Tyler Wince — COMIC BOOK PANELS Theme
   The site is a comic page: thick panel borders,
   speech bubbles, halftone dots, bold punchy type,
   every section a panel in the story.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:ital,wght@0,400;0,500;0,700;1,400&display=swap');

:root {
  /* Typography */
  --font-display: 'Bangers', 'Impact', sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-sans: var(--font-body);
  --font-system: var(--font-sans);
  --font-hand: var(--font-display);

  /* Comic Book Palette */
  --color-paper: #FFFDF5;
  --color-paper-warm: #FFF8E7;
  --color-paper-dark: #F5F0E0;
  --color-white: #FFFFFF;
  --color-ink: #1A1A1A;
  --color-ink-mid: #333333;
  --color-ink-soft: #4A4A4A;
  --color-muted: #888888;
  --color-ghost: #BBBBBB;
  --color-red: #E63946;
  --color-blue: #457B9D;
  --color-yellow: #F4A261;
  --color-green: #2A9D8F;
  --color-caption: #FFF3CD;
  --color-caption-border: #E6C200;
  --color-panel-border: #1A1A1A;
  --color-gutter: #E8E4DA;
  --color-halftone: rgba(69, 123, 157, 0.06);
  --color-speed-lines: rgba(230, 57, 70, 0.08);

  /* Cross-theme compatibility aliases */
  --color-bg: var(--color-paper);
  --color-surface: var(--color-white);
  --color-surface-dark: var(--color-paper-warm);
  --color-surface-mid: var(--color-paper-dark);
  --color-surface-elevated: var(--color-white);
  --color-cream: var(--color-paper);
  --color-parchment: var(--color-paper-warm);
  --color-vellum: var(--color-paper-dark);
  --color-accent: var(--color-red);
  --color-accent-light: #F07079;
  --color-accent-wash: rgba(230, 57, 70, 0.08);
  --color-text-primary: var(--color-ink);
  --color-text-secondary: var(--color-ink-soft);
  --color-text-tertiary: var(--color-muted);
  --color-rust: var(--color-red);
  --color-rust-light: #F07079;
  --color-rust-pale: rgba(230, 57, 70, 0.08);
  --color-forest: var(--color-green);
  --color-forest-light: #3EC9B8;
  --color-brown: #6B5B4D;
  --color-grid: var(--color-gutter);
  --color-border: var(--color-panel-border);
  --color-border-light: #D0D0D0;
  --color-water: var(--color-blue);
  --color-gold: var(--color-yellow);
  --color-gold-light: #F7B97A;
  --color-gold-pale: rgba(244, 162, 97, 0.12);
  --color-gold-dim: rgba(244, 162, 97, 0.08);

  /* Compat aliases */
  --color-cyan: var(--color-blue);
  --color-cyan-dim: rgba(69, 123, 157, 0.08);
  --color-amber: var(--color-yellow);
  --color-sand: var(--color-yellow);
  --color-seal: var(--color-red);
  --color-ribbon: var(--color-red);
  --color-magenta: var(--color-red);
  --color-rose: var(--color-red);
  --color-rose-dim: rgba(230, 57, 70, 0.08);
  --color-rose-glow: rgba(230, 57, 70, 0.04);
  --color-pink: var(--color-red);
  --color-pink-light: rgba(230, 57, 70, 0.15);
  --color-wine: #9B2335;
  --color-purple: #6C5B7B;
  --color-purple-dim: rgba(108, 91, 123, 0.08);
  --color-navy: #1D3557;
  --color-navy-light: #2B4C7E;
  --color-blush: var(--color-paper);
  --color-lace: rgba(230, 57, 70, 0.04);
  --color-abyss: var(--color-ink);
  --color-deep: var(--color-ink-mid);
  --color-red-soft: var(--color-red);
  --color-red-dark: #B82E3A;
  --color-red-dim: rgba(230, 57, 70, 0.08);
  --color-green-light: #3EC9B8;
  --color-green-dim: rgba(42, 157, 143, 0.1);
  --color-green-wash: rgba(42, 157, 143, 0.05);
  --color-titlebar: var(--color-ink);
  --line-red: var(--color-red);
  --line-blue: var(--color-blue);
  --line-green: var(--color-green);
  --line-gold: var(--color-yellow);

  /* Sidebar compat aliases */
  --color-sidebar-bg: var(--color-ink);
  --color-sidebar-border: #333;
  --color-sidebar-surface: #2A2A2A;
  --color-sidebar-text: #CCC;
  --color-sidebar-muted: #888;
  --color-sidebar-accent: var(--color-red);
  --color-sidebar-active-bg: rgba(230, 57, 70, 0.12);

  /* Paper & panel compat */
  --color-paper-shadow: rgba(0, 0, 0, 0.15);
  --color-surface-glass: rgba(255, 253, 245, 0.95);
  --color-surface-glow: rgba(230, 57, 70, 0.05);
  --color-panel: var(--color-white);
  --color-panel-hover: var(--color-paper-warm);
  --color-panel-border: var(--color-ink);
  --color-panel-border-bright: var(--color-red);
  --color-rule-light: var(--color-border-light);

  /* Layout */
  --nav-width: 72px;
  --nav-height: 0px;
  --max-width-text: 660px;
  --max-width-content: 960px;
  --max-width-wide: 1200px;
  --panel-border: 3px solid var(--color-ink);
  --panel-gutter: 12px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 48px;
  --space-12: 64px;
  --space-16: 80px;
  --space-20: 96px;

  /* Sharp comic feel */
  --border-radius: 0px;
  --border-radius-lg: 0px;
  --border-radius-xl: 0px;
  --border-radius-full: 999px;

  /* Shadows — dramatic */
  --shadow-sm: 3px 3px 0 rgba(0, 0, 0, 0.15);
  --shadow-md: 5px 5px 0 rgba(0, 0, 0, 0.2);
  --shadow-lg: 8px 8px 0 rgba(0, 0, 0, 0.2);
  --shadow-glow-cyan: 4px 4px 0 rgba(69, 123, 157, 0.3);
  --shadow-glow-magenta: 4px 4px 0 rgba(230, 57, 70, 0.3);
  --shadow-glow-amber: 4px 4px 0 rgba(244, 162, 97, 0.3);
  --shadow-letter: 6px 6px 0 rgba(0, 0, 0, 0.15);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 150ms ease;
  --transition-base: 280ms ease;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background-color: var(--color-gutter);
  line-height: 1.65;
  overflow-x: hidden;
}

/* Halftone dot pattern on body */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, var(--color-halftone) 1.2px, transparent 1.2px);
  background-size: 8px 8px;
  pointer-events: none;
  z-index: 0;
}

::selection {
  background: var(--color-red);
  color: var(--color-white);
}

a {
  color: var(--color-red);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

img {
  max-width: 100%;
  display: block;
}

strong {
  color: var(--color-ink);
  font-weight: 700;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  line-height: 1.1;
  font-family: var(--font-display);
  color: var(--color-ink);
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

p {
  margin: 0 0 1em;
  color: var(--color-ink-soft);
}

ul, ol {
  margin: 0 0 1.2em 1.2em;
  color: var(--color-ink-soft);
}

li {
  margin-bottom: 0.35em;
}

li::marker {
  color: var(--color-red);
}

code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--color-paper-warm);
  border: 2px solid var(--color-ink);
  padding: 2px 6px;
  color: var(--color-ink);
}

pre {
  position: relative;
  margin: 1.5rem 0;
  padding: 20px;
  overflow-x: auto;
  background: var(--color-ink);
  color: var(--color-paper);
  font-size: 0.87rem;
  border: 3px solid var(--color-ink);
}

pre code {
  border: none;
  background: transparent;
  padding: 0;
  color: inherit;
}

blockquote {
  margin: 1.5rem 0;
  padding: 20px 24px;
  background: var(--color-caption);
  border: 3px solid var(--color-ink);
  border-left: 6px solid var(--color-red);
  position: relative;
}

blockquote::before {
  content: none;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* ---- Utilities ---- */
.mb-3 { margin-bottom: var(--space-3); }
.mb-6 { margin-bottom: var(--space-6); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--color-red);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ============================================
   SITE SHELL — Comic Page Frame
   ============================================ */

.site-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============================================
   COMIC NAV — Vertical Left Spine
   ============================================ */

.comic-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--nav-width);
  background: var(--color-ink);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-right: 4px solid var(--color-ink);
}

.nav-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px 0;
  text-decoration: none;
  border-bottom: 3px solid #333;
}

.nav-brand-mark {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--color-red);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  flex: 1;
  width: 100%;
}

.nav-chapter {
  margin: 0;
  width: 100%;
}

.nav-chapter a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 6px;
  text-decoration: none;
  color: #888;
  transition: all 150ms ease;
  position: relative;
  border-bottom: 1px solid #333;
}

.nav-chapter a:hover {
  color: var(--color-paper);
  background: #2A2A2A;
}

.nav-chapter a.active {
  color: var(--color-red);
  background: rgba(230, 57, 70, 0.1);
}

.nav-chapter a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--color-red);
}

.chapter-num {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0.05em;
}

.chapter-label {
  font-family: var(--font-mono);
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

/* Legacy / compat nav classes */
.site-header { display: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li { margin: 0; }
.nav-toggle { display: none; }

/* ---- Main Content Area ---- */
.main-content-area {
  margin-left: var(--nav-width);
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.main-inner {
  flex: 1;
  padding: var(--panel-gutter);
  width: 100%;
}

/* ---- AI Design Banner ---- */
.ai-design-banner {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  margin-bottom: var(--panel-gutter);
  background: var(--color-caption);
  border: 2px solid var(--color-ink);
  position: relative;
}

/* Caption box pointer */
.ai-design-banner::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 20px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--color-ink);
}

.ai-design-banner span {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--color-ink-soft);
  font-style: italic;
}

.ai-design-banner a {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--color-red);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ai-design-banner a:hover {
  color: var(--color-blue);
}

/* ---- Footer ---- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--color-ink);
  border-top: 4px solid var(--color-ink);
  margin-top: auto;
  margin-left: 0;
}

.footer-tagline {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--color-red);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-links li {
  margin: 0;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-yellow);
}

.footer-copy {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #666;
  letter-spacing: 0.05em;
}

/* ---- Panel Component (reusable comic panel) ---- */
.panel {
  background: var(--color-paper);
  border: 3px solid var(--color-ink);
  padding: 0;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.panel:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--color-ink);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 3px solid var(--color-ink);
  background: var(--color-caption);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--color-ink);
  margin: 0;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.panel-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--color-red);
  border: 2px solid var(--color-ink);
}

.panel-indicator-cyan,
.panel-indicator-green {
  background: var(--color-green);
}

.panel-indicator-amber {
  background: var(--color-yellow);
}

.panel-action {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--color-red);
  text-transform: uppercase;
}

.panel-body {
  padding: 16px;
}

/* ---- Content Wrappers ---- */
.content-wrapper,
.content-wrapper-narrow {
  width: 100%;
  margin: 0 auto;
  padding: var(--space-10) 0;
}

.content-wrapper {
  max-width: var(--max-width-content);
}

.content-wrapper-narrow {
  max-width: var(--max-width-text);
}

/* ---- Link Utilities ---- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--color-red);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.link-arrow::after {
  content: '\2192';
  transition: transform var(--transition-fast);
}

.link-arrow:hover {
  color: var(--color-blue);
}

.link-arrow:hover::after {
  transform: translateX(4px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-red);
  color: var(--color-white);
  padding: 12px 28px;
  font-family: var(--font-display);
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
  border: 3px solid var(--color-ink);
  transition: all var(--transition-fast);
  box-shadow: 4px 4px 0 var(--color-ink);
}

.button:hover {
  background: var(--color-blue);
  color: var(--color-white);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--color-ink);
}

.button:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--color-ink);
}

.button-secondary {
  background: var(--color-paper);
  color: var(--color-ink);
}

.button-secondary:hover {
  background: var(--color-caption);
  color: var(--color-ink);
}

.divider {
  height: 3px;
  border: none;
  background: var(--color-ink);
  margin: var(--space-10) 0;
}

/* ---- Speech Bubble ---- */
.speech-bubble {
  position: relative;
  background: var(--color-white);
  border: 3px solid var(--color-ink);
  padding: 12px 16px;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 24px;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 12px solid var(--color-ink);
}

.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 27px;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 9px solid var(--color-white);
  z-index: 1;
}

/* ---- Post Layout ---- */
.post {
  max-width: var(--max-width-content);
  margin: 0 auto;
  background: var(--color-paper);
  border: 3px solid var(--color-ink);
  padding: 0;
}

.post::before {
  content: none;
}

.post-header {
  margin-bottom: 0;
  padding: 32px 32px 24px;
  border-bottom: 3px solid var(--color-ink);
  background: var(--color-paper);
}

.post-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1;
  font-weight: 400;
  color: var(--color-ink);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.post-description {
  margin: 0 0 14px;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  font-style: italic;
  color: var(--color-ink-soft);
  line-height: 1.5;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px solid var(--color-ink);
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.82;
  max-width: var(--max-width-text);
  color: var(--color-ink-soft);
  padding: 32px;
}

.post-content h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 3px solid var(--color-ink);
  text-transform: uppercase;
}

.post-content h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  margin-top: 2rem;
  text-transform: uppercase;
}

.post-content img {
  margin: 2rem 0;
  border: 3px solid var(--color-ink);
}

.post-footer {
  margin-top: 0;
  padding: 16px 32px;
  border-top: 3px solid var(--color-ink);
  background: var(--color-caption);
}

.post-footer-text {
  margin: 0;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-ink-soft);
  font-style: italic;
}

/* ---- Book List Items ---- */
.book-item {
  padding: 10px 12px;
  border-bottom: 2px solid var(--color-ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  transition: background var(--transition-fast);
  background: var(--color-paper);
}

.book-item:hover {
  background: var(--color-caption);
}

.book-item:last-child {
  border-bottom: none;
}

.book-listing-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.book-depth-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  background: var(--color-red);
  border: 2px solid var(--color-ink);
}

.five-star-book .book-depth-dot {
  background: var(--color-yellow);
}

.has-notes .book-depth-dot {
  background: var(--color-blue);
}

.book-title-link {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink);
  text-decoration: none;
}

.book-title-link:hover {
  color: var(--color-red);
}

.book-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink);
}

.note-icon {
  font-size: 10px;
  vertical-align: super;
  color: var(--color-red);
}

.book-author {
  font-family: var(--font-body);
  font-size: 13px;
  font-style: italic;
  color: var(--color-muted);
}

.book-rating {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--color-yellow);
  white-space: nowrap;
}

.book-rating .stars {
  letter-spacing: 0.05em;
}

.currently-reading,
.book-rating .currently-reading {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--color-green);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.unrated-text,
.book-rating .unrated-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-muted);
  text-transform: uppercase;
}

/* ---- Feature Grid ---- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0;
  margin: 20px 0;
  border: 3px solid var(--color-ink);
  overflow: hidden;
}

.feature-card {
  padding: 16px;
  background: var(--color-paper);
  border-right: 3px solid var(--color-ink);
  border-bottom: 3px solid var(--color-ink);
}

.feature-card:last-child {
  border-right: none;
}

.feature-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.feature-card h3::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--color-red);
  border: 2px solid var(--color-ink);
  margin-right: 8px;
  vertical-align: middle;
}

.feature-card p {
  margin: 0;
  font-size: 13px;
}

/* ---- Callout ---- */
.callout {
  background: var(--color-caption);
  border: 3px solid var(--color-ink);
  border-left: 6px solid var(--color-red);
  padding: 16px 20px;
  margin: 20px 0;
}

/* ---- Screenshot Strip ---- */
.screenshot-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 200px);
  gap: var(--panel-gutter);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px 0 16px;
}

.screenshot-card {
  margin: 0;
  scroll-snap-align: start;
}

.screenshot-card img {
  border: 3px solid var(--color-ink);
}

/* ---- Stack Grid (Etch stacks) ---- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0;
  border: 3px solid var(--color-ink);
  margin: 16px 0;
  overflow: hidden;
}

.stack-card {
  text-decoration: none;
  color: inherit;
}

.stack-card-stack {
  padding: 14px;
  background: var(--color-paper);
  height: 100%;
  border-right: 3px solid var(--color-ink);
  border-bottom: 3px solid var(--color-ink);
  transition: background var(--transition-fast);
}

.stack-card:hover .stack-card-stack {
  background: var(--color-caption);
}

.stack-card-front {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.stack-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stack-card-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stack-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--color-ink);
  margin: 0;
  line-height: 1.3;
  text-transform: uppercase;
}

.stack-card-desc {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-muted);
  margin: 4px 0 0;
  line-height: 1.4;
}

.stack-card-icon {
  font-size: 16px;
  color: var(--color-red);
}

/* ---- Code Copy Button ---- */
.code-copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--color-red);
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  cursor: pointer;
  opacity: 0;
  border: 2px solid var(--color-paper);
  transition: opacity var(--transition-fast);
}

pre:hover .code-copy-button {
  opacity: 1;
}

.code-copy-button:hover {
  background: var(--color-blue);
}

/* ---- Animations ---- */
.animate-in {
  animation: comicPop 400ms var(--ease-out) both;
}

.delay-1,
.animate-in-delay-1 {
  animation-delay: 80ms;
}

.delay-2 {
  animation-delay: 160ms;
}

.delay-3 {
  animation-delay: 240ms;
}

.reveal-ready[data-reveal] {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 400ms ease, transform 400ms var(--ease-out);
}

.reveal-ready[data-reveal].is-visible {
  opacity: 1;
  transform: scale(1);
}

@keyframes comicPop {
  0% { opacity: 0; transform: scale(0.9); }
  70% { transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

/* Speed lines burst on hover for interactive elements */
@keyframes speedLines {
  0% { background-size: 100% 100%; }
  50% { background-size: 105% 105%; }
  100% { background-size: 100% 100%; }
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--color-green);
  border: 2px solid var(--color-ink);
  display: inline-block;
}

.keyboard-nav *:focus {
  outline: 3px solid var(--color-red);
  outline-offset: 2px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  :root {
    --nav-width: 0px;
  }

  .comic-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    height: 56px;
    flex-direction: row;
    border-right: none;
    border-bottom: 4px solid var(--color-ink);
    z-index: 1000;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .nav-brand {
    width: auto;
    padding: 0 14px;
    border-bottom: none;
    border-right: 3px solid #333;
    flex-shrink: 0;
  }

  .nav-links {
    flex-direction: row;
    padding: 0;
    overflow-x: auto;
    flex: 1;
  }

  .nav-chapter {
    width: auto;
    flex-shrink: 0;
  }

  .nav-chapter a {
    flex-direction: row;
    gap: 6px;
    padding: 16px 14px;
    border-bottom: none;
    border-right: 1px solid #333;
    white-space: nowrap;
  }

  .nav-chapter a.active::before {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    height: 3px;
  }

  .chapter-num {
    font-size: 16px;
  }

  .chapter-label {
    font-size: 8px;
  }

  .main-content-area {
    margin-left: 0;
    margin-top: 56px;
  }

  .ai-design-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .ai-design-banner::after {
    display: none;
  }

  .site-footer {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  .post-header {
    padding: 20px 16px 16px;
  }

  .post-content {
    padding: 20px 16px;
  }

  .post-footer {
    padding: 12px 16px;
  }
}

@media (max-width: 480px) {
  .chapter-label {
    display: none;
  }

  .nav-chapter a {
    padding: 16px 12px;
  }

  html {
    font-size: 15px;
  }

  .post-title {
    font-size: 28px;
  }
}
