/* ---------- Fonts (self-hosted, no third-party requests) ---------- */
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/dm-sans-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/dm-sans-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/dm-mono-400-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/dm-mono-400-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/dm-mono-500-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/dm-mono-500-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #0d0f14;
  --surface: #141820;
  --surface-2: #1a2030;
  --border: #1e2530;
  --text: #e8eaf0;
  --text-2: #aab3c2;
  --muted: #7d8697;
  --accent: #4fc3f7;
  /* Career eras: one hue each, none close to the UI accent. app.js uses the same values. */
  --era-edu: #8b6cff;
  --era-intl: #ff7a45;
  --era-free: #ff5c9a;
  --era-cloud: #35d69b;
  --label-w: 150px;
  --gutter: clamp(1rem, 4vw, 3rem);
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Language switching: each text exists twice, the inactive language is hidden. */
html[lang="cs"] [lang="en"],
html[lang="en"] [lang="cs"] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 4rem; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Prose is sans; labels, tags and data keep the technical mono voice. */
.header-tag, .avail, .nav-links a, .lang-switch button, .btn, .hint, .legend, .chart, .tooltip,
.card-meta, .tags, .result, .contact-item .k, .plain em, footer { font-family: var(--mono); }

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.6;
}

a { color: inherit; }
::selection { background: rgba(79, 195, 247, 0.3); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.8rem var(--gutter);
  background: rgba(13, 15, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.04em;
  text-decoration: none;
  line-height: 1;
}
.brand span { color: var(--accent); }

.nav-links { display: flex; gap: 1.5rem; margin-left: auto; }
.nav-links a {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.lang-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.lang-switch button {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  background: transparent;
  color: var(--muted);
  border: 0;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--bg); font-weight: 500; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 34px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 1px; transition: transform 0.2s, opacity 0.2s; }
.topbar.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topbar.open .nav-toggle span:nth-child(2) { opacity: 0; }
.topbar.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.5rem 3rem;
  align-items: end;
  padding: clamp(1.8rem, 4vw, 3rem) var(--gutter) 1rem;
}

.header-tag {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

h1 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.title-prefix { font-weight: 400; color: var(--muted); }
.tagline {
  font-weight: 500;
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-top: 0.5rem;
}

.avail {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.1rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-2);
}
.avail::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--era-cloud);
  box-shadow: 0 0 8px var(--era-cloud);
}

.lead { color: var(--text-2); max-width: 62ch; margin-top: 1.5rem; font-size: 1.05rem; }
.hero-side .lead { margin-top: 0; }

.hero-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.2rem; }

.btn {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 500; }
.btn.primary:hover { background: #7fd5fa; }

/* ---------- Sections ---------- */
.section { padding: 4rem var(--gutter) 1rem; }
#about { padding-top: 3rem; }
#timeline .section-head { margin-bottom: 0.8rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.4rem 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
h2 { font-family: var(--sans); font-weight: 700; font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.03em; line-height: 1.15; }
h3 { font-family: var(--sans); font-weight: 600; font-size: 1.1rem; line-height: 1.3; letter-spacing: -0.01em; }
.hint { font-size: 0.72rem; color: var(--muted); }

/* ---------- Timeline ---------- */
.legend { display: flex; gap: 0.6rem 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.7rem; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.legend-dot.parallel { width: 18px; border: 1.5px dotted var(--text-2); background: transparent; }

.timeline-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter) 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.chart { position: relative; min-width: 920px; padding-top: 0.5rem; }

.tl-overlay { position: absolute; top: 0; bottom: 0; left: var(--label-w); right: 0; pointer-events: none; }
.tl-band { position: absolute; top: 0; bottom: 0; opacity: 0.05; }
.tl-grid { position: absolute; top: 24px; bottom: 0; width: 1px; background: var(--border); }
.tl-now { position: absolute; top: 20px; bottom: 0; width: 1px; background: rgba(79, 195, 247, 0.45); z-index: 6; }
.tl-now span {
  position: absolute; top: -17px; left: 50%; transform: translateX(-50%);
  font-size: 0.68rem; letter-spacing: 0.06em; color: var(--accent); white-space: nowrap;
}

.tl-axis { position: relative; height: 24px; margin-left: var(--label-w); }
.tl-year { position: absolute; transform: translateX(-50%); font-size: 0.7rem; color: var(--muted); }

.tl-group { display: flex; align-items: center; margin: 1.2rem 0 0.4rem; position: relative; }
.tl-group-label {
  width: var(--label-w); flex-shrink: 0; padding-right: 1rem; text-align: right;
  font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; line-height: 1.25;
}
.tl-group-line { flex: 1; height: 1px; opacity: 0.3; }
.tl-group-label, .tl-label { position: sticky; left: 0; z-index: 12; background: var(--bg); align-self: stretch; display: flex; align-items: center; justify-content: flex-end; }

.tl-row { display: flex; align-items: center; margin-bottom: 0.3rem; position: relative; }
.tl-label {
  width: var(--label-w); flex-shrink: 0; padding-right: 1rem; text-align: right;
  font-size: 0.7rem; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; line-height: 1.25;
}
.tl-track { flex: 1; height: 34px; position: relative; }

.bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  font-weight: 500;
  color: var(--bg);
  background: var(--bc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 0;
  /* Separates bars that touch end to end (e.g. consecutive schools or jobs). */
  box-shadow: inset -2px 0 0 var(--bg);
  cursor: pointer;
  z-index: 2;
  transition: height 0.15s, filter 0.15s;
}
.bar:hover, .bar:focus-visible, .bar.active { height: 32px; z-index: 10; filter: brightness(1.15); }
.bar:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.bar.ongoing { border-top-right-radius: 0; border-bottom-right-radius: 0; box-shadow: none; }
.bar.ongoing::after {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 18px;
  background: linear-gradient(90deg, transparent, rgba(13, 15, 20, 0.5));
}
/* Parallel cooperation alongside the main role: outlined and dotted, not a second full-time job. */
.bar.parallel {
  background: color-mix(in srgb, var(--bc) 14%, transparent);
  border: 1.5px dotted var(--bc);
  color: var(--bc);
  box-shadow: none;
}
.bar.joined-right { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.bar.joined-left { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 0; }

.tl-ms-row { display: flex; align-items: center; margin-top: 0.2rem; }
.tl-ms-track { flex: 1; height: 78px; position: relative; border-bottom: 1px solid var(--border); }
.ms { position: absolute; top: 50%; transform: translate(-50%, -50%); z-index: 8; }
.ms-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bg); }
.ms-label {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 0.66rem; letter-spacing: 0.02em; white-space: pre; text-align: center; line-height: 1.25; text-transform: uppercase;
}
.ms-label.above { bottom: 15px; }
.ms-label.below { top: 15px; }

