:root {
  --navy: #1d2b43;
  --navy-deep: #162235;
  --paper: #fffdf8;
  --page: #f0eee8;
  --ink: #1b2434;
  --muted: #606268;
  --soft: #d7d7d0;
  --line: #d9d8d0;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(29, 43, 67, 0.06) 0 1px, transparent 1px 24px),
    linear-gradient(180deg, rgba(29, 43, 67, 0.04) 0 1px, transparent 1px 24px),
    var(--page);
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  line-height: 1.45;
}

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

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

.page-actions {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 18px 28px;
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 700;
}

.quick-contact {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(29, 43, 67, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--navy);
  padding: 7px 10px;
  backdrop-filter: blur(12px);
}

.quick-label {
  color: #5d6777;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.quick-value {
  font-weight: 700;
}

.email-chip {
  grid-template-columns: 1fr;
}

.copy-chip {
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.08s ease;
}

.copy-chip:hover {
  border-color: rgba(29, 43, 67, 0.38);
}

.copy-chip:active {
  transform: translateY(1px);
}

.copy-chip.copied {
  border-color: #2f7c5b;
  background: #e7f5ee;
}

.copy-chip.copied .quick-label,
.copy-chip.copied .quick-value {
  color: #1f5d43;
}

.print-btn {
  border: 1px solid rgba(29, 43, 67, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--navy);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 10px 16px;
  backdrop-filter: blur(12px);
}

.print-btn {
  background: var(--navy);
  color: var(--white);
}

.cv-page {
  display: grid;
  grid-template-columns: minmax(300px, 0.42fr) minmax(0, 0.58fr);
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto 56px;
  background: var(--paper);
  box-shadow: 0 30px 80px rgba(20, 28, 40, 0.16);
}

.sidebar {
  background: var(--navy);
  color: var(--white);
  padding: 42px 46px 48px;
}

.profile-kicker {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.45;
  text-transform: uppercase;
}

.profile-photo {
  display: block;
  width: 176px;
  height: 176px;
  margin: 0 auto 28px;
  border: 7px solid var(--white);
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 18%;
  background: var(--white);
}

.identity h1 {
  margin-bottom: 16px;
  color: var(--white);
  font-size: 4.35rem;
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: 0;
}

.role-line {
  margin-bottom: 22px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  text-transform: none;
}

.summary {
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.58;
}

.rail-section {
  margin-top: 32px;
}

.rail-section h2 {
  margin-bottom: 14px;
  color: var(--soft);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0;
}

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

.rail-list li {
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
}

.strong-list li {
  font-weight: 700;
}

.rail-item {
  margin-bottom: 16px;
}

.rail-item h3 {
  margin-bottom: 4px;
  color: var(--white);
  font-size: 1rem;
  font-weight: 800;
}

.rail-item p {
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.84);
}

.contact-list li:first-child {
  font-weight: 800;
}

.cert-list li {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.88rem;
}

.main-column {
  position: relative;
  padding: 36px 36px 34px 36px;
}

.content-section + .content-section {
  margin-top: 34px;
}

.section-banner {
  position: relative;
  margin: 0 0 22px -78px;
  background: var(--soft);
  padding: 15px 28px 16px 78px;
}

.section-banner::after {
  position: absolute;
  bottom: -34px;
  left: 0;
  width: 42px;
  height: 34px;
  background: #777a78;
  clip-path: polygon(0 0, 100% 100%, 100% 0);
  content: "";
}

.section-banner h2 {
  margin: 0;
  color: #111111;
  font-size: 2.8rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
}

.company + .company {
  margin-top: 28px;
}

.company-title {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 8px;
}

.company-title h3 {
  margin-bottom: 0;
  color: var(--navy);
  font-size: 1.42rem;
  font-weight: 800;
  text-transform: uppercase;
}

.company-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
  text-align: right;
}

.company-sector {
  margin: 0 0 6px;
  color: #6a6f78;
  font-size: 0.9rem;
  font-weight: 700;
}

.company-note {
  margin-bottom: 18px;
  color: #595a5e;
  font-size: 1.02rem;
}

.role {
  margin-top: 18px;
}

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

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

.role h4,
.project h3,
.pov-grid h3 {
  margin-bottom: 4px;
  color: #52545a;
  font-size: 1.1rem;
  font-weight: 800;
}

.role-head span,
.project-head span {
  flex: 0 0 auto;
  color: #52545a;
  font-weight: 800;
}

.role-head span {
  display: block;
  margin-top: 0;
  text-align: right;
  white-space: nowrap;
}

.company-meta {
  display: grid;
  gap: 3px;
  text-align: right;
}

.company-meta .meta-label {
  font-weight: 700;
}

.company-meta .meta-dates {
  font-weight: 800;
}

.role p,
.project p,
.pov-grid p {
  margin: 0;
  color: #595a5e;
  font-size: 1rem;
}

.project p + p {
  margin-top: 10px;
}

.print-project-summary {
  display: none;
}

.project-features {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  color: #595a5e;
}

.project-features li {
  position: relative;
  padding-left: 1rem;
  line-height: 1.45;
}

.role-points {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  color: #595a5e;
}

.role-points li {
  position: relative;
  padding-left: 1rem;
  line-height: 1.45;
}

.project-features li::before,
.role-points li::before {
  position: absolute;
  top: 0.66em;
  left: 0;
  width: 0.34rem;
  height: 0.34rem;
  border-radius: 999px;
  background: #7b8595;
  transform: translateY(-50%);
  content: "";
}

.compact-role,
.role-line-only {
  margin-top: 10px;
}

.project + .project {
  margin-top: 20px;
}

.project h3 {
  color: var(--navy);
}

.pov-grid {
  display: grid;
  gap: 16px;
}

