/* ============================================
   CV — Editorial document, print-optimized
   ============================================ */

body.cv {
  background: var(--paper-warm);
  font-size: 15px;
  line-height: 1.55;
}

/* ---------- Toolbar (screen only) ---------- */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 243, 238, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--rule);
}

.toolbar__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.9rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.toolbar__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  transition: gap var(--dur-fast) var(--ease);
}

.toolbar__back:hover {
  gap: 0.8rem;
}

.toolbar__title {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.toolbar__actions {
  display: flex;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.04em;
  background: var(--paper);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.btn--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.btn svg {
  width: 14px;
  height: 14px;
}

/* ---------- Sheet ---------- */
.sheet {
  max-width: 920px;
  margin: 3rem auto 5rem;
  background: #fff;
  padding: 3.6rem;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 12px 36px rgba(0, 0, 0, 0.08),
    0 24px 80px rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  position: relative;
}

@media (max-width: 700px) {
  .sheet {
    margin: 1rem;
    padding: 2rem 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  }
}

/* ---------- Header ---------- */
.cv-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.6rem;
  margin-bottom: 2.4rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 600px) {
  .cv-head {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

.cv-head__name {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 0.95;
  margin-bottom: 0.4rem;
}

.cv-head__name em {
  font-style: italic;
  font-weight: 300;
}

.cv-head__title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.cv-head__meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  text-align: left;
}

@media (min-width: 600px) {
  .cv-head__meta {
    text-align: right;
  }
}

.cv-head__meta a,
.cv-head__meta span {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

@media (min-width: 600px) {
  .cv-head__meta a,
  .cv-head__meta span {
    justify-content: flex-end;
  }
}

.cv-head__meta a:hover {
  color: var(--accent);
}

.cv-head__meta svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* ---------- Section ---------- */
.cv-section {
  margin-top: 2.4rem;
}

.cv-section__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
}

.cv-section__title::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}

.cv-section__title em {
  font-style: italic;
  font-weight: 300;
}

/* ---------- Summary ---------- */
.cv-summary {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  max-width: 64ch;
}

.cv-summary p {
  margin-bottom: 0.8rem;
}

.cv-summary p:last-child {
  margin-bottom: 0;
}

.cv-summary em {
  font-style: italic;
}

.cv-summary .lead {
  font-size: 1.18rem;
  letter-spacing: -0.01em;
}

.cv-summary mark {
  background: var(--accent-soft);
  color: var(--ink);
  padding: 0.05rem 0.25rem;
  border-radius: 2px;
}

/* ---------- Quick facts ---------- */
.cv-quickfacts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 1.6rem 0;
  padding: 1.2rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.qf {
  text-align: center;
  border-right: 1px solid var(--rule);
}

.qf:last-child {
  border-right: 0;
}

.qf__num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}

.qf__num em {
  font-style: italic;
  color: var(--accent);
}

