/* ═══════════════════════════════════════════════════════
   Adrian Clarke — QA Engineer
   style.css  (global + CV)
═══════════════════════════════════════════════════════ */

/* ── RESET ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── TOKENS ──────────────────────────────────────── */
:root {
  /* Brand */
  --orange:   #eb4910;
  --cream:    #f8f5f0;
  --dark:     #1a1714;
  --mid:      #3d3830;
  --muted:    #7a7065;
  --border:   #e0d8cf;
  --edge:     #2F3E46;

  /* Monospace */
  --mono: 'Geist Mono', monospace;

  /* CV syntax colours — warm tones drawn from brand palette */
  --j-key:    #8a8078;   /* keys — mid warm */
  --j-string: #e8e0d5;   /* values — light cream (brightest) */
  --j-number: #eb4910;   /* brand orange — numbers         */
  --j-bool:   #eb4910;   /* brand orange — booleans        */
  --j-null:   #b8a898;   /* soft warm — null               */
  --j-brace:  #b8a898;   /* soft warm — braces / brackets  */
  --j-punct:  #c8bdb2;   /* rule tone — colons / commas    */
}

html { scroll-behavior: smooth; }

body {
  background: var(--edge);
  color: var(--dark);
  font-family: 'Geist', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── CONTAINER ───────────────────────────────────── */
.container {
  max-width: 1140px;
  margin: 0 auto;
  width: 100%;
}

/* ── NAV ─────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  background: linear-gradient(to right,
    var(--edge) calc(50% - 570px),
    var(--cream) calc(50% - 570px),
    var(--cream) calc(50% + 570px),
    var(--edge) calc(50% + 570px)
  );
  z-index: 1000;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 48px;
  height: 64px;
  max-width: 1140px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dark);
  margin-right: auto;
}

.nav-brand em {
  font-style: italic;
  color: var(--orange);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-family: 'Geist', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--dark); }

.nav-cta {
  background: var(--dark) !important;
  color: var(--cream) !important;
  padding: 10px 20px !important;
  border-radius: 4px;
  font-size: 0.8rem !important;
  letter-spacing: 0.04em;
  transition: background 0.2s !important;
}

.nav-cta:hover { background: var(--orange) !important; }

/* ── HAMBURGER TOGGLE ────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: opacity 0.2s;
}

/* ── THEME TOGGLE ─────────────────────────────── */
.theme-toggle {
  position: relative;
  background: var(--cream);
  border: 1px solid var(--muted);
  border-radius: 20px;
  width: 52px;
  height: 28px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.25s, border-color 0.25s;
}

.theme-toggle:hover { border-color: var(--dark); }

.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px; /* left = light mode (default) */
  width: 20px;
  height: 20px;
  background: var(--orange);
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  line-height: 1;
  pointer-events: none;
  transition: left 0.25s ease;
}

.toggle-knob::before { content: '🌙'; }

[data-theme="dark"] .toggle-knob { left: calc(100% - 23px); } /* right = dark mode */
[data-theme="dark"] .toggle-knob::before { content: '☀️'; }

/* ── HERO ────────────────────────────────────────── */
.hero {
  max-width: 1140px;
  margin: 0 auto;
  background: var(--cream);
  display: grid;
  grid-template-columns: 1fr 360px;
  min-height: min(calc(100vh - 64px), 760px);
  padding-right: 48px;
}

.page-about .hero { grid-template-columns: 1fr 260px; }

.hero-content {
  padding: 48px 56px 72px 48px;
  display: flex;
  flex-direction: column;
}

.hero-overline {
  font-family: 'Geist', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 20px;
  margin-bottom: 0;
}

.hero-title {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: clamp(3rem, 5vw, 5.5rem);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}

.hero-title em {
  font-style: italic;
  color: var(--orange);
}

.hero-bio {
  font-size: 1.05rem;
  color: var(--mid);
  line-height: 1.75;
  margin-bottom: 44px;
}

.hero-bio strong {
  color: var(--dark);
  font-weight: 500;
}

.page-about .hero-bio a {
  color: var(--dark);
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--orange);
  color: #fff;
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding: 14px 28px;
  border-radius: 4px;
  transition: background 0.2s, transform 0.15s;
}

