/* ==========================================================================
   Bogdan Roatis — CV
   Screen: card layout with light/dark themes. Print: A4, always light.
   ========================================================================== */

:root {
  --paper: #ffffff;
  --ink: #15181c;
  --ink-2: #454b55;
  --muted: #6f7580;
  --line: #e3e5e0;
  --accent: #0b7d55;
  --accent-ink: #ffffff;
  --accent-soft: #e7f3ed;
  --chip: #f2f4f0;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14171a;
    --ink: #e9ebee;
    --ink-2: #bcc1c9;
    --muted: #8d939c;
    --line: #262a2f;
    --accent: #3ddc84;
    --accent-ink: #06170e;
    --accent-soft: rgba(61, 220, 132, .10);
    --chip: #1b1f23;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #14171a;
  --ink: #e9ebee;
  --ink-2: #bcc1c9;
  --muted: #8d939c;
  --line: #262a2f;
  --accent: #3ddc84;
  --accent-ink: #06170e;
  --accent-soft: rgba(61, 220, 132, .10);
  --chip: #1b1f23;
  color-scheme: dark;
}

/* ---------- Base ---------- */

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: .18em;
}
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; }

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-fill { fill: currentColor; stroke: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Sheet ---------- */

.sheet {
  max-width: 66rem;
  margin: 0 auto;
  padding: 3.5rem 3.5rem 3rem;
}

/* ---------- Header ---------- */

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .9rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.name {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.02;
  font-weight: 750;
  letter-spacing: -.03em;
  color: var(--ink);
}

.nowrap { white-space: nowrap; }
.headline .sep { color: var(--accent); margin: 0 .15em; }

.headline {
  margin-top: .6rem;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink-2);
}

.contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .45rem;
  list-style: none;
  font-size: .9rem;
}
.contact a {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--ink-2);
}
.contact a:hover { color: var(--accent); text-decoration: none; }
.contact .contact-item {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--ink-2);
}
.contact .icon { color: var(--accent); font-size: 1rem; }

.print-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: .35rem;
  padding: .5rem .9rem;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}
.print-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.contact .print-btn,
.contact .print-btn:hover { color: var(--accent-ink); text-decoration: none; }
.print-btn:focus-visible { border-radius: 999px; }
.contact .print-btn .icon { color: inherit; font-size: .95rem; }

/* ---------- Summary ---------- */

.intro {
  padding: 2rem 0 2.25rem;
  border-bottom: 1px solid var(--line);
}

.summary {
  max-width: 48rem;
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--ink);
}


/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17.5rem;
  gap: 3.5rem;
  padding-top: 2.25rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.4rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- Experience timeline ---------- */

.jobs {
  position: relative;
  list-style: none;
}
.jobs::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .55rem;
  bottom: .5rem;
  width: 1px;
  background: var(--line);
}

.job {
  position: relative;
  padding-left: 1.75rem;
}
.job + .job { margin-top: 2rem; }
.job::before {
  content: "";
  position: absolute;
  left: 0;
  top: .42rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--accent);
}
.job:first-child::before { background: var(--accent); }

.job-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.job-role {
  font-size: 1.1rem;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -.01em;
  color: var(--ink);
}
.job-dates {
  flex: none;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
}
.job-company {
  margin-top: .1rem;
  font-size: .95rem;
  font-weight: 600;
  color: var(--accent);
}
.job-company .client {
  font-weight: 500;
  color: var(--muted);
}
.job-context {
  margin-top: .45rem;
  font-size: .92rem;
  font-style: italic;
  color: var(--muted);
}

.bullets {
  margin-top: .6rem;
  list-style: none;
}
.bullets li {
  position: relative;
  padding-left: 1.1rem;
  font-size: .95rem;
}
.bullets li + li { margin-top: .3rem; }
.bullets li::before {
  content: "";
  position: absolute;
  left: .15rem;
  top: .68em;
  width: .38rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  opacity: .7;
}

.job-links {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .5rem;
  margin-top: .75rem;
  list-style: none;
}
.job-links a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .22rem .65rem;
  font-size: .8rem;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.job-links a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.job-links .icon { font-size: .8rem; color: var(--accent); }
.job-links .link-url { display: none; }
.link-retired {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .22rem .65rem;
  font-size: .8rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 999px;
}
.job-links .link-retired .icon { color: var(--muted); }
.retired-note {
  margin-left: .15rem;
  padding-left: .5rem;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-left: 1px solid var(--line);
}

/* One employer, several positions */
.role-count {
  display: inline-block;
  padding: .05rem .5rem;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  vertical-align: .1em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}
.positions {
  position: relative;
  margin-top: 1rem;
  margin-left: 1.1rem;
  list-style: none;
}
.positions::before {
  content: "";
  position: absolute;
  left: 3px;
  top: .55rem;
  bottom: .55rem;
  width: 2px;
  border-radius: 2px;
  background: var(--accent-soft);
}
.position {
  position: relative;
  padding-left: 1.3rem;
}
.position + .position { margin-top: 1.2rem; }
.position::before {
  content: "";
  position: absolute;
  left: 0;
  top: .45rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--accent);
}
.position:first-child::before { background: var(--accent); }
.position-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .6rem;
}
.pos-type {
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.position-role {
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.4;
  color: var(--ink);
}
.position .job-context { margin-top: .3rem; }

/* ---------- Sidebar ---------- */

.sidebar > section + section { margin-top: 2.25rem; }

.skill-group + .skill-group { margin-top: 1.1rem; }
.skill-group h3 {
  margin-bottom: .5rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  list-style: none;
}
.chips li {
  padding: .18rem .6rem;
  font-size: .8rem;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.edu-degree {
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--ink);
}
.edu-school {
  margin-top: .2rem;
  font-size: .9rem;
  color: var(--ink-2);
}
.edu-meta {
  margin-top: .3rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--muted);
}
.edu-detail {
  margin-top: .6rem;
  font-size: .88rem;
  line-height: 1.55;
}

