/* LinkedIn microsite (modules/linkedin). LinkedIn's profile structure in the site's glass design system: only base.css
   tokens, no raw colours except the neutral logo placeholder tint. */

.li { padding-block: clamp(20px, 4vw, 40px) clamp(40px, 6vw, 72px); }
.li-wrap { max-width: 1128px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.li-wrap > *, .li-aside { min-width: 0; }
.li-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.li-main { display: grid; gap: 16px; min-width: 0; }
.li-aside { display: grid; gap: 16px; position: sticky; top: calc(var(--nav-h) + 72px); }
@media (max-width: 960px) {
  .li-grid { grid-template-columns: minmax(0, 1fr); }
  .li-aside { position: static; }
}

.li svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.li h1, .li h2, .li h3, .li h4 { margin: 0; }
.li p { margin: 0; }
.li-meta { color: var(--text-muted); font-size: .88rem; line-height: 1.5; }

/* ── top card ── */
.li-top { overflow: hidden; padding: 0; }
.li-top__cover { position: relative; aspect-ratio: 4 / 1; background: var(--tag-bg); overflow: hidden; }
.li-top__cover img { width: 100%; height: 100%; object-fit: cover; }
/* rotating photos: a slow crossfade with a gentle drift; the one fading out stays drifted until it's gone */
.li-top__cover[data-li-covers] img { position: absolute; inset: 0; opacity: 0; transform: scale(1); filter: none; transition: opacity 1.8s ease-in-out, transform 9s linear, visibility 0s 1.8s; visibility: hidden; }
.li-top__cover[data-li-covers] img.is-on { opacity: 1; transform: scale(1.06); visibility: visible; transition: opacity 1.8s ease-in-out, transform 9s linear, visibility 0s; }
.li-cover__bar { position: absolute; z-index: 1; top: 10px; right: 10px; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 20px); }
.li-cover__place, .li-cover__pause { background: color-mix(in srgb, var(--ink) 62%, transparent); color: var(--cream); border: 1px solid color-mix(in srgb, var(--cream) 30%, transparent); border-radius: var(--radius-pill); }
.li-cover__place { display: inline-flex; align-items: center; gap: 5px; min-width: 0; min-height: 30px; padding: 0 12px 0 8px; font-size: .8rem; font-weight: 600; line-height: 1.2; }
.li-cover__place > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-cover__place[hidden], .li-cover__pause[hidden] { display: none; }
.li-cover__pause { position: relative; flex: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; cursor: pointer; }
.li-cover__pause::after { content: ''; position: absolute; inset: -7px; } /* 44px tap target */
.li .li-cover__bar svg { width: 14px; height: 14px; }
:is(.li-cover__pause, .li-roles__pause):not(.is-paused) .i-play, :is(.li-cover__pause, .li-roles__pause).is-paused .i-pause { display: none; }
.li-top__main { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; padding: 0 clamp(18px, 3vw, 28px) 4px; }
.li-top__photo { grid-column: 1 / -1; width: clamp(112px, 18vw, 152px); aspect-ratio: 1; margin-top: calc(clamp(112px, 18vw, 152px) / -2); border-radius: 50%; overflow: hidden; border: 4px solid var(--glass-border); box-shadow: var(--shadow-glass); background: var(--bg); }
.li-top__photo img { width: 100%; height: 100%; object-fit: cover; }
.li-top__id { display: grid; gap: 6px; padding-top: 6px; }
.li-top h1 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); }
.li-pronouns { font: 400 .9rem/1 var(--font-body); color: var(--text-muted); letter-spacing: 0; vertical-align: middle; }
.li-top__headline { font-size: 1.02rem; line-height: 1.45; max-width: 60ch; }
.li-top__loc { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.li-top__stats { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .9rem; font-weight: 600; color: var(--link); }
.li-top__orgs { list-style: none; margin: 0; padding: 10px 0 0; display: grid; gap: 10px; align-content: start; font-size: .9rem; font-weight: 600; max-width: 240px; }
.li-top__orgs li { display: flex; align-items: center; gap: 10px; }
.li-top__actions { padding: 16px clamp(18px, 3vw, 28px) 22px; }
.li-top__actions .btn { min-height: 40px; padding: .55em 1.2em; }
.li-top--compact .li-top__main { grid-template-columns: auto minmax(0, 1fr); align-items: center; padding: 16px clamp(18px, 3vw, 28px); }
.li-top--compact .li-top__photo { grid-column: auto; width: 72px; margin-top: 0; border-width: 2px; }
.li-top--compact h1 { font-size: 1.35rem; }
.li-top--compact .li-top__headline { font-size: .92rem; }
.li-top--compact .li-top__loc, .li-top--compact .li-top__stats { display: none; }
@media (max-width: 640px) {
  .li-top__main { grid-template-columns: minmax(0, 1fr); }
  .li-top__orgs { display: none; }
}

/* ── sub-nav ── */
.li-subnav { position: sticky; top: calc(var(--nav-h) + 8px); z-index: 5; padding: 6px; border-radius: var(--radius-pill); }
.li-subnav__inner { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.li-subnav__inner::-webkit-scrollbar { display: none; }
.li-subnav a { flex: none; padding: .5em 1em; border-radius: var(--radius-pill); color: var(--text); text-decoration: none; font-size: .92rem; font-weight: 500; }
.li-subnav a:hover { background: var(--glass-bg-hover); }
.li-subnav a[aria-current] { background: var(--terracotta-strong); color: var(--cream); }

/* ── cards ── */
.li-card { padding: clamp(18px, 3vw, 26px) clamp(18px, 3vw, 28px); display: grid; gap: 14px; }
.li-card__head { display: flex; align-items: baseline; gap: 10px; }
.li-card__head h2 { font-size: 1.45rem; }
.li-count { color: var(--text-muted); font-size: .9rem; }
.li-card__more { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 4px calc(-1 * clamp(18px, 3vw, 28px)) calc(-1 * clamp(18px, 3vw, 26px)); padding: 12px; border-top: 1px solid var(--nav-border); color: var(--text); font-weight: 600; font-size: .95rem; text-decoration: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.li-card__more:hover { background: var(--glass-bg-hover); }
.li-card--side { gap: 8px; padding: 18px 20px; }
.li-side-h { font: 600 1rem/1.3 var(--font-body); color: var(--heading); }
.li-side-h:not(:first-child) { margin-top: 10px; }
.li-card--side a { word-break: break-word; }
.li-glance, .li-sidelinks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .95rem; }
.li-glance a, .li-sidelinks a { color: var(--text); text-decoration: none; }
.li-glance a:hover, .li-sidelinks a:hover { color: var(--link); text-decoration: underline; }
.li-source { font-size: .8rem; color: var(--text-muted); text-align: center; }
.li-detail-head { gap: 4px; }
.li-detail-head .back-link { margin-bottom: 4px; }
.li-detail-head h2 { font-size: 1.7rem; }

/* about: first paragraph, the rest behind "see more" (works without JS) */
.li-about { display: grid; gap: 12px; max-width: 72ch; }
.li-moretext { display: grid; gap: 12px; }
.li-moretext > summary { list-style: none; cursor: pointer; color: var(--text-muted); font-weight: 600; width: fit-content; }
.li-moretext > summary::-webkit-details-marker { display: none; }
.li-moretext > summary:hover { color: var(--text); }
.li-moretext[open] > summary { order: 2; }
.li-moretext__hide, .li-moretext[open] .li-moretext__show { display: none; }
.li-moretext[open] .li-moretext__hide { display: inline; }
.li-moretext p { margin-top: 12px; }

/* ── items (experience, education, licenses, projects) ── */
.li-list { list-style: none; margin: 0; padding: 0; display: grid; }
.li-item { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-top: 1px solid var(--nav-border); }
.li-item:first-child { border-top: 0; padding-top: 2px; }
.li-item--project { grid-template-columns: minmax(0, 1fr) auto; }
.li-item__body { display: grid; gap: 3px; min-width: 0; }
.li-item__title { font: 600 1.02rem/1.35 var(--font-body); color: var(--heading); letter-spacing: 0; }
.li-item__sub { font-size: .92rem; }
.li-desc { margin-top: 8px !important; font-size: .95rem; max-width: 72ch; }
.li-desc--label { margin-bottom: -4px !important; }
.li-bullets { margin: 8px 0 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: .95rem; max-width: 72ch; }
.li-skillline { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px !important; font-size: .9rem; }
.li-skillline svg { margin-top: 2px; color: var(--text-muted); }
.li-skills-tags { margin-top: 10px; }
.li-assoc { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--text-muted); margin-top: 4px !important; }
.li-btn-sm { min-height: 36px; padding: .45em 1.1em; font-size: .88rem; margin-top: 10px; }
.li-btn-sm svg { width: 15px; height: 15px; }
.li-project__img { display: block; width: clamp(96px, 18vw, 160px); border-radius: var(--radius-sm); overflow: hidden; align-self: start; border: 1px solid var(--glass-border); }
.li-project__img img { width: 100%; height: auto; }

/* grouped roles: one logo, a timeline of titles */
.li-timeline { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 16px; }
.li-timeline > li { position: relative; padding-left: 22px; display: grid; gap: 3px; }
.li-timeline > li::before { content: ''; position: absolute; left: 3px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); }
.li-timeline > li:not(:last-child)::after { content: ''; position: absolute; left: 7px; top: 22px; bottom: -14px; width: 1px; background: var(--field-border); }

