/*
 * DH Experience — blocks + scroll motion.
 * Everything is visible by default; the animated states only apply under html.pg-motion
 * (set when "Scroll animations" is on and the visitor doesn't prefer reduced motion).
 * Colours and fonts follow the theme tokens when present, with fallbacks for any theme.
 */
.pg-tl, .pg-stats, .pg-pol, .dhx-skills, .dhx-polaroid, .pg-stack {
  --dhx-accent: var(--accent, #6C60BF);
  --dhx-accent-rgb: var(--accent-rgb, 108, 96, 191);
  --dhx-bg: var(--bg, #F3F3F3);
  --dhx-text: var(--text, #0C0B14);
  --dhx-line: var(--line, rgba(12, 11, 20, .12));
  --dhx-muted: var(--muted, #77737F);
  --dhx-muted-strong: var(--muted-strong, #4A4652);
  --dhx-ease: var(--ease, cubic-bezier(.2, .7, .1, 1));
  --dhx-display: var(--font-display, "Syne", system-ui, sans-serif);
  --dhx-gutter: var(--page-gutter, clamp(20px, 4vw, 64px));
}

/* =========================================================================
 * Timeline
 * ====================================================================== */
.pg-tl { position: relative; padding: clamp(80px, 12vh, 160px) 0 clamp(60px, 10vh, 140px); background: var(--dhx-bg); overflow-x: clip; }
html:has(.pg-tl), html:has(.pg-tl) body { overflow-x: clip; }
.pg-tl__wrap {
  position: relative; width: min(100% - 2 * var(--dhx-gutter), 1180px); margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); row-gap: clamp(56px, 12vh, 130px);
}
.pg-tl__rail { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; translate: -50% 0; background: var(--dhx-line); border-radius: 2px; }
.pg-tl__fill { position: absolute; inset: 0; display: block; background: linear-gradient(var(--dhx-accent), rgba(var(--dhx-accent-rgb), .55)); transform-origin: 50% 0; border-radius: 2px; }
.pg-tl__head {
  position: absolute; left: 50%; top: 0; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px rgba(var(--dhx-accent-rgb), .9), 0 0 28px 8px rgba(var(--dhx-accent-rgb), .6);
  opacity: 0; transition: opacity .3s;
}
.pg-tl__chapter {
  grid-column: 1 / -1; justify-self: center; position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 14px; padding: 12px 22px; border-radius: 999px;
  background: var(--dhx-bg); border: 1px solid var(--dhx-line);
  font-family: var(--dhx-display); font-weight: 700; letter-spacing: -.02em;
}
.pg-tl__num { color: var(--dhx-accent); font-size: 22px; font-variant-numeric: tabular-nums; }
.pg-tl__kicker { font-size: 15px; text-transform: lowercase; color: var(--dhx-muted-strong); }
.pg-tl__item { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); align-items: center; }
.pg-tl__node {
  grid-column: 2; grid-row: 1; justify-self: center; position: relative; z-index: 1;
  display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%;
  background: var(--dhx-accent); border: 1px solid var(--dhx-accent); color: #fff;
  transition: background-color .5s var(--dhx-ease), color .5s var(--dhx-ease), border-color .5s var(--dhx-ease), box-shadow .6s var(--dhx-ease), transform .6s var(--dhx-ease);
}
.pg-tl__node svg { width: 24px; height: 24px; }
.pg-tl__card { grid-row: 1; max-width: 520px; }
.pg-tl__item.is-left .pg-tl__card { grid-column: 1; justify-self: end; text-align: right; padding-right: clamp(20px, 3vw, 48px); }
.pg-tl__item.is-right .pg-tl__card { grid-column: 3; justify-self: start; padding-left: clamp(20px, 3vw, 48px); }
.pg-tl__text {
  margin: 0; font-family: var(--dhx-display); font-weight: 600; font-size: clamp(20px, 1.9vw, 30px);
  line-height: 1.22; letter-spacing: -.03em; color: var(--dhx-text);
}
.pg-tl__text strong, .pg-tl__text b { color: var(--dhx-accent); font-weight: 700; }

/* motion: a faint line fills with the scroll, icons light up, entries slide in */
.pg-motion .pg-tl__fill { transform: scaleY(0); }
.pg-motion .pg-tl__node { background: var(--dhx-bg); border-color: var(--dhx-line); color: var(--dhx-muted); }
.pg-motion .pg-tl__item.is-on .pg-tl__node {
  background: var(--dhx-accent); border-color: var(--dhx-accent); color: #fff; transform: scale(1.08);
  box-shadow: 0 0 0 8px rgba(var(--dhx-accent-rgb), .16), 0 0 44px rgba(var(--dhx-accent-rgb), .7);
}
.pg-motion .pg-tl__card { opacity: .12; filter: blur(6px); transition: opacity .9s var(--dhx-ease), transform 1.1s var(--dhx-ease), filter .9s var(--dhx-ease); }
.pg-motion .pg-tl__item.is-left .pg-tl__card { transform: translateX(-46px); }
.pg-motion .pg-tl__item.is-right .pg-tl__card { transform: translateX(46px); }
.pg-motion .pg-tl__item.is-on .pg-tl__card { opacity: 1; transform: none; filter: none; }

@media (max-width: 760px) {
  .pg-tl__wrap { grid-template-columns: 52px minmax(0, 1fr); row-gap: 56px; }
  .pg-tl__rail { left: 26px; }
  .pg-tl__chapter { grid-column: 1 / -1; justify-self: start; }
  .pg-tl__item { grid-template-columns: 52px minmax(0, 1fr); }
  .pg-tl__node { grid-column: 1; width: 46px; height: 46px; }
  .pg-tl__item.is-left .pg-tl__card, .pg-tl__item.is-right .pg-tl__card { grid-column: 2; justify-self: start; text-align: left; padding: 0 0 0 16px; }
  .pg-motion .pg-tl__item.is-left .pg-tl__card, .pg-motion .pg-tl__item.is-right .pg-tl__card { transform: translateX(30px); }
  .pg-motion .pg-tl__item.is-on .pg-tl__card { transform: none; }
}

/* =========================================================================
 * Polaroid (inside a timeline entry, or the standalone block)
 * ====================================================================== */
.pg-pol {
  grid-row: 1; align-self: center; width: var(--pol-w, clamp(180px, 17vw, 260px)); max-width: 100%; margin: 0; padding: 12px 12px 0;
  background: #FBFAF7; border-radius: 2px; box-shadow: 0 2px 4px rgba(8, 7, 14, .08), 0 22px 50px rgba(8, 7, 14, .18);
  transform: rotate(var(--tilt, -4deg));
}
.pg-tl__item.is-left .pg-pol { grid-column: 3; justify-self: start; margin-left: clamp(30px, 5vw, 90px); }
.pg-tl__item.is-right .pg-pol { grid-column: 1; justify-self: end; margin-right: clamp(30px, 5vw, 90px); }
.pg-pol__img { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: #E9E6F2; border-radius: 0; }
/* square photo corners, whatever the theme does to images */
.pg-pol .pg-pol__img img { width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; border-radius: 0 !important; box-shadow: none; margin: 0; }
.pg-pol__img span { position: absolute; inset: 0; display: grid; place-content: center; padding: 12px; text-align: center; color: #8A84A8; font-size: 12px; line-height: 1.5; }
/* the white lip is always there, caption or not */
.pg-pol__cap { margin: 0; min-height: 54px; padding: 12px 4px 14px; color: #2A2640; font-family: var(--dhx-display); font-weight: 600; font-size: 15px; line-height: 1.2; letter-spacing: -.02em; text-align: center; }
[data-theme="dark"] .pg-pol { background: #F3F1EC; }

.pg-motion .pg-pol { opacity: 0; transform: translateY(60px) rotate(-9deg) scale(.92); transition: opacity .9s var(--dhx-ease), transform 1.1s var(--dhx-ease); }
.pg-motion .pg-tl__item.is-on .pg-pol,
.pg-motion .dhx-polaroid.is-in .pg-pol { opacity: 1; transform: rotate(var(--tilt, -4deg)); }

@media (max-width: 760px) {
  .pg-tl__item.has-pol { grid-template-rows: auto auto; row-gap: 26px; }
  .pg-tl__item.is-left .pg-pol, .pg-tl__item.is-right .pg-pol { grid-column: 2; grid-row: 2; justify-self: center; margin: 0; width: min(62vw, 240px); }
}

.dhx-polaroid { display: flex; padding: clamp(24px, 4vw, 56px) var(--dhx-gutter); }
.dhx-polaroid.is-left { justify-content: flex-start; }
.dhx-polaroid.is-center { justify-content: center; }
.dhx-polaroid.is-right { justify-content: flex-end; }

/* =========================================================================
 * Skills — a character sheet with level bars
 * ====================================================================== */
/* identical to the old "Buttons" section header (digitalhumanist-buttons) */
.dhx-skills { padding: clamp(46px, 5.5vw, 80px) 0 clamp(58px, 7vw, 106px); background: transparent; }
.dhx-skills__inner { width: 100%; max-width: min(100%, var(--bh-wrap, var(--wrap, min(calc(100vw - (clamp(20px, 5vw, 80px) * 2)), 1680px)))); margin-inline: auto; }
.dhx-skills__head { max-width: 980px; margin: 0 0 34px; }
.dhx-skills .dhx-skills__kicker {
  margin: 0 0 clamp(12px, 1.2vw, 18px) !important; padding: 0;
  color: color-mix(in srgb, var(--dhx-text) 58%, transparent);
  font-family: var(--dhx-display); font-size: clamp(14px, 1.16vw, 19px); font-weight: 800;
  line-height: 1.22; letter-spacing: .11em; text-transform: uppercase;
  overflow-wrap: anywhere; word-break: normal; hyphens: auto;
}
.dhx-skills__kicker span { color: var(--dhx-accent); font: inherit; }
.dhx-skills .dhx-skills__title {
  max-width: 960px; margin: 0 !important; padding-block: .025em .055em;
  color: inherit; font-family: var(--dhx-display);
  font-size: clamp(36px, 5vw, var(--dhx-title-size, 60px)) !important; font-weight: 700;
  line-height: 1; letter-spacing: -.05em; text-wrap: balance;
  overflow-wrap: anywhere; word-break: normal; hyphens: auto;
}
.dhx-skills__title strong, .dhx-skills__title b { color: var(--dhx-accent); font-weight: 850; }
.dhx-skills .pg-stats { margin-top: 0; }
@media (max-width: 760px) {
  .dhx-skills { padding: 42px 0 64px; }
  .dhx-skills .dhx-skills__title { font-size: clamp(36px, 13vw, var(--dhx-title-size, 60px)) !important; }
}

.pg-stats { list-style: none; margin: clamp(24px, 4vh, 48px) 0 0; padding: 0; width: 100%; border-top: 1px solid var(--dhx-line); }
.pg-stat {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas: "num title level" "num bar bar";
  gap: 14px 20px; align-items: center; padding: clamp(20px, 3vh, 30px) 0; border-bottom: 1px solid var(--dhx-line); margin: 0;
}
.pg-stat__num { grid-area: num; align-self: start; color: var(--dhx-accent); font-family: var(--dhx-display); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; padding-top: 6px; }
.pg-stat__title { grid-area: title; font-family: var(--dhx-display); font-weight: 700; font-size: clamp(22px, 2.4vw, 38px); line-height: 1.04; letter-spacing: -.04em; color: var(--dhx-text); }
.pg-stat__level {
  grid-area: level; justify-self: end; padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(var(--dhx-accent-rgb), .5);
  color: var(--dhx-accent); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
}
.pg-stat__bar { grid-area: bar; position: relative; height: 8px; border-radius: 999px; background: rgba(var(--dhx-accent-rgb), .12); }
.pg-stat__bar i {
  position: absolute; left: 0; top: 0; bottom: 0; width: var(--lv, 70%); border-radius: inherit;
  background: linear-gradient(90deg, rgba(var(--dhx-accent-rgb), .55), var(--dhx-accent));
  box-shadow: 0 0 18px rgba(var(--dhx-accent-rgb), .55);
}
.pg-stat__bar i::after { content: ""; position: absolute; right: -6px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--dhx-accent), 0 0 18px rgba(var(--dhx-accent-rgb), .8); }
.pg-motion .pg-stat__bar i { width: 0; transition: width 1.6s cubic-bezier(.16, 1, .3, 1); transition-delay: calc(var(--i, 0) * 140ms + 150ms); }
.pg-motion .pg-stat.is-in .pg-stat__bar i { width: var(--lv, 70%); }
@media (max-width: 760px) {
  .pg-stat { grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "num title" "num level" "num bar"; }
  .pg-stat__level { justify-self: start; white-space: normal; }
}

/* the old blocks the script rebuilt (Intro sections, Buttons skill cards) */
.pg-motion .pg-src-hidden, .dhx-built .pg-src-hidden { display: none !important; }

/* =========================================================================
 * Pages without a timeline: sections slide over each other like sheets
 * ====================================================================== */
.pg-motion .pg-stack {
  position: sticky; transform-origin: 50% 0; will-change: transform;
  transform: scale(calc(1 - var(--recede, 0) * .05));
  filter: brightness(calc(1 - var(--recede, 0) * .12));
}
html[data-theme="dark"].pg-motion .pg-stack { filter: brightness(calc(1 - var(--recede, 0) * .4)); }
.pg-motion .pg-sheet {
  background-color: var(--dhx-bg);
  border-radius: clamp(22px, 3vw, 40px) clamp(22px, 3vw, 40px) 0 0;
  box-shadow: 0 -30px 100px rgba(8, 7, 14, .14);
  overflow: clip;
}

/* titles rise out of a mask; rows and cards arrive in a stagger */
.pg-motion .pg-rise .pg-mask { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .12em .1em 0; margin: 0 -.12em -.1em 0; }
.pg-motion .pg-rise .pg-mask > span { display: inline-block; transform: translateY(108%); transition: transform 1.1s var(--ease, cubic-bezier(.2, .7, .1, 1)); transition-delay: calc(var(--i, 0) * 70ms); }
.pg-motion .pg-rise.is-in .pg-mask > span { transform: none; }
.pg-motion .pg-arrive { opacity: 0; translate: 0 48px; transition: opacity .8s var(--ease, cubic-bezier(.2, .7, .1, 1)), translate 1.1s var(--ease, cubic-bezier(.2, .7, .1, 1)); transition-delay: calc(var(--i, 0) * 80ms); }
.pg-motion .pg-arrive.is-in { opacity: 1; translate: 0 0; }

/* =========================================================================
 * "scroll" cue on page heroes — same as the homepage one (theme .cue)
 * ====================================================================== */
.dhx-cue {
  position: absolute; left: 50%; bottom: 4vh; translate: -50% 0; z-index: 3; pointer-events: none;
  display: grid; justify-items: center; gap: 10px;
  color: var(--muted, rgba(12, 12, 12, .58)); font-family: var(--font-body, "Inter", system-ui, sans-serif);
  font-size: 11px; font-weight: 800; line-height: 1; letter-spacing: .2em; text-transform: uppercase;
}
.dhx-cue i { display: block; width: 1px; height: 46px; background: linear-gradient(var(--text, #0C0B14), transparent); transform-origin: top; animation: dhx-cue 2.2s var(--ease, cubic-bezier(.22, 1, .36, 1)) infinite; }
@keyframes dhx-cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
@media (max-width: 760px) { .dhx-cue { bottom: 3vh; gap: 8px; } .dhx-cue i { height: 34px; } }
@media (prefers-reduced-motion: reduce) { .dhx-cue i { animation: none; } }
/* page heroes: on phones / short windows the title sits at the bottom, so leave room for the cue */
@media (max-width: 760px), (max-height: 700px) {
  .pg-motion .dhh-hero .dhh-hero__inner { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 3vh + 84px); }
}

/* =========================================================================
 * Articles page: the title gets its own screen (same idea as the About me / homepage heroes)
 * ====================================================================== */
.pg-motion .bap-articles-page--editorial .bap-section-head.pg-pagehero {
  position: relative; display: flex; flex-direction: row; align-items: flex-end; justify-content: flex-start; margin: 0; min-height: calc(100vh - 40px); min-height: calc(100svh - 40px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12vh + 56px);
}
.pg-motion .bap-articles-page--editorial .bap-section-head.pg-pagehero h1 {
  font-size: clamp(72px, 15.5vw, 260px) !important; line-height: .84; letter-spacing: -.075em; margin: 0;
}
@media (max-width: 760px) {
  .pg-motion .bap-articles-page--editorial .bap-section-head.pg-pagehero h1 { font-size: clamp(56px, 21vw, 120px) !important; }
}

/* =========================================================================
 * Section subtitle (Personality, Bookshelf)
 * ====================================================================== */
.dhx-skills .dhx-sub { max-width: 46ch; margin: clamp(14px, 1.6vw, 22px) 0 0; color: var(--dhx-muted-strong); font-size: clamp(17px, 1.3vw, 20px); line-height: 1.45; }
.dhx-skills .dhx-sub strong { color: var(--dhx-accent); }

/* =========================================================================
 * Personality radar — one series in the accent: 2px line, 10% area,
 * ≥8px points with a surface ring, hairline solid grid, text in text colours.
 * ====================================================================== */
.dhx-radar { --dhx-surface: var(--bg, #F3F3F3); }
.dhx-radar__body { display: grid; grid-template-columns: minmax(0, 620px) minmax(0, 1fr); gap: clamp(28px, 5vw, 96px); align-items: center; margin-top: 0; }
/* the chart box is square; the plot sits inside it with --in of room on every side for the labels */
.dhx-radar__chart { --in: 19%; position: relative; margin: -11% 0 0; width: 100%; aspect-ratio: 1; } /* the box is empty above the top label: pull it up */
.dhx-radar__svg { position: absolute; left: var(--in); top: var(--in); width: calc(100% - 2 * var(--in)); height: calc(100% - 2 * var(--in)); overflow: visible; }
.dhx-radar__grid polygon, .dhx-radar__grid line { fill: none; stroke: var(--dhx-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.dhx-radar__area { fill: rgba(var(--dhx-accent-rgb), .1); stroke: var(--dhx-accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.dhx-radar__dot { fill: var(--dhx-accent); stroke: var(--dhx-surface); stroke-width: 2; vector-effect: non-scaling-stroke; }
.dhx-radar__shape { transform-origin: 200px 200px; transform-box: view-box; }
/* --x / --y: position in % of the plot (0–100) */
.dhx-radar__label, .dhx-radar__hit, .dhx-radar__tip {
  position: absolute;
  left: calc(var(--in) + (100% - 2 * var(--in)) * var(--x) / 100);
  top: calc(var(--in) + (100% - 2 * var(--in)) * var(--y) / 100);
}
.dhx-radar__label {
  width: max-content; max-width: 13ch; color: var(--dhx-muted-strong); pointer-events: none;
  font-family: var(--dhx-display); font-size: clamp(12px, 1.05vw, 15px); font-weight: 700; line-height: 1.15; letter-spacing: -.015em;
  /* pushed straight out from its point: the box corner/edge nearest the chart touches the anchor */
  translate: calc(-50% + 50% * var(--cx, 0)) calc(-50% + 50% * var(--cy, 0)); text-align: center;
}
.dhx-radar__label.is-right { text-align: left; }
.dhx-radar__label.is-left { text-align: right; }
.dhx-radar__label b { color: var(--dhx-text); font-weight: 800; }
/* hover targets: bigger than the dots */
.dhx-radar__hit { width: 34px; height: 34px; margin: 0; padding: 0; translate: -50% -50%; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.dhx-radar__hit:focus-visible { outline: 2px solid var(--dhx-accent); outline-offset: -6px; }
.dhx-radar__tip {
  z-index: 3; translate: -50% calc(-100% - 16px); pointer-events: none;
  display: grid; gap: 2px; padding: 9px 13px; border-radius: 12px; white-space: nowrap;
  background: var(--dhx-text); color: var(--dhx-surface); box-shadow: 0 12px 30px rgba(8, 7, 14, .22);
  font-size: 12px; line-height: 1.25;
}
.dhx-radar__tip b { font-family: var(--dhx-display); font-size: 16px; font-weight: 800; }
.dhx-radar__side { display: grid; gap: 22px; align-content: center; }
.dhx-radar__log { margin: 0; padding: 0; border-top: 1px solid var(--dhx-line); }
.dhx-radar__log > div { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--dhx-line); }
.dhx-radar__log dt { color: var(--dhx-muted); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; padding-top: 4px; }
.dhx-radar__log dd { margin: 0; font-family: var(--dhx-display); font-weight: 700; font-size: clamp(17px, 1.5vw, 22px); line-height: 1.15; letter-spacing: -.03em; color: var(--dhx-text); }
.dhx-radar__log dd span { color: var(--dhx-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.dhx-radar__foot { margin: 0; color: var(--dhx-muted); font-size: 13px; font-style: italic; }

.pg-motion .dhx-radar__shape { transform: scale(.08); opacity: 0; transition: transform 1.4s cubic-bezier(.16, 1, .3, 1) .15s, opacity .6s ease .15s; }
.pg-motion .dhx-radar__label { opacity: 0; transition: opacity .8s ease; transition-delay: calc(.5s + var(--i, 0) * 60ms); }
.pg-motion .dhx-radar.is-in .dhx-radar__shape { transform: none; opacity: 1; }
.pg-motion .dhx-radar.is-in .dhx-radar__label { opacity: 1; }

@media (max-width: 1180px) {
  .dhx-radar__body { grid-template-columns: minmax(0, 1fr); margin-top: 0; }
  .dhx-radar__chart { max-width: 600px; margin: -13% auto -9%; }
  .dhx-radar__side { max-width: 600px; width: 100%; margin-inline: auto; }
}
.dhx-radar__label i, .dhx-radar__key { display: none; }
.dhx-radar__label em { font-style: normal; }
@media (max-width: 760px) {
  /* phones: numbers at the points, names in a key below (tap a point for its score) */
  .dhx-radar__body { grid-template-columns: minmax(0, 1fr); }
  .dhx-radar__chart { --in: 10%; margin: 0 auto; }
  .dhx-radar__label em, .dhx-radar__label b { display: none; }
  .dhx-radar__label i { display: inline; font-style: normal; color: var(--dhx-muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
  .dhx-radar__key {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 14px 0 0; padding: 0; list-style: none;
    color: var(--dhx-muted-strong); font-family: var(--dhx-display); font-size: 13px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em;
  }
  .dhx-radar__key li { display: flex; gap: 8px; margin: 0; }
  .dhx-radar__key i { flex: none; width: 2.2ch; font-style: normal; color: var(--dhx-muted); font-size: 11px; font-weight: 800; padding-top: 1px; }
  .dhx-radar__log > div { grid-template-columns: 8em minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .dhx-radar__shape, .dhx-radar__label { transition: none; } }

/* =========================================================================
 * Bookshelf — spines in the site palette; the cover swings open on hover/click
 * ====================================================================== */
.dhx-shelf { --ink: #0C0B14; --paper: #F3F1EC; --lilac: #6C60BF; --lilac-300: #A89FDB; --lilac-100: #E3DFF5; --violet: #1B1636; }
.dhx-shelf__stage { position: relative; margin-top: clamp(0px, 1vw, 14px); padding: 0 0 0 clamp(0px, 3vw, 40px); }
.dhx-shelf__row {
  list-style: none; margin: 0; padding: 22px 0 0; display: flex; align-items: flex-end; justify-content: center; gap: 5px;
  position: relative; z-index: 1;
}
.dhx-shelf__board {
  height: 14px; margin-top: -1px; border-radius: 3px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--dhx-text) 14%, var(--dhx-bg)) 0%, color-mix(in srgb, var(--dhx-text) 22%, var(--dhx-bg)) 100%);
  box-shadow: 0 18px 30px -12px rgba(8, 7, 14, .35);
}
.dhx-book { position: relative; flex: none; margin: 0; }
.dhx-book__spine {
  position: relative; display: grid; place-items: center;
  width: var(--w, 52px); height: var(--h, 290px); margin: 0; padding: 0;
  border: 0; border-radius: 3px 3px 2px 2px; cursor: pointer; overflow: hidden;
  background: var(--ink); color: var(--paper);
  box-shadow: inset -6px 0 10px -4px rgba(0, 0, 0, .35), inset 2px 0 0 rgba(255, 255, 255, .08), 0 2px 0 rgba(0, 0, 0, .08);
  transition: translate .45s cubic-bezier(.22, 1, .36, 1), box-shadow .45s;
}
/* title and author: one under the other, centred on the spine, read bottom-to-top (Italian spines) */
.dhx-book__text {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  writing-mode: vertical-rl; transform: rotate(180deg);
  max-height: calc(var(--h, 290px) - 64px); text-align: center;
}
.dhx-book__title { font-family: var(--dhx-display); font-weight: 700; font-size: 14px; line-height: 1.1; letter-spacing: .02em; text-transform: uppercase; }
.dhx-book__author { font-family: var(--font-body, "Inter", system-ui, sans-serif); font-size: 9.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; opacity: .72; }
.dhx-book[data-empty] .dhx-book__spine { opacity: .55; }

/* six covers, one palette */
.dhx-book--d1 .dhx-book__spine { background: linear-gradient(90deg, transparent 0 0) , linear-gradient(var(--lilac) 0 0) top 14px left 0 / 100% 3px no-repeat, linear-gradient(var(--lilac) 0 0) bottom 14px left 0 / 100% 3px no-repeat, var(--ink); color: var(--paper); }
.dhx-book--d2 .dhx-book__spine { background: linear-gradient(var(--ink) 0 0) top 12px left 8px / calc(100% - 16px) 1px no-repeat, linear-gradient(var(--ink) 0 0) top 16px left 8px / calc(100% - 16px) 1px no-repeat, linear-gradient(var(--ink) 0 0) bottom 12px left 8px / calc(100% - 16px) 1px no-repeat, linear-gradient(var(--ink) 0 0) bottom 16px left 8px / calc(100% - 16px) 1px no-repeat, var(--paper); color: var(--ink); }
.dhx-book--d3 .dhx-book__spine { background: radial-gradient(circle at 50% 26px, rgba(255, 255, 255, .9) 0 5px, transparent 5.5px), var(--lilac); color: #fff; }
.dhx-book--d4 .dhx-book__spine { background: var(--violet); color: var(--lilac-100); box-shadow: inset 0 0 0 5px var(--violet), inset 0 0 0 6px rgba(168, 159, 219, .55), inset 6px 0 10px -4px rgba(0, 0, 0, .4); }
.dhx-book--d5 .dhx-book__spine { background: linear-gradient(var(--violet) 0 0) bottom 0 left 0 / 100% 22% no-repeat, var(--lilac-100); color: var(--violet); }
.dhx-book--d6 .dhx-book__spine { background: repeating-linear-gradient(90deg, rgba(12, 11, 20, .07) 0 1px, transparent 1px 4px), var(--lilac-300); color: var(--ink); }
html[data-theme="dark"] .dhx-book--d1 .dhx-book__spine { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), inset 6px 0 10px -4px rgba(0, 0, 0, .5); }

/* the page: the cover swings open from the spine */
.dhx-book__page {
  position: absolute; left: 100%; bottom: 0; z-index: 5; width: min(300px, 70vw); height: var(--h, 290px);
  display: flex; flex-direction: column; gap: 14px; padding: 26px 24px 22px; margin: 0;
  background: linear-gradient(90deg, rgba(12, 11, 20, .08), transparent 14px), var(--paper); color: var(--ink);
  border-radius: 0 6px 6px 0; box-shadow: 0 24px 60px rgba(8, 7, 14, .28);
  transform-origin: 0 50%; transform: perspective(1100px) rotateY(-92deg); opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform .7s cubic-bezier(.22, 1, .36, 1), opacity .3s, visibility 0s .7s;
}
.dhx-book.is-flip .dhx-book__page { left: auto; right: 100%; transform-origin: 100% 50%; transform: perspective(1100px) rotateY(92deg); border-radius: 6px 0 0 6px; background: linear-gradient(270deg, rgba(12, 11, 20, .08), transparent 14px), var(--paper); }
.dhx-book__label { margin: 0; color: var(--lilac); font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.dhx-book__why { margin: 0; flex: 1; font-family: var(--dhx-display); font-weight: 600; font-size: 19px; line-height: 1.25; letter-spacing: -.025em; color: var(--ink); overflow: auto; }
.dhx-book__meta { margin: 0; color: rgba(12, 11, 20, .55); font-size: 12px; line-height: 1.35; }
.dhx-book__meta span { font-weight: 700; color: var(--ink); }

@media (hover: hover) and (pointer: fine) and (min-width: 761px) {
  .dhx-book:hover, .dhx-book.is-open, .dhx-book:focus-within { z-index: 4; }
  .dhx-book:hover .dhx-book__spine, .dhx-book.is-open .dhx-book__spine, .dhx-book:focus-within .dhx-book__spine { translate: 0 -14px; box-shadow: inset -6px 0 10px -4px rgba(0, 0, 0, .35), 0 16px 24px -10px rgba(8, 7, 14, .45); }
  .dhx-book:hover .dhx-book__page, .dhx-book.is-open .dhx-book__page, .dhx-book:focus-within .dhx-book__page {
    transform: perspective(1100px) rotateY(0) translateY(-14px); opacity: 1; visibility: visible; pointer-events: auto;
    transition: transform .7s cubic-bezier(.22, 1, .36, 1), opacity .25s, visibility 0s;
  }
}

/* phones / touch: the shelf scrolls sideways; the tapped book's page opens under it */
.dhx-shelf__reader { display: none; }
@media (hover: none), (max-width: 760px) {
  .dhx-shelf__stage { padding: 0; margin-inline: calc(-1 * var(--dhx-gutter)); }
  .dhx-shelf__row, .dhx-shelf__board { margin-inline: 0; }
  .dhx-shelf__row { justify-content: flex-start; overflow-x: auto; padding: 40px var(--dhx-gutter) 0; scroll-snap-type: x proximity; scrollbar-width: none; }
  .dhx-shelf__row::-webkit-scrollbar { display: none; }
  .dhx-book { scroll-snap-align: center; }
  .dhx-book__page { display: none; }
  .dhx-book.is-open .dhx-book__spine { translate: 0 -14px; }
  .dhx-shelf.is-ready .dhx-shelf__reader {
    display: flex; flex-direction: column; gap: 12px; margin-top: 22px; padding: 22px 22px 20px; min-height: 0;
    background: var(--paper); color: var(--ink); border-radius: 6px; box-shadow: 0 18px 44px rgba(8, 7, 14, .16);
    transform-origin: 50% 0; transform: perspective(900px) rotateX(-80deg); opacity: 0; max-height: 0; padding-block: 0; overflow: hidden;
    transition: transform .6s cubic-bezier(.22, 1, .36, 1), opacity .3s, max-height .5s, padding .4s;
  }
  .dhx-shelf.is-ready .dhx-shelf__reader.is-on { transform: none; opacity: 1; max-height: 400px; padding-block: 22px 20px; }
}
@media (prefers-reduced-motion: reduce) { .dhx-book__spine, .dhx-book__page, .dhx-shelf__reader { transition: none !important; } }
.dhx-radar__tip[hidden] { display: none; }

/* ---- the shelf arrives: the board draws, then the books are put on it one by one ---- */
.pg-motion .dhx-shelf__board { transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.1s cubic-bezier(.22, 1, .36, 1); }
.pg-motion .dhx-book { opacity: 0; translate: 0 -46px; rotate: -5deg; transform-origin: 50% 100%;
  transition: opacity .5s ease, translate .9s cubic-bezier(.34, 1.4, .5, 1), rotate .9s cubic-bezier(.34, 1.4, .5, 1);
  transition-delay: calc(.35s + var(--i, 0) * 85ms); }
.pg-motion .dhx-shelf.is-in .dhx-shelf__board { transform: none; }
.pg-motion .dhx-shelf.is-in .dhx-book { opacity: 1; translate: 0 0; rotate: 0deg; }
@media (prefers-reduced-motion: reduce) { .pg-motion .dhx-book, .pg-motion .dhx-shelf__board { transition: none; opacity: 1; translate: none; rotate: none; transform: none; } }

/* ---- phones: "swipe" hint + a fade on the right edge while there are more books ---- */
.dhx-shelf__swipe { display: none; }
@media (hover: none), (max-width: 760px) {
  /* the fade is an overlay, not a mask on the scroller (masks block swiping on iPhone) */
  .dhx-shelf__stage::after { content: ""; position: absolute; top: 0; right: 0; bottom: 14px; width: 22%; z-index: 2; pointer-events: none; background: linear-gradient(90deg, color-mix(in srgb, var(--dhx-bg) 0%, transparent), var(--dhx-bg)); transition: opacity .3s; }
  .dhx-shelf.is-end .dhx-shelf__stage::after { opacity: 0; }
  .dhx-shelf__row { touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .dhx-book, .dhx-book__spine { touch-action: pan-x pan-y; }
  .dhx-shelf__swipe {
    display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 14px 0 0;
    color: var(--dhx-muted); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
    transition: opacity .4s;
  }
  .dhx-shelf__swipe i { position: relative; width: 34px; height: 1px; background: currentColor; animation: dhx-swipe 1.8s cubic-bezier(.22, 1, .36, 1) infinite; }
  .dhx-shelf__swipe i::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border: solid currentColor; border-width: 1px 1px 0 0; transform: rotate(45deg); }
  .dhx-shelf.is-scrolled .dhx-shelf__swipe { opacity: 0; }
}
@keyframes dhx-swipe { 0% { transform: translateX(-6px); opacity: .3; } 50% { transform: translateX(4px); opacity: 1; } 100% { transform: translateX(-6px); opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .dhx-shelf__swipe i { animation: none; } }

/* section titles stay on one line: they shrink to fit instead of wrapping
   (Syne here is ~0.51em per character; .55 leaves a little air) */
.dhx-skills .dhx-skills__title { white-space: nowrap; max-width: none;
  font-size: min(clamp(36px, 5vw, var(--dhx-title-size, 60px)), calc((100vw - 2 * var(--page-gutter, 5vw)) / (var(--chars, 12) * .55))) !important; }
@media (max-width: 760px) {
  .dhx-skills .dhx-skills__title { font-size: min(clamp(36px, 13vw, var(--dhx-title-size, 60px)), calc((100vw - 2 * var(--page-gutter, 16px)) / (var(--chars, 12) * .55))) !important; }
}

/* dark mode: the ink and violet covers would vanish into the page, so they lift a step,
   every spine gets a faint light edge, and the shelf board turns light */
html[data-theme="dark"] .dhx-shelf { --ink: #2B2741; --violet: #3A3170; }
html[data-theme="dark"] .dhx-book__spine { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), inset -6px 0 10px -4px rgba(0, 0, 0, .45), 0 10px 24px -12px rgba(0, 0, 0, .8); }
html[data-theme="dark"] .dhx-book--d4 .dhx-book__spine { box-shadow: inset 0 0 0 5px var(--violet), inset 0 0 0 6px rgba(207, 200, 255, .6), inset -6px 0 10px -4px rgba(0, 0, 0, .45); }
html[data-theme="dark"] .dhx-book[data-empty] .dhx-book__spine { opacity: .85; }
html[data-theme="dark"] .dhx-shelf__board { background: linear-gradient(180deg, #3A3650, #2A2740); box-shadow: 0 18px 30px -12px rgba(0, 0, 0, .9); }
