/* CV — A4 single-column, ATS-safe */

:root {
  --ink: #1a1a1a;
  --muted: #444;
  --rule: #c8c8c8;
  --accent: #1e3a5f;
  --page-pad: 14mm;
  --font: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html {
  font-size: 10.5pt;
}

body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: #e8e8e8;
  font-family: var(--font);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

.cv {
  max-width: 210mm;
  min-height: 297mm;
  margin: 1.5rem auto;
  padding: var(--page-pad);
  background: #fff;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.12);
}

/* Header — all critical info in body flow (not page header/footer) */
.cv-header {
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1.5px solid var(--accent);
}

.name {
  margin: 0 0 0.15rem;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1.15;
}

.title {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--muted);
}

.contact {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.65rem;
}

.contact span + span::before {
  content: "·";
  margin-right: 0.5rem;
  color: #999;
}

.contact a {
  word-break: break-all;
}

/* Sections */
.section {
  margin-top: 1rem;
}

.section h2 {
  margin: 0 0 0.45rem;
  padding-top: 0.05rem;
  padding-bottom: 0.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  border-bottom: 1px solid var(--rule);
}

.summary {
  margin: 0;
  text-align: left;
}

/* Skills as plain text lists — no bars */
.skills-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.skills-list li {
  margin-bottom: 0.2rem;
}

.skill-category {
  font-weight: 600;
  color: var(--ink);
}

.skill-items {
  color: var(--muted);
}

/* Experience / projects / education entries */
.entry {
  margin-bottom: 0.65rem;
}

.entry:last-child {
  margin-bottom: 0;
}

.entry-header {
  margin-bottom: 0.15rem;
}

.entry-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.25;
}

.entry-meta {
  margin: 0.1rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.75rem;
}

.entry-desc {
  margin: 0.2rem 0 0;
  color: var(--ink);
}

.bullets {
  margin: 0.25rem 0 0;
  padding-left: 1.15rem;
}

.bullets li {
  margin-bottom: 0.18rem;
}

.bullets li::marker {
  color: var(--accent);
}

.certs-list {
  margin: 0;
  padding-left: 1.15rem;
}

.certs-list.compact-certs {
  margin-top: 0.35rem;
}

.certs-list li {
  margin-bottom: 0.15rem;
}

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

/* Action bar / Download buttons */
@media screen {
  .actions-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    z-index: 1000;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 25px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  }

  .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(30, 58, 95, 0.2);
    text-decoration: none;
  }

  .btn-secondary {
    background-color: #f1f3f5;
    color: var(--accent);
  }

  .btn-secondary:hover {
    background-color: #e9ecef;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
  }

  /* Language switcher */
  .actions-divider {
    width: 1px;
    align-self: stretch;
    margin: 0.25rem 0;
    background: var(--rule);
    opacity: 0.6;
  }

  .lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  .lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.7rem;
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    color: var(--muted);
    background: transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
  }

  .lang-btn:hover {
    background-color: #f1f3f5;
    color: var(--accent);
    text-decoration: none;
  }

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

  .lang-active:hover {
    background-color: var(--accent);
    color: #fff;
    opacity: 0.9;
  }

  body {
    padding: 0 0.5rem 6rem; /* extra padding to scroll past the floating bar */
  }
}

/* Mobile — keep single-column, just tighten spacing */
@media screen and (max-width: 600px) {
  html {
    font-size: 9.5pt;
  }

  body {
    padding: 0 0 5rem;
  }

  .cv {
    margin: 0;
    padding: 10mm 5mm;
    min-height: auto;
    box-shadow: none;
  }

  .name {
    font-size: 1.5rem;
  }

  .title {
    font-size: 0.95rem;
  }

  .contact {
    flex-direction: column;
    gap: 0.25rem;
  }

  .contact span + span::before {
    content: none;
    margin-right: 0;
  }

  .contact a {
    word-break: break-word;
  }

  .actions-bar {
    gap: 0.4rem;
    padding: 0.5rem;
    bottom: 0.75rem;
  }

  .btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
  }

  .lang-btn {
    padding: 0.35rem 0.55rem;
    font-size: 0.7rem;
  }
}

/* Print / PDF (Playwright) */
@page {
  size: A4;
  margin: 0;
}

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

  html {
    font-size: 10pt;
    overflow: hidden; /* prevent micro-overflow from creating blank page 2 */
  }

  body {
    background: #fff;
    margin: 0;
    padding: 0;
  }

  .cv {
    margin: 0;
    max-width: none;
    min-height: auto;
    box-shadow: none;
    padding: var(--page-pad);
  }

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

  .section {
    /* break-inside: avoid removed — large sections (e.g. Experience)
       can exceed one page and would leave blank space on page 1.
       Individual .entry elements below still avoid breaking. */
  }

  .entry {
    break-inside: avoid;
  }
}
