:root {
  --ink: #1c2430;
  --muted: #5b6573;
  --line: #d8dde4;
  --paper: #f4f1eb;
  --card: #fff;
  --accent: #2f4a6d;
  --accent-hover: #243a57;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  font-size: 16px;
}

.page {
  max-width: 820px;
  margin: 32px auto 64px;
  background: var(--card);
  padding: 40px 44px 48px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(28, 36, 48, 0.08);
}

h1, h2, h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2rem;
  line-height: 1.15;
}

h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  margin-bottom: 14px;
}

h3 {
  font-size: 1.05rem;
}

p {
  margin: 0 0 8px;
}

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

a:hover {
  text-decoration: underline;
}

section {
  margin-top: 28px;
}

.hero {
  display: flex;
  gap: 28px;
  align-items: center;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.photo {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 12%;
  flex-shrink: 0;
  border: 3px solid #eef1f5;
  background: #fff;
}

.role {
  color: var(--accent);
  font-weight: 600;
  margin-top: 4px;
}

.location,
.company,
.dates,
.hint {
  color: var(--muted);
}

.contacts {
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.sep {
  margin: 0 6px;
  color: var(--line);
}

.print-urls {
  display: none;
}

.print-contacts {
  display: none;
}

.print-note {
  display: none;
}

.download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin: 0;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.download:hover {
  background: var(--accent-hover);
}

.profiles {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0 0;
}

.profiles a {
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

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

.brand-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.inline-icon {
  color: #25d366;
  margin-left: 4px;
  font-size: 1.05rem;
}

.inline-icon:hover {
  text-decoration: none;
  color: #1ebe57;
}

.job {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
  margin-bottom: 22px;
}

.logo-wrap {
  width: 88px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  text-decoration: none;
  border: 1px solid transparent;
}

.logo-wrap:hover {
  border-color: var(--line);
}

.logo-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

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

.dates {
  white-space: nowrap;
  font-size: 0.9rem;
  margin: 0;
}

.company {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.scope {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 8px;
}

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

li {
  margin-bottom: 5px;
}

.edu {
  margin-bottom: 12px;
}

.oss {
  padding-left: 18px;
}

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

.skills {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skills li {
  margin: 0;
  background: #eef2f7;
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
}

@media (max-width: 700px) {
  .page {
    margin: 0;
    padding: 24px 20px 40px;
    border-radius: 0;
    box-shadow: none;
  }

  .hero {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .hero-top {
    width: 100%;
  }

  .profiles {
    justify-content: center;
  }

  .job {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .logo-wrap {
    width: 72px;
    height: 48px;
  }

  .job-head {
    flex-direction: column;
    gap: 2px;
  }

  .contacts {
    line-height: 1.7;
  }

  .sep {
    display: none;
  }

  .contacts a,
  .contacts .hint {
    display: inline-block;
    margin-right: 8px;
  }
}

@media print {
  :root {
    --ink: #111;
    --muted: #333;
    --accent: #111;
    --line: #bbb;
  }

  body {
    background: #fff;
    font-size: 10.5pt;
    line-height: 1.35;
    color: #111;
  }

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

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

  .print-urls {
    display: block;
    font-size: 9.5pt;
    color: #333;
    margin-top: 4px;
  }

  .print-contacts {
    display: block;
  }

  .print-note {
    display: block;
    font-size: 9.5pt;
    color: #333;
    margin: 16px 0 0;
  }

  .print-contacts sup {
    font-size: 7.5pt;
    line-height: 0;
  }

  .hero {
    display: block;
    padding-bottom: 10px;
    margin-bottom: 8px;
  }

  h1 {
    font-size: 18pt;
  }

  .role {
    font-size: 11pt;
    color: #111;
  }

  .contacts a {
    color: #111;
    text-decoration: none;
  }

  .profiles,
  .inline-icon {
    display: none;
  }

  .hero-top {
    display: block;
  }

  section {
    margin-top: 12px;
  }

  h2 {
    font-size: 9.5pt;
    color: #111;
    margin-bottom: 8px;
    padding-bottom: 3px;
  }

  h3 {
    font-size: 11pt;
  }

  .job {
    display: block;
    margin-bottom: 10px;
  }

  .scope {
    color: #333;
    font-size: 10pt;
  }

  li {
    margin-bottom: 2px;
  }

  .skills {
    display: block;
  }

  .skills li {
    display: inline;
    background: none;
    padding: 0;
    font-weight: 400;
    color: #111;
    font-size: 10.5pt;
  }

  .skills li:not(:last-child)::after {
    content: ", ";
  }

  .oss a {
    color: #111;
    word-break: break-all;
  }

  a {
    color: #111;
  }

  .edu {
    break-inside: avoid;
  }
}

@page {
  size: A4;
  margin: 16mm 14mm;

  @top-left {
    content: none;
  }

  @top-center {
    content: none;
  }

  @top-right {
    content: none;
  }

  @bottom-left {
    content: none;
  }

  @bottom-center {
    content: none;
  }

  @bottom-right {
    content: none;
  }
}
