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

:root {
  --sidebar-width: 280px;
  --radius: 12px;
  --radius-sm: 8px;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: var(--font-body);
  --border-width: 1px;
  --avatar-end: #7c3aed;
}

/* ── Default ── */
[data-preset="default"][data-theme="light"] {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-hover: #fafafa;
  --text: #18181b;
  --text-muted: #71717a;
  --border: #e4e4e7;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --timeline: #d4d4d8;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08);
  --avatar-end: #7c3aed;
}

[data-preset="default"][data-theme="dark"] {
  --bg: #09090b;
  --surface: #18181b;
  --surface-hover: #27272a;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --border: #3f3f46;
  --accent: #3b82f6;
  --accent-soft: #1e293b;
  --timeline: #52525b;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.4);
  --avatar-end: #6366f1;
}

/* ── Terminal ── */
[data-preset="terminal"][data-theme="light"] {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-hover: #f0f3f6;
  --text: #24292f;
  --text-muted: #57606a;
  --border: #d0d7de;
  --accent: #1a7f37;
  --accent-soft: #dafbe1;
  --timeline: #d0d7de;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
  --font-body: "JetBrains Mono", ui-monospace, monospace;
  --font-heading: "JetBrains Mono", ui-monospace, monospace;
  --avatar-end: #1a7f37;
}

[data-preset="terminal"][data-theme="dark"] {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-hover: #1c2128;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --border: #30363d;
  --accent: #39d353;
  --accent-soft: #122117;
  --timeline: #30363d;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.5);
  --font-body: "JetBrains Mono", ui-monospace, monospace;
  --font-heading: "JetBrains Mono", ui-monospace, monospace;
  --avatar-end: #238636;
}

/* ── Editorial ── */
[data-preset="editorial"][data-theme="light"] {
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface-hover: #f5f5f4;
  --text: #1c1917;
  --text-muted: #78716c;
  --border: #d6d3d1;
  --accent: #92400e;
  --accent-soft: #fef3c7;
  --timeline: #d6d3d1;
  --shadow: none;
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.06);
  --font-body: "Source Serif 4", Georgia, serif;
  --font-heading: "Playfair Display", Georgia, serif;
  --avatar-end: #78350f;
}

[data-preset="editorial"][data-theme="dark"] {
  --bg: #1c1917;
  --surface: #292524;
  --surface-hover: #44403c;
  --text: #fafaf9;
  --text-muted: #a8a29e;
  --border: #57534e;
  --accent: #fbbf24;
  --accent-soft: #422006;
  --timeline: #57534e;
  --shadow: none;
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.3);
  --font-body: "Source Serif 4", Georgia, serif;
  --font-heading: "Playfair Display", Georgia, serif;
  --avatar-end: #b45309;
}

/* ── Nordic ── */
[data-preset="nordic"][data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --accent: #6366f1;
  --accent-soft: #eef2ff;
  --timeline: #cbd5e1;
  --shadow: 0 1px 3px rgba(99, 102, 241, 0.06);
  --shadow-lg: 0 4px 16px rgba(99, 102, 241, 0.1);
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-heading: "DM Sans", system-ui, sans-serif;
  --avatar-end: #818cf8;
}

[data-preset="nordic"][data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --accent: #818cf8;
  --accent-soft: #1e1b4b;
  --timeline: #475569;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-heading: "DM Sans", system-ui, sans-serif;
  --avatar-end: #a5b4fc;
}

/* ── Brutalist ── */
[data-preset="brutalist"] {
  --radius: 0;
  --radius-sm: 0;
  --border-width: 2px;
}

[data-preset="brutalist"][data-theme="light"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f5f5f5;
  --text: #000000;
  --text-muted: #404040;
  --border: #000000;
  --accent: #0000ff;
  --accent-soft: #e8e8ff;
  --timeline: #000000;
  --shadow: 4px 4px 0 #000;
  --shadow-lg: 6px 6px 0 #000;
  --font-body: "Space Grotesk", system-ui, sans-serif;
  --font-heading: "Space Grotesk", system-ui, sans-serif;
  --avatar-end: #0000ff;
}

