/* vizcraft.pl site styles. Tokens and components come from vizcraft.css (the Vizcraft theme);
   this file only does layout and the site-specific pieces. */

:root { --sidebar-w: 320px; --bar-top: var(--vz-space-5); --bar-h: 62px; --edge: max(var(--vz-space-6), calc((100% - 1320px) / 2 + var(--vz-space-6))); /* % not vw: vw counts the scrollbar, which shifted the pills against the sidebar */ }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-top) + var(--bar-h) + var(--vz-space-4)); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; min-height: 100vh; }
img { display: block; max-width: 100%; }

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

/* ── Background canvas ─────────────────────────────────────── */
#bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* ── Layout: sticky sidebar + scrolling content ────────────── */
.layout {
  position: relative; z-index: 1;
  max-width: 1320px; margin: 0 auto;
  padding: calc(var(--bar-top) + var(--bar-h) + var(--vz-space-4)) var(--vz-space-6) var(--vz-space-6);
  display: flex; align-items: flex-start; gap: var(--vz-space-6);
}
.content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--vz-space-7); }

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  flex: 0 0 var(--sidebar-w); position: sticky; top: calc(var(--bar-top) + var(--bar-h) + var(--vz-space-4));
  max-height: calc(100vh - var(--bar-top) - var(--bar-h) - var(--vz-space-4) - var(--vz-space-6));
  overflow: hidden; /* never a scrollbar on desktop: .sidebar__inner scales down to fit instead (see shell.js) */
}
.sidebar__inner {
  display: flex; flex-direction: column; gap: var(--vz-space-4);
  --fit: 1; width: calc(100% / var(--fit)); transform: scale(var(--fit)); transform-origin: top left;
}
.sidebar__rule { width: 100%; height: 1px; margin: 0; border: 0; background: var(--vz-border); }
.sidebar__actions { display: flex; flex-direction: column; gap: var(--vz-space-2); }
.sidebar__actions .vz-btn { width: 100%; }
.vz-btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; box-shadow: none; filter: none; }
/* On desktop the CV buttons live in the top right pill, so the sidebar copy is hidden */
.sidebar__actions, .sidebar__rule--actions { display: none; }
.sidebar__business { margin: 0; font-size: 12px; line-height: 1.5; color: var(--vz-text-faint); }

/* Round photo with the brand's animated highlight: a turning magenta, cyan, amber ring and a soft glow behind it */
.portrait {
  position: relative; align-self: center; width: 220px; aspect-ratio: 1; margin: var(--vz-space-3) 0 var(--vz-space-2);
  padding: 4px; border-radius: 50%;
  background: conic-gradient(from var(--vz-angle), var(--vz-magenta-bright), var(--vz-cyan), var(--vz-amber), var(--vz-magenta-bright));
  animation: vz-spin var(--vz-duration-highlight) linear infinite;
}
.portrait::before {
  content: ""; position: absolute; inset: -6px; z-index: -1; border-radius: 50%;
  background: inherit; filter: blur(22px); opacity: 0.55;
  animation: glow-breathe var(--vz-duration-highlight) ease-in-out infinite;
}
.portrait img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--vz-surface-1-solid); background: var(--vz-surface-2-solid); }
@keyframes glow-breathe { 0%, 100% { opacity: 0.4; transform: scale(0.97); } 50% { opacity: 0.75; transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .portrait, .portrait::before { animation: none; } }
[data-theme="light"] .portrait::before { opacity: 0.35; }

.profile { display: flex; flex-direction: column; align-items: center; gap: var(--vz-space-2); text-align: center; }
.profile__name { margin: 0; font-size: 28px; line-height: 1.1; letter-spacing: -0.01em; }
.profile__headline { margin: 0; font-size: 12px; font-weight: 600; line-height: 1.5; letter-spacing: 0.1em; text-transform: uppercase; color: var(--vz-cyan); }
[data-theme="light"] .profile__headline { color: var(--vz-focus); } /* darker cyan, readable on white */
.profile__location { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--vz-text-muted); }

