:root {
  --bg: #1B1F23;
  --bg-soft: #22262B;
  --panel: #262B31;
  --border: #363C43;
  --text: #E7E7E4;
  --text-dim: #9AA0A6;
  --ink: #2451B3;
  --ink-soft: #3A63C9;
  --paper: #F7F3EC;
  --paper-shadow: rgba(0,0,0,0.45);
  --accent-burgundy: #7A2E3B;
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

body { background: var(--bg); color: var(--text); }

body.light-mode {
  --bg: #EDEBE6;
  --bg-soft: #E4E1DA;
  --panel: #FFFFFF;
  --border: #D8D4CB;
  --text: #24262B;
  --text-dim: #6B6F76;
  --paper: #FDFCFA;
  --paper-shadow: rgba(60,50,40,0.25);
}

.preview-stage {
  background: var(--bg);
  background-image: radial-gradient(circle at 50% 0%, var(--bg-soft), var(--bg) 60%);
}

.template-bold .r-header h1,
.template-bold .r-section h2 { color: #7A2E3B; border-color: #7A2E3B; }
.template-bold .r-skill-pill { background: rgba(122,46,59,0.08); color: #7A2E3B; }
.template-bold .r-header { border-bottom: 4px solid #7A2E3B; padding-bottom: 12px; }

.template-minimal .r-header h1 { color: #26241F; font-weight: 400; }
.template-minimal .r-section h2 { color: #26241F; border-bottom: 1px solid #26241F; }
.template-minimal .r-skill-pill { background: transparent; border: 1px solid #26241F; color: #26241F; }
.template-minimal .r-contact { background: transparent; }

/* modern template - clean teal accent, contemporary sans headings */
.template-modern .r-header h1 {
  color: #0F766E;
  font-family: var(--font-body);
  font-weight: 700;
}
.template-modern .r-header p {
  color: #0F766E;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
}
.template-modern .r-header {
  border-bottom: none;
}
.template-modern .r-contact {
  background: rgba(15,118,110,0.08);
  border: none;
  border-radius: 20px;
}
.template-modern .r-section h2 {
  font-family: var(--font-body);
  color: #0F766E;
  border-bottom: none;
  background: rgba(15,118,110,0.08);
  border-radius: 6px;
  padding: 6px 10px;
  letter-spacing: 0.05em;
}
.template-modern .r-entry-top strong { font-family: var(--font-body); font-weight: 700; color: #134E4A; }
.template-modern .r-skill-pill {
  background: #0F766E;
  color: #fff;
  border-radius: 20px;
}

.template-sharp .r-header h1 { color: #16222E; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 700; }
.template-sharp .r-header p { color: #3E7CA6; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; font-size: 12px; }
.template-sharp .r-header { border-bottom: 3px solid #16222E; padding-bottom: 10px; }
.template-sharp .r-contact { background: #16222E; color: #EAF1F6; border: none; border-radius: 0; }
.template-sharp .r-contact span { color: #EAF1F6; }
.template-sharp .r-contact-label { color: #EAF1F6; opacity: 0.7; }
.template-sharp .r-section h2 { color: #16222E; background: #EAF1F6; border-bottom: none; border-left: 4px solid #3E7CA6; padding: 5px 10px; font-size: 12px; }
.template-sharp .r-skill-pill { background: #16222E; color: #EAF1F6; border-radius: 3px; }
.template-sharp .r-entry-top strong { color: #16222E; }
.template-sharp .r-entry-top span { color: #3E7CA6; font-weight: 600; }

.template-academic { font-family: var(--font-display); }
.template-academic .r-header {
  text-align: center;
  background: #EFEBDD;
  border-bottom: 1px solid #26241F;
  padding: 40px 60px 20px;
  margin: -56px -60px 20px;
}
.template-academic .r-header h1 { color: #26241F; font-weight: 600; letter-spacing: 0.03em; }
.template-academic .r-photo { float: none; margin: 0 auto 10px; display: block; }
.template-academic .r-contact-label { text-align: center; }
.template-academic .r-contact { justify-content: center; background: transparent; border: none; padding: 6px 0 0; }
.template-academic .r-section h2 {
  color: #26241F; background: transparent; border-bottom: none;
  border-top: 1px solid #26241F; border-bottom: 1px solid #26241F;
  padding: 4px 0; text-align: center; letter-spacing: 0.2em;
}
.template-academic .r-entry-top strong { font-family: var(--font-display); font-weight: 600; }
.template-academic .r-skill-pill { background: transparent; border: 1px solid #26241F; color: #26241F; border-radius: 2px; }