@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --cv-ink: #0c2340;
  --cv-soft: #3f4a58;
  --cv-mute: #64748b;
  --cv-line: #e4ddd0;
  --cv-gold: #a8864c;
  --cv-gold-deep: #8a6a3a;
  --cv-cream: #f7f6f3;
  --cv-paper: #fffcf7;
  --cv-navy-mid: #1a365d;
  --cv-a4-w: 210mm;
  --cv-a4-h: 297mm;
  --cv-a4-w-px: 794px;
  --cv-a4-h-px: 1123px;
}

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

html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

body.cv-body {
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  font-size: 10.4px;
  color: var(--cv-ink);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(168, 134, 76, 0.14), transparent 46%),
    #e7e2d8;
  line-height: 1.45;
  padding: 20px;
}

/* ── Top bar ── */
.cv-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(255, 252, 247, 0.92);
  border-bottom: 1px solid rgba(168, 134, 76, 0.18);
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 24px rgba(12, 35, 64, 0.06);
}

.cv-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--cv-ink);
}

.cv-topbar-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cv-gold);
  box-shadow: 0 0 0 3px rgba(168, 134, 76, 0.2);
}

.cv-topbar-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.cv-topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cv-topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  border-radius: 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cv-ink);
  text-decoration: none;
  border: 1px solid var(--cv-line);
  background: white;
  transition: all 0.2s ease;
}

.cv-topbar-link:hover {
  border-color: rgba(168, 134, 76, 0.45);
  color: var(--cv-gold-deep);
}

.cv-topbar-nav button,
.cv-btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 0.55rem;
  border: none;
  cursor: pointer;
  background: var(--cv-ink);
  color: white;
}

.cv-btn-download:hover { background: var(--cv-navy-mid); }

/* ── A4 sheet ── */
.cv-sheet-wrap {
  width: var(--cv-a4-w);
  max-width: var(--cv-a4-w-px);
  margin: 76px auto 32px;
}

.cv-sheet {
  position: relative;
  width: 100%;
  min-height: var(--cv-a4-h);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #fffdf9 0%, var(--cv-paper) 48%, #faf6ef 100%);
  box-shadow: 0 18px 50px rgba(12, 35, 64, 0.14);
  overflow: visible;
  border: 1px solid rgba(168, 134, 76, 0.28);
}

.cv-sheet::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cv-gold-deep), #c4a574, var(--cv-gold-deep));
  z-index: 2;
}

/* ── Hero ── */
.cv-hero-band {
  display: grid;
  grid-template-columns: 100px 1.2fr 0.95fr;
  gap: 16px;
  align-items: center;
  padding: 22px 26px 18px;
  background:
    radial-gradient(circle at 8% 20%, rgba(168, 134, 76, 0.15), transparent 42%),
    linear-gradient(135deg, #f3eee4 0%, #fffdf8 55%, #f7f1e7 100%);
  border-bottom: 1px solid var(--cv-line);
}

.cv-photo-wrap {
  width: 94px;
  height: 94px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(145deg, #c4a574, var(--cv-gold-deep) 55%, #c9a56a);
  box-shadow: 0 6px 16px rgba(138, 106, 58, 0.22);
}

.cv-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 50%;
  display: block;
  background: var(--cv-cream);
}

.cv-identity .cv-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 0.95;
  color: var(--cv-ink);
}

.cv-role {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--cv-gold-deep);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cv-tagline {
  margin-top: 6px;
  color: var(--cv-soft);
  font-size: 10.2px;
  line-height: 1.5;
}

.cv-contact {
  text-align: right;
  font-size: 10px;
  color: var(--cv-soft);
  line-height: 1.65;
  word-break: break-word;
}

.cv-contact strong {
  display: inline-block;
  margin-bottom: 2px;
  color: var(--cv-gold-deep);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cv-contact a {
  color: var(--cv-ink);
  text-decoration: none;
  font-weight: 600;
}

/* ── Body ── */
.cv-body-inner {
  flex: 1;
  padding: 14px 26px 20px;
}

.cv-section {
  margin-bottom: 12px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.cv-section-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--cv-ink);
  border-bottom: 1px solid var(--cv-line);
  padding-bottom: 3px;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cv-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(168, 134, 76, 0.5), transparent);
}

.cv-summary {
  color: var(--cv-soft);
  font-size: 10.2px;
  line-height: 1.5;
  text-align: justify;
}

.cv-summary a {
  color: var(--cv-ink);
  font-weight: 600;
}

.cv-skills-grid {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 2px 10px;
}

.cv-skill-cat {
  font-weight: 700;
  font-size: 10px;
  color: var(--cv-gold-deep);
}

.cv-skill-val {
  color: var(--cv-soft);
  font-size: 10.2px;
  line-height: 1.45;
}