/* Section nav: vertical pills; the current one gets the design system's .vz-active highlight */
.side-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--vz-space-1); }
.side-nav a {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px;
  border: 1.5px solid transparent; border-radius: var(--vz-radius-pill);
  color: var(--vz-text-muted); font-size: 14px; font-weight: 600; text-decoration: none;
  transition: color var(--vz-duration-fast) var(--vz-ease), background-color var(--vz-duration-fast) var(--vz-ease);
}
.side-nav a:hover { color: var(--vz-text); background-color: var(--vz-surface-2); }
.side-nav a.vz-active { --vz-fill: var(--vz-surface-1-solid); color: var(--vz-text); }
.side-nav a.vz-active .iconify { color: var(--vz-magenta-text); }

.contacts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--vz-space-2); }
.contacts a, .contacts li > span {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 1px solid var(--vz-border); border-radius: 50%; background: var(--vz-surface-2);
  color: var(--vz-magenta-text); text-decoration: none;
  transition: border-color var(--vz-duration-fast) var(--vz-ease), box-shadow var(--vz-duration-fast) var(--vz-ease);
}
.contacts a:hover { border-color: var(--vz-magenta-text); box-shadow: var(--vz-glow-button); }

/* ── Skills ────────────────────────────────────────────────── */
.skills { gap: var(--vz-space-5); }
.skills__sub { margin: 0 0 var(--vz-space-3); font: 600 13px/1.3 var(--vz-font-sans); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--vz-text-muted); }
/* Cards keep their own height and flow down balanced columns (CSS columns), like the old site */
.skills__grid { column-width: 260px; column-gap: var(--vz-space-3); }
.skills__grid > .skill { break-inside: avoid; margin-bottom: var(--vz-space-3); }
.skills__tags, .skill__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.skill { display: flex; flex-direction: column; gap: var(--vz-space-3); }
.skill__head { display: flex; align-items: center; gap: var(--vz-space-3); }
.skill__icon { flex: none; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.skill__name { margin: 0; flex: 1; min-width: 0; font-size: 16px; line-height: 1.2; }
/* The meter fills in once the section has scrolled into view */
.reveal .vz-progress__fill { width: var(--level); transform: scaleX(0); transform-origin: left;
  transition: transform 0.9s var(--vz-ease); }
.reveal.is-in .vz-progress__fill { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) { .reveal .vz-progress__fill { transition: none; } }

/* ── Languages ─────────────────────────────────────────────── */
.languages__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--vz-space-3); }
.lang { display: flex; flex-direction: column; gap: var(--vz-space-3); }
.lang__head { display: flex; align-items: center; gap: var(--vz-space-3); }
.lang__flag { flex: none; display: inline-flex; }
.lang__text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lang__prof { margin: 0; font-size: 13px; color: var(--vz-text-muted); }

/* ── Awards & certifications ───────────────────────────────── */
.certifications__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: var(--vz-space-3); }
.cert { display: flex; flex-direction: column; color: var(--vz-text); text-decoration: none; min-width: 0;
  transition: border-color var(--vz-duration-fast) var(--vz-ease), box-shadow var(--vz-duration-fast) var(--vz-ease); }
.vz a.cert { color: var(--vz-text); } /* beat the theme's magenta link colour */
.cert__icon { flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--vz-radius-control); border: 1px solid transparent; }
.cert__icon--magenta { background: var(--vz-magenta-tint); border-color: var(--vz-magenta-line); color: var(--vz-magenta-text); }
.cert__icon--cyan { background: var(--vz-cyan-tint); border-color: var(--vz-cyan-line); color: var(--vz-cyan); }
.cert__icon--green { background: var(--vz-green-tint); border-color: var(--vz-green-line); color: var(--vz-green); }
.cert__icon--amber { background: var(--vz-amber-tint); border-color: var(--vz-amber-line); color: var(--vz-amber); }
.cert__head { display: flex; align-items: center; gap: var(--vz-space-3); }
.cert__name { flex: 1; min-width: 0; }
.cert__more, .cert__more-inner { display: contents; }
.cert__more-inner > * { display: block; }
.cert__name { font-size: 14px; font-weight: 600; line-height: 1.3; }
.cert__issuer { font-size: 13px; color: var(--vz-text-muted); }
.cert__date { font-size: 12px; color: var(--vz-text-faint); }
.cert--link .cert__head > .iconify { flex: none; color: var(--vz-text-faint); }
.cert--link:hover { border-color: var(--vz-magenta-line); box-shadow: var(--vz-glow-button); }
.cert--link:hover .cert__head > .iconify { color: var(--vz-magenta-text); }

