/*==============================================
  Yevhen Boichuk — personal card / résumé
  One column, one file, no framework.

  Everything below is sized in rem, so the whole
  design scales from a single number: the root
  font-size on <html>. 150% => 1rem = 24px.
================================================*/

html { font-size: 150%; }

:root {
  --bg: #ffffff;
  --text: #1a1c20;
  --muted: #6b7280;
  --rule: rgba(0, 0, 0, 0.10);
  --accent: #0e7490;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216;
    --text: #e6e8ec;
    --muted: #939aa6;
    --rule: rgba(255, 255, 255, 0.12);
    --accent: #5fd3e6;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

p { margin: 0 0 0.875rem; }
p:last-child { margin-bottom: 0; }

/* ---- Layout ---- */
.page {
  max-width: 42.5rem;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 5rem;
}

section { margin-top: 2.75rem; }

h1 {
  margin: 0 0 0.25rem;
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 1.125rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

/* ---- Intro ---- */
.intro {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.avatar {
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.role {
  margin: 0;
  font-size: 1.0625rem;
}
.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}
.links {
  margin: 0.625rem 0 0;
  font-size: 0.9375rem;
}
.links a { margin-right: 1rem; }
.links a:last-child { margin-right: 0; }

/* ---- Language / PDF switch ---- */
.utility {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}
.utility a { margin-right: 1rem; }
.utility .current {
  color: var(--text);
  font-weight: 500;
  margin-right: 1rem;
}

/* ---- Entry lists (experience, projects) ---- */
.entries {
  margin: 0;
  padding: 0;
  list-style: none;
}
.entries li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--rule);
}
.entries li:first-child { border-top: none; padding-top: 0; }

.title { font-weight: 500; }
.org { color: var(--muted); }
.org::before { content: '· '; }
.date {
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

/* Optional bullets under a job — see the "Experience" markup. */
.entries .detail {
  margin: 0.375rem 0 0;
  padding: 0 0 0 1.4rem;
  list-style: none;
  color: var(--muted);
  font-size: 0.9375rem;
}
.entries .detail li {
  display: list-item;
  position: relative;
  border-top: none;
  padding: 0.0625rem 0;
  gap: 0;
}
.entries .detail li::before {
  content: '—';
  position: absolute;
  left: -1.4rem;
}

.projects li { align-items: flex-start; padding: 1rem 0; }
.projects p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}
.projects > li > a { font-size: 0.875rem; white-space: nowrap; }

/* ---- Skills ---- */
.skills {
  margin: 0;
  display: grid;
  grid-template-columns: 9.75rem 1fr;
  row-gap: 0.625rem;
  column-gap: 1.25rem;
}
.skills dt {
  color: var(--muted);
  font-size: 0.9375rem;
}
.skills dd {
  margin: 0;
  font-size: 0.9375rem;
}

/* ---- Footer ---- */
footer {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ---- Small screens ----
   The breakpoint is in em, which media queries always
   resolve against 16px — so 52.5em is 840px, i.e. the
   560px of the 100% design scaled by the same 150%. */
@media (max-width: 52.5em) {
  .page { padding: 3rem 1.25rem 4rem; }
  .intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.125rem;
  }
  .entries li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  .skills {
    grid-template-columns: 1fr;
    row-gap: 0.125rem;
  }
  .skills dd { margin-bottom: 0.625rem; }
}

@media (max-width: 30em) {
  html { font-size: 118%; }
}

/* ---- Print / PDF ---- */
@page {
  margin: 14mm 15mm;
}

@media print {
  html { font-size: 100%; }
  :root {
    --bg: #fff;
    --text: #000;
    --muted: #444;
    --rule: rgba(0, 0, 0, 0.2);
    --accent: #000;
  }
  body { line-height: 1.5; }
  .page { max-width: none; padding: 0; }
  .no-print { display: none !important; }
  p { margin-bottom: 0.625rem; }
  section { margin-top: 1.25rem; }
  h2 { margin-bottom: 0.75rem; }

  /* The small-screen rules above match the print viewport too;
     put the two-column layout back for paper. */
  .intro {
    flex-direction: row;
    align-items: center;
    gap: 1.25rem;
  }
  .avatar { width: 4.5rem; height: 4.5rem; }
  .entries li {
    flex-direction: row;
    align-items: baseline;
    gap: 1.25rem;
    padding: 0.5rem 0;
  }
  .projects li { align-items: flex-start; padding: 0.5rem 0; }
  .entries .detail { margin-top: 0.25rem; }
  .entries .detail li { padding: 0; }
  .skills {
    grid-template-columns: 9.75rem 1fr;
    row-gap: 0.375rem;
  }
  .skills dd { margin-bottom: 0; }
  footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    page-break-inside: avoid;
  }
  .entries li, .projects li { page-break-inside: avoid; }
  h2 { page-break-after: avoid; }
  a { text-decoration: none; }
  .projects > li > a::after { content: ' ↗'; }
}
