:root {
  --blue: #1f5f93;
  --blue-dark: #17496f;
  --text: #17202a;
  --muted: #5d6670;
  --line: #dce3e9;
  --soft: #f5f8fa;
  --paper: #ffffff;
  --bg: #eef2f5;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.page-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 28px auto;
  padding: 52px 62px 36px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 34px rgba(23, 32, 42, .10);
}

.site-header {
  text-align: center;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--blue);
}

h1 {
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.1;
  letter-spacing: -.4px;
}

.headline {
  margin: 10px auto 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}

.contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 8px;
  color: var(--muted);
  font-size: 13px;
}

a {
  color: var(--blue-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover { color: var(--blue); }

.section { margin-top: 30px; }

.section > h2 {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 23px;
  line-height: 1.2;
}

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

.skill-card {
  padding: 14px 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.skill-card.wide { grid-column: 1 / -1; }

.skill-card h3,
.education-item h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
}

.skill-card p,
.education-item p { margin: 0; color: #333d47; }

.job {
  padding: 0 0 22px;
  margin: 0 0 22px;
  border-bottom: 1px solid var(--line);
}

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

.job-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 8px;
}

.job h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.25;
}

.company {
  margin: 2px 0 0;
  color: var(--blue-dark);
  font-weight: 650;
}

.meta {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  white-space: nowrap;
  text-align: right;
}

ul {
  margin: 8px 0 0 20px;
  padding: 0;
}

li { margin-bottom: 5px; }

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

.compact { margin-top: 30px; }

.education-item {
  padding: 0 0 12px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

.education-item:last-child { border-bottom: 0; }
.education-item p span { color: var(--muted); }

.cert-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cert-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.cert-list li:last-child { border-bottom: 0; }
.cert-list span { color: var(--muted); text-align: right; }

footer {
  margin-top: 34px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

footer p { margin: 0; }

@media (max-width: 760px) {
  body { font-size: 14px; }

  .page-shell {
    width: 100%;
    margin: 0;
    padding: 28px 18px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .headline { font-size: 14px; }
  .contacts { line-height: 1.6; }
  .desktop-only { display: none; }

  .skills-grid,
  .bottom-grid { grid-template-columns: 1fr; }

  .skill-card.wide { grid-column: auto; }

  .job-heading { grid-template-columns: 1fr; gap: 2px; }
  .meta { text-align: left; white-space: normal; }

  .cert-list li { grid-template-columns: 1fr; gap: 2px; }
  .cert-list span { text-align: left; }
}

@media print {
  @page { margin: 0.55in; }

  body {
    background: #fff;
    color: #000;
    font-size: 10.5pt;
  }

  .page-shell {
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  a { color: inherit; text-decoration: none; }
  .site-header { padding-bottom: 14px; }
  .section { margin-top: 18px; }
  .section > h2 { font-size: 16pt; margin-bottom: 8px; }

  .skills-grid { gap: 7px; }
  .skill-card { padding: 8px 10px; background: #fff; }

  .job {
    break-inside: avoid-page;
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  .job h3 { font-size: 11.5pt; }
  .meta { font-size: 9pt; }
  li { margin-bottom: 2px; }
  footer { display: none; }
}