/* The theme's tag text colours are too light on a white page (about 2:1 for cyan, green and amber), so in
   the light theme they are darkened here. Remove this once the theme repo has darker light-mode tag text. */
[data-theme="light"] .vz-tag { color: var(--vz-magenta); }
[data-theme="light"] .vz-tag--cyan { color: color-mix(in srgb, var(--vz-cyan) 55%, black); }
[data-theme="light"] .vz-tag--green { color: color-mix(in srgb, var(--vz-green) 55%, black); }
[data-theme="light"] .vz-tag--amber { color: color-mix(in srgb, var(--vz-amber) 55%, black); }

/* ── Language + theme, top right corner ─────────────────────── */
.brand-pill {
  position: fixed; top: var(--bar-top); left: var(--edge); z-index: 15;
  width: var(--sidebar-w); display: flex; align-items: center; justify-content: center; height: var(--bar-h);
  padding: 0 var(--vz-space-5); border-radius: var(--vz-radius-pill);
}
.brand-pill img { width: 230px; height: auto; }
.page-controls {
  position: fixed; top: var(--bar-top); right: var(--edge); z-index: 15; height: var(--bar-h);
  display: flex; align-items: center; gap: var(--vz-space-2);
  padding: var(--vz-space-1); border-radius: var(--vz-radius-pill);
}
.cv-actions { display: flex; gap: var(--vz-space-2); padding-right: var(--vz-space-2); margin-right: var(--vz-space-1);
  border-right: 1px solid var(--vz-border); }
.icon-btn, .theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 1px solid var(--vz-border); border-radius: 50%; background: var(--vz-surface-2);
  color: var(--vz-text); cursor: pointer;
  transition: background-color var(--vz-duration-fast) var(--vz-ease), color var(--vz-duration-fast) var(--vz-ease);
}
.icon-btn:hover, .theme-toggle:hover { color: var(--vz-magenta-text); }
.icon-btn[aria-disabled="true"] { color: var(--vz-text-muted); cursor: not-allowed; }
.icon-btn[aria-disabled="true"]:hover { color: var(--vz-text-muted); }
/* Dark page shows the moon, light page the sun */
.theme-toggle__sun, [data-theme="light"] .theme-toggle__moon { display: none; }
[data-theme="light"] .theme-toggle__sun { display: inline-block; }

/* ── Header ────────────────────────────────────────────────── */
/* One-sentence pitch above the first section */
.tagline { margin: 0; padding: 0 var(--vz-space-5); max-width: 900px; font-family: var(--vz-font-display); font-weight: 700;
  font-size: clamp(26px, 3.2vw, 42px); line-height: 1.15; letter-spacing: -0.01em; color: var(--vz-text); }

/* Sections are panels (theme: .vz-panel + .vz-section-title + .vz-underline); the first one starts level with the sidebar */
.section { display: flex; flex-direction: column; gap: var(--vz-space-4); }
.section-head { display: flex; flex-direction: column; gap: var(--vz-space-2); }
.about__text { margin: 0; font-size: clamp(16px, 1.4vw, 18px); line-height: 1.7; color: var(--vz-text); }

/* Fade the YAML-driven text in once it has loaded */
.section > *, .profile, .contacts { transition: opacity var(--vz-duration-slow) var(--vz-ease); }
body:not(.is-ready) .tagline, body:not(.is-ready) .section > *:not(.section-head), body:not(.is-ready) .profile, body:not(.is-ready) .contacts { opacity: 0; }

/* ── Top bar and phone profile (phones and tablets only) ──── */
.topbar, .mprofile { display: none; }
.scrim { position: fixed; inset: 0; z-index: 20; background: rgb(1 4 9 / 0.6); }

/* Light theme: the scrim and panels need a little more weight on a pale page */
[data-theme="light"] .scrim { background: rgb(31 35 40 / 0.35); }
[data-theme="light"] .vz-panel { background: rgb(255 255 255 / 0.82); }

