/*
 * Radical Imagination — /portfolio/ deep-dive page ("workbench")
 * Spec: docs/superpowers/specs/2026-04-13-portfolio-deep-dive-page.md
 *
 * Source is a ledger, not a printed page. Motion language is ledger-expansion,
 * not letterpress. The homepage stays the altar; this page is the workbench.
 */

/* ============ BRAND TOKENS (inherited from homepage) ============ */
:root {
  --bg: #000;
  --bg-soft: #0d0d0d;
  --cream: #e8d9a8;
  --crimson: #dc143c;
  --gold: #ffd700;
  --green: #00aa00;
  --muted: #555;
  --muted-strong: #888;
  --line: #1a1a1a;
  --line-strong: #2a2a2a;
}

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

html, body {
  background: var(--bg);
  color: var(--cream);
  font-family: 'Cormorant Garamond', Georgia, serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body.wb-lock-scroll { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; }

/* ============ LEFT DOT NAV ============ */
.wb-dots {
  position: fixed;
  top: 50%;
  left: 24px;
  transform: translateY(-50%);
  z-index: 40;
  opacity: 0.8;
}
.wb-dots ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wb-dots a {
  display: block;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  position: relative;
}
.wb-dots .dot {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 180ms ease, transform 180ms ease;
}
.wb-dots a:hover .dot,
.wb-dots a[aria-current="true"] .dot {
  background: var(--gold);
  transform: scale(1.3);
}
/* Number on hover */
.wb-dots a::before {
  content: attr(data-ch);
  position: absolute;
  left: 32px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted-strong);
  opacity: 0;
  transition: opacity 140ms ease;
  white-space: nowrap;
}
.wb-dots a:hover::before { opacity: 1; }

@media (max-width: 720px) {
  .wb-dots { display: none; } /* mobile: scroll is the nav */
}

/* ============ MAIN LAYOUT ============ */
.wb-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 80px 32px 120px;
}

/* ============ HEADER ============ */
.wb-header {
  padding-bottom: 60px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 48px;
}

.wb-back {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted-strong);
  margin-bottom: 36px;
  transition: color 140ms ease;
}
.wb-back:hover { color: var(--gold); }

.wb-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(52px, 10vw, 120px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--cream);
  line-height: 0.95;
  margin-bottom: 28px;
}

.wb-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.55;
  color: #bbb;
  max-width: 680px;
  margin-bottom: 32px;
}

.wb-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted-strong);
}
.wb-meta .sep {
  color: var(--muted);
  margin: 0 10px;
}

/* ============ CHAPTER LIST ============ */
.wb-chapters {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wb-chapter {
  scroll-margin-top: 40px;
}

/* ============ CHAPTER CARD (collapsed) ============ */
.wb-card {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 28px;
  align-items: start;
  width: 100%;
  padding: 28px 24px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
  position: relative;
}
.wb-card:hover,
.wb-card:focus-visible {
  border-color: var(--gold);
  background: #111;
  outline: none;
}

.wb-card-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 22px;
  font-weight: 500;
  color: var(--gold);
  padding-top: 4px;
  letter-spacing: 1px;
}

.wb-card-body {
  min-width: 0;
}

.wb-card-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: 0.01em;
  color: var(--cream);
  text-transform: uppercase;
  margin-bottom: 8px;
  line-height: 1.15;
}

.wb-card-desc {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 16px;
  line-height: 1.5;
  color: #aaa;
  margin-bottom: 14px;
  max-width: 58ch;
}

.wb-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.wb-status {
  padding: 4px 10px;
  border: 1px solid var(--muted);
  color: var(--muted-strong);
  border-radius: 2px;
}
.wb-status.live { color: var(--gold); border-color: var(--gold); }
.wb-status.building { color: var(--crimson); border-color: var(--crimson); }

.wb-stack {
  color: #aaa;
  font-weight: 500;
}

.wb-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wb-rule {
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  color: var(--muted-strong);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 999px;
}

.wb-card-open {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted-strong);
  padding-top: 8px;
  white-space: nowrap;
  transition: color 180ms ease, transform 180ms ease;
}
.wb-card:hover .wb-card-open,
.wb-card:focus-visible .wb-card-open {
  color: var(--gold);
  transform: translateX(4px);
}

