@import url('https://fonts.googleapis.com/css2?family=PT+Serif:ital,wght@0,400;0,700;1,400&family=PT+Sans:wght@400;700&display=swap');

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

:root {
  --paper: #faf9f7;
  --ink: #1a1a1a;
  --muted: #555;
  --light: #888;
  --rule: #d0cdc8;
  --accent: #1a3a6b;
}

html { background: #e8e5e0; }

body {
  font-family: 'PT Sans', 'Arial', sans-serif;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.42;
  background: #e8e5e0;
  padding: 2.5rem 1rem 4rem;
}

.print-bar {
  max-width: 760px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.print-bar.is-actions-only {
  justify-content: flex-end;
}

.print-bar a {
  font-size: .82rem;
  color: #666;
  text-decoration: none;
}

.print-bar a:hover { text-decoration: underline; }

.print-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-print {
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: .35rem .9rem;
  font-size: .82rem;
  cursor: pointer;
  color: #333;
  display: flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
}

.btn-print:hover { background: #f5f5f5; }

.btn-download {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-download:hover { background: #24497f; }

.locale-switcher {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-left: .25rem;
}

.locale-link {
  min-width: 34px;
  justify-content: center;
  font-weight: 700;
}

.locale-link.is-active {
  background: rgba(26,58,107,.08);
  border-color: var(--accent);
  color: var(--accent);
}

.print-note {
  max-width: 760px;
  margin: 0 auto 1.1rem;
  font-size: .76rem;
  color: var(--light);
  text-align: right;
}

.paper {
  max-width: 760px;
  margin: 0 auto;
  background: var(--paper);
  line-height: 1.42;
  box-shadow:
    0 1px 1px rgba(0,0,0,.06),
    0 4px 12px rgba(0,0,0,.1),
    0 16px 40px rgba(0,0,0,.08);
  padding: 56px 64px 60px;
}

.cv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding-bottom: 1.4rem;
  border-bottom: 2px solid var(--ink);
}

.cv-name {
  font-family: 'PT Serif', Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.15;
  letter-spacing: 0;
}

.cv-role {
  margin-top: .25rem;
  font-size: .95rem;
  color: var(--muted);
  font-style: italic;
}

.cv-contacts {
  text-align: right;
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.55;
  flex-shrink: 0;
}

.cv-contacts a { color: var(--muted); text-decoration: none; }
.cv-contacts a:hover { text-decoration: underline; }

.cv-intro {
  margin-top: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1.35fr .95fr;
  gap: 2rem;
}

.cv-intro.is-single-column { grid-template-columns: 1fr; }

.cv-summary-title,
.cv-facts-title {
  font-family: 'PT Serif', Georgia, serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .7rem;
}

.cv-summary-text {
  font-size: .92rem;
  color: var(--muted);
  line-height: 1.55;
}

.cv-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: .65rem;
}

.cv-fact {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: .8rem;
  align-items: baseline;
  padding-bottom: .35rem;
  border-bottom: 1px dotted var(--rule);
}

.cv-fact:last-child { border-bottom: none; padding-bottom: 0; }

.cv-fact-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--light);
}

.cv-fact-value {
  font-size: .85rem;
  color: var(--ink);
}

.cv-section { margin-top: 1.6rem; }

.cv-section-title {
  font-family: 'PT Serif', Georgia, serif;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--rule);
  padding-bottom: .3rem;
  margin-bottom: 1.1rem;
  break-after: avoid;
  page-break-after: avoid;
}

.cv-entry {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.3rem;
}

.cv-entry-date {
  flex-shrink: 0;
  width: 90px;
  font-size: .78rem;
  color: var(--light);
  padding-top: .15rem;
  text-align: right;
}

.cv-entry-body { flex: 1; }

.cv-entry-title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--ink);
  line-height: 1.28;
}

.cv-entry-title a { color: var(--accent); text-decoration: none; }
.cv-entry-title a:hover { text-decoration: underline; }

.cv-entry-sub {
  font-size: .82rem;
  color: var(--muted);
  margin-top: .1rem;
  font-style: italic;
  line-height: 1.32;
}

.cv-entry-desc {
  margin-top: .45rem;
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.46;
}

.cv-entry-stack {
  margin-top: .45rem;
  font-size: .78rem;
  color: var(--light);
}

.cv-entry-stack strong { color: var(--muted); font-weight: 700; }

.cv-entry-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .9rem;
  margin-top: .35rem;
}

.cv-entry-links a {
  font-size: .8rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(26,58,107,.25);
}

.cv-entry-links a:hover { text-decoration: underline; }

.cv-entry-note {
  margin-top: .35rem;
  font-size: .8rem;
  color: var(--light);
  line-height: 1.45;
}

.skills-table { width: 100%; border-collapse: collapse; }

.skills-table td {
  padding: .3rem 0;
  vertical-align: top;
  font-size: .88rem;
}

.skills-table td:first-child {
  width: 140px;
  font-weight: 700;
  color: var(--ink);
  padding-right: 1rem;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.skills-table td:last-child { color: var(--muted); }
.skills-table tr { border-bottom: 1px dotted var(--rule); }
.skills-table tr:last-child { border-bottom: none; }

.cv-version-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .85rem;
}