.tooltip {
  display: none;
  position: fixed;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  z-index: 1001;
  pointer-events: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.tooltip.visible { display: block; }
.tt-company { font-family: var(--sans); font-weight: 600; font-size: 1.05rem; margin-bottom: 0.2rem; }
.tt-role { font-size: 0.75rem; color: var(--accent); margin-bottom: 0.4rem; }
.tt-period { font-size: 0.7rem; color: var(--muted); margin-bottom: 0.6rem; }
.tt-note { font-size: 0.7rem; color: var(--text-2); margin: -0.3rem 0 0.6rem; }
.tt-projects-h { font-size: 0.66rem; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.tt-tag { display: inline-block; background: rgba(255, 255, 255, 0.07); border-radius: 3px; padding: 1px 6px; margin: 2px 2px 0 0; font-size: 0.7rem; color: var(--text-2); }

/* ---------- Video ---------- */
.video-section { padding-top: 1rem; padding-bottom: 3rem; }
.video-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 2rem 3rem; align-items: center; }
.video-frame { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #000; }
.yt-facade, .video-frame iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.yt-facade {
  position: relative; cursor: pointer;
  background-color: #000;
  background-image: url('https://i.ytimg.com/vi/cfGaS5syYvs/maxresdefault.jpg'), url('img/david.jpg');
  background-position: center, center 20%;
  background-size: cover, cover;
  background-repeat: no-repeat;
}
.yt-facade::after { content: ''; position: absolute; inset: 0; background: rgba(13, 15, 20, 0.25); transition: background 0.2s; }
.yt-facade:hover::after { background: rgba(13, 15, 20, 0.05); }
.yt-play {
  position: absolute; top: 50%; left: 50%; z-index: 1;
  width: 72px; height: 50px; transform: translate(-50%, -50%);
  background: var(--accent); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s;
}
.yt-play::before {
  content: ''; position: absolute; top: 50%; left: 54%; transform: translate(-50%, -50%);
  border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent var(--bg);
}
.yt-facade:hover .yt-play, .yt-facade:focus-visible .yt-play { transform: translate(-50%, -50%) scale(1.08); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.video-text p { color: var(--text-2); font-size: 1rem; margin-top: 0.8rem; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; }
.about-text p { color: var(--text-2); margin-bottom: 1rem; max-width: 65ch; font-size: 1rem; }
.about-text .aside { color: var(--muted); font-size: 0.9rem; }
.offer { list-style: none; display: grid; gap: 1rem; align-content: start; }
.offer li { padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 6px; }
.offer p { color: var(--text-2); font-size: 0.92rem; margin-top: 0.35rem; }

/* ---------- Project cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.card {
  --c: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--c);
  border-radius: 8px;
  padding: 1.3rem 1.3rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.card.era-intl { --c: var(--era-intl); }
.card.era-free { --c: var(--era-free); }
.card.era-cloud { --c: var(--era-cloud); }
.card-meta { font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.card p { font-size: 0.92rem; color: var(--text-2); }
.result { font-size: 0.78rem; color: var(--text); padding: 0.55rem 0.7rem; background: rgba(255, 255, 255, 0.03); border-radius: 4px; }
.result strong { color: var(--c); font-family: var(--sans); font-weight: 700; font-size: 1.1rem; }
.card .tags { margin-top: auto; }

.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tags > span {
  font-size: 0.7rem;
  padding: 3px 9px;
  border-radius: 4px;
  background: rgba(79, 195, 247, 0.07);
  border: 1px solid rgba(79, 195, 247, 0.18);
  color: var(--accent);
}
.card .tags > span {
  background: color-mix(in srgb, var(--c) 8%, transparent);
  border-color: color-mix(in srgb, var(--c) 25%, transparent);
  color: var(--c);
}

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem 2rem; }
.skill-group h3 { font-size: 1.05rem; margin-bottom: 0.6rem; }
.skill-note { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }
.three-col { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr; gap: 2rem; margin-top: 3rem; }
.sub { margin-bottom: 0.8rem; }
.plain { list-style: none; display: grid; gap: 0.5rem; }
.plain li { font-size: 0.9rem; color: var(--text-2); padding-left: 1rem; position: relative; }
.plain li::before { content: '›'; position: absolute; left: 0; color: var(--muted); }
.plain li.cert::before { content: '◆'; color: var(--accent); font-size: 0.6rem; top: 0.3em; }
.plain em { color: var(--muted); font-style: normal; font-size: 0.8rem; margin-left: 0.4rem; }
.plain strong { color: var(--text); font-weight: 500; }

/* ---------- Contact ---------- */
.contact { padding-bottom: 4rem; }
.contact .lead { margin-top: 0; margin-bottom: 1.8rem; }
.contact-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2.5rem; align-items: center; }
.portrait {
  display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border);
}
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.contact-item {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.2s;
}
a.contact-item:hover { border-color: var(--accent); }
.contact-item .k { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.contact-item .v { font-size: 0.95rem; overflow-wrap: anywhere; }

/* ---------- Partners ---------- */
.partners { padding-top: 1rem; padding-bottom: 3rem; }
.partners-title {
  font-family: var(--mono); font-size: 0.68rem; font-weight: 400;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 1.4rem;
}
.partner-logos {
  list-style: none;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 1.5rem 2.75rem;
}
.partner-logos a {
  display: flex; align-items: center; height: 44px;
  text-decoration: none;
  filter: grayscale(1);
  opacity: 0.5;
  transition: filter 0.25s, opacity 0.25s;
}
.partner-logos a:hover,
.partner-logos a:focus-visible { filter: none; opacity: 1; }
.partner-logos img { display: block; height: 22px; width: auto; }
.partner-logos img.logo-square { height: 40px; }
.partner-logos img.logo-tall { height: 36px; }
.partner-logos img.logo-wide { height: 26px; }
.partner-logos img.logo-slim { height: 20px; }

footer {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.5rem var(--gutter);
  border-top: 1px solid var(--border);
  font-size: 0.7rem; color: var(--muted); letter-spacing: 0.05em;
}

/* ---------- 404 ---------- */
.page-404 { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 1rem var(--gutter); }
.page-404 h1 { font-size: 4rem; color: var(--accent); }
.page-404 p { color: var(--text-2); margin-top: 0.6rem; }
.page-404 .btn { margin-top: 1.5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: 1fr; }
  .about-grid, .three-col { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 640px) {
  /* The chart stays compact: narrower labels, horizontal scroll for the bars. */
  :root { --label-w: 96px; }
  .chart { min-width: 860px; }
  .tl-label { font-size: 0.66rem; padding-right: 0.6rem; }
  .tl-group-label { font-size: 0.64rem; padding-right: 0.6rem; }
  .topbar { gap: 0.75rem; }
  .nav-toggle { display: flex; }
  .lang-switch { margin-left: auto; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0.5rem var(--gutter) 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  }
  .topbar.open .nav-links { display: flex; }
  .nav-links a { padding: 0.85rem 0; font-size: 0.85rem; color: var(--text); border-bottom: 1px solid var(--border); }
  .nav-links a:last-child { border-bottom: 0; }
  .lead { font-size: 1rem; }
  .cards, .skills { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .portrait { width: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