.pov-grid article {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.footer {
  margin-top: 34px;
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 980px) {
  .page-actions {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    padding: 14px 18px;
  }

  .page-actions::-webkit-scrollbar {
    display: none;
  }

  .quick-contact {
    width: auto;
    flex: 0 0 auto;
    grid-template-columns: auto 1fr;
    border-radius: 999px;
  }

  .print-btn {
    flex: 0 0 auto;
  }

  .cv-page {
    grid-template-columns: 1fr;
    width: min(720px, calc(100% - 28px));
  }

  .sidebar {
    padding: 36px 30px;
  }

  .profile-photo {
    width: 148px;
    height: 148px;
    margin-left: 0;
  }

  .profile-kicker {
    margin-bottom: 14px;
    font-size: 0.73rem;
  }

  .identity h1 {
    font-size: 4rem;
  }

  .main-column {
    padding: 30px;
  }

  .section-banner {
    margin-left: 0;
    padding-left: 26px;
  }

  .section-banner::after {
    display: none;
  }
}

@media (max-width: 640px) {
  .page-actions {
    gap: 10px;
    font-size: 0.82rem;
  }

  .quick-contact {
    grid-template-columns: auto auto;
    gap: 6px;
    padding: 7px 10px;
  }

  .quick-value {
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .print-btn {
    padding: 8px 10px;
    width: auto;
  }

  .cv-page {
    width: 100%;
    margin-bottom: 0;
  }

  .sidebar,
  .main-column {
    padding: 28px 22px;
  }

  .identity h1 {
    font-size: 3.35rem;
  }

  .role-line {
    font-size: 0.98rem;
  }

  .section-banner h2 {
    font-size: 2.1rem;
  }

  .company-title,
  .project-head {
    display: block;
  }

  .company-title p,
  .company-meta {
    text-align: right;
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  body {
    background: linear-gradient(90deg, var(--navy) 0 38%, var(--paper) 38% 100%);
    font-size: 8.5pt;
    line-height: 1.25;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .page-actions,
  .footer {
    display: none;
  }

  .cv-page {
    grid-template-columns: 38% 62%;
    width: 100%;
    margin: 0;
    background: linear-gradient(90deg, var(--navy) 0 38%, var(--paper) 38% 100%);
    box-shadow: none;
  }

  .sidebar {
    background: transparent;
    padding: 24px 26px 10px;
  }

  .profile-photo {
    width: 118px;
    height: 118px;
    border-width: 5px;
    margin-bottom: 18px;
  }

  .profile-kicker {
    margin-bottom: 10px;
    font-size: 7.2pt;
  }

  .identity h1 {
    margin-bottom: 10px;
    font-size: 35pt;
  }

  .role-line {
    margin-bottom: 10px;
    font-size: 10pt;
    line-height: 1.3;
  }

  .summary,
  .rail-list li,
  .rail-item p {
    font-size: 8.7pt;
  }

  .summary {
    margin-bottom: 7px;
  }

  .rail-section {
    margin-top: 16px;
  }

  .rail-section h2 {
    margin-bottom: 7px;
    font-size: 18pt;
  }

  .rail-list li {
    margin-bottom: 3px;
  }

  .rail-item {
    margin-bottom: 8px;
  }

  .rail-item h3 {
    margin-bottom: 2px;
    font-size: 8.8pt;
  }

  .cert-list li {
    font-size: 7.4pt;
  }

  .main-column {
    padding: 18px 18px 8px 24px;
  }

  .content-section + .content-section {
    margin-top: 18px;
  }

  .section-banner {
    margin: 0 0 12px -48px;
    padding: 8px 16px 8px 48px;
  }

  .section-banner::after {
    bottom: -20px;
    width: 24px;
    height: 20px;
  }

  .main-column .content-section:nth-of-type(3) {
    break-before: auto;
    margin-top: 18px;
  }

  .section-banner h2 {
    font-size: 25pt;
  }

  .company + .company {
    margin-top: 14px;
  }

  .company-title {
    gap: 12px;
    margin-bottom: 4px;
  }

  .company-title h3 {
    font-size: 12pt;
  }

  .company-title p,
  .role-head span,
  .project-head span {
    font-size: 8.4pt;
  }

  .company-sector {
    margin-bottom: 4px;
    font-size: 8.1pt;
  }

  .company-note,
  .role p,
  .project p,
  .pov-grid p,
  .project-features,
  .role-points {
    font-size: 8.5pt;
  }

  .project p + p {
    margin-top: 6px;
  }

  .personal-projects .project p,
  .personal-projects .project ul {
    display: none;
  }

  .personal-projects .project .print-project-summary {
    display: block;
    margin-top: 4px;
    line-height: 1.25;
  }

  .personal-projects .project + .project {
    margin-top: 6px;
  }

  .project-features,
  .role-points {
    gap: 2px;
    margin-top: 5px;
  }

  .project-features li,
  .role-points li {
    padding-left: 0.72rem;
    line-height: 1.3;
  }

  .project-features li::before,
  .role-points li::before {
    width: 0.2rem;
    height: 0.2rem;
    top: 0.62em;
  }

  .company-note {
    margin-bottom: 8px;
  }

  .role {
    margin-top: 7px;
  }

  .role h4,
  .project h3,
  .pov-grid h3 {
    margin-bottom: 1px;
    font-size: 9.5pt;
  }

  .project + .project {
    margin-top: 9px;
  }

  .pov-grid {
    gap: 8px;
  }

  .pov-grid article {
    padding-top: 7px;
  }

  .company,
  .project,
  .pov-grid article {
    break-inside: avoid;
  }

  .main-column > :last-child,
  .personal-projects > :last-child {
    margin-bottom: 0;
  }
}
