/* ============================================================
   CV page layout
   Loaded after style.css so the portfolio's design tokens, fonts,
   buttons and theme settings remain shared.
   ============================================================ */

.cv-page {
  min-height: 100vh;
  padding-bottom: 1px;
}

/* Page actions */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: min(940px, calc(100% - 40px));
  margin: 26px auto 0;
}

.toolbar .button {
  min-height: 42px;
  padding: 0 16px;
  font-size: 14px;
}

.toolbar-back {
  margin-right: auto;
}

.toolbar-back span {
  margin-right: 3px;
}

/* Main document sheet */
.sheet {
  width: min(940px, calc(100% - 40px));
  margin: 18px auto 64px;
  padding: clamp(30px, 5.5vw, 66px) clamp(24px, 6.5vw, 72px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

/* Identity and contact details */
.sheet > header {
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--brand);
  font: 600 11px/1.5 var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}

.kicker::before {
  width: 25px;
  height: 1px;
  background: currentColor;
  content: '';
}

.sheet h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 58px);
  line-height: 1.02;
  letter-spacing: -.055em;
}

.role {
  margin: 12px 0 24px;
  color: var(--muted);
  font-size: clamp(16px, 2.2vw, 19px);
  line-height: 1.5;
}

.contact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.contact > span {
  min-width: 0;
  padding: 9px 12px;
  overflow-wrap: anywhere;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.contact a,
.sub a {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--brand-line);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.contact a:hover,
.sub a:hover {
  color: var(--brand);
  text-decoration-color: currentColor;
}

/* Section structure */
.sheet section {
  margin-top: 34px;
}

.sheet h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  color: var(--brand);
  font: 600 11px/1.5 var(--font-mono);
  letter-spacing: .17em;
  text-transform: uppercase;
}

.sheet h2::after {
  flex: 1;
  height: 1px;
  background: var(--border);
  content: '';
}

.sheet p {
  margin: 7px 0;
}

.sheet section > p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.8;
}

/* Education and project entries */
.item {
  margin: 0 0 23px;
}

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

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

.sheet h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

.date {
  flex: 0 0 auto;
  color: var(--dim);
  font: 500 11px/1.5 var(--font-mono);
  letter-spacing: .035em;
  text-align: right;
  white-space: nowrap;
}

.sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.item > p:not(.sub) {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.sheet ul {
  margin: 9px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13.8px;
  line-height: 1.75;
}

.sheet li {
  margin: 5px 0;
  padding-left: 3px;
}

.sheet li::marker {
  color: var(--brand);
}

/* Technical learning tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px;
}

.tag {
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.45;
}

/* Tablet and mobile refinements */
@media (max-width: 700px) {
  .toolbar {
    width: min(100% - 28px, 560px);
    margin-top: 16px;
  }

  .toolbar .button {
    flex: 1 1 auto;
    padding-inline: 12px;
  }

  .toolbar-back {
    flex-basis: 100%;
    margin-right: 0;
  }

  .sheet {
    width: calc(100% - 28px);
    margin: 14px auto 36px;
    padding: 30px 24px;
    border-radius: 16px;
  }

  .contact {
    grid-template-columns: 1fr;
  }

  .sheet section {
    margin-top: 30px;
  }
}

@media (max-width: 480px) {
  .sheet {
    width: calc(100% - 20px);
    padding: 25px 18px;
  }

  .sheet h1 {
    font-size: 39px;
  }

  .role {
    margin-bottom: 19px;
    font-size: 16px;
  }

  .item-head {
    display: block;
  }

  .date {
    display: block;
    margin-top: 3px;
    text-align: left;
  }

  .sheet h3 {
    font-size: 16px;
  }

  .sheet section > p,
  .item > p:not(.sub),
  .sheet ul {
    font-size: 13.5px;
  }
}

/* Print / Save as PDF */
@page {
  size: A4;
  margin: 13mm 15mm;
}

@media print {
  html,
  body {
    background: #fff !important;
    color: #111 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .toolbar {
    display: none !important;
  }

  .cv-page {
    min-height: 0;
    padding: 0;
  }

  .sheet {
    width: auto;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }

  .sheet > header {
    padding-bottom: 12px;
    border-color: #ccc;
  }

  .kicker,
  .sheet h2 {
    color: #2455a8;
  }

  .kicker {
    margin-bottom: 4px;
    font-size: 7.5pt;
  }

  .kicker::before {
    display: none;
  }

  .sheet h1 {
    color: #111;
    font-size: 25pt;
  }

  .role {
    margin: 3px 0 9px;
    color: #333;
    font-size: 10.5pt;
  }

  .contact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 10px;
    color: #333;
    font-size: 8pt;
  }

  .contact > span {
    padding: 2px 0;
    border: 0;
    background: none;
  }

  .contact a,
  .sub a {
    color: #111;
    font-weight: 400;
    text-decoration: none;
  }

  .sheet section {
    margin-top: 15px;
  }

  .sheet h2 {
    margin-bottom: 7px;
    font-size: 8pt;
    break-after: avoid;
  }

  .sheet h2::after {
    background: #ccc;
  }

  .sheet section > p,
  .item > p:not(.sub),
  .sheet ul {
    color: #222;
    font-size: 8.7pt;
    line-height: 1.42;
  }

  .sheet h3 {
    color: #111;
    font-size: 9.5pt;
  }

  .date {
    color: #444;
    font-size: 7.5pt;
  }

  .sub {
    color: #444;
    font-size: 8pt;
  }

  .item {
    margin-bottom: 9px;
    break-inside: avoid;
  }

  .sheet ul {
    margin-top: 2px;
  }

  .sheet li {
    margin: 1px 0;
  }

  .sheet li::marker {
    color: #444;
  }

  .tags {
    gap: 4px;
    margin-bottom: 5px;
  }

  .tag {
    padding: 1px 6px;
    border-color: #bbb;
    background: none;
    color: #222;
    font-size: 7.5pt;
  }

  a {
    color: inherit;
  }
}