.btn-primary:hover { background: #d03e0c; transform: translateY(-1px); }

.btn-ghost {
  font-family: 'Geist', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted);
  transition: color 0.2s;
}

.btn-ghost:hover { color: var(--dark); }

.hero-photo {
  position: relative;
  overflow: hidden;
  background: var(--dark);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  opacity: 0.9;
  mix-blend-mode: luminosity;
}

.hero-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--orange) 0%, transparent 60%);
  opacity: 0.15;
  pointer-events: none;
}

/* ── PILLARS ─────────────────────────────────────── */
.pillars {
  background: linear-gradient(to right,
    var(--edge) calc(50% - 570px),
    #eeebe5 calc(50% - 570px),
    #eeebe5 calc(50% + 570px),
    var(--edge) calc(50% + 570px)
  );
}

.pillars-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
}

.pillar {
  padding: 52px 48px;
  border-right: 1px solid var(--border);
}

.pillar:last-child { border-right: none; }

.pillar-icon {
  font-size: 1.4rem;
  margin-bottom: 20px;
  opacity: 0.6;
}

.pillar-title {
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.pillar-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ── SKILLS ──────────────────────────────────────── */
.skills-section {
  padding: 96px 48px;
  max-width: 1140px;
  margin: 0 auto;
  background: var(--cream);
}

.skills-header {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 48px;
}

.skills-header h2 {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -0.01em;
}

.skills-rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.skill {
  background: var(--cream);
  padding: 28px 32px;
  transition: background 0.2s;
}

.skill:hover { background: #f0ece6; }

.skill-name {
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--dark);
}

.skill-detail {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 300;
}

/* ── QUOTE BAND ──────────────────────────────────── */
.quote-band {
  background: linear-gradient(to right,
    var(--edge) calc(50% - 570px),
    #f0e8e3 calc(50% - 570px),
    #f0e8e3 calc(50% + 570px),
    var(--edge) calc(50% + 570px)
  );
  padding: 96px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.quote-band::before {
  content: '\201C';
  position: absolute;
  top: -40px;
  right: max(3%, calc(50% - 490px));
  font-family: 'Barlow', sans-serif;
  font-size: 28rem;
  font-weight: 700;
  color: var(--orange);
  opacity: 0.07;
  line-height: 1;
  pointer-events: none;
}

.quote-text {
  font-family: 'Barlow', sans-serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  line-height: 1.35;
  color: var(--dark);
  max-width: 820px;
  margin: 0 auto 24px;
}

.quote-attr {
  font-family: 'Geist', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── FOOTER ──────────────────────────────────────── */
footer {
  background: var(--dark);
  color: #6a6055;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a09080;
}

.footer-brand em {
  font-style: italic;
  color: var(--orange);
}

.footer-links {
  display: flex;
  gap: 28px;
}

.footer-links a {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6a6055;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--orange); }

.footer-note {
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  color: #3d3530;
  border-top: 1px solid #2a2520;
  padding-top: 24px;
  margin-top: 8px;
}

.footer-year {
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  color: #3d3530;
  margin-top: 4px;
}

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 900px) {
  .nav-inner { padding: 0 24px; }

  /* Show hamburger, hide inline links */
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 24px 16px;
    z-index: 150;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 0;
    font-size: 0.95rem;
    color: var(--muted);
    text-align: right;
  }

  .nav-cta {
    margin-top: 8px;
    text-align: center;
    padding: 12px 20px !important;
    font-size: 0.85rem !important;
    border-radius: 4px;
  }

  /* Hero */
  .hero {
    grid-template-columns: 1fr;
    max-height: none;
    padding-right: 0;
  }

  .page-about .hero {
    grid-template-columns: 1fr;
  }

  .hero-photo {
    height: 360px;
    order: -1;
  }

  .hero-photo img {
    object-position: center 20%;
  }

  .hero-content { padding: 48px 24px; }

  /* Pillars */
  .pillars-inner { grid-template-columns: 1fr; border-left: none; border-right: none; }
  .pillar { border-right: none; border-bottom: 1px solid var(--border); }
  .pillar:last-child { border-bottom: none; }

  /* Skills */
  .skills-section { padding: 64px 24px; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }

  /* Misc */
  .quote-band { padding: 72px 24px; }
  footer .footer-inner { padding: 32px 24px; }

  /* CV responsive */
  .cv-hero-content {
    padding: 40px 24px;
    max-height: none;
  }

  .json-container {
    max-height: 420px;
  }

  .cv-modal {
    padding: 8px;
  }

  .cv-modal-dialog {
    width: calc(100% - 16px);
    max-height: calc(100vh - 32px);
    border-radius: 6px;
  }

  .cv-modal-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    gap: 8px;
  }

  .cv-modal-title {
    font-size: 0.8rem;
  }

  .cv-modal-actions {
    gap: 6px;
  }

  .cv-modal-print,
  .cv-modal-close {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .cv-modal-content {
    padding: 16px;
  }

  .cv-doc {
    padding: 14px;
    margin: 0;
  }

  .cv-doc-header {
    grid-template-columns: 1fr 80px;
    gap: 10px;
    padding: 12px;
    align-items: center;
  }

  .cv-doc-header h1 {
    font-size: 1.4rem;
  }

  .cv-doc-header-main {
    overflow: hidden;
  }

  .cv-doc-header-avatar {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
  }

  .cv-doc-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 18px;
  }

  .cv-doc-sidebar {
    border-right: none;
    border-bottom: 1px solid #efe6da;
    padding-right: 0;
    padding-bottom: 12px;
  }

  .cv-doc-main {
    padding-left: 0;
  }

  .cv-doc-section h3 {
    font-size: 0.8rem;
  }

  .cv-print-section {
    padding: 24px 0;
  }

  .cv-print-container {
    width: 100%;
    padding: 0 16px;
  }

  .cv-doc-print {
    padding: 12px;
  }
}

