:root {
  --white: #FFFFFF;
  --tint: #F4F6F8;
  --ink: #141A22;
  --ink-2: #49515C;
  --muted: #8A919B;
  --line: #E3E7EC;
  --accent: #3A6377;
  --head: "Inter Tight", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html[lang="uk"] body [lang="en"], html[lang="en"] body [lang="uk"] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

.eyebrow, .sec-num { font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; }
.sec-num { color: var(--accent); }
.ph { background: #E6E9ED; display: grid; place-content: center; text-align: center; color: var(--muted); font-size: 12px; }

/* only the chosen tab is on the page; the choice is made in <head>, so there is no flash */
html[data-view="cv"] #view-portfolio, html[data-view="portfolio"] #view-cv { display: none; }

/* ---------- top bar ---------- */
.topbar { position: fixed; inset: 0 0 auto; z-index: 20; height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 24px; transition: background .3s, border-color .3s; border-bottom: 1px solid transparent; }
.topbar.solid { background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-color: var(--line); }
.tb-side { display: flex; align-items: center; gap: 12px; }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--accent); }
.badge { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--white); display: grid; place-items: center; font-size: 10px; font-weight: 500; letter-spacing: .06em; }
button.badge { font: 500 10px/1 var(--body); color: var(--ink); cursor: pointer; padding: 0; }
button.badge:hover { border-color: var(--ink-2); }
.tabs { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); }
.tab { font: 500 10px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); background: none; border: 0; border-radius: 999px; padding: 11px 18px; cursor: pointer; transition: background .2s, color .2s; }
.tab:hover { color: var(--ink); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html[data-view="cv"] .tab[data-view="cv"], html[data-view="portfolio"] .tab[data-view="portfolio"] { background: var(--ink); color: var(--white); }
.menu { display: flex; gap: 2px; opacity: 0; pointer-events: none; transition: opacity .3s; }
.topbar.solid .menu { opacity: 1; pointer-events: auto; }
html[data-view="cv"] .menu { display: none; }
.menu a { font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; padding: 9px 12px; border-radius: 4px; color: var(--ink-2); }
.menu a:hover, .menu a.on { background: var(--tint); color: var(--ink); }

.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; padding: 15px 22px; border: 1px solid var(--ink); background: transparent; color: var(--ink); transition: background .2s, color .2s; }
button.btn { cursor: pointer; line-height: 1.65; }
.btn.dark, .btn:hover { background: var(--ink); color: var(--white); }
.btn.dark:hover { background: transparent; color: var(--ink); }

/* =====================================================================
   CV tab — for recruiters: a compact, printable document on a tinted desk
   ===================================================================== */
.cv-view { background: var(--tint); padding: 96px 24px 72px; min-height: 100vh; }
.cv-toolbar, .sheet { max-width: 1040px; margin: 0 auto; }
.cv-toolbar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cv-toolbar .btn { padding: 10px 18px; background: var(--white); }
.cv-toolbar .btn:hover { background: var(--ink); }

.sheet { background: var(--white); border: 1px solid var(--line); padding: 52px 56px 56px; }
.cv-head { display: grid; grid-template-columns: 88px 1fr auto; gap: 28px; align-items: center; padding-bottom: 32px; border-bottom: 2px solid var(--ink); }
.cv-photo { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; }
.cv-name { font-family: var(--head); font-weight: 700; font-size: 38px; line-height: 1.05; letter-spacing: -.03em; margin: 0 0 8px; }
.cv-role { margin: 0; font-size: 15px; color: var(--ink-2); }
.cv-status { margin: 10px 0 0; font-size: 13px; font-weight: 500; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.cv-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.cv-contacts { list-style: none; margin: 0; padding: 0; font-size: 14px; line-height: 1.9; color: var(--ink-2); text-align: right; }
.cv-contacts a:hover { color: var(--accent); }

.cv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 48px; padding-top: 36px; }
.cv-side { border-left: 1px solid var(--line); padding-left: 32px; }
.cv-sec + .cv-sec { margin-top: 38px; }
.cv-h { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0 0 16px; }
.cv-summary p { margin: 0 0 10px; font-size: 15px; color: var(--ink-2); }
.cv-summary strong, .cv-job li strong { color: var(--ink); font-weight: 600; }
.cv-list { margin: 0; padding-left: 18px; font-size: 14.5px; color: var(--ink-2); }
.cv-list li { margin-bottom: 8px; }
.cv-list strong { color: var(--ink); font-weight: 600; }