.langs { list-style: none; }
.langs li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .45rem 0;
  font-size: .9rem;
  border-bottom: 1px dashed var(--line);
}
.langs li:last-child { border-bottom: 0; }
.langs span:first-child { font-weight: 600; color: var(--ink); }
.langs span:last-child { color: var(--muted); text-align: right; }

/* ---------- Responsive ---------- */

@media (max-width: 60rem) {
  .sheet { padding: 2.5rem 2.25rem; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.25rem 2.5rem;
  }
  .sidebar > section + section { margin-top: 0; }
  .sidebar .skills { grid-row: span 2; }
}

@media (max-width: 40rem) {
  html { font-size: 93.75%; }
  .sheet { padding: 1.75rem 1rem 2rem; }
  .hero { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
  .summary { font-size: 1.02rem; }
  .job-head { flex-direction: column; gap: .15rem; }
  .sidebar { grid-template-columns: minmax(0, 1fr); }
  .sidebar .skills { grid-row: auto; }
  .positions { margin-left: .75rem; }
}

/* ---------- Print (A4, always light) ---------- */

@page {
  size: A4;
  margin: 10mm 11mm 11mm;
}

@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --paper: #ffffff;
    --ink: #111418;
    --ink-2: #353a42;
    --muted: #636a74;
    --line: #dcdfd9;
    --accent: #0b7d55;
    --accent-soft: #eef6f1;
    --chip: #f4f5f2;
    color-scheme: light;
  }

  html { font-size: 12px; }
  body {
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

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

  .sheet {
    max-width: none;
    padding: 0;
  }

  .hero { padding-bottom: 1.1rem; }
  .eyebrow { margin-bottom: .5rem; }
  .name { font-size: 2.6rem; }
  .contact { font-size: .88rem; gap: .25rem; }

  .intro { padding: 1.1rem 0 1.25rem; }
  .summary { font-size: 1rem; max-width: none; }

  .layout {
    grid-template-columns: minmax(0, 1fr) 28%;
    gap: 1.75rem;
    padding-top: 1.1rem;
  }
  .section-title { margin-bottom: .9rem; break-after: avoid; page-break-after: avoid; }

  /* Jobs may split across pages between bullets, but a heading always
     stays with the text that follows it, and no bullet is cut in half. */
  .job-head, .job-company, .job-context, .position-title { break-after: avoid; page-break-after: avoid; }
  .bullets li, .job-links { break-inside: avoid; page-break-inside: avoid; }
  .job:not(.job-multi) { break-inside: avoid; page-break-inside: avoid; }
  .bullets { orphans: 2; widows: 2; }
  .position + .position { margin-top: .75rem; }
  .job + .job { margin-top: 1.1rem; }
  .job-context { margin-top: .3rem; }
  .bullets { margin-top: .4rem; }
  .bullets li { line-height: 1.45; }
  .bullets li + li { margin-top: .12rem; }
  .job-links { margin-top: .4rem; }

  .sidebar { display: block; }
  .sidebar > section + section { margin-top: 1.5rem; }
  .skill-group { break-inside: avoid; }

  /* Positioned boxes are painted in a later layer, which scrambles the PDF's
     text order (what ATS parsers and copy-paste read). Draw the timeline
     without positioning in print. */
  .jobs, .job, .positions, .position, .bullets li { position: static; }
  .jobs::before, .positions::before { content: none; }
  .jobs { background: linear-gradient(var(--line), var(--line)) 4px .55rem / 1px calc(100% - 1.05rem) no-repeat; }
  .positions { background: linear-gradient(var(--accent-soft), var(--accent-soft)) 3px .55rem / 2px calc(100% - 1.1rem) no-repeat; }
  .job::before { position: static; float: left; margin: .42rem 0 0 -1.75rem; }
  .position::before { position: static; float: left; margin: .45rem 0 0 -1.3rem; }
  .bullets li::before { position: static; display: inline-block; vertical-align: middle; margin: 0 .57rem 0 -.95rem; }
  .retired-note, .pos-type, .role-count { font-size: .75rem; }

  /* Links as readable text: label plus the address, one per line. */
  .job-links { display: block; margin-top: .35rem; }
  .job-links li + li { margin-top: .1rem; }
  .job-links a {
    display: inline;
    padding: 0;
    font-size: .8rem;
    color: var(--ink-2);
    background: none;
    border: 0;
    border-radius: 0;
  }
  .job-links a .icon { display: none; }
  .job-links .link-label { font-weight: 600; }
  .job-links .link-url { display: inline; margin-left: .45rem; color: var(--accent); font-weight: 400; word-break: break-all; }
  .job-links .link-label::after { content: ":"; }
  .link-retired { display: inline; padding: 0; font-size: .8rem; font-weight: 600; color: var(--ink-2); border: 0; }
  .link-retired .icon { display: none; }
  .link-retired .retired-note::before { content: ": "; margin-left: -.45rem; }
  .retired-note {
    margin-left: .45rem;
    padding-left: 0;
    font-family: var(--font-sans);
    font-size: .8rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
    border-left: 0;
  }
  .sidebar > section:not(.skills) { break-inside: avoid; page-break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  .print-btn { transition: none; }
}