/* ── EXTRA SMALL SCREENS ──── */
@media (max-width: 480px) {
  .cv-modal {
    padding: 4px;
  }

  .cv-modal-dialog {
    width: calc(100% - 8px);
  }

  .cv-doc {
    padding: 10px;
  }

  .cv-doc-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .cv-doc-header {
    grid-template-columns: 1fr 70px;
    gap: 8px;
    padding: 10px;
  }

  .cv-doc-header h1 {
    font-size: 1.15rem;
  }

  .cv-doc-header-avatar {
    width: 70px;
    height: 70px;
  }

  .cv-modal-content {
    padding: 10px;
  }

  .cv-print-section {
    padding: 16px 0;
  }

  .cv-print-container {
    width: 100%;
    padding: 0 8px;
  }

  .cv-doc-print {
    padding: 8px;
  }
}

/* ── ANIMATIONS ──────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-overline { animation: fadeUp 0.5s ease both; }
.hero-title   { animation: fadeUp 0.5s 0.1s ease both; }
.hero-bio     { animation: fadeUp 0.5s 0.2s ease both; }
.hero-actions { animation: fadeUp 0.5s 0.3s ease both; }


/* ═══════════════════════════════════════════════════════
   CV PAGE
═══════════════════════════════════════════════════════ */

/* ── CV hero ── */
.cv-hero-content {
  padding: 48px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cv-eyebrow {
  font-family: 'Geist', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
  animation: fadeUp 0.5s ease both;
}

/* ── JSON container ── */
.json-container {
  background: var(--dark);
  border: 1px solid var(--mid);
  border-radius: 4px;
  padding: 1.75rem 2rem;
  overflow: auto;
  flex: 1;
  max-height: 650px;
  animation: fadeUp 0.5s 0.1s ease both;
  scrollbar-width: thin;
  scrollbar-color: var(--mid) transparent;
}

.json-container::-webkit-scrollbar { width: 6px; height: 6px; }
.json-container::-webkit-scrollbar-track { background: transparent; }
.json-container::-webkit-scrollbar-thumb { background: var(--mid); border-radius: 3px; }

/* ── JSON pre ── */
.json-pre {
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.85;
  white-space: pre-wrap;
  color: var(--j-string);
}

/* ── Syntax token colours ── */
.j-key     { color: var(--j-key); }
.j-string  { color: var(--j-string); }
.j-number  { color: var(--j-number); }
.j-bool    { color: var(--j-bool); }
.j-null    { color: var(--j-null); font-style: italic; }
.j-brace, .j-bracket { color: var(--j-brace); }
.j-colon, .j-comma   { color: var(--j-punct); }
.j-error   { color: var(--muted); font-style: italic; }

/* ── CV download row ── */
.cv-footer {
  margin-top: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  animation: fadeUp 0.5s 0.25s ease both;
}

.cv-print-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.cv-print-note {
  font-family: 'Barlow', sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  font-style: italic;
  color: var(--muted);
  line-height: 1.35;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.cv-print-note-title {
  font: inherit;
}

.cv-print-note-body {
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.cv-print-note-line,
.cv-print-note-signoff {
  display: block;
}

.cv-footer .btn-primary {
  font-size: 0.8rem;
  padding: 12px 22px;
}

.cv-footer .btn-ghost {
  white-space: nowrap;
}

/* ── CV modal document ── */
body.has-open-modal {
  overflow: hidden;
}

.cv-modal[hidden] {
  display: none;
}

.cv-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 28px;
}

.cv-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 23, 20, 0.66);
}