.cv-featured {
  background: linear-gradient(135deg, rgba(168, 134, 76, 0.1), rgba(249, 247, 242, 0.35));
  border: 1px solid rgba(168, 134, 76, 0.22);
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.cv-featured .cv-proj-name { color: var(--cv-gold-deep); }

.cv-live-pill {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border: 1px solid rgba(138, 106, 58, 0.4);
  color: var(--cv-gold-deep);
  font-size: 8px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 700;
  vertical-align: middle;
}

.cv-project { margin-bottom: 8px; }
.cv-project:last-child { margin-bottom: 0; }

.cv-proj-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 1px;
}

.cv-proj-name {
  font-weight: 700;
  font-size: 11px;
  color: var(--cv-ink);
}

.cv-proj-stack {
  font-size: 9.5px;
  color: var(--cv-mute);
  font-style: italic;
  text-align: right;
  flex-shrink: 0;
  max-width: 48%;
  line-height: 1.35;
}

.cv-proj-company {
  font-size: 10px;
  font-weight: 600;
  color: var(--cv-navy-mid);
  margin-bottom: 3px;
}

.cv-bullets { list-style: none; padding: 0; }

.cv-bullets li {
  position: relative;
  padding-left: 12px;
  color: var(--cv-soft);
  font-size: 10.2px;
  margin-bottom: 2px;
  line-height: 1.45;
}

.cv-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.48em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: linear-gradient(145deg, #c4a574, var(--cv-gold-deep));
}

.cv-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.cv-edu-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.cv-edu-name { font-weight: 700; font-size: 10.5px; }
.cv-edu-meta { font-size: 10px; color: var(--cv-mute); text-align: right; }
.cv-edu-sub {
  color: var(--cv-soft);
  font-size: 9.8px;
  margin-top: 2px;
  margin-bottom: 8px;
}

.cv-projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 10px;
}

.cv-project-full {
  grid-column: 1 / -1;
}

.cv-proj-line {
  color: var(--cv-soft);
  font-size: 9.1px;
  line-height: 1.35;
  margin-top: 1px;
}

.cv-bullets-tight li {
  margin-bottom: 0;
}

.cv-edu-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 8px;
  font-size: 9.1px;
  margin-bottom: 3px;
  line-height: 1.35;
}

.cv-edu-inline .cv-edu-name {
  font-weight: 700;
  color: var(--cv-ink);
}

.cv-edu-inline .cv-edu-meta {
  color: var(--cv-mute);
  text-align: right;
}

.cv-edu-inline .cv-edu-dates {
  grid-column: 1 / -1;
  color: var(--cv-soft);
  font-size: 8.8px;
}

.cv-bottom-row {
  margin-top: 2px;
}

.cv-footer-note {
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--cv-line);
  color: var(--cv-mute);
  font-size: 9.5px;
  text-align: center;
  letter-spacing: 0.03em;
}

/* ── Screen preview scale on small screens ── */
@media screen and (max-width: 820px) {
  .cv-sheet-wrap {
    transform: scale(calc(min(1, (100vw - 24px) / var(--cv-a4-w-px))));
    transform-origin: top center;
    margin-bottom: 16px;
  }
}

@media (max-width: 640px) {
  .cv-topbar { flex-direction: column; align-items: stretch; padding: 10px 14px; }
  .cv-topbar-nav { flex-wrap: wrap; justify-content: center; }
  .cv-hero-band {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 16px;
  }
  .cv-photo-wrap { margin: 0 auto; }
  .cv-contact { text-align: center; }
  .cv-two-col { grid-template-columns: 1fr; gap: 10px; }
  .cv-projects-grid { grid-template-columns: 1fr; }
  .cv-project-full { grid-column: auto; }
  .cv-proj-top { flex-direction: column; align-items: flex-start; }
  .cv-proj-stack { max-width: 100%; text-align: left; }
}

/* ── Print / PDF modes ── */
body.cv-print-mode,
body.cv-pdf-export {
  background: white !important;
  padding: 0 !important;
  margin: 0 !important;
}

body.cv-print-mode .cv-topbar,
body.cv-pdf-export .cv-topbar {
  display: none !important;
}

body.cv-print-mode .cv-sheet-wrap,
body.cv-pdf-export .cv-sheet-wrap {
  width: var(--cv-a4-w) !important;
  max-width: var(--cv-a4-w-px) !important;
  margin: 0 auto !important;
  transform: none !important;
}

body.cv-print-mode .cv-sheet,
body.cv-pdf-export .cv-sheet {
  width: var(--cv-a4-w) !important;
  max-width: var(--cv-a4-w-px) !important;
  min-height: auto !important;
  height: auto !important;
  max-height: none !important;
  box-shadow: none !important;
  border: none !important;
}

@media print {
  @page { margin: 6mm; size: A4 portrait; }

  body.cv-body { background: white; padding: 0; }

  .cv-topbar { display: none !important; }

  .cv-sheet-wrap {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    transform: none !important;
  }

  .cv-sheet {
    box-shadow: none !important;
    border: none !important;
    min-height: auto !important;
  }

  a { color: inherit; text-decoration: none; }

  .cv-section { break-inside: avoid; page-break-inside: avoid; }
}