.cv-job { padding: 22px 0; border-top: 1px solid var(--line); }
.cv-job:first-child { border-top: 0; padding-top: 0; }
.cv-job-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.cv-job h3 { font-family: var(--head); font-weight: 600; font-size: 18px; line-height: 1.3; letter-spacing: -.015em; margin: 0; }
.cv-when { flex: none; font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cv-org { font-size: 14px; color: var(--muted); margin: 3px 0 10px; }
.cv-org b { font-weight: 500; color: var(--ink-2); }
.cv-job ul { margin: 0; padding-left: 18px; font-size: 14.5px; color: var(--ink-2); }
.cv-job li { margin-bottom: 4px; }
.cv-job li a { color: var(--accent); border-bottom: 1px solid currentColor; }
.cv-more { display: inline-block; margin-top: 12px; font-size: 13.5px; font-weight: 500; color: var(--accent); border-bottom: 1px solid currentColor; }
.cv-more:hover { color: var(--ink); }

.stack { margin: 0; }
.stack div + div { margin-top: 14px; }
.stack dt { font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.stack dd { margin: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; color: var(--ink-2); }
.tag { font-size: 12.5px; line-height: 1.4; padding: 3px 8px; border-radius: 3px; background: var(--tint); color: var(--ink-2); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cv-note, .cv-text { font-size: 13.5px; color: var(--ink-2); margin: 14px 0 0; }
.cv-text { margin: 0; }
.cv-edu div + div { margin-top: 16px; }
.cv-edu b { display: block; font-size: 14px; font-weight: 600; line-height: 1.4; }
.cv-edu span span { display: inline; }
.cv-edu > div > span { display: block; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.cv-projects { list-style: none; margin: 0; padding: 0; }
.cv-projects li + li { margin-top: 14px; }
.cv-projects a { display: block; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.cv-projects b { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.cv-projects b::after { content: " →"; font-weight: 400; color: var(--accent); }
.cv-projects a:hover b { color: var(--accent); }

/* ---------- shared by the portfolio cards and the case modal ---------- */
.stat-cover { display: flex; flex-direction: column; justify-content: flex-end; padding: 28px; background: var(--ink); color: var(--white); }
.stat-cover b { white-space: nowrap; font-family: var(--head); font-weight: 700; font-size: clamp(56px, 7vw, 96px); line-height: .9; letter-spacing: -.045em; }
.stat-cover > span { font-size: 15px; margin: 10px 0 18px; color: #C9D2DC; }
.stat-cover i { font-style: normal; font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: #8FB3C6; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.14); }
.stat-cover.big { padding: 48px; }
.stat-cover.has-logo { position: relative; }
.stat-logo { position: absolute; top: 50%; right: 22px; transform: translateY(-50%); width: 27%; max-width: 130px; height: auto; filter: drop-shadow(0 10px 24px rgba(0,0,0,.45)); }
.case-cover img.stat-logo, .case-card:hover .case-cover img.stat-logo { height: auto; object-fit: contain; transform: translateY(-50%); }
.stat-cover.has-logo > b, .stat-cover.has-logo > span, .stat-cover.has-logo > i { max-width: 54%; }
.stat-cover.big .stat-logo { top: 50%; right: 56px; transform: translateY(-50%); width: 36%; max-width: 260px; }
.stat-cover.big > span, .stat-cover.big > i { max-width: 58%; }
@media (max-width: 760px) {
  .stat-cover.big { padding: 28px 20px; }
  .stat-cover.big .stat-logo { top: 20px; right: 64px; transform: none; width: 34%; }
  .stat-cover.big.has-logo > b, .stat-cover.big.has-logo > span, .stat-cover.big.has-logo > i { max-width: none; }
  .stat-cover.big > b { margin-top: 120px; }
}
.stat-cover.big b { font-size: clamp(72px, 11vw, 140px); }
.case-meta { font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }

html.modal-open { overflow: hidden; }
.case-dialog { width: min(920px, calc(100% - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; background: var(--white); color: var(--ink); overflow: auto; overscroll-behavior: contain; }
.case-dialog::backdrop { background: rgba(20, 26, 34, .5); }
.case-dialog[open] { animation: cd-in .3s ease; }
@keyframes cd-in { from { opacity: 0; transform: translateY(16px); } }
.cd-close { position: sticky; top: 16px; float: right; margin: 16px 16px -52px 0; z-index: 2; font-size: 13px; }
.cd-cover { aspect-ratio: 16/8; }
img.cd-cover { display: block; width: 100%; height: auto; object-fit: cover; object-position: top; }
.cd-gallery img { height: auto; object-position: top; border: 1px solid var(--line); }
.cd-gallery .wide { grid-column: 1 / -1; }
.cd-gallery .auto { aspect-ratio: auto; border: 0; }
.cd-content .cd-caption { font-size: 13px; color: var(--muted); margin: -24px 0 0; }
.cd-content { padding: 40px 48px 48px; }
.cd-title { font-family: var(--head); font-weight: 700; font-size: clamp(28px, 3.4vw, 44px); letter-spacing: -.035em; line-height: 1.05; margin: 12px 0 28px; }
.cd-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0 0 36px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cd-facts div { padding: 16px 16px 16px 0; }
.cd-facts dt { font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.cd-facts dd { margin: 0; font-size: 14px; }
.cd-content h3 { font-family: var(--head); font-weight: 600; font-size: 19px; letter-spacing: -.02em; margin: 28px 0 8px; }
.cd-content p, .cd-content li { color: var(--ink-2); max-width: 680px; }
.cd-content p { margin: 0; }
.cd-content strong, .prose strong { font-weight: 600; color: var(--ink); background: linear-gradient(transparent 60%, rgba(58, 99, 119, .16) 60%); padding: 0 1px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.cd-content ul { margin: 0; padding-left: 18px; }
.cd-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 36px 0; }
.cd-gallery > * { aspect-ratio: 16/10; width: 100%; object-fit: cover; }
.cd-content .btns { margin-top: 36px; }

.foot { padding: 28px 56px; font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; border-top: 1px solid var(--line); }
html[data-view="cv"] .foot { background: var(--tint); }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the curtain that sweeps across when switching between the CV and the portfolio */
.curtain { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--ink); color: var(--white); transform: translateY(100%); pointer-events: none; }
.curtain b { font-family: var(--head); font-weight: 700; font-size: clamp(56px, 12vw, 200px); letter-spacing: -.05em; }
.curtain[data-to="portfolio"] { background: #2440E8; color: #D7F35B; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .menu { display: none; }
  .cv-grid { grid-template-columns: minmax(0, 1fr) 250px; gap: 32px; }
  .cv-side { padding-left: 24px; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 16px; gap: 8px; }
  .tb-side { gap: 8px; }
  .tab { padding: 11px 14px; }

  .cv-view { padding: 76px 0 0; }
  .cv-toolbar { padding: 0 16px; }
  .sheet { border: 0; border-top: 1px solid var(--line); padding: 28px 20px 48px; }
  .cv-head { grid-template-columns: 64px 1fr; gap: 16px 18px; }
  .cv-photo { width: 64px; height: 64px; }
  .cv-name { font-size: 28px; }
  .cv-contacts { grid-column: 1 / -1; text-align: left; line-height: 1.8; }
  .cv-grid { grid-template-columns: 1fr; gap: 0; }
  .cv-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); margin-top: 38px; padding-top: 32px; }
  .cv-job-top { flex-direction: column; gap: 0; }

  .cd-gallery { grid-template-columns: 1fr; }
  .case-dialog { width: 100%; max-width: 100%; height: 100%; max-height: 100%; }
  .cd-content { padding: 28px 20px 40px; }
  .cd-facts { grid-template-columns: 1fr 1fr; }
  .foot { padding: 20px; flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- print: the CV tab becomes a clean A4 document ---------- */
@media print {
  /* A4, two pages: smaller type and tighter rhythm than on screen */
  @page { size: A4; margin: 10mm 12mm; }
  .topbar, .cv-toolbar, .case-dialog, .foot, .curtain { display: none !important; }
  body { font-size: 10px; line-height: 1.45; }
  .cv-view { background: none; padding: 0; min-height: 0; }
  .sheet { border: 0; padding: 0; max-width: none; }
  .cv-head { grid-template-columns: 64px 1fr auto; gap: 18px; padding-bottom: 14px; }
  .cv-photo { width: 64px; height: 64px; }
  .cv-name { font-size: 26px; margin-bottom: 4px; }
  .cv-role { font-size: 12px; }
  .cv-status { font-size: 10.5px; margin-top: 5px; }
  /* an A4 page is ~718 css px wide, under the 760px breakpoint, so undo the phone layout here */
  .cv-contacts { grid-column: auto; text-align: right; font-size: 10.5px; line-height: 1.6; }
  .cv-job-top { flex-direction: row; gap: 16px; }
  .cv-grid { grid-template-columns: minmax(0, 1fr) 190px; gap: 22px; padding-top: 16px; }
  .cv-side { border-left: 1px solid var(--line); border-top: 0; margin-top: 0; padding: 0 0 0 16px; }
  .cv-h { break-after: avoid; }
  .cv-sec + .cv-sec { margin-top: 16px; }
  .cv-h { font-size: 9px; margin-bottom: 8px; }
  .cv-summary p { font-size: 10.5px; margin-bottom: 5px; }
  .cv-list, .cv-job ul { font-size: 10px; }
  .cv-list li { margin-bottom: 3px; }
  .cv-job { padding: 9px 0; break-inside: avoid; }
  .cv-job h3 { font-size: 12.5px; }
  .cv-when { font-size: 10px; }
  .cv-org { font-size: 10px; margin: 1px 0 4px; }
  .cv-job li { margin-bottom: 1px; }
  .stack div + div { margin-top: 8px; }
  .stack dt { font-size: 9.5px; margin-bottom: 3px; }
  .stack dd { gap: 3px; }
  .tag { font-size: 9px; padding: 1px 5px; }
  .cv-edu div + div { margin-top: 8px; }
  .cv-edu b { font-size: 10.5px; }
  .cv-edu > div > span, .cv-text, .cv-projects a { font-size: 9.5px; }
  .cv-projects li + li { margin-top: 8px; }
  .cv-projects b { font-size: 10.5px; }
  .cv-job li a, .cv-contacts a { color: inherit; border: 0; }
  .cv-projects b::after { content: ""; }
  .cv-more { display: none; }
}