.cv-modal-dialog {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100vh - 56px);
  background: #fffdf9;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
}

.cv-modal-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #f7f2eb;
}

.cv-modal-title {
  font-family: 'Barlow', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
}

.cv-modal-actions {
  display: flex;
  gap: 10px;
}

.cv-modal-print,
.cv-modal-close {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  padding: 8px 12px;
  cursor: pointer;
}

.cv-modal-print:hover,
.cv-modal-close:hover {
  border-color: var(--muted);
  color: var(--dark);
}

.cv-modal-content {
  overflow: auto;
  padding: 24px;
  background: #f3eee7;
}

.cv-doc {
  width: min(860px, 100%);
  margin: 0 auto;
  background: #fff;
  border: 1px solid #ddd3c7;
  padding: 34px;
}

.cv-doc-header {
  display: grid;
  grid-template-columns: 1fr 108px;
  gap: 20px;
  align-items: end;
  background: var(--orange);
  border-bottom: 2px solid #d03e0c;
  padding: 16px;
  margin-bottom: 20px;
}

.cv-doc-header-main {
  min-width: 0;
}

.cv-doc-header-avatar {
  width: 108px;
  height: 108px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.85);
}

.cv-doc-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cv-doc-header h1 {
  font-family: 'Barlow', sans-serif;
  font-size: 2.15rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.cv-doc-role {
  margin-top: 6px;
  font-size: 1rem;
  color: #ffffff;
}

.cv-doc-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  list-style: none;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.95);
}

.cv-doc-meta a {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.cv-doc-grid {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 24px;
}

.cv-doc-sidebar {
  border-right: 1px solid #efe6da;
  padding-right: 18px;
}

.cv-doc-main {
  padding-left: 4px;
}

.cv-doc-section {
  margin-bottom: 18px;
}

.cv-doc-section h3 {
  font-family: 'Barlow', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5e5449;
  margin-bottom: 9px;
}

.cv-doc-section p,
.cv-doc-section li {
  color: #2f2923;
  font-size: 0.88rem;
  line-height: 1.55;
}

.cv-doc-list {
  list-style: none;
  display: grid;
  gap: 8px;
}

.cv-doc-subhead {
  font-weight: 600;
}

.cv-doc-entry {
  margin-bottom: 14px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.cv-doc-entry h4 {
  font-family: 'Barlow', sans-serif;
  font-size: 1rem;
  line-height: 1.25;
  color: #17120e;
}

.cv-doc-company {
  font-size: 0.88rem;
  color: #6d645a;
}

.cv-doc-dates {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #857a6d;
}

.cv-doc-bullets {
  margin: 8px 0 0 18px;
  display: grid;
  gap: 5px;
}

.cv-doc-stack {
  margin-top: 8px;
}

.cv-doc-loading,
.cv-doc-error {
  background: #fff;
  border: 1px solid #ddd3c7;
  padding: 16px;
}

.cv-doc-error .btn-primary {
  margin-top: 10px;
}

/* ── PRINTABLE CV PAGE ── */
.cv-print-section {
  background: linear-gradient(to right,
    var(--edge) calc(50% - 570px),
    #f3eee7 calc(50% - 570px),
    #f3eee7 calc(50% + 570px),
    var(--edge) calc(50% + 570px)
  );
  padding: 0;
  min-height: calc(100vh - 64px);
}

.cv-print-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 48px;
  background: #f7f2eb;
  border-bottom: 1px solid var(--border);
  max-width: 1140px;
  margin: 0 auto;
}

.cv-print-title {
  font-family: 'Barlow', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
  margin: 0;
}

.cv-print-actions {
  display: flex;
  gap: 10px;
}

.cv-print-button {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: border-color 0.2s, color 0.2s;
}

.cv-print-button:hover {
  border-color: var(--muted);
  color: var(--dark);
}

.cv-print-container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 48px 48px;
}