.qf__label {
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Profiles grid ---------- */
.cv-profiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.profile {
  padding: 0.8rem 0;
  border-top: 1px solid var(--rule);
}

.profile__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.profile a {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.profile a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Experience ---------- */
.job {
  margin-bottom: 2rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--rule-soft);
  page-break-inside: avoid;
  break-inside: avoid;
}

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

.job__head {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

@media (min-width: 600px) {
  .job__head {
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 1rem;
  }
}

.job__co {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.job__co a {
  border-bottom: 1px solid var(--rule);
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.job__co a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.job__co-aka {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.02em;
  vertical-align: 0.15em;
  margin-left: 0.25em;
}

/* Right meta column: date on top, location below — both right-aligned, both mono/muted */
.job__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

@media (min-width: 600px) {
  .job__meta {
    align-items: flex-end;
    text-align: right;
  }
}

/* Date floats above location — the time period is the primary scan target */
.job__date {
  order: -1;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.job__loc {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  opacity: 0.75; /* slightly quieter than the date — geography is secondary */
}

.job__role {
  /* Title only — date has moved to .job__meta */
}

.job__title {
  font-size: 0.95rem;
  font-weight: 500;
}

.job__tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.5rem;
  margin-bottom: 0.6rem;
  display: inline-block;
}

.job__lead {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0.8rem;
  max-width: 70ch;
}

.bullets {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.bullets li {
  position: relative;
  padding-left: 1.2rem;
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 72ch;
}

.bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62rem;
  width: 6px;
  height: 1px;
  background: var(--ink);
}

.bullets li strong {
  font-weight: 600;
}

.bullets li mark {
  background: linear-gradient(transparent 62%, var(--accent-soft) 62%);
  color: var(--ink);
  padding: 0 0.1rem;
}

/* Subprojects in Labs42 */
.subprojects {
  margin-top: 0.8rem;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.subproject__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.subproject__title em {
  font-style: italic;
}

.subproject .bullets {
  margin-top: 0.4rem;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
}

@media (min-width: 700px) {
  .skills-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.4rem 2rem;
  }
}

.skill-group {
  page-break-inside: avoid;
  break-inside: avoid;
}

.skill-group__title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}

.skill-row {
  margin-bottom: 0.5rem;
  font-size: 0.92rem;
  line-height: 1.55;
}

.skill-row strong {
  font-weight: 600;
  color: var(--ink);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0.02em;
}

.skill-tag--primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.skill-tag--accent {
  background: var(--accent-soft);
  color: var(--ink);
  border-color: transparent;
}

/* ---------- Two col rows ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 600px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem 2rem;
  }
}

/* ---------- Edu / Cert / Awards ---------- */
.entry {
  padding: 0.4rem 0;
  page-break-inside: avoid;
  break-inside: avoid;
}

.entry__head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: baseline;
}

.entry__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
}

.entry__date {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.entry__sub {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.entry__desc {
  font-size: 0.88rem;
  margin-top: 0.4rem;
  line-height: 1.55;
  color: var(--ink);
  max-width: 70ch;
}

.entry a {
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.entry a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Inline languages (compact) ---------- */
.cv-section--compact {
  margin-top: 1.4rem;
}

.lang-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  font-size: 0.92rem;
}

.lang-item {
  font-family: var(--font-display);
  color: var(--muted);
}

.lang-item strong {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- Olympiad list ---------- */
.olympiad {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

@media (min-width: 500px) {
  .olympiad {
    grid-template-columns: 1fr 1fr;
  }
}

.olympiad li {
  font-size: 0.88rem;
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--rule-soft);
}

.olympiad li strong {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.06em;
}

/* ---------- Footer ---------- */
.cv-foot {
  margin-top: 3rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

@media (min-width: 600px) {
  .cv-foot {
    grid-template-columns: 1fr auto 1fr;
    text-align: center;
  }
}

.cv-foot__left { text-align: left; }
.cv-foot__right { text-align: right; }

/* ---------- Print ---------- */
@media print {
  @page {
    size: A4;
    margin: 10mm 13mm;
  }

  html, body {
    background: #fff !important;
    color: #000;
    font-size: 9pt;
    line-height: 1.38;
  }

  body.cv {
    background: #fff !important;
  }

  .toolbar,
  .cv-foot__right,
  .cv-profiles,
  .no-print {
    display: none !important;
  }

  .sheet {
    margin: 0;
    padding: 0;
    box-shadow: none;
    background: #fff;
    max-width: 100%;
    border-radius: 0;
  }

  .cv-head {
    margin-bottom: 0.3rem;
    padding-bottom: 0.25rem;
    gap: 0.3rem;
  }

  .cv-head__name {
    font-size: 18pt;
    margin-bottom: 0.15rem;
    line-height: 1;
  }

  .cv-head__title {
    font-size: 7pt;
    margin-bottom: 0.1rem;
  }

  .cv-head__meta {
    font-size: 7.6pt;
    gap: 0.15rem;
  }

  .cv-head__meta svg {
    width: 9px;
    height: 9px;
  }

  .eyebrow {
    font-size: 7.4pt !important;
  }

  .cv-section {
    margin-top: 0.35rem;
    page-break-inside: auto;
  }

  .cv-section__title {
    font-size: 12pt;
    margin-bottom: 0.25rem;
    page-break-after: avoid;
    break-after: avoid;
  }

  /* Restore accent on section title chip — anchors the brand rhythm */
  .cv-section__title::before {
    background: #ff5b1f;
    width: 14px;
  }

  .cv-summary {
    font-size: 8.8pt;
    line-height: 1.35;
    max-width: 100%;
  }

  .cv-summary p {
    margin-bottom: 0.28rem;
  }

  .cv-summary .lead {
    font-size: 9.4pt;
    line-height: 1.35;
  }

  /* Marks: bold accent underline — reads in B&W (weight) and in color (underline) */
  .cv-summary mark,
  .bullets li mark {
    background: transparent !important;
    color: #000 !important;
    padding: 0;
    font-weight: 600;
    border-bottom: 1.5px solid #ff5b1f;
  }

  .cv-quickfacts {
    border-color: #000;
    margin: 0.25rem 0;
    padding: 0.22rem 0;
  }

  .qf__num {
    font-size: 12pt;
  }

  /* Restore accent inside quickfact numbers */
  .qf__num em {
    color: #ff5b1f;
  }

  .qf__label {
    font-size: 6.4pt;
    margin-top: 0.1rem;
  }

  .job {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    page-break-inside: auto;
    break-inside: auto;
    widows: 3;
    orphans: 3;
  }

  .job__head {
    margin-bottom: 0.18rem;
    page-break-after: avoid;
    break-after: avoid;
  }

  /* Print: meta column aligns to top of the left block */
  .job__meta {
    align-items: flex-end;
    text-align: right;
    gap: 0.1rem;
  }

  .job__lead {
    page-break-after: avoid;
    break-after: avoid;
  }

  .job__co {
    font-size: 10.5pt;
  }

  .job__title {
    font-size: 8.8pt;
  }

  .job__date,
  .job__loc {
    font-size: 7.4pt;
  }

  /* Restore orange on job tag — it's the brand kicker, earns its color */
  .job__tag {
    font-size: 7.2pt;
    color: #ff5b1f !important;
    margin-top: 0.08rem;
  }

  .job__lead {
    font-size: 9pt;
    line-height: 1.4;
    margin: 0.18rem 0;
  }

  .bullets {
    margin: 0.25rem 0 0;
    padding-left: 0.9rem;
  }

  .bullets li {
    font-size: 8.5pt;
    line-height: 1.34;
    margin: 0.12rem 0;
    padding-left: 0.45rem;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Accent bullets — gives the page a visual rhythm */
  .bullets li::before {
    background: #ff5b1f;
  }

  .subprojects {
    margin-top: 0.28rem;
    padding-left: 0.7rem;
    gap: 0.28rem;
  }

  .subproject__title {
    font-size: 8.6pt;
    margin-bottom: 0;
  }

  .subproject .bullets {
    margin-top: 0.12rem;
  }

  .skills-grid {
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 0.35rem 0.9rem;
  }

  .skill-group {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .skill-group__title {
    font-size: 6.2pt;
    margin-bottom: 0.18rem;
    padding-bottom: 0.1rem;
  }

  .skill-row {
    margin-bottom: 0.16rem;
    font-size: 7.2pt;
    line-height: 1.25;
  }

  .skill-tags {
    gap: 0.12rem;
    margin-top: 0.08rem;
  }

  /* Neutral tags stay monochrome; accent tags keep their accent border */
  .skill-tag,
  .skill-tag--primary {
    background: transparent !important;
    color: #000 !important;
    border: 1px solid #999 !important;
    font-size: 6.2pt;
    padding: 0.02rem 0.2rem;
    letter-spacing: 0;
    border-radius: 2px;
  }

  .skill-tag--accent {
    background: transparent !important;
    color: #ff5b1f !important;
    border: 1px solid #ff5b1f !important;
    font-size: 6.2pt;
    padding: 0.02rem 0.2rem;
    letter-spacing: 0;
    border-radius: 2px;
  }

  .two-col {
    gap: 0.3rem 1rem;
  }

  .entry {
    padding: 0.14rem 0;
  }

  .entry__title {
    font-size: 8.6pt;
  }

  .entry__sub {
    font-size: 7.4pt;
    margin-top: 0;
  }

  .entry__desc {
    font-size: 7.4pt;
    line-height: 1.3;
    margin-top: 0.1rem;
    max-width: 100%;
  }

  .entry__date {
    font-size: 7pt;
  }

  .entry a {
    font-size: 6.6pt;
  }

  .olympiad {
    margin-top: 0.08rem;
    gap: 0.04rem 0.3rem;
  }

  .olympiad li {
    font-size: 7.2pt;
    padding: 0.06rem 0;
  }

  .cv-section--compact {
    margin-top: 0.35rem;
  }

  .lang-inline {
    font-size: 8.2pt;
    gap: 0.15rem 1rem;
  }

  .cv-foot {
    margin-top: 0.45rem;
    padding-top: 0.22rem;
    font-size: 7pt;
  }

  /* Restore accent on company links — they're the clickable URLs, should scan in color */
  a {
    color: #000 !important;
    text-decoration: none;
  }

  .job__co a[href] {
    color: #ff5b1f !important;
    border-bottom: 0;
  }

  .entry a {
    border-bottom: 0;
  }

  /* hide URL annotations to save space */
  .job__co a[href^="http"]::after {
    content: "";
  }
}