@media (max-width: 720px) {
  .wb-card {
    grid-template-columns: auto 1fr;
    gap: 16px;
    padding: 22px 18px;
  }
  .wb-card-open {
    grid-column: 1 / -1;
    padding-top: 4px;
  }
  .wb-card-num { font-size: 18px; }
}

/* ============ OVERLAY (ledger expansion) ============ */
.wb-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  pointer-events: none;
}
.wb-overlay[aria-hidden="false"] {
  display: block;
  pointer-events: auto;
}

.wb-overlay-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 220ms ease;
}
.wb-overlay[aria-hidden="false"] .wb-overlay-scrim { opacity: 1; }

.wb-overlay-panel {
  position: absolute;
  inset: 4vh 4vw;
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.985);
  opacity: 0;
  transition: transform 260ms cubic-bezier(0.2, 0.7, 0.25, 1), opacity 220ms ease;
}
.wb-overlay[aria-hidden="false"] .wb-overlay-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.wb-overlay-close {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 5;
  width: 40px;
  height: 40px;
  font-size: 28px;
  color: var(--muted-strong);
  border-radius: 50%;
  transition: color 140ms ease, background 140ms ease;
}
.wb-overlay-close:hover {
  color: var(--gold);
  background: rgba(255, 215, 0, 0.08);
}

.wb-overlay-inner {
  overflow-y: auto;
  flex: 1;
  padding: 48px clamp(24px, 5vw, 72px) 56px;
}

/* ============ LEDGER (expanded content) ============ */
.wb-ledger-head {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  align-items: baseline;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.wb-ledger-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 42px;
  color: var(--gold);
  line-height: 1;
}
.wb-ledger-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 4.5vw, 48px);
  letter-spacing: 0.01em;
  color: var(--cream);
  text-transform: uppercase;
  line-height: 1.05;
  grid-column: 2;
}
.wb-ledger-status {
  grid-column: 2;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 10px;
}

.wb-ledger-preview {
  margin-bottom: 36px;
}
.wb-preview-placeholder {
  background: linear-gradient(135deg, #111 0%, #0a0a0a 100%);
  border: 1px dashed var(--line-strong);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  color: var(--muted-strong);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  letter-spacing: 1.5px;
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
  border-radius: 2px;
}
.wb-ledger-cta {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  transition: background 160ms ease, color 160ms ease;
}
.wb-ledger-cta:hover {
  background: var(--gold);
  color: var(--bg);
}
.wb-ledger-cta.gold { /* already default */ }

.wb-ledger-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
@media (max-width: 820px) {
  .wb-ledger-body { grid-template-columns: 1fr; gap: 32px; }
}

.wb-ledger-why h3,
.wb-ledger-how h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted-strong);
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.wb-ledger-why h3 { border-color: var(--crimson); }

.wb-ledger-why p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  line-height: 1.7;
  color: #cdcdcd;
  margin-bottom: 16px;
  max-width: 58ch;
}
.wb-ledger-why p strong { color: var(--cream); font-weight: 600; }

.wb-ledger-how ul {
  list-style: none;
  margin-bottom: 24px;
}
.wb-ledger-how li {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  line-height: 1.55;
  color: #bbb;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.wb-ledger-how li:last-child { border-bottom: 0; }
.wb-tech {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: var(--gold);
  padding: 2px 6px;
  background: rgba(255, 215, 0, 0.07);
  border-radius: 2px;
  margin-right: 10px;
}
.wb-ledger-how code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: #ccc;
  background: rgba(255, 215, 0, 0.05);
  padding: 1px 5px;
  border-radius: 2px;
}

.wb-rules-list li strong {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--crimson);
  text-transform: uppercase;
  margin-right: 8px;
  display: inline-block;
  min-width: 160px;
}

/* ============ FOOTER ============ */
.wb-footer {
  margin-top: 80px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted-strong);
}
.wb-footer p { margin: 6px 0; }
.wb-footer a { color: var(--gold); }

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .wb-overlay-scrim,
  .wb-overlay-panel,
  .wb-card,
  .wb-card-open,
  .wb-dots .dot,
  .wb-back {
    transition: none !important;
  }
  .wb-overlay[aria-hidden="false"] .wb-overlay-panel {
    transform: none;
  }
}