.cv-doc-print {
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .cv-print-section {
    padding: 0;
  }

  .cv-print-toolbar {
    padding: 10px 16px;
    flex-wrap: wrap;
    max-width: none;
  }

  .cv-print-title {
    font-size: 0.8rem;
    flex: 0 0 100%;
  }

  .cv-print-actions {
    gap: 6px;
    align-self: flex-end;
  }

  .cv-print-button {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .cv-print-container {
    padding: 16px;
  }

  .cv-doc-print {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .cv-print-container {
    padding: 12px;
  }

  .cv-doc-print {
    padding: 8px;
  }

  .cv-print-toolbar {
    padding: 8px 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .cv-print-title {
    font-size: 0.75rem;
    order: 1;
  }

  .cv-print-actions {
    order: 2;
    justify-content: space-between;
  }
}


/* ═══════════════════════════════════════════════════════
   DARK MODE
═══════════════════════════════════════════════════════ */

[data-theme="dark"] {
  --cream:  #2c2825;
  --dark:   #f0ece6;
  --mid:    #c8bdb2;
  --muted:  #8a8078;
  --border: #2e2a26;
  --edge:   #1a1816;
}

/* Sections with hardcoded light backgrounds */
[data-theme="dark"] .pillars {
  background: linear-gradient(to right,
    var(--edge) calc(50% - 570px),
    #242018 calc(50% - 570px),
    #242018 calc(50% + 570px),
    var(--edge) calc(50% + 570px)
  );
}
[data-theme="dark"] .skill:hover      { background: #28241f; }
[data-theme="dark"] .quote-band {
  background: linear-gradient(to right,
    var(--edge) calc(50% - 570px),
    #221e1a calc(50% - 570px),
    #221e1a calc(50% + 570px),
    var(--edge) calc(50% + 570px)
  );
}

/* Footer has var(--dark) as bg which inverts — restore a proper dark */
[data-theme="dark"] footer            { background: #0f0d0b; }

/* Hero photo backdrop also uses var(--dark) — keep it dark */
[data-theme="dark"] .hero-photo       { background: #0f0d0b; }

/* JSON viewer — keep dark regardless of mode */
[data-theme="dark"] .json-container   { background: #0f0d0b; }
[data-theme="dark"] .nav-cta          { background: var(--orange) !important; color: #fff !important; }

/* Keep CV document paper styling stable in dark mode */
[data-theme="dark"] .cv-modal-content {
  background: #2b2620;
}

[data-theme="dark"] .cv-modal-toolbar {
  background: #211d18;
}

[data-theme="dark"] .cv-modal-print,
[data-theme="dark"] .cv-modal-close {
  border-color: #4c4339;
}

[data-theme="dark"] .cv-print-toolbar {
  background: #211d18;
}

[data-theme="dark"] .cv-print-button {
  border-color: #4c4339;
  color: #f0ece6;
}

[data-theme="dark"] .cv-print-button:hover {
  border-color: #6a6055;
}

@media print {
  body {
    background: #fff;
  }

  #nav-placeholder,
  .hero,
  footer,
  .cv-modal-backdrop,
  .cv-modal-toolbar,
  .cv-print-toolbar,
  .nav,
  [data-include="/pages/footer.html"],
  .json-container {
    display: none !important;
  }

  .cv-print-section {
    background: #fff !important;
    min-height: auto;
    padding: 0;
  }

  .cv-print-container {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  .cv-modal {
    position: static;
    padding: 0;
    display: block;
  }

  .cv-modal[hidden] {
    display: block;
  }

  .cv-modal-dialog,
  .cv-modal-content,
  .cv-doc,
  .cv-doc-print {
    width: 100%;
    max-height: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
    background: #fff !important;
  }

  .cv-doc-header {
    background: #fff !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .cv-doc-section {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