@media (max-width: 959px) {
  .page-controls, .brand-pill { display: none; }
  .sidebar__actions { display: flex; }
  .sidebar__rule--actions { display: block; }
  /* No stacking context on .layout here, so the drawer can sit above the top bar and scrim */
  .layout { display: block; padding: var(--vz-space-4); z-index: auto; }
  .sidebar { top: 0; }
  .content { position: relative; z-index: 1; }
  .topbar {
    position: sticky; top: var(--vz-space-2); z-index: 10;
    margin: var(--vz-space-2) var(--vz-space-4) 0; padding: var(--vz-space-2) var(--vz-space-2) var(--vz-space-2) var(--vz-space-4);
    border-radius: var(--vz-radius-pill);
    display: flex; align-items: center; gap: var(--vz-space-3);
  }
  .vz .topbar__home { margin-right: auto; display: flex; align-items: center; min-height: 44px; }

  /* Phone profile on the page: photo, name, headline, location, then the contact buttons */
  .mprofile {
    display: flex; flex-direction: column; align-items: center; gap: var(--vz-space-2); text-align: center;
    padding: var(--vz-space-5) 0 var(--vz-space-2);
  }
  .portrait--m { width: 168px; margin: 0 0 var(--vz-space-2); }
  .mprofile .contacts { margin-top: var(--vz-space-2); }
  .sidebar .contacts { display: none; } /* the drawer skips them: the page shows them under the location */
  .mprofile__name { margin: 0; font: 700 30px/1.1 var(--vz-font-display); letter-spacing: -0.01em; }
  /* The drawer no longer needs the photo and name: the page shows them */
  .sidebar .portrait, .sidebar .profile { display: none; }
  .topbar__logo { width: 132px; height: auto; }
  .topbar__menu {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    border: 0; border-radius: 50%; background: transparent; color: var(--vz-text); cursor: pointer;
  }
  .topbar__menu:hover { background: var(--vz-surface-2); }

  /* The sidebar becomes a drawer from the left */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 30;
    width: min(320px, 86vw); max-height: none; border-radius: 0 var(--vz-radius-panel) var(--vz-radius-panel) 0;
    background: var(--vz-surface-1-solid);
    transform: translateX(-105%); transition: transform var(--vz-duration-slow) var(--vz-ease);
  }
  .drawer-open .sidebar { transform: none; }
  .drawer-open { overflow: hidden; }
  .sidebar { overflow-y: auto; scrollbar-width: thin; } /* the drawer may scroll on a very short phone */
  .section { padding: var(--vz-space-4); }
  html { scroll-padding-top: calc(var(--topbar-h, 60px) + 24px); }
}
@media (max-width: 420px) {
  .topbar .vz-segment button { min-width: 40px; padding: 0 10px; }
  .topbar { gap: var(--vz-space-2); }
  .topbar__logo { width: 110px; }
}

/* ---------- Experience & Education timeline ---------- */
.career__list { margin: 0; padding: 0 0 0 32px; list-style: none; gap: 28px; }
.career__list::before { left: 7px; top: 24px; bottom: 24px; }
.tl__item { display: grid; gap: 10px; }
.tl__item::before { transition: box-shadow .3s, background .3s; }
.vz-timeline > .tl__item::before { left: -32px; top: 16px; }
.vz-timeline > .tl__item.is-focus::before { background: var(--vz-magenta-bright); border-color: var(--vz-magenta-bright); box-shadow: 0 0 0 5px color-mix(in srgb, var(--vz-magenta) 30%, transparent), 0 0 14px var(--vz-magenta); }
.tl__head { display: flex; align-items: center; gap: 14px; }
.tl__mark {
  flex: none; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--vz-border, rgba(255,255,255,.15)); overflow: hidden; color: #1b1b2f;
}
.tl__mark img { max-width: 80%; max-height: 80%; object-fit: contain; }
.tl__org { margin: 0; font-size: 1.1rem; }
.tl__meta, .tl__dates { font-size: .85rem; opacity: .75; }
.tl__who { display: grid; gap: 2px; min-width: 0; }

/* secondary line: one dot per position */
.tl__positions { position: relative; margin-left: 23px; padding-left: 34px; display: grid; gap: 18px; }
.tl__positions::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--vz-cyan), var(--vz-magenta)); opacity: .55; }
.tl__pos { position: relative; opacity: .6; transition: opacity .3s; padding: 10px 14px; border-radius: var(--vz-radius-card); }
.tl__pos::before { content: ""; position: absolute; left: -35.5px; top: 15px; width: 12px; height: 12px; border-radius: 50%; box-sizing: border-box;
  transform: translateX(-5px); background: var(--vz-surface-1-solid); border: 2px solid var(--vz-magenta); transition: box-shadow .3s, background .3s; }
