/* Profile: a console cross-media bar. Only the profile page loads this file. */
.xmb-page {
  --xmb-hue: #a8792a;
  --xmb-text: #f4f6fa;
  --xmb-muted: rgba(244, 246, 250, .72);
  --xmb-glow: rgba(255, 255, 255, .55);
  --xmb-panel: rgba(8, 10, 16, .38);
  --xmb-line: rgba(255, 255, 255, .7);
  --cat-w: 128px;
  color-scheme: dark;
  min-height: 100dvh;
  margin: 0;
  display: block;
  background:
    radial-gradient(120% 90% at 20% 10%, color-mix(in srgb, var(--xmb-hue) 70%, #000) 0%, transparent 60%),
    linear-gradient(170deg, color-mix(in srgb, var(--xmb-hue) 55%, #000), color-mix(in srgb, var(--xmb-hue) 14%, #05060a) 70%);
  background-attachment: fixed;
  color: var(--xmb-text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}
:root[data-theme="light"] .xmb-page {
  --xmb-text: #1c2230;
  --xmb-muted: rgba(28, 34, 48, .7);
  --xmb-glow: rgba(255, 255, 255, .9);
  --xmb-panel: rgba(255, 255, 255, .55);
  --xmb-line: rgba(255, 255, 255, .95);
  color-scheme: light;
  background:
    radial-gradient(120% 90% at 20% 10%, color-mix(in srgb, var(--xmb-hue) 35%, #fff) 0%, transparent 60%),
    linear-gradient(170deg, color-mix(in srgb, var(--xmb-hue) 42%, #fff), color-mix(in srgb, var(--xmb-hue) 18%, #fff) 70%);
  background-attachment: fixed;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .xmb-page {
    --xmb-text: #1c2230;
    --xmb-muted: rgba(28, 34, 48, .7);
    --xmb-glow: rgba(255, 255, 255, .9);
    --xmb-panel: rgba(255, 255, 255, .55);
    --xmb-line: rgba(255, 255, 255, .95);
    color-scheme: light;
    background:
      radial-gradient(120% 90% at 20% 10%, color-mix(in srgb, var(--xmb-hue) 35%, #fff) 0%, transparent 60%),
      linear-gradient(170deg, color-mix(in srgb, var(--xmb-hue) 42%, #fff), color-mix(in srgb, var(--xmb-hue) 18%, #fff) 70%);
    background-attachment: fixed;
  }
}
.xmb-page a { color: inherit; }
.xmb-page :focus-visible { outline: 3px solid var(--xmb-glow); outline-offset: 3px; }

/* Wave: a band and two lines drifting slowly, behind everything. */
.xmb-wave {
  position: fixed;
  left: 0;
  right: 0;
  top: 30dvh;
  height: 46dvh;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  /* Fade the band out instead of ending on a hard edge. */
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.xmb-wave svg { width: 200%; height: 100%; }
.xmb-wave__band { fill: rgba(255, 255, 255, .08); }
.xmb-wave__line { fill: none; stroke: var(--xmb-line); stroke-width: 1.6; opacity: .55; vector-effect: non-scaling-stroke; }
.xmb-wave__line--slow { opacity: .3; }
@media (prefers-reduced-motion: no-preference) {
  .xmb-wave svg { animation: xmb-drift 70s linear infinite; }
}
/* The path pattern repeats every 1200 of 3200 units, so this loop is seamless. */
@keyframes xmb-drift { to { transform: translateX(-37.5%); } }

.xmb-portrait {
  position: fixed;
  right: max(-4vw, -60px);
  bottom: 0;
  height: 92dvh;
  max-width: 46vw;
  object-fit: contain;
  object-position: bottom right;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to left, #000 60%, transparent);
  mask-image: linear-gradient(to left, #000 60%, transparent);
  opacity: .92;
}
.xmb-clock {
  position: fixed;
  top: 18px;
  right: 28px;
  z-index: 2;
  margin: 0;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .3);
}

/* Without JS: plain stacked sections. */
.xmb { position: relative; z-index: 1; padding: 72px clamp(20px, 6vw, 80px) 48px; max-width: 46rem; }
.xmb-bar { display: none; }
.xmb-panel { margin-bottom: 32px; }
.xmb-panel__title { margin: 0 0 10px; font-size: 1.3rem; font-weight: 400; }
.xmb-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.xmb-item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 56px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease-out;
}
.xmb-item__icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; transition: width 220ms cubic-bezier(.16,1,.3,1), height 220ms cubic-bezier(.16,1,.3,1); }
.xmb-item__icon svg, .xmb-cat__icon svg { width: 100%; height: 100%; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .25)); }
.xmb-item__text { display: grid; min-width: 0; }
.xmb-item__title { font-size: 1.05rem; transition: font-size 220ms cubic-bezier(.16,1,.3,1); }
.xmb-item__sub { font-size: .82rem; color: var(--xmb-muted); }
.xmb-detail {
  margin: 8px 0 16px 60px;
  padding: 18px 22px;
  border-radius: 8px;
  background: var(--xmb-panel);
  backdrop-filter: blur(6px);
  line-height: 1.6;
}
.xmb-detail__title { margin: 0 0 8px; font-size: 1.5rem; font-weight: 400; }
.xmb-detail__empty { margin: 0; color: var(--xmb-muted); }
.xmb-detail__empty strong { color: var(--xmb-text); font-weight: 600; }
.xmb-detail .prose { margin: 0; white-space: pre-line; }
.xmb-detail a { text-decoration: underline; text-underline-offset: .2em; }
.xmb-spec { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.xmb-spec dt { color: var(--xmb-muted); }
.xmb-spec dd { margin: 0; overflow-wrap: anywhere; }

/* With JS: the cross-media bar. */
.xmb[data-xmb-ready] { max-width: none; padding: 0; min-height: 100dvh; }
.xmb[data-xmb-ready] .xmb-panel__title { display: none; }
.xmb[data-xmb-ready] .xmb-panel[data-xmb-hidden] { display: none; }
.xmb[data-xmb-ready] .xmb-bar {
  --start-x: 16vw;
  display: flex;
  position: absolute;
  top: 17dvh;
  left: 0;
  transform: translateX(calc(var(--start-x) - var(--xmb-index, 0) * var(--cat-w)));
  transition: transform 260ms cubic-bezier(.16,1,.3,1);
}
.xmb-cat {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  width: var(--cat-w);
  min-height: 112px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  opacity: .55;
  transition: opacity 200ms ease-out;
}
.xmb-cat__icon { width: 54px; height: 54px; transition: transform 220ms cubic-bezier(.16,1,.3,1); }
.xmb-cat__label { font-size: .95rem; opacity: 0; transition: opacity 200ms ease-out; white-space: nowrap; }
.xmb-cat[aria-selected="true"] { opacity: 1; }
.xmb-cat[aria-selected="true"] .xmb-cat__icon { transform: scale(1.22); }
.xmb-cat[aria-selected="true"] .xmb-cat__label { opacity: 1; text-shadow: 0 0 10px var(--xmb-glow); }
.xmb-cat:hover { opacity: .85; }

.xmb[data-xmb-ready] .xmb-panel {
  position: absolute;
  top: calc(17dvh + 132px);
  left: calc(16vw + var(--cat-w) / 2 - 36px);
  width: min(24rem, 30vw);
}
.xmb[data-xmb-ready] .xmb-items { gap: 2px; }
.xmb[data-xmb-ready] .xmb-item { opacity: .62; }
.xmb[data-xmb-ready] .xmb-item-row.is-selected > .xmb-item { opacity: 1; }
.xmb[data-xmb-ready] .xmb-item-row.is-selected .xmb-item__icon { width: 58px; height: 58px; }
.xmb[data-xmb-ready] .xmb-item-row.is-selected .xmb-item__title { font-size: 1.3rem; text-shadow: 0 0 12px var(--xmb-glow); }
.xmb[data-xmb-ready] .xmb-item:hover { opacity: .9; }
.xmb[data-xmb-ready] .xmb-detail { display: none; }
/* The selected item's details open beside the item column. */
.xmb[data-xmb-ready] .xmb-item-row.is-selected > .xmb-detail {
  display: block;
  position: absolute;
  top: 0;
  left: calc(100% + 28px);
  width: min(34rem, 34vw);
  /* Long entries scroll inside the panel instead of running off the screen. */
  max-height: calc(100dvh - 17dvh - 132px - 28px);
  overflow-y: auto;
  scrollbar-width: thin;
  margin: 0;
  animation: xmb-detail-in 260ms cubic-bezier(.16,1,.3,1) both;
}
@keyframes xmb-detail-in { from { opacity: 0; transform: translateX(-10px); } }

/* Phones and narrow tablets: centred bar, details open in place, page scrolls. */
@media (max-width: 899px) {
  .xmb-page { --cat-w: 104px; }
  .xmb-portrait { height: 70dvh; max-width: 70vw; opacity: .22; }
  .xmb-clock { top: 12px; right: 16px; font-size: .95rem; }
  .xmb[data-xmb-ready] .xmb-bar { --start-x: calc(50vw - var(--cat-w) / 2); top: 56px; }
  .xmb-cat__icon { width: 46px; height: 46px; }
  .xmb[data-xmb-ready] .xmb-panel {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    padding: 190px 16px 40px;
  }
  .xmb[data-xmb-ready] .xmb-item-row.is-selected > .xmb-detail {
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
    margin: 6px 0 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xmb-page *, .xmb-page *::before, .xmb-page *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}

/* Contact popup: cover the whole page here, not the Home rail gap. */
.xmb-page .directory-popup { position: fixed; inset: 0; z-index: 100; padding: 32px 20px; }
@media (max-width: 49.9375rem) { .xmb-page .directory-popup { padding: 0; } }

/*
 * Private message popup as a console system dialog: tinted glass, thin light
 * rules top and bottom, light type, glassy fields and a rounded Send.
 */
.xmb-page .directory-popup__backdrop { background: rgba(4, 5, 8, .55); backdrop-filter: blur(3px); }
.xmb-page .contact-popup__window {
  width: min(40rem, 100%);
  max-height: min(88dvh, calc(100% - 24px));
  gap: 0;
  padding: 26px clamp(20px, 4vw, 40px) 30px;
  overflow: hidden auto;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, .55);
  border-bottom: 1px solid rgba(255, 255, 255, .55);
  border-radius: 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--xmb-hue) 32%, rgba(14, 16, 24, .9)), rgba(10, 12, 18, .92));
  color: #f4f6fa;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
.xmb-page .contact-popup__window .directory-popup__header { margin-bottom: 6px; }
.xmb-page .contact-popup__window .directory-popup__title {
  font: 300 clamp(1.5rem, 3vw, 2rem)/1.2 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
  color: #fff;
  text-shadow: 0 0 14px rgba(255, 255, 255, .35);
}
.xmb-page .contact-popup__window .directory-popup__close {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font: 400 .92rem/1 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
.xmb-page .contact-popup__window .directory-popup__close:hover { background: rgba(255, 255, 255, .18); }
.xmb-page .contact-popup__window .directory-popup__rule { border-color: rgba(255, 255, 255, .25); }
.xmb-page .contact-body { gap: 12px; }
.xmb-page .contact-intro { color: #f4f6fa; font-weight: 300; font-size: 1.02rem; }
.xmb-page .contact-note { color: rgba(244, 246, 250, .7); }
.xmb-page .contact-form { gap: 6px; }
.xmb-page .contact-form label {
  margin-top: 8px;
  color: rgba(244, 246, 250, .85);
  font: 400 .88rem/1.2 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}
.xmb-page .contact-form label span { color: rgba(244, 246, 250, .6); font-size: .8rem; }
.xmb-page .contact-form input,
.xmb-page .contact-form textarea {
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 6px;
  background: rgba(255, 255, 255, .07);
  color: #fff;
}
.xmb-page .contact-form input::placeholder,
.xmb-page .contact-form textarea::placeholder { color: rgba(244, 246, 250, .5); }
.xmb-page .contact-form input:focus-visible,
.xmb-page .contact-form textarea:focus-visible { outline: 2px solid rgba(255, 255, 255, .85); outline-offset: 1px; background: rgba(255, 255, 255, .12); }
.xmb-page .contact-submit {
  justify-self: center;
  min-width: 11rem;
  min-height: 46px;
  margin-top: 14px;
  padding: 0 28px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 999px;
  background: linear-gradient(rgba(255, 255, 255, .28), rgba(255, 255, 255, .06));
  color: #fff;
  font: 400 1.05rem/1 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  box-shadow: 0 0 18px rgba(255, 255, 255, .12);
}
.xmb-page .contact-submit:hover { background: linear-gradient(rgba(255, 255, 255, .38), rgba(255, 255, 255, .12)); filter: none; }
.xmb-page .contact-status { color: rgba(244, 246, 250, .75); text-align: center; }
@media (max-width: 49.9375rem) {
  .xmb-page .contact-popup__window { width: 100%; height: 100dvh; max-height: 100dvh; padding: 20px 18px 28px; }
}

/* Experience entries: role, organisation, period and tags, then what was done. */
.xmb-xp__org { margin: -2px 0 8px; font-size: 1.05rem; color: var(--xmb-text); }
.xmb-xp__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 14px; }
.xmb-xp__period { margin-right: 4px; color: var(--xmb-muted); font-variant-numeric: tabular-nums; }
.xmb-xp__tag {
  padding: 2px 10px;
  border: 1px solid color-mix(in srgb, var(--xmb-text) 30%, transparent);
  border-radius: 999px;
  font-size: .8rem;
  color: var(--xmb-muted);
}
.xmb-xp__tag--now { border-color: color-mix(in srgb, var(--xmb-text) 70%, transparent); color: var(--xmb-text); }
.xmb-xp__list { margin: 0; padding-left: 1.1em; display: grid; gap: 8px; }
.xmb-xp__list li::marker { color: var(--xmb-muted); }
.xmb-xp__note { margin: 10px 0 0; color: var(--xmb-muted); }
