:root {
  --text: #1a1a1a;
  --muted: #5f6368;
  --soft: #8a8f98;
  --line: #d8dbe0;
  --accent: #3f5c7a;
  --bg: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #eef2f7 0%, #f8fafc 100%);
  color: var(--text);
  font-family: "Inter", sans-serif;
  line-height: 1.45;
}

body {
  padding: 24px 0;
}

.page {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.96);
  padding: 15mm 15mm 14mm;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Header */
.header {
  display: block;
  margin-bottom: 18px;
  padding: 14px 24px;
  border-radius: 6px;
  background: rgba(63, 92, 122, 0.08);
  border: 1px solid rgba(63, 92, 122, 0.12);
}

.header-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}

.header-contact {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.role {
  margin: 0 0 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.contact {
  display: grid;
  gap: 6px;
  justify-items: end;
  font-size: 12.5px;
  text-align: right;
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
}

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

.contact-item .icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-item .icon svg {
  width: 100%;
  height: 100%;
}

.contact a,
.contact span {
  color: inherit;
  text-decoration: none;
}

.job-links {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.job-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 12.5px;
}

.job-links a:hover {
  color: var(--accent);
}

.job-links .icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex-shrink: 0;
}

.job-links .icon svg {
  width: 100%;
  height: 100%;
}

.job-links-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text);
}

/* Sections */
.section {
  margin-top: 14px;
}


.header-contact a,
.header-contact .job-links-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text);
  text-decoration: none;
}

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

.header-contact .icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex-shrink: 0;
}

.header-contact .icon svg {
  width: 100%;
  height: 100%;
}

.summary {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(63, 92, 122, 0.15);
  color: var(--muted);
}

h2 {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
}

p {
  margin: 0;
  font-size: 12.5px;
}

ul {
  margin: 6px 0 0 18px;
  padding: 0;
}

li {
  margin: 0 0 1px;
  font-size: 12.5px;
}

strong {
  font-weight: 700;
}

/* Section heading emphasis */
.experience-section h2,
.education-section h2,
.bottom-grid h2 {
  font-size: 13.5px;
}

.item,
.project,
.edu {
  margin-bottom: 12px;
}

.item-head,
.edu-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 3px;
}

.item-head p,
.edu p,
.project p:first-of-type {
  margin-top: 2px;
  color: var(--muted);
}

.item-head span,
.edu-head span {
  font-size: 11.5px;
  color: var(--soft);
  white-space: nowrap;
}

.experience-section .item,
.education-section .edu,
.project,
.section .item {
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}

/* Layout blocks */
.two-col {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 18px;
  align-items: start;
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
}

.bottom-grid > .section {
  min-width: 0;
}

.bottom-grid > .section h2 {
  margin-top: 0;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-top: 10px;
}

.pill {
  font-size: 11px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid rgba(63, 92, 122, 0.2);
  padding: 1px 7px;
  border-radius: 4px;
}

.compact li {
  margin-bottom: 1px;
}

.bottom-grid .project:last-child,
.education-section .edu:last-child,
.experience-section .item:last-child {
  margin-bottom: 0;
}

.tech {
  font-size: 11px;
  font-weight: 500;
  color: var(--soft);
  margin-left: 4px;
}

.subhead {
  margin-top: 0;
}

/* Print */
@page {
  size: A4;
  margin: 10mm;
}

@media print {
  html,
  body {
    background: #ffffff;
    padding: 0;
  }

  .page {
    width: auto;
    min-height: auto;
    margin: 0;
    padding: 10mm 12mm;
    box-shadow: none;
  }

  .header-top {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .header-contact {
    justify-items: end;
    text-align: right;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  .header {
    padding: 14px 16px;
    margin-bottom: 10px;
  }

  .section {
    margin-top: 10px;
    padding-top: 8px;
  }

  .header + .section {
    margin-top: 8px;
  }

  .item,
  .project,
  .edu {
    margin-bottom: 6px;
  }

  ul {
    margin-top: 4px;
  }

  li {
    margin-bottom: 2px;
  }

  .summary {
    margin-top: 8px;
    padding-top: 8px;
  }

  p, li {
    font-size: 11px;
  }

  h3 {
    font-size: 12px;
  }

  h2 {
    font-size: 11px;
  }

  .experience-section h2,
  .education-section h2 {
    font-size: 12px;
  }
}

/* Mobile fallback */
@media screen and (max-width: 900px) {
  body {
    padding: 0;
    background: #ffffff;
  }

  .page {
    width: 100%;
    min-height: auto;
    padding: 22px;
    box-shadow: none;
  }

  .header,
  .header-top,
  .two-col,
  .bottom-grid,
  .item-head,
  .edu-head {
    display: block;
  }

  .header-contact {
    justify-items: start;
    text-align: left;
    margin-top: 12px;
  }

  .contact {
    margin-top: 12px;
    justify-items: start;
    text-align: left;
  }

  .experience-section .item,
  .education-section .edu {
    padding-left: 0;
    border-left: none;
  }
}

.section {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* remove line for first section after header */
.header + .section {
  border-top: none;
  padding-top: 0;
  margin-top: 14px;
}
.section {
  margin-top: 16px;
}

.item,
.project,
.edu {
  margin-bottom: 10px;
}