.tl__pos::after { content: ""; position: absolute; left: -27.5px; top: 20px; width: 28px; height: 2px; background: var(--vz-magenta); opacity: .5; }
.tl__pos.is-focus { opacity: 1; }
.tl__pos.vz-active { --vz-fill: var(--vz-surface-2-solid); }
.tl__pos.is-focus::before { background: var(--vz-magenta-bright); border-color: var(--vz-magenta-bright);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--vz-magenta) 30%, transparent), 0 0 12px var(--vz-magenta); }
.tl__pos-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px;
  font-weight: 600; padding-bottom: 8px; border-bottom: 1px solid var(--vz-border, rgba(255,255,255,.15)); }
.tl__pos.is-focus .tl__pos-head { border-bottom-color: var(--vz-magenta); }
.tl__dates { font-weight: 400; }
.tl__list { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: .92rem; line-height: 1.5; }
.tl__item:not(.is-focus) .tl__head { opacity: .8; }

/* theme's .vz-timeline li dots must only hit top-level items */
.vz-timeline .tl__list li::before { content: none; display: none; }
.vz-timeline .tl__list li { position: static; }

/* ---------- Active halo (focus.js adds the theme's .vz-active) ---------- */
.section, [data-focus-unit] { border: 1.5px solid transparent; transition: opacity .3s; }
.section.vz-active { --vz-fill: var(--vz-surface-1-solid); }
.skills__group[data-focus-unit] { padding: var(--vz-space-3); border-radius: var(--vz-radius-card); }
.tl__item[data-focus-unit] { padding: 10px 14px; border-radius: var(--vz-radius-card); }
.tl__item[data-focus-unit].vz-active { --vz-fill: var(--vz-surface-2-solid); }

/* ---------- Skills: collapsed to icon, name and bar; details expand in place on hover (mouse devices only) ---------- */
.skill__more, .skill__more-inner { display: contents; }
@media (hover: hover) and (pointer: fine) {
  .skills__grid { column-width: auto; }
  .skills__grid.is-cols { display: flex; align-items: flex-start; gap: var(--vz-space-3); }
  .skills__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--vz-space-3); }
  .skills__grid .skill { margin-bottom: 0; gap: 0; }
  .skill .vz-progress__track { margin-top: var(--vz-space-2); }
  .skill__more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s var(--vz-ease); }
  .skill__more-inner { display: block; overflow: hidden; min-height: 0; }
  .skill .skill__tags { padding-top: var(--vz-space-3); opacity: 0; transition: opacity .2s; }
  .skill:hover .skill__more, .skill:focus-within .skill__more { grid-template-rows: 1fr; }
  .skill:hover .skill__tags, .skill:focus-within .skill__tags { opacity: 1; }
}

