:root {
  --bg: #eef3f8;
  --paper: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #d8e1ea;
  --accent: rgb(0, 153, 255);
  --accent-dark: #006fc0;
  --accent-soft: rgba(0, 153, 255, 0.1);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --chip-bg: #eef7ff;
  --chip-border: #cce8ff;
  --mini-card-bg: #f8fbff;
  --contact-pill-bg: #f1f7fd;
  --body-bg-start: #f4f8fc;
  --body-bg-end: #eaf1f8;
}

body.dark {
  --bg: #0f172a;
  --paper: #1e293b;
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --line: #334155;
  --accent: rgb(0, 153, 255);
  --accent-dark: #38bdf8;
  --accent-soft: rgba(0, 153, 255, 0.15);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  --chip-bg: rgba(0, 153, 255, 0.1);
  --chip-border: rgba(0, 153, 255, 0.25);
  --mini-card-bg: #273449;
  --contact-pill-bg: #1e3a5f;
  --body-bg-start: #0f172a;
  --body-bg-end: #111827;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  background: linear-gradient(180deg, var(--body-bg-start) 0%, var(--body-bg-end) 100%);
  color: var(--ink);
  transition: background 0.3s ease, color 0.3s ease;
}

/* ── Fixed download button ── */
.fab-btn {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 153, 255, 0.3);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dark);
  font-weight: 700;
}

.primary-btn {
  display: inline-block;
  border: none;
  background: var(--accent);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  background: var(--accent-dark);
}

/* ── Page shell ── */
.page-shell {
  padding: 32px 24px 48px;
}

.cv-card {
  width: 900px;
  margin: 0 auto;
  background: var(--paper);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 40px;
}

/* ── Hero ── */
.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.hero-left {
  display: flex;
  flex-direction: column;
}

.hero-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.name {
  margin: 4px 0 0;
  font-size: 2.3rem;
  line-height: 1.05;
}

.role {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

.role-sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.profile-text {
  margin: 14px 0 0;
  color: var(--ink);
  font-size: 0.93rem;
  line-height: 1.75;
  border-top: 1px solid var(--line);
}

/* ── Portrait ── */
.portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

/* ── Contact list ── */
.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  font-size: 0.93rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}

.contact-list li:last-child {
  border-bottom: none;
}

.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: white;
  border-radius: 7px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  line-height: 1;
}

.contact-list a,
.contact-list span {
  color: var(--ink);
  word-break: break-all;
  text-decoration: none;
  font-size: 0.88rem;
}

.contact-list a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

/* ── Sections ── */
.section {
  padding-top: 28px;
}

.section h3 {
  margin: 0 0 16px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-dark);
  font-weight: 700;
}

.two-column {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 36px;
}

.entry {
  margin-bottom: 22px;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
}

.entry-head h4,
.mini-card h4 {
  margin: 0;
  font-size: 1.02rem;
}

.entry-head span {
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.92rem;
}

.meta {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

ul {
  margin: 0;
  padding-left: 18px;
}

li + li {
  margin-top: 8px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.chip-group span {
  background: #eef7ff;
  color: var(--accent-dark);
  border: 1px solid #cce8ff;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.compact-list {
  padding-left: 18px;
  margin-bottom: 22px;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mini-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: #fbfdff;
}

.mini-card p {
  margin: 10px 0 0;
  color: var(--muted);
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Responsive (screen only) ── */
@media screen and (max-width: 960px) {
  .cv-card {
    width: 100%;
  }

  .hero,
  .two-column,
  .entry-grid {
    grid-template-columns: 1fr;
  }

  .cv-card {
    padding: 24px;
    border-radius: 18px;
  }

  .entry-head {
    flex-direction: column;
    gap: 4px;
  }
}

/* ── Print / PDF ── */
.no-print {
  /* visible on screen */
}

@page {
  size: A4;
  margin: 15mm 14mm;
}

@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background: white;
    margin: 0;
    padding: 0;
  }

  .page-shell {
    padding: 0;
  }

  .no-print {
    display: none !important;
  }

  .cv-card {
    width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }

  .hero {
    grid-template-columns: 1.3fr 1fr;
    gap: 20px;
  }

  .two-column {
    grid-template-columns: 1.4fr 1fr;
    gap: 28px;
  }

  .entry-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section {
    padding-top: 20px;
  }

  .mini-card,
  .entry {
    break-inside: avoid;
  }

  .contact-list {
    border: 1px solid #ccc;
  }

  .contact-icon {
    background: var(--accent) !important;
    color: white !important;
  }

  .chip-group span {
    background: #eef7ff !important;
    border: 1px solid #cce8ff !important;
  }
}
.dark-toggle {
  border: none;
  background: rgba(255,255,255,0.9);
  border-radius: 12px;
  width: 42px;
  height: 42px;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.dark .dark-toggle {
  background: rgba(30, 41, 59, 0.95);
}

body.dark .lang-toggle {
  background: rgba(30, 41, 59, 0.95);
  border-color: var(--line);
}

body.dark .lang-btn:not(.active) {
  color: var(--muted);
}

body.dark .cv-card {
  background: var(--paper);
}

/* ── Language toggle ── */
.fab-group {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-toggle {
  display: flex;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  font-family: 'Inter', Arial, sans-serif;
  transition: background 0.15s, color 0.15s;
}

.lang-btn.active {
  background: var(--accent);
  color: white;
}

.lang-btn:not(.active):hover {
  background: var(--accent-soft, #eef7ff);
  color: var(--accent-dark);
}

/* ── Contact ── */
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  margin-bottom: 4px;
}

.contact-row .contact-pill {
  margin: 0 8px 8px 0;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  background: var(--contact-pill-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px 5px 5px;
  font-size: 0.84rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  gap: 0;
}

.contact-pill .contact-icon {
  margin-right: 7px;
}

.contact-pill:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  box-sizing: border-box;
}

.contact-icon img {
  display: block;
  width: 14px;
  height: 14px;
  max-width: 14px;
  max-height: 14px;
  flex-shrink: 0;
}

/* ── Hero ── */
.hero {
  display: flex;
  align-items: center;
  gap: 0;
  padding-bottom: 20px;
}

.portrait {
  width: 110px;
  height: 110px;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  flex-shrink: 0;
  border: 3px solid var(--line);
  margin-right: 24px;
}

.hero-body { flex: 1; }

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dark);
  font-weight: 700;
}

.name {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 800;
}

.role {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 500;
}

/* ── Sections ── */
.section {
  padding-top: 24px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
}

.last-section { padding-bottom: 4px; }

.section h3 {
  margin: 0 0 14px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--accent-dark);
  font-weight: 700;
}

