/* Charter to Code — Style Frame tokens & shared CSS */

:root {
  --cream-base:    #FEFCF8;
  --cream-panel:   #F5F0E8;
  --cream-rule:    #E8DFCE;
  --cream-deeper:  #EDE4D2;
  --orange:        #B85C38;
  --orange-hot:    #D46B3E;
  --orange-soft:   #E8A179;
  --ink:           #2C2C2C;
  --ink-soft:      #5A4A3F;
  --ink-faint:     #8B7E70;
  --term-bg:       #0A0A0A;
  --term-green:    #00FF00;
  --term-green-dim:#00B800;
  --term-amber:    #FFB000;
  --success-green: #3D6B35;
  --error-red:     #B83030;

  --font-mono:  'Courier Prime', 'Courier New', ui-monospace, monospace;
  --font-serif: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  --font-hand:  'Caveat', 'Kalam', 'Comic Sans MS', cursive;
}

/* ─── Frame shell (1920×1080) ─────────────────────────────── */
.frame {
  width: 1920px;
  height: 1080px;
  position: relative;
  overflow: hidden;
  font-family: var(--font-mono);
  color: var(--ink);
  background: var(--cream-base);
}
.frame--cream { background: var(--cream-base); }
.frame--terminal { background: var(--term-bg); color: var(--term-green); }

/* faint cream paper variation across the surface */
.frame--cream::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(1400px 900px at 30% 20%, #FFFEFB 0%, transparent 60%),
    radial-gradient(1200px 800px at 80% 90%, #F5F0E8 0%, transparent 65%);
  pointer-events: none;
}

/* ─── Caption pill (bottom third) ─────────────────────────── */
.caption {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  background: rgba(20, 18, 15, 0.92);
  color: #FAF7F1;
  font-family: var(--font-mono);
  font-size: 30px;
  letter-spacing: 0.01em;
  padding: 18px 36px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 6;
}
.caption--terminal {
  background: rgba(0, 0, 0, 0.85);
  color: var(--term-green);
  border: 1px solid rgba(0, 255, 0, 0.35);
}
.caption .caret {
  display: inline-block;
  width: 14px; height: 28px;
  background: currentColor;
  vertical-align: -4px;
  margin-left: 6px;
  animation: caret-blink 1s steps(2,end) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

/* ─── Phase header ────────────────────────────────────────── */
.phase-header {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--orange);
  font-weight: 700;
}
.phase-header__rule {
  height: 2px;
  background: var(--orange);
  margin-top: 14px;
  width: 100%;
  max-width: 880px;
}

/* ─── Pipeline tracker (top of phase scenes) ───────────────── */
.pipeline-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 72px;
  background: rgba(245, 240, 232, 0.9);
  border-bottom: 1px solid var(--cream-rule);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--ink-soft);
  z-index: 5;
}
.pipeline-bar .node {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 16px;
}
.pipeline-bar .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--cream-rule);
  border: 2px solid var(--ink-faint);
}
.pipeline-bar .node.active .dot {
  background: var(--orange-hot);
  border-color: var(--orange-hot);
  box-shadow: 0 0 0 6px rgba(212, 107, 62, 0.18);
}
.pipeline-bar .node.done .dot { background: var(--orange); border-color: var(--orange); }
.pipeline-bar .arrow { color: var(--ink-faint); margin: 0 4px; }

/* ─── Notebook ────────────────────────────────────────────── */
.notebook {
  position: relative;
  background: var(--cream-base);
  border: 1px solid var(--cream-rule);
  box-shadow:
    0 2px 0 rgba(0,0,0,0.02),
    0 30px 60px -20px rgba(80, 60, 30, 0.18),
    0 14px 30px -10px rgba(80, 60, 30, 0.10);
  border-radius: 4px;
}
.notebook__ribbon {
  position: absolute;
  top: -8px; right: 96px;
  width: 38px;
  height: 180px;
  background: linear-gradient(180deg, #B83030 0%, #9A2222 100%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.notebook__edge {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.02);
}
.notebook__title {
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.section-head {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--orange);
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 24px;
}
.section-head__rule {
  height: 2px;
  background: var(--orange);
  flex: 1;
}
.section-head__hint {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-faint);
  font-size: 22px;
}