/* ---------- Contact buttons: own colour each, expand on hover (mouse devices); neighbours slide aside ---------- */
.contacts { flex-wrap: nowrap; }
.contact { --c: var(--vz-magenta-text); flex: none; }
.contact--cyan { --c: var(--vz-cyan); }
.contact--green { --c: var(--vz-green); }
.contact--amber { --c: var(--vz-amber); }
[data-theme="light"] .contact--cyan { --c: color-mix(in srgb, var(--vz-cyan) 65%, #000); }
[data-theme="light"] .contact--green { --c: color-mix(in srgb, var(--vz-green) 65%, #000); }
[data-theme="light"] .contact--amber { --c: color-mix(in srgb, var(--vz-amber) 65%, #000); }
[data-theme="light"] .contact--magenta { --c: var(--vz-magenta); }
.contacts .contact > a, .contacts .contact > span {
  position: static; width: auto; height: 44px; min-width: 44px; padding: 0 11px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: flex-start; gap: 0; border-radius: 22px; white-space: nowrap;
  color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  background: linear-gradient(color-mix(in srgb, var(--c) 12%, transparent), color-mix(in srgb, var(--c) 12%, transparent)), var(--vz-surface-2-solid);
  transition: border-color .2s, box-shadow .2s, gap .25s var(--vz-ease);
}
.contact__label { max-width: 0; overflow: hidden; opacity: 0; font-size: 13px; font-weight: 600; color: var(--vz-text);
  transition: max-width .3s var(--vz-ease), opacity .2s; }
.contacts .contact > a:hover, .contacts .contact > span:hover, .contacts .contact > a:focus-visible, .contacts .contact > span:focus-visible {
  border-color: var(--c); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 45%, transparent); }
@media (hover: hover) and (pointer: fine) {
  .contact > a:hover, .contact > span:hover, .contact > a:focus-visible, .contact > span:focus-visible { gap: 8px; }
  .contact > a:hover .contact__label, .contact > span:hover .contact__label,
  .contact > a:focus-visible .contact__label, .contact > span:focus-visible .contact__label { max-width: 170px; opacity: 1; }
}

/* ---------- Views: Resume / Portfolio ---------- */
.view-pill { position: fixed; top: var(--bar-top); left: calc(var(--edge) + var(--sidebar-w) + var(--vz-space-5)); z-index: 15; height: var(--bar-h);
  display: flex; align-items: center; padding: var(--vz-space-1); border-radius: var(--vz-radius-pill); }
.view-pill .vz-segment button, .view-switch--phone button { display: inline-flex; align-items: center; gap: 8px; }
.view-switch--phone { display: none; }
@media (max-width: 959px) {
  .view-pill { display: none; }
  .view-switch--phone { display: inline-flex; }
  .view-switch--phone .view-label { display: none; } /* icons only: the top bar is tight */
  .view-switch--phone button { min-width: 40px; padding: 0 10px; }
}
@media (min-width: 600px) and (max-width: 959px) { .view-switch--phone .view-label { display: inline; } }

/* ---------- Portfolio ---------- */
.portfolio__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--vz-space-3); align-items: start; }
.cards__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--vz-space-3); }
.portfolio__grid.is-cols { display: flex; align-items: flex-start; }
.project { display: flex; flex-direction: column; }
.project__head { display: flex; align-items: center; gap: var(--vz-space-3); }
.project__icon { flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.project__name { margin: 0; flex: 1; min-width: 0; font-size: 18px; line-height: 1.25; }
.project__more, .project__more-inner { display: contents; }
.project__more-inner > * { margin-top: var(--vz-space-3); }
.project__text { margin: 0; color: var(--vz-text-muted); line-height: 1.55; font-size: 14.5px; }
.project__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.project__actions { display: flex; flex-wrap: wrap; gap: var(--vz-space-2); }
@media (hover: hover) and (pointer: fine) {
  .project__more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s var(--vz-ease); }
  .project__more-inner { display: block; overflow: hidden; min-height: 0; opacity: 0; transition: opacity .2s; }
  .project:hover .project__more, .project:focus-within .project__more { grid-template-rows: 1fr; }
  .project:hover .project__more-inner, .project:focus-within .project__more-inner { opacity: 1; }
}

/* The stage: the project that is open live, below the cards */
.portfolio__stage { margin-top: var(--vz-space-4); padding: var(--vz-space-3); }
.portfolio__stage[hidden] { display: none; }
.stage__head { display: flex; align-items: center; gap: var(--vz-space-3); padding: 0 var(--vz-space-1) var(--vz-space-3); }
.stage__tab, .stage__close { flex: none; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--vz-border); border-radius: 50%; background: var(--vz-surface-2); color: var(--vz-text); cursor: pointer; }
.stage__tab:hover, .stage__close:hover { color: var(--vz-magenta-text); }
.stage__frame { border-radius: var(--vz-radius-card); overflow: hidden; }
.stage__frame iframe { display: block; width: 100%; border: 0; background: transparent; }
.portfolio__stage { background: var(--vz-surface-1); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* Small phones: the top bar gets a second row for the Resume / Portfolio switch */
@media (max-width: 480px) {
  :root { --topbar-h: 114px; }
  .topbar { flex-wrap: wrap; border-radius: 28px; row-gap: var(--vz-space-2); }
  .view-switch--phone { order: 10; flex: 1 0 100%; display: flex; }
  .view-switch--phone button { flex: 1; justify-content: center; }
  .view-switch--phone .view-label { display: inline; }
}
@media (max-width: 380px) {
  .topbar__logo { width: 92px; }
  .topbar { padding-left: var(--vz-space-3); }
  .topbar .vz-segment button { min-width: 34px; padding: 0 8px; }
  .topbar .theme-toggle, .topbar__menu { width: 40px; height: 40px; }
}

/* ---------- Stats strip above About ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--vz-space-3); }
.stat { display: flex; flex-direction: column; gap: 4px; padding: var(--vz-space-4); }
.stat__value { font: 700 34px/1.1 var(--vz-font-display); color: var(--vz-text); }
.stat__value--magenta { color: var(--vz-magenta-text); }
.stat__value--cyan { color: var(--vz-cyan); }
.stat__value--green { color: var(--vz-green); }
.stat__value--amber { color: var(--vz-amber); }
.stat__label { font-size: 14px; color: var(--vz-text-muted); line-height: 1.35; }
body:not(.is-ready) .stats { opacity: 0; }
.stats { transition: opacity var(--vz-duration-slow) var(--vz-ease); }
.stat { --vz-fill: color-mix(in srgb, var(--vz-surface-2-solid) 92%, transparent); border: 1.5px solid var(--vz-border);
  background: var(--vz-fill); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
/* Same halo as .vz-active (theme), on hover */
.stat:hover { --vz-fill: var(--vz-surface-2-solid); border-color: transparent;
  background: linear-gradient(var(--vz-fill), var(--vz-fill)) padding-box,
    conic-gradient(from var(--vz-angle), var(--vz-magenta-bright), var(--vz-cyan), var(--vz-amber), var(--vz-magenta-bright)) border-box;
  animation: vz-spin var(--vz-duration-highlight) linear infinite, vz-breathe var(--vz-duration-highlight) ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .stat:hover { animation: none; box-shadow: var(--vz-glow-active-a); } }

/* Certificates: icon + name; issuer and date open in place on hover (mouse devices) */
.certifications__grid.is-cols { display: flex; align-items: flex-start; }
.cert__more-inner > * + * { margin-top: 2px; }
@media (hover: none), (pointer: coarse) { .cert__more-inner { display: flex; flex-direction: column; margin-top: var(--vz-space-2); padding-left: 52px; } }
@media (hover: hover) and (pointer: fine) {
  .cert__more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s var(--vz-ease); }
  .cert__more-inner { display: flex; flex-direction: column; overflow: hidden; min-height: 0; opacity: 0; padding-left: 52px; transition: opacity .2s; }
  .cert:hover .cert__more, .cert:focus-within .cert__more { grid-template-rows: 1fr; }
  .cert:hover .cert__more-inner, .cert:focus-within .cert__more-inner { opacity: 1; padding-top: var(--vz-space-2); }
}