[data-preset="brutalist"][data-theme="dark"] {
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-hover: #1a1a1a;
  --text: #ffffff;
  --text-muted: #a3a3a3;
  --border: #ffffff;
  --accent: #ff0000;
  --accent-soft: #2a0000;
  --timeline: #ffffff;
  --shadow: 4px 4px 0 #fff;
  --shadow-lg: 6px 6px 0 #fff;
  --font-body: "Space Grotesk", system-ui, sans-serif;
  --font-heading: "Space Grotesk", system-ui, sans-serif;
  --avatar-end: #ff0000;
}

/* ── Warm ── */
[data-preset="warm"][data-theme="light"] {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-hover: #f5f0eb;
  --text: #44403c;
  --text-muted: #78716c;
  --border: #e7e5e4;
  --accent: #c2410c;
  --accent-soft: #ffedd5;
  --timeline: #d6d3d1;
  --shadow: 0 1px 3px rgba(194, 65, 12, 0.06);
  --shadow-lg: 0 4px 12px rgba(194, 65, 12, 0.1);
  --font-body: "Libre Franklin", system-ui, sans-serif;
  --font-heading: "Libre Franklin", system-ui, sans-serif;
  --avatar-end: #ea580c;
}

[data-preset="warm"][data-theme="dark"] {
  --bg: #1c1917;
  --surface: #292524;
  --surface-hover: #44403c;
  --text: #fafaf9;
  --text-muted: #a8a29e;
  --border: #57534e;
  --accent: #fb923c;
  --accent-soft: #431407;
  --timeline: #57534e;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.4);
  --font-body: "Libre Franklin", system-ui, sans-serif;
  --font-heading: "Libre Franklin", system-ui, sans-serif;
  --avatar-end: #f97316;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background 0.2s, color 0.2s;
}