.cv-version-card {
  border: 1px solid var(--rule);
  background: rgba(255,255,255,.45);
  padding: .85rem;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-height: 110px;
}

.cv-version-card:hover {
  border-color: var(--accent);
  background: rgba(26,58,107,.04);
}

.cv-version-card.is-current {
  border-color: var(--accent);
  background: rgba(26,58,107,.08);
}

.cv-version-card strong {
  color: var(--accent);
  font-size: .92rem;
}

.cv-version-card span {
  font-size: .78rem;
  line-height: 1.4;
}

.cv-list {
  display: grid;
  gap: .45rem;
  padding-left: 1.05rem;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.5;
}

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

.cv-achievement {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  margin-bottom: .6rem;
  font-size: .88rem;
}

.cv-achievement-year {
  flex-shrink: 0;
  width: 90px;
  text-align: right;
  font-size: .78rem;
  color: var(--light);
}

.cv-achievement-text { color: var(--muted); }
.cv-achievement-text strong { color: var(--ink); }

.cv-link-groups {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cv-link-group {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1rem;
  align-items: start;
}

.cv-link-group-label {
  font-size: .78rem;
  color: var(--light);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  padding-top: .15rem;
}

.cv-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .7rem;
}

.cv-link-pill {
  display: inline-block;
  padding: .32rem .72rem;
  border: 1px solid var(--rule);
  background: rgba(255,255,255,.45);
  color: var(--accent);
  text-decoration: none;
  font-size: .82rem;
  line-height: 1.35;
  white-space: nowrap;
}

.cv-link-pill:hover {
  border-color: var(--accent);
  background: rgba(26,58,107,.04);
}

.cv-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: .75rem;
  color: var(--light);
  text-align: center;
  font-style: italic;
}

.cv-header,
.cv-intro,
.cv-entry,
.cv-achievement,
.cv-link-group,
.cv-version-card,
.cv-fact,
.skills-table tr,
.cv-list li {
  break-inside: avoid;
  page-break-inside: avoid;
}

body.pdf-export { line-height: 1.34; }

body.pdf-export .paper {
  box-shadow: none;
  line-height: 1.34;
  padding: 40px 44px 42px;
}

body.pdf-export .cv-header {
  gap: 1.25rem;
  padding-bottom: .95rem;
}

body.pdf-export .cv-contacts { line-height: 1.32; }

body.pdf-export .cv-intro {
  margin-top: .85rem;
  padding-bottom: .8rem;
  gap: 1.2rem;
}

body.pdf-export .cv-intro.is-single-column { grid-template-columns: 1fr; }

body.pdf-export .cv-summary-text { line-height: 1.38; }
body.pdf-export .cv-facts { gap: .42rem; }
body.pdf-export .cv-fact { padding-bottom: .2rem; }
body.pdf-export .cv-section { margin-top: 1rem; }
body.pdf-export .cv-section-title { margin-bottom: .7rem; }

body.pdf-export .cv-entry {
  display: block;
  margin-bottom: .75rem;
}

body.pdf-export .cv-entry-date {
  width: auto;
  text-align: left;
  padding-top: 0;
  margin-bottom: .18rem;
}

body.pdf-export .cv-entry-sub { margin-top: .05rem; }
body.pdf-export .cv-entry-links { gap: .35rem .7rem; margin-top: .18rem; }
body.pdf-export .cv-entry-desc { margin-top: .24rem; line-height: 1.32; }
body.pdf-export .cv-entry-stack { margin-top: .24rem; }
body.pdf-export .skills-table td { padding: .2rem 0; }
body.pdf-export .cv-achievement { margin-bottom: .35rem; }
body.pdf-export .cv-link-groups { gap: .75rem; }
body.pdf-export .cv-link-pill { padding: .26rem .58rem; font-size: .78rem; }
body.pdf-export .cv-version-grid { gap: .55rem; }
body.pdf-export .cv-version-card { min-height: auto; padding: .6rem; }
body.pdf-export .cv-footer { margin-top: 1rem; padding-top: .6rem; }

@media print {
  html { background: #fff; }
  body { background: #fff; padding: 0; }
  .print-bar,
  .print-note { display: none; }
  .paper {
    box-shadow: none;
    padding: 30px 40px 40px;
    max-width: 100%;
  }
}

@media (max-width: 700px) {
  .cv-version-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .print-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .print-note { text-align: left; }

  .print-actions {
    justify-content: stretch;
    flex-direction: column;
  }

  .btn-print {
    width: 100%;
    justify-content: center;
  }

  .locale-switcher {
    width: 100%;
    margin-left: 0;
  }

  .locale-link { flex: 1; }
  .paper { padding: 28px 24px 36px; }
  .cv-header { flex-direction: column; }
  .cv-contacts { text-align: left; }
  .cv-intro { grid-template-columns: 1fr; gap: 1rem; }
  .cv-fact,
  .cv-link-group { grid-template-columns: 1fr; }
  .cv-link-list { gap: .45rem .55rem; }
  .cv-entry { flex-direction: column; gap: .2rem; }
  .cv-entry-date { width: auto; text-align: left; }
}