/* Experience: position + dates always visible, the responsibilities open on hover (mouse devices only) */
.tl__more, .tl__more-inner { display: contents; }
@media (hover: hover) and (pointer: fine) {
  .tl__more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s var(--vz-ease); }
  .tl__more-inner { display: block; overflow: hidden; min-height: 0; opacity: 0; transition: opacity .2s; }
  .tl__pos:hover .tl__more, .tl__pos:focus-within .tl__more { grid-template-rows: 1fr; }
  .tl__pos:hover .tl__more-inner, .tl__pos:focus-within .tl__more-inner { opacity: 1; }
  .tl__pos-head { border-bottom-color: transparent; }
}

/* Visual fixes: tagline lines up with the text inside the sections; top bar pills get room left and right */
@media (max-width: 959px) { .tagline { padding: 0 var(--vz-space-4); } }
.view-pill, .page-controls { padding-inline: var(--vz-space-3); }
.cv-actions { margin-right: var(--vz-space-2); }

/* Hover glow on inactive buttons */
.side-nav a:not(.vz-active):hover, .icon-btn:hover, .theme-toggle:hover, .stage__tab:hover, .stage__close:hover,
.vz-segment button[aria-pressed="false"]:hover, .chip:hover {
  border-color: var(--vz-magenta-text); box-shadow: var(--vz-glow-button); }
.vz-segment button[aria-pressed="false"]:hover { color: var(--vz-text); }
.vz-segment button, .side-nav a { transition: box-shadow var(--vz-duration-fast) var(--vz-ease), border-color var(--vz-duration-fast) var(--vz-ease), color var(--vz-duration-fast) var(--vz-ease), background-color var(--vz-duration-fast) var(--vz-ease); }
.vz-segment button { border: 1px solid transparent; }

.project__image { display: block; width: 100%; max-height: 260px; object-fit: contain; border-radius: var(--vz-radius-control); background: var(--vz-surface-2-solid); border: 1px solid var(--vz-border); }