.subsection-label { margin: 20px 0 14px !important; }

.body-text {
  margin: 0;
  color: var(--ink);
  font-size: 0.93rem;
  line-height: 1.75;
}

/* ── Chips ── */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 22px;
}

.chip-group span {
  display: inline-block;
  background: var(--chip-bg);
  color: var(--accent-dark);
  border: 1px solid var(--chip-border);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  margin: 0 8px 8px 0;
  white-space: nowrap;
}

/* ── Entries ── */
.entry { margin-bottom: 20px; }
.entry:last-child { margin-bottom: 0; }

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.entry-head h4 { margin: 0; font-size: 0.98rem; font-weight: 700; }
.entry-head span { color: var(--muted); white-space: nowrap; font-size: 0.88rem; font-weight: 500; }

.meta { margin: 4px 0 8px; color: var(--muted); font-size: 0.88rem; }

ul { margin: 0; padding-left: 18px; }
li { font-size: 0.91rem; line-height: 1.65; }
li + li { margin-top: 5px; }

/* ── Strengths + Languages ── */
.two-sm { display: flex; gap: 0; }
.two-sm > div:first-child { width: 60%; padding-right: 28px; }
.two-sm > div:last-child { width: 40%; }

.compact-list { padding-left: 18px; margin: 0; }

/* ── Projects ── */
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mini-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--mini-card-bg);
}

.mini-card h4 { margin: 0 0 6px; font-size: 0.92rem; font-weight: 700; }
.mini-card p { margin: 0; color: var(--muted); font-size: 0.87rem; line-height: 1.6; }

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media screen and (max-width: 780px) {
  .cv-card { width: 100%; padding: 24px 20px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .two-sm, .project-grid { grid-template-columns: 1fr; }
  .entry-head { flex-direction: column; gap: 2px; }
  .fab-group { flex-direction: column; align-items: flex-end; gap: 8px; }
}

/* ── Print ── */
.no-print {}

@page {
  size: A4 portrait;
  margin: 12mm 14mm;
  @top-center { content: ''; }
  @bottom-center { content: ''; }
}

@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  body { background: white !important; }
  .page-shell { padding: 0 !important; }
  .no-print { display: none !important; }
  .cv-card { width: 100% !important; margin: 0 !important; border-radius: 0 !important; box-shadow: none !important; padding: 0 !important; }
  .two-sm > div:first-child { width: 60% !important; padding-right: 28px !important; }
  .two-sm > div:last-child { width: 40% !important; }
  .project-grid { grid-template-columns: 1fr 1fr !important; }
  .section { border-top: 1px solid #d8e1ea !important; }
  .mini-card, .entry { break-inside: avoid; }
  .contact-icon { background: rgb(0, 153, 255) !important; color: white !important; }
  .chip-group span { background: #eef7ff !important; border: 1px solid #cce8ff !important; }
  .contact-pill { background: #f1f7fd !important; border: 1px solid #d8e1ea !important; }
}