:root {
  --bg: #0b0f14;
  --surface: #12161c;
  --surface-2: #1a2029;
  --text: #e6eaf1;
  --muted: #a7b0bf;
  --primary: #4fb3ff;
  --primary-2: #2a89d8;
  --accent: #8b5cf6;
  --success: #3ddc97;
  --shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Light theme */
html.light {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --accent: #7c3aed;
  --success: #059669;
  --shadow: 0 10px 30px rgba(2,6,23,0.08);
}

* { box-sizing: border-box }
html, body { height: 100% }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 600px at 10% -10%, rgba(79,179,255,0.2), transparent 60%),
              radial-gradient(800px 400px at 90% -20%, rgba(139,92,246,0.18), transparent 60%), var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  width: min(100%, 1100px);
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(10px);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  border-bottom: 1px solid color-mix(in oklab, var(--surface-2) 60%, transparent);
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto; /* photo+name, nav, actions */
  align-items: center;
  gap: 12px;
  padding: 18px 0; /* slightly taller header to accommodate photo */
}
.branding { display: flex; align-items: center; gap: 14px }
.name-block { display: grid }
.header-contacts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px }
.header-contacts .contact-link { color: var(--muted); text-decoration: none }
.header-contacts .contact-link:hover { color: var(--text) }
.header-contacts .sep { color: var(--muted) }
.photo {
  aspect-ratio: 9 / 11;
  height: clamp(96px, 10vw, 150px);
  max-height: 35mm; /* ensure PDF constraint */
  width: auto;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: var(--shadow);
  background: var(--surface-2);
}
.avatar {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center; color: #fff; font-weight: 700;
  box-shadow: var(--shadow);
}
.name { margin: 0; font-size: 1.25rem }
.role { margin: 0; color: var(--muted); font-size: .9rem }
.nav { display: none }
.nav a { color: var(--muted); text-decoration: none; margin: 0 10px }
.nav a:hover { color: var(--text) }
.actions { display: flex; gap: 8px; justify-self: end }
/* Hide non-essential UI while exporting */
html.exporting .actions { display: none !important }

.btn {
  appearance: none;
  border: 1px solid color-mix(in oklab, var(--primary) 25%, var(--surface-2));
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface) 90%, var(--primary) 10%), var(--surface));
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow) }
.btn.primary {
  border-color: color-mix(in oklab, var(--primary) 60%, var(--surface-2));
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
}
.btn.icon { width: 40px; justify-content: center; display: inline-flex }

.hero { padding: 28px 0 10px }
.hero-content {
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface) 70%, transparent), var(--surface));
  border: 1px solid color-mix(in oklab, var(--surface-2) 60%, transparent);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
}
.hero h2 { margin-top: 0; font-size: clamp(1.2rem, 2vw + 1rem, 2rem) }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 }
.contact-meta { display: flex; gap: 12px; color: var(--muted); font-size: .95rem }

.card {
  margin: 18px 0;
  padding: 22px;
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface-2) 50%, transparent), var(--surface));
  border: 1px solid color-mix(in oklab, var(--surface-2) 60%, transparent);
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; font-size: 1.3rem }

.chip-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px }
.chip-list li {
  padding: 8px 12px; border-radius: 999px; font-size: .9rem;
  background: color-mix(in oklab, var(--primary) 10%, var(--surface-2));
  border: 1px solid color-mix(in oklab, var(--primary) 15%, var(--surface-2));
}

.experience { display: grid; gap: 16px }
.exp-item { display: grid; gap: 10px }
.exp-header { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: baseline }
.exp-role { color: var(--muted); margin: 4px 0 0 }
.exp-meta { color: var(--muted); font-size: .9rem }
.exp-points { margin: 0; padding-left: 18px }
.exp-note { color: var(--muted); font-style: italic }

.edu-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px }
.edu-meta { color: var(--muted); margin-left: 8px }

.lang-grid { display: grid; grid-template-columns: 1fr; gap: 10px }
.lang-meta { color: var(--muted) }

.site-footer { border-top: 1px solid color-mix(in oklab, var(--surface-2) 60%, transparent); margin-top: 28px }
.footer-inner { display: flex; justify-content: space-between; align-items: center; padding: 16px 0 }
.footer-inner .contact { display: flex; gap: 10px; align-items: center }
.footer-inner a { color: var(--text); text-decoration: none }
.footer-inner a:hover { color: var(--primary) }
.footer-inner .note { color: var(--muted) }

/* Responsive */
@media (min-width: 880px) {
  .nav { display: flex }
}
@media print {
  :root { --bg: #ffffff; --text: #111827; --muted: #4b5563 }
  body { background: #fff }
  /* Keep header visible so name + photo print together */
  .actions, .btn, .site-footer { display: none !important }
  .site-header { position: static; backdrop-filter: none; background: #fff; border-bottom: none }
  .photo { height: 35mm; max-height: 35mm }
  .name { font-size: 1.6rem }
  .header-contacts { gap: 8px }
  .header-contacts .contact-link { color: #1f2937 }
  .hero, .card { box-shadow: none; border: none; padding: 0; margin: 0 0 12px 0 }
  .container { width: 100%; padding: 0 16px }
}