* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary-color: #24292f;
  --secondary-color: #5f6b76;
  --accent-color: #1f4f5f;
  --line-color: #d7dee4;
}

html, body {
  margin: 0;
  padding: 0;
  background: #f6f8fa;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color: var(--primary-color);
  font-size: 9.15pt;
  line-height: 1.28;
}

/* A4 canvas with internal margins. */
.page {
  width: 210mm;
  height: 297mm;
  margin: 0 auto;
  background: #fff;
  padding: 13mm 14mm 15mm 14mm;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(31,79,95,0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.resume-section {
  flex: 0 0 auto;
  min-width: 0;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 0;
}

.header h1 {
  margin: 0 0 3px 0;
  color: var(--accent-color);
  font-size: 20.5pt;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.header p {
  margin: 0;
  color: var(--secondary-color);
  font-size: 9.2pt;
}

.header .headline {
  margin-bottom: 1px;
  color: var(--primary-color);
  font-weight: 600;
}

.header-link {
  color: inherit;
  text-decoration: none;
}

/* Section titles */
.title-3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.9pt;
  font-weight: 700;
  color: var(--accent-color);
  margin-top: 0;
  margin-bottom: 4px;
}

.title-3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-color);
}

/* Skills */
.skills-section {
  margin-bottom: 2px;
}

.skills-section p {
  margin: 1.3px 0;
  line-height: 1.24;
}

.skills-section strong {
  color: var(--accent-color);
}

/* Experience and education rows */
.experience-header,
.experience-subheader {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.experience-header {
  font-weight: 700;
  font-size: 10.25pt;
  margin-top: 5px;
}

.experience-section .experience-header {
  margin-top: 7px;
}

.resume-section > .title-3 + .experience-header {
  margin-top: 0;
}

.experience-header span:last-child {
  color: var(--secondary-color);
  font-size: 9.0pt;
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
}

.experience-subheader {
  font-size: 9.0pt;
  color: var(--secondary-color);
  margin-top: 1px;
  margin-bottom: 1.5px;
}

.experience-subheader em {
  font-style: normal;
  text-align: right;
}

.credential-link {
  color: inherit;
  text-decoration: none;
}

/* Bullets */
ul {
  margin-top: 1px;
  margin-bottom: 3px;
  padding-left: 15px;
}

li {
  margin-bottom: 1.7px;
  line-height: 1.25;
  text-align: left;
}

@media screen {
  body {
    padding: 18px 0;
  }
}

@media print {
  html, body {
    width: 210mm;
    height: 297mm;
    background: #fff;
  }

  body {
    padding: 0;
  }

  .page {
    width: 210mm;
    height: 297mm;
    margin: 0;
    padding: 13mm 14mm 15mm 14mm;
    box-shadow: none;
    overflow: hidden;
  }
}

@page {
  size: A4;
  margin: 0;
}

/* Fixed corner buttons (screen only) */
.download-btn,
.lang-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--accent-color);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(31, 79, 95, 0.18);
  text-decoration: none;
  z-index: 10;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.lang-btn {
  right: 68px;
}
.download-btn:hover,
.lang-btn:hover {
  box-shadow: 0 6px 18px rgba(31, 79, 95, 0.28);
  transform: translateY(-1px);
}

@media print {
  .download-btn,
  .lang-btn {
    display: none;
  }
}