.profile h1,
.section h2,
.card-top h3,
.project-card h3 {
  font-family: var(--font-heading);
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  max-width: 1100px;
  margin: 0 auto;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 2.5rem 1.5rem;
  background: var(--surface);
  border-right: var(--border-width) solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.profile {
  text-align: center;
}

.avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar:not(img) {
  background: linear-gradient(135deg, var(--accent), var(--avatar-end));
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
}

img.avatar {
  border: 2px solid var(--border);
}

.profile h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.role {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.location {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

.theme-control {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
}

.theme-control-label {
  display: block;
  cursor: pointer;
}

.theme-control-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-control-track {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  height: 2rem;
  padding: 2px 0.5rem 2px 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: background 0.2s, border-color 0.2s;
}

.theme-control-input:checked + .theme-control-track {
  flex-direction: row-reverse;
  padding: 2px 2px 2px 0.5rem;
  background: var(--accent-soft);
  border-color: var(--accent);
}

.theme-control-thumb {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.theme-control-input:checked + .theme-control-track .theme-control-thumb {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.theme-control-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 0 0.15rem;
  transition: color 0.2s;
}

.theme-control-input:checked + .theme-control-track .theme-control-text {
  color: var(--accent);
}

.theme-control-input:focus-visible + .theme-control-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang-switch {
  display: flex;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.lang-switch button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch button.active {
  background: var(--accent);
  color: #fff;
}

.lang-flag {
  font-size: 1rem;
  line-height: 1;
}

.lang-text {
  line-height: 1;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.78rem;
}

.contact-item {
  color: var(--text-muted);
  text-decoration: none;
  word-break: break-all;
  text-align: center;
}

.contact-item:hover {
  color: var(--accent);
}

.print-btn {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.print-btn:hover {
  background: var(--accent);
  color: #fff;
}

.contact-block {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.contact-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  word-break: break-all;
}

.contact-link:hover {
  color: var(--accent);
}

.copy-btn {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.social {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.social a {
  color: var(--text-muted);
  padding: 0.25rem;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.social a:hover {
  color: var(--accent);
  background: none;
}

.sidebar-meta {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Main content */
.content {
  padding: 2.5rem 2rem 4rem;
  overflow-y: auto;
}

.section {
  margin-bottom: 3rem;
}

.section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.section-header h2 {
  margin-bottom: 0;
}

.about-text {
  color: var(--text-muted);
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

/* Timeline */
.timeline {
  list-style: none;
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--timeline);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-marker {
  position: absolute;
  left: -1.5rem;
  top: 1.25rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  transform: translateX(-1px);
}

.timeline-card {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

.timeline-card:hover {
  box-shadow: var(--shadow-lg);
}

.card-top .period {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

.card-top h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.35rem 0 0.25rem;
}

.card-top .at {
  color: var(--text-muted);
  font-weight: 400;
}

.meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-body {
  margin-top: 1rem;
}

.card-body h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  margin-top: 0.75rem;
}

.card-body h4:first-child {
  margin-top: 0;
}

.card-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.card-body ul {
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.card-body li {
  margin-bottom: 0.25rem;
}

.expandable {
  display: none;
}

.timeline-card.expanded .expandable {
  display: block;
}

.show-more {
  margin-top: 0.75rem;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  font-weight: 500;
}

.show-more:hover {
  text-decoration: underline;
}

.timeline-card:not(.has-more) .show-more {
  display: none;
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.tags span,
.skill-list li {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
}

/* Projects */
.project-grid {
  display: grid;
  gap: 1rem;
}

.project-card {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.project-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.project-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.project-details {
  margin: 0.75rem 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.project-link {
  display: inline-block;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 0.5rem;
}

.project-link:hover {
  text-decoration: underline;
}

/* Skills */
.skill-groups {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.skill-group-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.skill-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Language skills */
.lang-skills {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lang-skill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
}

.lang-name {
  font-weight: 600;
}

.lang-scores {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Education */
.edu-grid,
.cert-grid {
  display: grid;
  gap: 0.75rem;
}

.edu-card,
.cert-card {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
}

.edu-card h3,
.cert-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.edu-degree {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0.25rem 0;
}

.subsection-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: var(--text-muted);
}

.cert-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Publications */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pub-item {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
}

.pub-item h3 {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

.pub-authors {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: var(--bg);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
  z-index: 100;
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Responsive */
@media (min-width: 768px) {
  .cert-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 2rem 1.25rem;
  }

  .sidebar-meta {
    margin-top: 0;
  }

  .content {
    padding: 1.5rem 1.25rem 3rem;
  }
}

[data-preset="brutalist"] .timeline-card:hover,
[data-preset="brutalist"] .project-card:hover {
  transform: translate(-2px, -2px);
}

[data-preset="editorial"] .section h2 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

[data-preset="editorial"] .section h2 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pdf-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(2px);
}

.pdf-overlay[hidden] {
  display: none !important;
}

.pdf-overlay-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #44403c;
}

.print-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* PDF export — same layout as @media print, applied on screen for html2canvas */
body.pdf-export {
  background: #fff !important;
}

body.pdf-export [data-theme="dark"],
body.pdf-export [data-theme="light"],
body.pdf-export [data-preset="warm"] {
  --bg: #fff;
  --surface: #fff;
  --text: #111;
  --text-muted: #444;
  --border: #ddd;
  --accent: #c2410c;
  --accent-soft: #fef3ec;
}

body.pdf-export .theme-control,
body.pdf-export .lang-switch,
body.pdf-export .print-btn,
body.pdf-export .copy-btn,
body.pdf-export .show-more,
body.pdf-export .toast,
body.pdf-export .no-print-icons,
body.pdf-export .web-only,
body.pdf-export #projects,
body.pdf-export .pdf-overlay {
  display: none !important;
}

body.pdf-export .expandable {
  display: block !important;
}

body.pdf-export .layout {
  display: block;
  max-width: 794px;
  margin: 0 auto;
  background: #fff;
}

body.pdf-export .sidebar {
  position: static !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  border: none;
  border-bottom: 2px solid #c2410c;
  padding: 0 0 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}

body.pdf-export .profile {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  flex: 1 1 auto;
}

body.pdf-export .avatar {
  width: 72px;
  height: 72px;
  margin: 0;
}

body.pdf-export .profile h1 {
  color: #111 !important;
}

body.pdf-export .role {
  color: #c2410c !important;
}

body.pdf-export .contact-list {
  flex: 1 1 100%;
  align-items: flex-start;
  font-size: 12px;
}

body.pdf-export .contact-item {
  color: #333 !important;
}

body.pdf-export .sidebar-meta {
  border: none;
  padding: 0;
  margin: 0;
  text-align: left;
  flex-direction: row;
  gap: 12px;
  font-size: 11px;
  color: #555 !important;
}

body.pdf-export .content {
  padding: 0;
  background: #fff;
}

body.pdf-export .section h2 {
  color: #c2410c !important;
  border-bottom: 1px solid #ddd;
  text-transform: uppercase;
}

body.pdf-export .about-text,
body.pdf-export .card-body p,
body.pdf-export .card-body li,
body.pdf-export .meta,
body.pdf-export .edu-degree,
body.pdf-export .pub-authors,
body.pdf-export .lang-scores {
  color: #444 !important;
}

body.pdf-export .timeline-card,
body.pdf-export .edu-card,
body.pdf-export .cert-card,
body.pdf-export .pub-item,
body.pdf-export .lang-skill {
  background: #fff !important;
  border: 1px solid #ddd !important;
  box-shadow: none !important;
}

body.pdf-export .tags span,
body.pdf-export .skill-list li {
  background: #fef3ec !important;
  color: #9a3412 !important;
  border: 1px solid #fed7aa !important;
}

body.pdf-export .skill-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

body.pdf-export .cert-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media print {
  @page {
    size: A4;
    margin: 10mm 12mm;
  }

  html,
  body,
  .layout,
  .sidebar,
  .content,
  .section,
  .timeline-card,
  .edu-card,
  .cert-card,
  .pub-item,
  .lang-skill,
  .project-card {
    background: #fff !important;
    background-color: #fff !important;
    color: #111 !important;
    box-shadow: none !important;
  }

  [data-theme="dark"],
  [data-theme="light"],
  [data-preset="warm"] {
    --bg: #fff;
    --surface: #fff;
    --text: #111;
    --text-muted: #444;
    --border: #ddd;
    --accent: #c2410c;
    --accent-soft: #fef3ec;
  }

  .theme-control,
  .lang-switch,
  .print-btn,
  .copy-btn,
  .show-more,
  .toast,
  .no-print-icons,
  .web-only,
  #projects,
  .cv-export-root {
    display: none !important;
  }

  .expandable {
    display: block !important;
  }

  html,
  body {
    font-size: 9.5pt;
    line-height: 1.4;
  }

  .layout {
    display: block;
    max-width: none;
  }

  .sidebar {
    position: static !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    border: none;
    border-bottom: 2px solid #c2410c;
    padding: 0 0 6mm;
    margin-bottom: 5mm;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4mm 6mm;
    align-items: center;
    page-break-inside: avoid;
  }

  .profile {
    display: flex;
    align-items: center;
    gap: 4mm;
    text-align: left;
    flex: 1 1 auto;
  }

  .avatar {
    width: 20mm;
    height: 20mm;
    margin: 0;
  }

  .profile h1 {
    font-size: 16pt;
    color: #111 !important;
  }

  .role {
    color: #c2410c !important;
  }

  .contact-list {
    flex: 1 1 100%;
    align-items: flex-start;
    font-size: 8.5pt;
  }

  .contact-item {
    color: #333 !important;
  }

  .sidebar-meta {
    border: none;
    padding: 0;
    margin: 0;
    text-align: left;
    flex-direction: row;
    gap: 4mm;
    font-size: 8pt;
    color: #555 !important;
  }

  .content {
    padding: 0;
  }

  .section {
    margin-bottom: 4mm;
    page-break-inside: auto;
  }

  .section h2 {
    font-size: 10pt;
    color: #c2410c !important;
    border-bottom: 1px solid #ddd;
    padding-bottom: 1mm;
    margin-bottom: 2.5mm;
    text-transform: uppercase;
  }

  .about-text,
  .card-body p,
  .card-body li,
  .meta,
  .edu-degree,
  .pub-authors {
    color: #444 !important;
    font-size: 8.5pt;
  }

  .timeline-card,
  .edu-card,
  .cert-card,
  .pub-item,
  .lang-skill {
    border: 1px solid #ddd !important;
    padding: 2.5mm 3mm;
    margin-bottom: 2mm;
  }

  .timeline-item {
    margin-bottom: 2mm;
  }

  .timeline-marker {
    background: #c2410c !important;
    border-color: #fff !important;
  }

  .tags span,
  .skill-list li {
    background: #fef3ec !important;
    color: #9a3412 !important;
    border: 1px solid #fed7aa !important;
    font-size: 7pt;
  }

  .skill-groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2mm;
  }

  .cert-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2mm;
  }
}