/* ─── Terminal ────────────────────────────────────────────── */
.terminal {
  position: relative;
  background: var(--term-bg);
  color: var(--term-green);
  font-family: var(--font-mono);
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 30px 80px -20px rgba(0,0,0,0.5),
    0 0 0 1px rgba(0,255,0,0.12);
}
.terminal__chrome {
  height: 36px;
  background: #0F0F0F;
  border-bottom: 1px solid rgba(0,255,0,0.12);
  display: flex; align-items: center;
  padding: 0 14px;
  gap: 8px;
  font-size: 13px;
  color: rgba(0,255,0,0.4);
  letter-spacing: 0.08em;
}
.terminal__dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(0,255,0,0.25); }
.terminal__dot.amber { background: rgba(255, 176, 0, 0.45); }
.terminal__dot.red   { background: rgba(184, 48, 48, 0.55); }
.terminal__title {
  margin-left: 14px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* subtle scanlines (no flicker) */
.terminal__body {
  position: relative;
  padding: 36px 44px;
  font-size: 26px;
  line-height: 1.6;
  letter-spacing: 0.01em;
}
.terminal__body::before {
  content: '';
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,0) 0,
      rgba(0,0,0,0) 2px,
      rgba(0,0,0,0.18) 3px,
      rgba(0,0,0,0.18) 3px
    );
  pointer-events: none;
  mix-blend-mode: multiply;
}
.terminal__body::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(80% 100% at 50% 50%, transparent 60%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}
.terminal .prompt { color: var(--term-green); }
.terminal .prompt::before { content: '> '; color: var(--term-green-dim); }
.terminal .dim { color: var(--term-green-dim); }
.terminal .amber { color: var(--term-amber); }
.terminal .err { color: #FF5050; }
.term-block-cursor {
  display: inline-block;
  width: 14px; height: 28px;
  background: var(--term-green);
  vertical-align: -4px;
  animation: term-blink 1.05s steps(2,end) infinite;
}
@keyframes term-blink { 50% { opacity: 0; } }

/* ─── Tag legend & phase indicators ───────────────────────── */
.legend {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 28px;
}
.legend__item { display: inline-flex; align-items: center; gap: 8px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--cream-deeper);
  color: var(--ink-soft);
  border: 1px solid var(--cream-rule);
}
.tag--orange { background: var(--orange); color: #FFF8EE; border-color: var(--orange); }
.tag--terminal { background: rgba(0,255,0,0.12); color: var(--term-green); border-color: rgba(0,255,0,0.35); }

/* ─── Quote / VOC card ────────────────────────────────────── */
.quote-card {
  background: var(--cream-panel);
  border-left: 3px solid var(--orange);
  padding: 22px 26px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 26px;
  color: var(--ink);
  position: relative;
  border-radius: 2px;
}
.quote-card .qmark {
  position: absolute;
  top: -6px; left: 12px;
  font-family: var(--font-serif);
  color: var(--orange);
  font-size: 56px;
  line-height: 1;
}

/* ─── XKCD comic ──────────────────────────────────────────── */
.comic-panel {
  background: var(--cream-base);
  border: 2px solid var(--ink);
  position: relative;
  font-family: var(--font-hand), 'Caveat', sans-serif;
}
.comic-caption {
  font-family: var(--font-hand), 'Caveat', sans-serif;
  font-size: 32px;
  color: var(--ink);
}

/* ─── Final stamp (typography-only) ───────────────────────── */
.final-mark {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 56px;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.1em;
}
.final-mark .check {
  width: 64px; height: 64px;
  border: 4px solid var(--orange);
  border-radius: 12px;
  display: inline-flex;
  align-items: center; justify-content: center;
}
.final-mark .check svg { width: 40px; height: 40px; }

/* small frame label badge for design canvas */
.frame-tag {
  position: absolute;
  top: 22px; left: 22px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 14px;
  color: var(--ink-faint);
  background: rgba(255,255,255,0.55);
  padding: 6px 10px;
  border: 1px solid var(--cream-rule);
  border-radius: 4px;
  z-index: 8;
}
.frame-tag--terminal {
  background: rgba(0,0,0,0.6);
  color: rgba(0,255,0,0.65);
  border-color: rgba(0,255,0,0.2);
}