/* Screenshot gallery in the stage */
.stage__gallery { display: flex; gap: var(--vz-space-3); overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: var(--vz-space-2); min-height: 80px; color: var(--vz-text-muted); }
.stage__shot { flex: none; scroll-snap-align: start; }
.stage__shot img { display: block; height: 460px; width: auto; max-width: 86vw; object-fit: contain; border-radius: var(--vz-radius-card); border: 1px solid var(--vz-border); background: var(--vz-surface-2-solid); }
.stage__head .vz-segment { margin-left: auto; }
.stage__head .vz-segment + .stage__tab { margin-left: 0; }

/* ---------- Animations (kept small; see anim.js) ---------- */
.anim [data-anim]:not(.seen) { opacity: 0; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .brand-pill, .view-pill, .page-controls, .topbar { animation: drop-in .5s var(--vz-ease) both; }
  .view-pill { animation-delay: .08s; }
  .page-controls { animation-delay: .16s; }
  .side-nav li { animation: slide-in .45s var(--vz-ease) both; }
  .side-nav li:nth-child(2) { animation-delay: .06s; }
  .side-nav li:nth-child(3) { animation-delay: .12s; }
  .side-nav li:nth-child(4) { animation-delay: .18s; }
  .side-nav li:nth-child(5) { animation-delay: .24s; }
  .side-nav a .iconify { transition: transform .2s var(--vz-ease); }
  .side-nav a:hover .iconify { transform: translateX(2px) scale(1.08); }
  .stat { transition: transform .2s var(--vz-ease); }
  .stat:hover { transform: translateY(-2px); }
}
@media print { .anim [data-anim]:not(.seen) { opacity: 1 !important; } }

/* ---------- Footer ---------- */
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--vz-space-2) var(--vz-space-5);
  padding: var(--vz-space-4) var(--vz-space-5) 0; border-top: 1px solid var(--vz-border); font-size: 13px; color: var(--vz-text-muted); }
.footer__links { display: flex; flex-wrap: wrap; gap: var(--vz-space-2) var(--vz-space-4); }
.vz .footer a { color: var(--vz-text-muted); text-decoration: none; transition: color .2s; }
.vz .footer a:hover { color: var(--vz-magenta-text); }
@media (max-width: 959px) { .footer { padding-inline: var(--vz-space-4); } }

[data-action][aria-busy="true"] { opacity: .6; cursor: progress; }

/* ---------- Phones: CV buttons live in the top bar next to Resume / Portfolio ---------- */
.cv-actions--phone { display: none; }
@media (max-width: 959px) {
  .cv-actions--phone { display: flex; border-right: 0; padding-right: 0; margin-right: 0; }
  .cv-actions--phone .icon-btn { width: 40px; height: 40px; }
  .sidebar__actions, .sidebar__rule--actions { display: none; }
}
@media (max-width: 480px) {
  .view-switch--phone { order: 10; flex: 1 0 calc(100% - 100px); min-width: 0; }
  .cv-actions--phone { order: 10; }
}

/* ---------- Phones: tighter timeline ---------- */
@media (max-width: 600px) {
  .career__list { padding-left: 24px; gap: 16px; }
  .career__list::before { left: 5px; top: 18px; bottom: 18px; }
  .vz-timeline > .tl__item::before { left: -24px; top: 11px; width: 14px; height: 14px; }
  .tl__item { gap: 6px; }
  .tl__head { gap: 10px; }
  .tl__mark { width: 36px; height: 36px; border-radius: 9px; }
  .tl__org { font-size: 1rem; }
  .tl__meta, .tl__dates { font-size: .78rem; }
  .tl__positions { margin-left: 8px; padding-left: 16px; gap: 8px; }
  .tl__pos { padding: 6px 8px; }
  .tl__pos::before { left: -17.5px; top: 12px; }
  .tl__pos::after { left: -9.5px; top: 17px; width: 10px; }
  .tl__pos-head { padding-bottom: 5px; font-size: .92rem; }
  .tl__list { margin-top: 6px; padding-left: 15px; gap: 4px; font-size: .84rem; line-height: 1.42; }
}

/* Phones: the contact buttons are already open, showing their value */
.mprofile .contacts { flex-wrap: wrap; justify-content: center; gap: var(--vz-space-2); }
.mprofile .contact { max-width: 100%; }
.mprofile .contact > a, .mprofile .contact > span { gap: 8px; max-width: 100%; }
.mprofile .contact__label { max-width: 240px; opacity: 1; overflow: hidden; text-overflow: ellipsis; }