/* logos */
.li-logo { display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: 6px; background: var(--cream); }
.li-logo img { width: 100%; height: 100%; object-fit: contain; }
.li-logo--md { width: 48px; height: 48px; }
.li-logo--sm { width: 32px; height: 32px; border-radius: 4px; }
.li-logo--xs { width: 22px; height: 22px; border-radius: 3px; }
.li-logo--blank { background: var(--tag-bg); color: var(--tag-text); font: 700 .85rem/1 var(--font-body); }
.li-logo--sm.li-logo--blank { font-size: .7rem; }

/* attachments (media on a role / school / licence) */
.li-attach { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.li-attach__item { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: start; color: var(--text); text-decoration: none; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--nav-border); max-width: 620px; }
a.li-attach__item:hover { background: var(--glass-bg-hover); }
.li-attach__thumb { border-radius: 6px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--tag-bg); }
.li-attach__thumb img { width: 100%; height: 100%; object-fit: cover; }
.li-attach__text { display: grid; gap: 4px; font-size: .9rem; }
.li-attach__text span { color: var(--text-muted); font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 520px) { .li-attach__item { grid-template-columns: 84px minmax(0, 1fr); } }

/* ── posts ── */
.li-card__lede { margin-top: -8px !important; }
.li-post-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.li-post-strip > * { scroll-snap-align: start; }
.li-feed { display: grid; gap: 16px; }
.li-post { padding: 16px 18px; display: grid; gap: 12px; align-content: start; }
.li-post--compact { padding: 14px; gap: 10px; box-shadow: none; }
.li-post__repost { font-size: .85rem; color: var(--text-muted); padding-bottom: 8px; border-bottom: 1px solid var(--nav-border); }
.li-post__head { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; align-items: center; }
.li-avatar-sm { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; display: block; }
.li-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.li-post__name { font-weight: 600; font-size: .95rem; color: var(--heading); }
.li-post__headline { font-size: .8rem; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.li-post__text { font-size: .95rem; white-space: pre-line; }
.li-post--compact .li-post__text { font-size: .88rem; }
.li-post__img { border-radius: var(--radius-sm); overflow: hidden; margin-inline: -4px; }
.li-post__img img { width: 100%; height: auto; }
.li-post--compact .li-post__img { aspect-ratio: 16 / 10; }
.li-post--compact .li-post__img img { height: 100%; object-fit: cover; }
.li-post__stats { font-size: .85rem; color: var(--text-muted); padding-top: 8px; border-top: 1px solid var(--nav-border); }

/* ── skills ── */
.li-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.li-tabs a { padding: .45em 1em; border-radius: var(--radius-pill); border: 1px solid var(--field-border); color: var(--text); text-decoration: none; font-size: .88rem; font-weight: 600; }
.li-tabs a span { color: var(--text-muted); font-weight: 500; margin-left: 2px; }
.li-tabs a:hover { background: var(--glass-bg-hover); }
.li-tabs a[aria-current="page"] { background: var(--terracotta-strong); border-color: var(--terracotta-strong); color: var(--cream); } /* cream on terracotta-strong: the button pair every preset must pass */
.li-tabs a[aria-current="page"] span { color: inherit; }
.li-skillrows { list-style: none; margin: 0; padding: 0; display: grid; }
.li-skillrow { padding: 14px 0; border-top: 1px solid var(--nav-border); display: grid; gap: 8px; }
.li-skillrow:first-child { border-top: 0; }
.li-usedin { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .88rem; }
.li-usedin li { display: flex; align-items: center; gap: 8px; }

/* ── phones (≤ 760px, same width as linkedin.js): compact top card, Connect menu, swipeable sections ── */
.li-narrow, .li-menu__toggle, .li-pagertabs[hidden], .li-arrows { display: none; }
@media (max-width: 760px) {
  .li { padding-top: 14px; }
  .li-wrap { gap: 10px; }
  .li-wide { display: none; }
  .li-narrow { display: revert; }

  /* top card: overflow stays visible for the menu, so the cover rounds its own corners */
  .li-top { position: relative; z-index: 6; overflow: visible; }
  .li-top__cover { aspect-ratio: 5 / 1; border-radius: var(--radius-lg) var(--radius-lg) 0 0; overflow: hidden; }
  .li-top:not(.li-top--compact) .li-top__main { padding-bottom: 16px; }
  .li-top:not(.li-top--compact) .li-top__photo { width: 96px; margin-top: -48px; }
  .li-top__orgs { display: none; }
  .li-top__id { gap: 4px; padding-top: 2px; }
  .li-top__loc { font-size: .84rem; }

  .li-roles__line { display: flex; align-items: center; gap: 4px; min-height: 32px; font-size: 1.02rem; font-weight: 600; color: var(--link); }
  .li-roles__now[hidden], .li-roles__pause[hidden] { display: none; }
  .li-roles__pause { position: relative; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-muted); cursor: pointer; }
  .li-roles__pause::after { content: ''; position: absolute; inset: -8px; } /* 44px tap target */
  .li .li-roles__pause svg { width: 14px; height: 14px; }
  .li-roles__school { font-size: .95rem; }

  /* Connect menu: the button sits beside the photo, the list drops below it */
  .li-menu.is-ready { position: absolute; z-index: 2; top: calc((100vw - 2 * var(--gutter)) / 5 + 10px); right: 16px; }
  .is-ready .li-menu__toggle { display: inline-flex; min-height: 44px; padding: .5em 1.1em; }
  .li-menu__toggle svg { transition: transform .3s var(--ease-out); }
  .is-open .li-menu__toggle svg { transform: rotate(180deg); }
  .is-ready .li-top__actions { position: absolute; top: calc(100% + 8px); right: 0; display: grid; gap: 2px; width: 230px; padding: 6px; border-radius: var(--radius-lg); border: 1px solid var(--glass-border); background: color-mix(in srgb, var(--bg) 96%, transparent); box-shadow: var(--shadow-glass);
    visibility: hidden; opacity: 0; transform: translateY(-6px) scale(.97); transform-origin: 100% 0; transition: opacity .2s ease, transform .3s var(--ease-out), visibility .2s; }
  .is-ready.is-open .li-top__actions { visibility: visible; opacity: 1; transform: none; }
  .is-ready .li-top__actions .btn { justify-content: flex-start; min-height: 48px; border: 0; border-radius: 14px; background: none; color: var(--text); box-shadow: none; }
  .is-ready .li-top__actions .btn:is(:hover, :focus-visible) { background: var(--glass-bg-hover); }
  .is-ready .li-top__actions .li-narrow { display: inline-grid; }

  /* sections: a deck in one grid cell, as tall as the front card. It runs to the screen edges, so a card leaves past
     the edge and the two behind show on the right (PEEK in linkedin.js). */
  .is-pager .li-subnav:not(.li-pagertabs) { display: none; }
  .is-pager .li-subnav a { min-height: 40px; display: inline-flex; align-items: center; }
  .is-pager .li-grid { gap: 0; }
  /* isolate: the cards' z-index (linkedin.js) stays inside the deck, so they scroll under the sticky tabs */
  .is-pager .li-main { isolation: isolate; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); height: var(--h, auto); overflow: hidden; overflow: clip; align-items: start; touch-action: pan-y; transition: height .3s var(--ease-out); }
  .is-pager .li-main > * { grid-area: 1 / 1; position: relative; top: 0; width: calc(100% - 12px); min-width: 0; transform-origin: 100% min(50%, 260px); transition: translate .42s var(--ease-out), scale .42s var(--ease-out), opacity .3s ease !important; }
  .is-pager .li-main > * > * { opacity: var(--seen, 1); transition: opacity .3s ease; }
  .is-pager .li-main > :not(.is-current) { top: var(--past, 0); height: var(--h); overflow: hidden; align-content: start; }
  .is-pager .is-dragging, .is-pager .is-dragging > *, .is-pager .is-dragging > * > * { transition: none !important; user-select: none; -webkit-user-select: none; }
  /* arrows for a mouse or trackpad; touch screens swipe. They straddle the cards' edges, clear of the text, and stick
     at the same height below the tabs on every card, so you can keep clicking without moving the mouse. */
  @media (hover: hover) and (pointer: fine) {
    .is-pager .li-main { grid-area: 1 / 1; }
    .is-pager .li-arrows:not([hidden]) { grid-area: 1 / 1; align-self: stretch; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; margin-inline: -14px; padding-top: 170px; pointer-events: none; }
    .li-arrow { position: sticky; top: calc(var(--nav-h) + 72px + 170px); display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 1px solid var(--field-border); background: color-mix(in srgb, var(--bg) 92%, transparent); color: var(--text); box-shadow: var(--shadow-glass); cursor: pointer; pointer-events: auto; transition: background .2s ease, scale .2s ease, opacity .2s ease; }
    .li-arrow:hover { background: var(--bg); scale: 1.08; }
    .li-arrow:disabled { opacity: 0; visibility: hidden; }
  }
  /* "More" is one card here, like the rest */
  .is-pager .li-aside { gap: 4px; padding-block: 8px 16px; border: 1px solid var(--glass-border); border-radius: var(--radius-lg); background: var(--glass-bg); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%); backdrop-filter: blur(var(--glass-blur)) saturate(160%); }
  .is-pager .li-aside .li-card { background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .is-pager #languages { display: none; } /* the More page lists the language */
  .is-pager .li-post-strip { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; } /* no sideways scroller inside a sideways scroller */
}
