/* SPDX-License-Identifier: WTFPL */
/* CV-Base page styles.
 * data-theme  : auto | light | dark        -> color-scheme, resolved with light-dark()
 * data-fx     : classic | material | glass -> style (glass turns into material on phones unless
 *               data-glass-phones, with reduced transparency, or without color-mix/blur)
 * data-layout : sidebar | single
 * data-icons  : brand | mono               -> logos in their brand colours or the accent
 * data-flavor : devops | plain             -> numbered sections, monospace details, pipeline
 *               timelines and live badges, or a plain résumé
 * --md-*      : Material 3 scheme generated from the accent colour, served by /theme.css
 */

:root { --accent: #4a5bb8; color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- tokens: classic ---------- */
:root {
  --primary: var(--accent);
  --bg: light-dark(#f3f4f6, var(--md-surface, #101317));
  --side: light-dark(#e6e8ec, var(--md-sc-low, #161a1f));
  --card: light-dark(#ffffff, var(--md-sc, #1b2026));
  --chip: light-dark(#f1f3f6, var(--md-sc-high, #242a31));
  --text: light-dark(#1b1f24, #e6e8eb);
  --muted: light-dark(#5b6470, #a3acb6);
  --outline: light-dark(#dde1e6, var(--md-outline-variant, #2e353e));
  --on-primary: #fff;
  --r-card: 4px;
  --r-chip: 4px;
  --shadow: 0 1px 2px light-dark(rgb(0 0 0 / .06), transparent);
  --font: "Ubuntu", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  /* Monospace details use the visitor's own fonts: nothing is downloaded. */
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  --ok: light-dark(#1a7f37, #4ac26b);
  /* Background pattern (DevOps flavour): a faint dot grid; transparent otherwise. */
  --grid: linear-gradient(transparent, transparent);
}

/* ---------- tokens: Material 3 (also the base of glass) ---------- */
:root:is([data-fx="material"], [data-fx="glass"]) {
  --primary: var(--md-primary, var(--accent));
  --on-primary: var(--md-on-primary, #fff);
  --bg: var(--md-surface, light-dark(#f8f9fc, #111318));
  --side: var(--md-sc-low, light-dark(#f2f3fa, #191c20));
  --card: light-dark(var(--md-sc-lowest, #fff), var(--md-sc, #1d2024));
  --chip: var(--md-sc-high, light-dark(#e6e8ef, #282a2f));
  --tonal: var(--md-secondary-container, light-dark(#dde1f9, #3f4759));
  --on-tonal: var(--md-on-secondary-container, light-dark(#141b2c, #dde1f9));
  --text: var(--md-on-surface, light-dark(#191c20, #e2e2e9));
  --muted: var(--md-on-surface-variant, light-dark(#44474f, #c4c6d0));
  --outline: var(--md-outline-variant, light-dark(#c4c6d0, #44474f));
  --r-card: 24px;
  --r-chip: 12px;
  --shadow: 0 1px 2px light-dark(rgb(0 0 0 / .06), transparent), 0 2px 8px light-dark(rgb(0 0 0 / .04), transparent);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; color: var(--text); background: var(--grid) 0 0 / 22px 22px, var(--bg); font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; overflow-wrap: anywhere; }
a { color: var(--primary); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
img { max-width: 100%; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 10; padding: 8px 14px; border-radius: 8px;
  background: var(--primary); color: var(--on-primary); }
.skip:focus { top: 8px; }
.print-only { display: none; }
.preview-bar { margin: 0; padding: 8px 16px; text-align: center; font-size: .9rem;
  background: var(--md-tertiary-container, #ffd8e4); color: var(--md-on-tertiary-container, #31111d); }

/* ---------- icons ---------- */
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.ic-brand { fill: var(--ic-l, currentColor); }
:root[data-theme="dark"] .ic-brand { fill: var(--ic-d, currentColor); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ic-brand { fill: var(--ic-d, currentColor); } }
:root[data-icons="mono"] .ic-brand { fill: var(--primary); }
.ic-img { object-fit: contain; border-radius: 4px; }

/* ---------- layout ---------- */
/* The profile column scrolls with the page and runs down to its very bottom, beside the footer. */
.cv { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  grid-template-rows: 1fr auto; min-height: 100vh; }
.profile { background: var(--side); border-right: 1px solid var(--outline); }
[data-layout="sidebar"] .profile { grid-row: 1 / span 2; }
.profile-inner { padding: 32px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.sections { padding: 32px clamp(16px, 4vw, 56px); display: flex; flex-direction: column; gap: 24px;
  max-width: 980px; width: 100%; }
[data-layout="single"] .cv { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; max-width: 980px; margin: 0 auto; }
[data-layout="single"] .profile { border: 0; background: transparent; }
[data-layout="single"] .profile-inner { position: static; max-height: none; align-items: center; text-align: center;
  padding: 40px 16px 8px; }
[data-layout="single"] .toc { display: none; }
[data-layout="single"] .contact, [data-layout="single"] .links, [data-layout="single"] .tools { justify-content: center; }
[data-layout="single"] .sections { margin: 0 auto; padding-top: 16px; }

/* ---------- profile ---------- */
.avatar { width: 128px; height: 128px; border-radius: 50%; object-fit: cover; display: block;
  border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--outline); background: var(--chip); }
.avatar.initials { display: grid; place-items: center; font-size: 2.6rem; font-weight: 700; letter-spacing: .02em;
  color: var(--on-primary); background: var(--primary); border-color: transparent; }
.name { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
.headline { margin: -6px 0 0; color: var(--muted); font-weight: 500; }
.location { margin: 0; color: var(--muted); display: flex; align-items: center; gap: 6px; font-size: .95rem; }
[data-layout="single"] .location { justify-content: center; }
.contact, .links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.contact { flex-direction: column; }
[data-layout="single"] .contact { flex-direction: row; gap: 6px 18px; }
.contact a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-size: .92rem; }
.contact a:hover span { text-decoration: underline; }
.contact .ic { color: var(--primary); }
.links a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--text);
  background: var(--card); border: 1px solid var(--outline); text-decoration: none; }
.links a:hover { border-color: var(--primary); }
.links .ic { width: 22px; height: 22px; }
.link-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.toc ul { list-style: none; margin: 4px 0 0; padding: 0; border-left: 2px solid var(--outline); }
.toc a { display: block; padding: 3px 12px; color: var(--muted); text-decoration: none; font-size: .9rem; margin-left: -2px;
  border-left: 2px solid transparent; }
.toc a:hover { color: var(--text); border-left-color: var(--primary); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.langs { display: inline-flex; border: 1px solid var(--outline); border-radius: 999px; overflow: hidden; }
.langs a { padding: 5px 12px; font-size: .85rem; color: var(--text); text-decoration: none; }
.langs a[aria-current] { background: var(--primary); color: var(--on-primary); }
button { font: inherit; cursor: pointer; }
.print { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--outline); background: var(--card); color: var(--text); font-size: .85rem; }
.print:hover { border-color: var(--primary); }

/* ---------- sections ---------- */
.card { background: var(--card); border: 1px solid var(--outline); border-radius: var(--r-card); box-shadow: var(--shadow);
  padding: 22px 26px; min-width: 0; scroll-margin-top: 16px; }
.card > h2 { font-size: 1.35rem; font-weight: 600; margin-bottom: 14px; }
:is([data-fx="material"], [data-fx="glass"]) .card > h2 { color: var(--primary); }
[data-fx="classic"] .card > h2 { padding-bottom: 12px; border-bottom: 1px solid var(--outline); margin: -4px -26px 16px; padding-left: 26px; padding-right: 26px; font-weight: 500; }
[data-fx="material"] .card { border-color: light-dark(transparent, var(--outline)); }
.rich p { margin: 0 0 .6em; } .rich p:last-child, .rich ul:last-child { margin-bottom: 0; }
.rich ul { margin: 0 0 .6em; padding-left: 1.2em; }
.intro { color: var(--muted); margin-bottom: 14px; }
.item-title { font-size: 1.05rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.item-title a { color: inherit; text-decoration-color: color-mix(in srgb, var(--primary) 55%, transparent); }
.item-title a:hover { color: var(--primary); }
.item-icon { display: inline-flex; color: var(--primary); }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--outline); display: grid; gap: 18px; }
.tl-item { position: relative; }
.tl-item::before { content: ""; position: absolute; left: -25px; top: 6px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 0 3px var(--card); }
.when { margin: 0 0 2px; font-size: .82rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--primary); }
.tl-item .rich { margin-top: 4px; color: var(--text); font-size: .95rem; }

/* experience / education */
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.entry { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; }
.entry-icon { width: 40px; height: 40px; border-radius: var(--r-chip); display: grid; place-items: center;
  background: var(--chip); color: var(--primary); }
:is([data-fx="material"], [data-fx="glass"]) .entry-icon { background: var(--tonal); color: var(--on-tonal); }
.entry-icon .ic { width: 22px; height: 22px; }
.entry-icon .ic-img { width: 30px; height: 30px; }
.entry-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.sub { margin: 2px 0 0; font-weight: 500; }
.meta { margin: 2px 0 0; color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.entry .rich { margin-top: 6px; font-size: .95rem; }
.is-current .entry-icon { box-shadow: 0 0 0 2px var(--primary); }

/* links */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
.link-card { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  border: 1px solid var(--outline); border-radius: calc(var(--r-card) * .6); background: var(--chip); }
.link-card:has(a:hover) { border-color: var(--primary); }
.link-card .item-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-icon { display: inline-flex; color: var(--primary); } .card-icon .ic { width: 26px; height: 26px; }
.card-text { min-width: 0; } .card-text .rich { margin-top: 4px; color: var(--muted); font-size: .9rem; }
.link-card .rich a { position: relative; z-index: 1; }

/* skills */
.skill-group { font-size: .85rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 14px 0 8px; }
.skill-group:first-of-type { margin-top: 0; }
.skills { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr)); }
.skill > :is(a, span:first-child) { text-decoration: none; color: var(--text); }
.skill { display: flex; }
.skill > a, .skill { min-width: 0; }
.skill > a { display: flex; flex: 1; }
.skill .skill-icon + .skill-name, .skill > a > .skill-icon + .skill-name { margin: 0; }
.skill, .skill > a { flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.skill { padding: 14px 8px; border-radius: var(--r-chip); background: var(--chip); border: 1px solid transparent; }
.skill:has(a:hover) { border-color: var(--primary); }
.skill-icon { display: inline-flex; } .skill-icon .ic { width: 36px; height: 36px; }
.skill-name { font-size: .88rem; font-weight: 500; line-height: 1.25; }

/* monitoring */
.monitor { display: block; width: 100%; border: 0; border-radius: calc(var(--r-card) * .6); background: transparent; color-scheme: normal; }
.frame-placeholder { padding: 24px; border: 2px dashed var(--outline); border-radius: 12px; color: var(--muted); text-align: center; font-size: .9rem; }

/* ---------- carousel ----------
 * Works without JavaScript: one radio button per slide (keyboard: arrow keys), the label of
 * each is its tab. The script adds previous / next buttons and swiping. */
.car-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.car-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.car-tab { padding: 7px 16px; border-radius: 999px; border: 1px solid var(--outline); background: var(--card);
  cursor: pointer; font-size: .92rem; font-weight: 500; user-select: none; -webkit-user-select: none; }
.car-tab:hover { border-color: var(--primary); }
[data-fx="classic"] .car-tab { border-radius: 4px; }
.car-panel { display: none; }
.car-input:nth-of-type(1):checked ~ .car-panels > .car-panel:nth-child(1),
.car-input:nth-of-type(2):checked ~ .car-panels > .car-panel:nth-child(2),
.car-input:nth-of-type(3):checked ~ .car-panels > .car-panel:nth-child(3),
.car-input:nth-of-type(4):checked ~ .car-panels > .car-panel:nth-child(4),
.car-input:nth-of-type(5):checked ~ .car-panels > .car-panel:nth-child(5),
.car-input:nth-of-type(6):checked ~ .car-panels > .car-panel:nth-child(6),
.car-input:nth-of-type(7):checked ~ .car-panels > .car-panel:nth-child(7),
.car-input:nth-of-type(8):checked ~ .car-panels > .car-panel:nth-child(8),
.car-input:nth-of-type(9):checked ~ .car-panels > .car-panel:nth-child(9),
.car-input:nth-of-type(10):checked ~ .car-panels > .car-panel:nth-child(10),
.car-input:nth-of-type(11):checked ~ .car-panels > .car-panel:nth-child(11),
.car-input:nth-of-type(12):checked ~ .car-panels > .car-panel:nth-child(12) { display: block; }
.car-input:nth-of-type(1):checked ~ .car-tabs > .car-tab:nth-child(1),
.car-input:nth-of-type(2):checked ~ .car-tabs > .car-tab:nth-child(2),
.car-input:nth-of-type(3):checked ~ .car-tabs > .car-tab:nth-child(3),
.car-input:nth-of-type(4):checked ~ .car-tabs > .car-tab:nth-child(4),
.car-input:nth-of-type(5):checked ~ .car-tabs > .car-tab:nth-child(5),
.car-input:nth-of-type(6):checked ~ .car-tabs > .car-tab:nth-child(6),
.car-input:nth-of-type(7):checked ~ .car-tabs > .car-tab:nth-child(7),
.car-input:nth-of-type(8):checked ~ .car-tabs > .car-tab:nth-child(8),
.car-input:nth-of-type(9):checked ~ .car-tabs > .car-tab:nth-child(9),
.car-input:nth-of-type(10):checked ~ .car-tabs > .car-tab:nth-child(10),
.car-input:nth-of-type(11):checked ~ .car-tabs > .car-tab:nth-child(11),
.car-input:nth-of-type(12):checked ~ .car-tabs > .car-tab:nth-child(12) {
  background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.car-input:nth-of-type(1):focus-visible ~ .car-tabs > .car-tab:nth-child(1),
.car-input:nth-of-type(2):focus-visible ~ .car-tabs > .car-tab:nth-child(2),
.car-input:nth-of-type(3):focus-visible ~ .car-tabs > .car-tab:nth-child(3),
.car-input:nth-of-type(4):focus-visible ~ .car-tabs > .car-tab:nth-child(4),
.car-input:nth-of-type(5):focus-visible ~ .car-tabs > .car-tab:nth-child(5),
.car-input:nth-of-type(6):focus-visible ~ .car-tabs > .car-tab:nth-child(6),
.car-input:nth-of-type(7):focus-visible ~ .car-tabs > .car-tab:nth-child(7),
.car-input:nth-of-type(8):focus-visible ~ .car-tabs > .car-tab:nth-child(8),
.car-input:nth-of-type(9):focus-visible ~ .car-tabs > .car-tab:nth-child(9),
.car-input:nth-of-type(10):focus-visible ~ .car-tabs > .car-tab:nth-child(10),
.car-input:nth-of-type(11):focus-visible ~ .car-tabs > .car-tab:nth-child(11),
.car-input:nth-of-type(12):focus-visible ~ .car-tabs > .car-tab:nth-child(12) { outline: 3px solid var(--primary); outline-offset: 2px; }
.car-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.car-nav[hidden] { display: none; }
.car-nav button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--outline); background: var(--card);
  color: var(--text); font-size: 1.4rem; line-height: 1; }
.car-nav button:hover { border-color: var(--primary); }
.car-dots { display: inline-flex; gap: 6px; }
.car-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--outline); }
.car-dots i.on { background: var(--primary); width: 20px; border-radius: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .car-panel { animation: car-in .25s ease-out; }
  @keyframes car-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
}

/* ---------- footer ---------- */
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; padding: 16px; font-size: .8rem; color: var(--muted); }
.foot a { color: var(--muted); }
[data-layout="sidebar"] .foot { grid-column: 2; }

/* ---------- glass ----------
 * Material 3 x glass: frosted surfaces are the scheme's surface containers made translucent,
 * over a soft mesh of its primary, secondary and tertiary containers. */
:root[data-fx="glass"] {
  --side: light-dark(color-mix(in srgb, var(--md-sc-low, #eef) 12%, transparent), color-mix(in srgb, var(--md-sc-low, #1a1c20) 7%, transparent));
  --card: light-dark(color-mix(in srgb, var(--md-sc-lowest, #fff) 16%, transparent), color-mix(in srgb, var(--md-sc, #1d2024) 9%, transparent));
  --chip: color-mix(in srgb, var(--md-sc-high, #e6e8ef) 16%, transparent);
  --outline: color-mix(in srgb, var(--md-on-surface, #888) 13%, transparent);
  --glass-shine: light-dark(rgb(255 255 255 / .75), color-mix(in srgb, var(--md-on-surface, #fff) 16%, transparent));
  --glass-shade: light-dark(color-mix(in srgb, var(--md-primary, #000) 10%, transparent), rgb(0 0 0 / .35));
  --r-card: 28px;
}
[data-fx="glass"] body, [data-fx="glass"] {
  /* The first glow is the accent itself, so that even the neutral palettes have something
   * to see through the glass. */
  --mesh-1: light-dark(color-mix(in oklab, var(--accent) 38%, transparent), color-mix(in oklab, var(--accent) 46%, transparent));
  --mesh-2: light-dark(color-mix(in oklab, var(--md-tertiary-container, var(--accent)) 90%, transparent), color-mix(in oklab, var(--md-tertiary, var(--accent)) 34%, transparent));
  --mesh-3: light-dark(color-mix(in oklab, var(--md-secondary-container, var(--accent)) 90%, transparent), color-mix(in oklab, var(--md-secondary, var(--accent)) 26%, transparent));
  background:
    var(--grid) 0 0 / 22px 22px,
    radial-gradient(120% 70% at 0% 0%, var(--mesh-1), transparent 62%),
    radial-gradient(90% 65% at 100% 40%, var(--mesh-2), transparent 65%),
    radial-gradient(130% 70% at 30% 100%, var(--mesh-3), transparent 70%),
    var(--bg);
  /* No light-dark() in this declaration: the server's fallback for older browsers would repeat
   * it after the color-mix() fallback below and undo it. --bg carries the light/dark choice. */
  background-attachment: fixed;
}
[data-fx="glass"] :is(.card, .profile, .links a, .langs, .print, .car-tab, .car-nav button) {
  -webkit-backdrop-filter: blur(9px) saturate(170%);
  backdrop-filter: blur(9px) saturate(170%);
}
[data-fx="glass"] .card { box-shadow: inset 0 1px 0 var(--glass-shine), 0 8px 28px -10px var(--glass-shade); }
[data-fx="glass"] .profile { border-right-color: var(--outline); }
[data-fx="glass"] .car-tab, [data-fx="glass"] .links a { background: color-mix(in srgb, var(--md-sc-lowest, #fff) 10%, transparent); }

/* Glass + DevOps: now and then a dot of the background grid swells and glows (cv.js adds them;
 * the layer follows the grid, which is fixed to the window in glass). */
/* Light: a softer glow, else dark dots look like smudges once blurred behind the panes. */
.sparks { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  --spark: light-dark(color-mix(in srgb, var(--md-primary, var(--accent)) 50%, transparent), var(--md-primary, var(--accent))); }
.sparks i { position: absolute; width: 2px; height: 2px; margin: -1px 0 0 -1px; border-radius: 50%; opacity: 0;
  background: var(--spark);
  box-shadow: 0 0 4px 1px color-mix(in srgb, var(--spark) 75%, transparent),
    0 0 12px 3px color-mix(in srgb, var(--spark) 35%, transparent);
  animation: spark var(--d, 3.6s) ease-in-out var(--w, 0s) infinite; }
@keyframes spark { 0%, 100% { opacity: 0; transform: scale(1); } 45% { opacity: 1; transform: scale(2.6); } 60% { opacity: .9; transform: scale(2.2); } }
/* Glass is costly and harder to read on phones: Material there, unless asked for. Also
 * Material when transparency is reduced, and when the browser lacks blur or colour mixing. */
@media (max-width: 700px), (prefers-reduced-transparency: reduce) {
  :root[data-fx="glass"]:not([data-glass-phones]) {
    --side: var(--md-sc-low); --card: light-dark(var(--md-sc-lowest), var(--md-sc)); --chip: var(--md-sc-high);
    --outline: var(--md-outline-variant); --r-card: 24px; }
  :root[data-fx="glass"]:not([data-glass-phones]) body { background: var(--md-surface); }
  :root[data-fx="glass"]:not([data-glass-phones]) :is(.card, .profile, .links a, .langs, .print, .car-tab, .car-nav button) {
    -webkit-backdrop-filter: none; backdrop-filter: none; }
  :root[data-fx="glass"]:not([data-glass-phones]) .card { box-shadow: var(--shadow); }
  :root[data-fx="glass"]:not([data-glass-phones]) .sparks { display: none; }
}
@media (prefers-reduced-motion: reduce) { .sparks { display: none; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root[data-fx="glass"] { --side: var(--md-sc-low); --card: light-dark(var(--md-sc-lowest), var(--md-sc)); --chip: var(--md-sc-high); }
  .sparks { display: none; }
}
@supports not (color: color-mix(in srgb, red, blue)) {
  :root[data-fx="glass"] { --side: var(--md-sc-low); --card: light-dark(var(--md-sc-lowest), var(--md-sc)); --chip: var(--md-sc-high);
    --outline: var(--md-outline-variant); }
  [data-fx="glass"] body, [data-fx="glass"] { background: var(--md-surface); }
  .sparks { display: none; }
}

/* ---------- modern touches (every flavour) ---------- */
.card { transition: border-color .2s, box-shadow .2s; }
.link-card, .skill, .links a, .car-tab, .print, .car-nav button { transition: border-color .15s, transform .15s, box-shadow .15s, background-color .15s; }
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .link-card:has(a:hover), .skill:has(a:hover), .links a:hover { transform: translateY(-2px); }
}
.link-card:has(a:hover) { box-shadow: 0 6px 18px -10px var(--primary); }
.name { font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem); letter-spacing: -.02em; }

/* live status (monitoring sections, "still ongoing" entries) */
.live-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
@media (prefers-reduced-motion: no-preference) {
  .live-dot, [data-flavor="devops"] .tl-item.is-current::before { animation: live 2.4s ease-out infinite; }
  @keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); }
    70%, 100% { box-shadow: 0 0 0 8px transparent; } }
}
.mon { border: 1px solid var(--outline); border-radius: calc(var(--r-card) * .6); overflow: hidden; background: var(--chip); }
.mon-bar { margin: 0; display: flex; align-items: center; gap: 8px; padding: 8px 14px; font: 500 .8rem/1.3 var(--mono);
  color: var(--muted); border-bottom: 1px solid var(--outline); }
.mon-live { color: var(--ok); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.mon .monitor { border-radius: 0; }

/* ---------- flavour: DevOps ----------
 * Numbered sections (the table of contents uses the same numbers), monospace details, dates as
 * tags, timelines drawn like a commit graph, experience as pipeline stages, compact skill
 * badges, a prompt before the headline. */
:root[data-flavor="devops"] {
  --grid: radial-gradient(circle, light-dark(rgb(20 30 60 / .11), rgb(255 255 255 / .07)) 1px, transparent 1.3px);
  --r-chip: 10px;
}
:root[data-flavor="devops"][data-fx="classic"] { --r-card: 8px; --r-chip: 6px; }

/* profile */
[data-flavor="devops"] .avatar { border-radius: 28%; border: 0; box-shadow: 0 0 0 3px var(--side), 0 0 0 5px var(--primary); }
[data-layout="single"][data-flavor="devops"] .avatar { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--primary); }
[data-flavor="devops"] .name { font-weight: 750; }
[data-flavor="devops"] .headline { margin-top: -4px; font: 500 .86rem/1.5 var(--mono); color: var(--text); }
[data-flavor="devops"] .headline::before { content: "$ "; color: var(--primary); font-weight: 700; }
[data-flavor="devops"] .headline::after { content: ""; display: inline-block; width: .55em; height: 1.1em; margin-left: .3em;
  vertical-align: -.2em; background: var(--primary); opacity: .8; }
@media (prefers-reduced-motion: no-preference) {
  [data-flavor="devops"] .headline::after { animation: caret 1.1s steps(1) infinite; }
  @keyframes caret { 50% { opacity: 0; } }
}
[data-flavor="devops"] :is(.location, .contact a) { font-family: var(--mono); font-size: .84rem; }
[data-flavor="devops"] .links a { border-radius: 12px; }
[data-flavor="devops"] :is(.langs, .print) { border-radius: 8px; font-family: var(--mono); }
[data-flavor="devops"] .langs a, [data-flavor="devops"] .print { font-size: .8rem; }

/* table of contents, numbered like the sections */
[data-flavor="devops"] .toc ul { counter-reset: toc; border-left-color: var(--outline); }
[data-flavor="devops"] .toc a { font-size: .86rem; display: flex; gap: .7em; }
[data-flavor="devops"] .toc a::before { flex: none; counter-increment: toc; content: counter(toc, decimal-leading-zero);
  font: 600 .78rem/1.7 var(--mono); color: var(--primary); opacity: .75; }
.toc a[aria-current] { color: var(--text); border-left-color: var(--primary); font-weight: 600; }

/* section headings */
[data-flavor="devops"] .sections { counter-reset: sec; }
[data-flavor="devops"] .sections > .card > h2 { display: flex; align-items: center; gap: .6em; color: var(--text); font-weight: 650; letter-spacing: -.01em; }
[data-flavor="devops"] .sections > .card > h2::before { counter-increment: sec; content: counter(sec, decimal-leading-zero);
  font: 700 .7rem/1 var(--mono); color: var(--primary); padding: .45em .55em; border-radius: 6px;
  background: var(--chip); border: 1px solid var(--outline); }
[data-flavor="devops"] .card:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--outline)); }

/* dates, places, groups: monospace tags */
[data-flavor="devops"] .when { display: inline-block; text-transform: none; letter-spacing: 0; font: 600 .76rem/1.6 var(--mono);
  padding: 0 8px; border-radius: 6px; background: var(--chip); border: 1px solid var(--outline); }
[data-flavor="devops"] .meta { font: .78rem/1.6 var(--mono); gap: 4px 8px; align-items: center; }
[data-flavor="devops"] .meta > :is(time, span:not(.place)) { padding: 0 8px; border-radius: 6px; background: var(--chip); border: 1px solid var(--outline); color: var(--text); }
[data-flavor="devops"] .place::before { content: "@ "; color: var(--primary); }
[data-flavor="devops"] .skill-group { font: 600 .78rem/1.4 var(--mono); letter-spacing: 0; text-transform: none; }
[data-flavor="devops"] .skill-group::before { content: "# "; color: var(--primary); }
[data-flavor="devops"] .sub { font-weight: 500; color: var(--muted); }

/* timeline as a commit graph */
[data-flavor="devops"] .timeline { gap: 22px; }
[data-flavor="devops"] .tl-item::before { left: -26px; top: 4px; width: 14px; height: 14px; background: var(--card);
  border: 3px solid var(--primary); box-shadow: none; box-sizing: border-box; }
[data-flavor="devops"] .tl-item.is-current::before { background: var(--ok); border-color: var(--ok); }
[data-flavor="devops"] .tl-item.is-current .when { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }

/* experience and education as pipeline stages */
[data-flavor="devops"] .entry { position: relative; }
[data-flavor="devops"] .entry:not(:last-child)::after { content: ""; position: absolute; left: 19px; top: 46px; bottom: -16px;
  width: 2px; border-radius: 2px; background: var(--outline); }
[data-flavor="devops"] .entry-icon { position: relative; border-radius: 12px; }
[data-flavor="devops"] .is-current .entry-icon { box-shadow: 0 0 0 2px var(--primary); }
[data-flavor="devops"] .is-current .entry-icon::after { content: ""; position: absolute; right: -4px; top: -4px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--card); }

/* link cards: an arrow when they lead somewhere */
[data-flavor="devops"] .link-card { padding-right: 34px; background: color-mix(in srgb, var(--chip) 70%, transparent); }
[data-flavor="devops"] .link-card:has(.item-title a)::after { content: "↗"; position: absolute; top: 10px; right: 12px;
  font: 600 .9rem/1 var(--mono); color: var(--muted); }
[data-flavor="devops"] .link-card:has(a:hover)::after { color: var(--primary); }
[data-flavor="devops"] .link-card .item-title { font-size: .98rem; }

/* skills: compact badges */
[data-flavor="devops"] .skills { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(148px, 100%), 1fr)); }
[data-flavor="devops"] :is(.skill, .skill > a) { flex-direction: row; justify-content: flex-start; text-align: left; gap: 10px; }
[data-flavor="devops"] .skill { padding: 9px 12px; border: 1px solid var(--outline); border-radius: var(--r-chip); }
[data-flavor="devops"] .skill:has(a:hover) { border-color: var(--primary); }
[data-flavor="devops"] .skill-icon .ic { width: 22px; height: 22px; }
[data-flavor="devops"] .skill-name { font: 500 .82rem/1.3 var(--mono); }

/* carousel: tabs like branches */
[data-flavor="devops"] .car-tabs { gap: 6px; padding-bottom: 12px; border-bottom: 1px dashed var(--outline); }
[data-flavor="devops"] .car-tab { border-radius: 8px; font: 500 .84rem/1.4 var(--mono); padding: 6px 12px; }
[data-flavor="devops"] .car-nav button { border-radius: 10px; }

[data-flavor="devops"] .foot { font-family: var(--mono); font-size: .75rem; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .cv { grid-template-columns: minmax(0, 1fr); }
  .profile { border-right: 0; border-bottom: 1px solid var(--outline); }
  .cv { grid-template-rows: none; }
  [data-layout="sidebar"] .profile { grid-row: auto; }
  .profile-inner { align-items: center; text-align: center; padding: 28px 16px 20px; }
  .location { justify-content: center; }
  .contact { flex-direction: row; justify-content: center; gap: 6px 18px; }
  .links, .tools { justify-content: center; }
  .toc { display: none; }
  .sections { padding: 16px; gap: 16px; }
  [data-layout="sidebar"] .foot { grid-column: auto; }
}
@media (max-width: 420px) {
  body { font-size: 15px; }
  .card { padding: 16px; }
  [data-fx="classic"] .card > h2 { margin: -2px -16px 14px; padding: 0 16px 10px; }
  .name { font-size: 1.4rem; }
  .avatar { width: 104px; height: 104px; }
  .entry { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
  .entry-icon { width: 32px; height: 32px; }
  .entry-icon .ic { width: 18px; height: 18px; }
  [data-flavor="devops"] .entry:not(:last-child)::after { left: 15px; top: 38px; }
  .skills { grid-template-columns: repeat(auto-fill, minmax(min(96px, 100%), 1fr)); }
  .car-tab { padding: 6px 12px; font-size: .85rem; }
}
@media (min-width: 2000px) {
  body { font-size: 18px; }
  .sections { max-width: 1200px; }
}

/* ---------- system settings ---------- */
@media (forced-colors: active) {
  .card, .link-card, .skill, .car-tab, .langs, .links a { border: 1px solid CanvasText; }
  .car-input:nth-of-type(n):checked ~ .car-tabs > .car-tab { forced-color-adjust: none; }
  .tl-item::before { forced-color-adjust: none; background: CanvasText; }
  .ic-brand { fill: CanvasText; }
}

/* ---------- print: an A4 CV ---------- */
@page { size: A4; margin: 14mm 14mm 16mm; }
@media print {
  :root { color-scheme: light; }
  html, body, [data-fx="glass"] body, [data-fx="glass"] { background: #fff; color: #111; font-size: 10.5pt; }
  .cv { display: block; }
  .profile { background: none; border: 0; }
  .profile-inner { position: static; max-height: none; padding: 0 0 8pt; flex-direction: column; align-items: flex-start; text-align: left; gap: 4pt; }
  .avatar { width: 80pt; height: 80pt; border: 0; box-shadow: none; }
  .contact { flex-direction: row; gap: 2pt 14pt; }
  .links { display: block; }
  .links a { display: inline-flex; width: auto; height: auto; border: 0; background: none; gap: 4pt; margin-right: 12pt; }
  .links .ic { width: 12pt; height: 12pt; }
  .link-label { position: static; width: auto; height: auto; clip-path: none; }
  .link-url { display: none; }
  .toc, .tools, .skip, .car-tabs, .car-nav, .monitor, .preview-bar, .foot a, .sparks { display: none !important; }
  .sections { display: block; padding: 0; max-width: none; }
  .card, [data-fx="glass"] .card { border: 0; box-shadow: none; background: none; padding: 0; margin: 0 0 12pt; border-radius: 0;
    -webkit-backdrop-filter: none; backdrop-filter: none; }
  .card > h2, [data-fx="classic"] .card > h2 { font-size: 13pt; margin: 0 0 6pt; padding: 0 0 3pt; border-bottom: 1px solid #999; color: #111; }
  .car-panel { display: block !important; animation: none; margin-bottom: 8pt; }
  .print-only { display: block; }
  .car-title { font-size: 11pt; margin: 0 0 4pt; }
  .entry, .tl-item, .link-card, .skill { break-inside: avoid; }
  .cards, .skills { gap: 4pt; }
  .link-card, .skill { background: none; border: 1px solid #ccc; padding: 4pt 6pt; }
  .skill .ic { width: 18pt; height: 18pt; }
  a { color: inherit; }
  .rich a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 85%; color: #555; overflow-wrap: anywhere; }
  .headline::before, .headline::after, .link-card::after, .mon { display: none !important; }
  .sections > .card > h2::before { background: none !important; border: 0 !important; padding: 0 !important; color: #555 !important; }
  .when, .meta > * { background: none !important; border: 0 !important; padding: 0 !important; }
  .tl-item::before { animation: none !important; }
  .foot { margin: 0 !important; justify-content: flex-start; padding: 8pt 0 0; }
}

/* Older browsers without the light-dark function: generated by the server (src/compat.rs). */
@supports not (color: light-dark(#000, #fff)) {
:root { --bg: #f3f4f6; --side: #e6e8ec; --card: #ffffff; --chip: #f1f3f6; --text: #1b1f24; --muted: #5b6470; --outline: #dde1e6; --shadow: 0 1px 2px rgb(0 0 0 / .06); --ok: #1a7f37; }
:root:is([data-fx="material"], [data-fx="glass"]) { --bg: var(--md-surface, #f8f9fc); --side: var(--md-sc-low, #f2f3fa); --card: var(--md-sc-lowest, #fff); --chip: var(--md-sc-high, #e6e8ef); --tonal: var(--md-secondary-container, #dde1f9); --on-tonal: var(--md-on-secondary-container, #141b2c); --text: var(--md-on-surface, #191c20); --muted: var(--md-on-surface-variant, #44474f); --outline: var(--md-outline-variant, #c4c6d0); --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 2px 8px rgb(0 0 0 / .04); }
[data-fx="material"] .card { border-color: transparent; }
:root[data-fx="glass"] { --side: color-mix(in srgb, var(--md-sc-low, #eef) 12%, transparent); --card: color-mix(in srgb, var(--md-sc-lowest, #fff) 16%, transparent); --glass-shine: rgb(255 255 255 / .75); --glass-shade: color-mix(in srgb, var(--md-primary, #000) 10%, transparent); }
[data-fx="glass"] body, [data-fx="glass"] { --mesh-1: color-mix(in oklab, var(--accent) 38%, transparent); --mesh-2: color-mix(in oklab, var(--md-tertiary-container, var(--accent)) 90%, transparent); --mesh-3: color-mix(in oklab, var(--md-secondary-container, var(--accent)) 90%, transparent); }
.sparks { --spark: color-mix(in srgb, var(--md-primary, var(--accent)) 50%, transparent); }
@media (max-width: 700px), (prefers-reduced-transparency: reduce) { :root[data-fx="glass"]:not([data-glass-phones]) { --card: var(--md-sc-lowest); } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { :root[data-fx="glass"] { --card: var(--md-sc-lowest); } }
@supports not (color: color-mix(in srgb, red, blue)) { :root[data-fx="glass"] { --card: var(--md-sc-lowest); } }
:root[data-flavor="devops"] { --grid: radial-gradient(circle, rgb(20 30 60 / .11) 1px, transparent 1.3px); }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) { --bg: var(--md-surface, #101317); --side: var(--md-sc-low, #161a1f); --card: var(--md-sc, #1b2026); --chip: var(--md-sc-high, #242a31); --text: #e6e8eb; --muted: #a3acb6; --outline: var(--md-outline-variant, #2e353e); --shadow: 0 1px 2px transparent; --ok: #4ac26b; }
:root:not([data-theme="light"]):is([data-fx="material"], [data-fx="glass"]) { --bg: var(--md-surface, #111318); --side: var(--md-sc-low, #191c20); --card: var(--md-sc, #1d2024); --chip: var(--md-sc-high, #282a2f); --tonal: var(--md-secondary-container, #3f4759); --on-tonal: var(--md-on-secondary-container, #dde1f9); --text: var(--md-on-surface, #e2e2e9); --muted: var(--md-on-surface-variant, #c4c6d0); --outline: var(--md-outline-variant, #44474f); --shadow: 0 1px 2px transparent, 0 2px 8px transparent; }
:root:not([data-theme="light"])[data-fx="material"] .card { border-color: var(--outline); }
:root:not([data-theme="light"])[data-fx="glass"] { --side: color-mix(in srgb, var(--md-sc-low, #1a1c20) 7%, transparent); --card: color-mix(in srgb, var(--md-sc, #1d2024) 9%, transparent); --glass-shine: color-mix(in srgb, var(--md-on-surface, #fff) 16%, transparent); --glass-shade: rgb(0 0 0 / .35); }
:root:not([data-theme="light"])[data-fx="glass"] body, :root:not([data-theme="light"])[data-fx="glass"] { --mesh-1: color-mix(in oklab, var(--accent) 46%, transparent); --mesh-2: color-mix(in oklab, var(--md-tertiary, var(--accent)) 34%, transparent); --mesh-3: color-mix(in oklab, var(--md-secondary, var(--accent)) 26%, transparent); }
:root:not([data-theme="light"]) .sparks { --spark: var(--md-primary, var(--accent)); }
@media (max-width: 700px), (prefers-reduced-transparency: reduce) { :root:not([data-theme="light"])[data-fx="glass"]:not([data-glass-phones]) { --card: var(--md-sc); } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { :root:not([data-theme="light"])[data-fx="glass"] { --card: var(--md-sc); } }
@supports not (color: color-mix(in srgb, red, blue)) { :root:not([data-theme="light"])[data-fx="glass"] { --card: var(--md-sc); } }
:root:not([data-theme="light"])[data-flavor="devops"] { --grid: radial-gradient(circle, rgb(255 255 255 / .07) 1px, transparent 1.3px); }
}
:root[data-theme="dark"] { --bg: var(--md-surface, #101317); --side: var(--md-sc-low, #161a1f); --card: var(--md-sc, #1b2026); --chip: var(--md-sc-high, #242a31); --text: #e6e8eb; --muted: #a3acb6; --outline: var(--md-outline-variant, #2e353e); --shadow: 0 1px 2px transparent; --ok: #4ac26b; }
:root[data-theme="dark"]:is([data-fx="material"], [data-fx="glass"]) { --bg: var(--md-surface, #111318); --side: var(--md-sc-low, #191c20); --card: var(--md-sc, #1d2024); --chip: var(--md-sc-high, #282a2f); --tonal: var(--md-secondary-container, #3f4759); --on-tonal: var(--md-on-secondary-container, #dde1f9); --text: var(--md-on-surface, #e2e2e9); --muted: var(--md-on-surface-variant, #c4c6d0); --outline: var(--md-outline-variant, #44474f); --shadow: 0 1px 2px transparent, 0 2px 8px transparent; }
:root[data-theme="dark"][data-fx="material"] .card { border-color: var(--outline); }
:root[data-theme="dark"][data-fx="glass"] { --side: color-mix(in srgb, var(--md-sc-low, #1a1c20) 7%, transparent); --card: color-mix(in srgb, var(--md-sc, #1d2024) 9%, transparent); --glass-shine: color-mix(in srgb, var(--md-on-surface, #fff) 16%, transparent); --glass-shade: rgb(0 0 0 / .35); }
:root[data-theme="dark"][data-fx="glass"] body, :root[data-theme="dark"][data-fx="glass"] { --mesh-1: color-mix(in oklab, var(--accent) 46%, transparent); --mesh-2: color-mix(in oklab, var(--md-tertiary, var(--accent)) 34%, transparent); --mesh-3: color-mix(in oklab, var(--md-secondary, var(--accent)) 26%, transparent); }
:root[data-theme="dark"] .sparks { --spark: var(--md-primary, var(--accent)); }
@media (max-width: 700px), (prefers-reduced-transparency: reduce) { :root[data-theme="dark"][data-fx="glass"]:not([data-glass-phones]) { --card: var(--md-sc); } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { :root[data-theme="dark"][data-fx="glass"] { --card: var(--md-sc); } }
@supports not (color: color-mix(in srgb, red, blue)) { :root[data-theme="dark"][data-fx="glass"] { --card: var(--md-sc); } }
:root[data-theme="dark"][data-flavor="devops"] { --grid: radial-gradient(circle, rgb(255 255 255 / .07) 1px, transparent 1.3px); }
}
