/* clickable cards, timeline avatars, proof grid, detail modal */
.card { cursor: pointer; }
.card:focus-visible, .t-item:focus-visible { outline: 3px solid var(--acc); outline-offset: 4px; }
.t-item:hover { transform: translate(-2px,-3px); box-shadow: 8px 9px 0 var(--soft); }
.more { display: block; margin-top: 14px; width: fit-content; font: 900 italic 14px var(--head); color: var(--ink); border-bottom: 3px solid var(--acc); padding-bottom: 1px; }
.more i { display: inline-block; font-style: normal; transition: transform .2s; }
.card:hover .more i, .t-item:hover .more i { transform: translateX(5px); }
.card-body .tags { margin-top: auto; }

.t-av { width: 96px; height: 96px; border: 3px solid var(--ink); border-radius: 16px; overflow: hidden; background: var(--paper-2); display: grid; place-items: center; flex: none; box-shadow: 3px 4px 0 var(--soft); }
.t-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-av.logo { background: #fff; }
.t-av.logo img { object-fit: contain; padding: 10px; }
.t-av.kj { background: repeating-conic-gradient(rgba(255,255,255,.14) 0 6deg, transparent 6deg 14deg), linear-gradient(135deg, var(--ink), #3a36a8); color: #fff; font: 400 40px/1 var(--jp); text-shadow: none; }
.t-main { min-width: 0; }
@media (max-width: 560px) { .t-item { grid-template-columns: 1fr; } .t-av { width: 64px; height: 64px; } }

.proof { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 24px; }
.proof-item { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; background: #fff; border: 3px solid var(--ink); border-radius: var(--r); box-shadow: 5px 6px 0 var(--soft); transition: transform .25s cubic-bezier(.3,1.6,.5,1), box-shadow .25s; }
.proof-item:hover { transform: translate(-2px,-5px) rotate(-1deg); box-shadow: 9px 10px 0 var(--soft); }
.proof-item:focus-visible { outline: 3px solid var(--acc); outline-offset: 4px; }
.proof-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-bottom: 3px solid var(--ink); border-radius: 15px 15px 0 0; background: var(--paper-2); }
.proof-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.proof-item:hover .proof-img img { transform: scale(1.07); }
.proof-cap { display: block; padding: 12px 14px 14px; }
.proof-cap b { display: block; font: 900 italic 16px/1.2 var(--head); }
.proof-cap small { display: block; margin-top: 3px; font-weight: 700; font-size: 12.5px; color: var(--dim); }

/* modal */
body.locked-modal { overflow: hidden; }
.modal { border: 0; padding: 0; background: transparent; width: min(960px, 100% - 24px); max-width: none; max-height: calc(100dvh - 24px); margin: auto; overflow: visible; color: var(--ink); }
.modal::backdrop { background: rgba(29,26,74,.62); backdrop-filter: blur(5px); animation: fade .25s ease; }
.modal[open] .m-card { animation: mpop .42s cubic-bezier(.3,1.5,.5,1); }
@keyframes fade { from { opacity: 0; } }
@keyframes mpop { from { opacity: 0; transform: translateY(26px) scale(.94) rotate(-.8deg); } }
.m-card { position: relative; display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); background: #fff; border: 3.5px solid var(--ink); border-radius: 24px; box-shadow: 9px 10px 0 var(--soft); max-height: calc(100dvh - 24px); overflow: hidden; }
.m-close { position: absolute; top: 12px; right: 12px; z-index: 5; width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--ink); background: #fff; color: var(--ink); font: 900 16px var(--head); cursor: pointer; box-shadow: 3px 3px 0 var(--acc); transition: transform .15s; }
.m-close:hover { transform: rotate(90deg) scale(1.08); }
.m-media { background: var(--paper-2) radial-gradient(rgba(143,141,247,.35) 1.3px, transparent 1.5px) 0 0 / 14px 14px; border-right: 3.5px solid var(--ink); display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.m-fig { margin: 0; display: grid; align-content: start; }
.m-main { width: 100%; max-height: 62dvh; object-fit: contain; background: #0d0b2b; display: block; }
.m-main.logo { background: #fff; padding: 40px; min-height: 260px; }
.m-fig figcaption { padding: 10px 16px; font: 800 13px var(--head); color: var(--dim); border-top: 3px solid var(--ink); background: #fff; }
.m-fig figcaption:empty { display: none; }
.m-hero.kj { flex: 1; min-height: 280px; display: grid; place-items: center; background: repeating-conic-gradient(rgba(255,255,255,.14) 0 6deg, transparent 6deg 14deg), linear-gradient(135deg, var(--ink), #3a36a8); }
.m-hero .kj-char { font-size: clamp(90px, 14vw, 150px); }
.m-thumbs { display: flex; gap: 10px; padding: 12px 14px 14px; background: #fff; border-top: 3px solid var(--ink); flex-wrap: wrap; }
.m-th { all: unset; box-sizing: border-box; width: 72px; height: 54px; border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; cursor: pointer; opacity: .6; transition: opacity .2s, transform .2s, box-shadow .2s; }
.m-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-th:hover { opacity: 1; transform: translateY(-2px); }
.m-th.on { opacity: 1; box-shadow: 3px 3px 0 var(--acc); }
.m-th:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.m-body { padding: 34px 30px 30px; overflow: auto; min-height: 0; }
.m-kicker { font: 800 12.5px var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); padding-right: 44px; }
.m-title { font: 900 italic clamp(26px, 3.4vw, 38px)/1.05 var(--head); letter-spacing: -.02em; margin: 8px 0 8px; }
.m-meta { font-weight: 800; color: var(--acc); font-size: 14px; margin-bottom: 14px; }
.m-about { font-weight: 600; color: #3b3870; margin-bottom: 10px; }
.m-facts { list-style: none; margin: 18px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.m-facts li { background: var(--paper-2); border: 2.5px solid var(--ink); border-radius: 14px; padding: 10px 12px; box-shadow: 3px 3px 0 var(--soft); }
.m-facts b { display: block; font: 900 italic 26px/1 var(--head); color: var(--acc); letter-spacing: -.02em; }
.m-facts span { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 700; line-height: 1.3; color: #3b3870; }
.m-h { font: 900 italic 18px var(--head); margin: 20px 0 8px; }
.m-list { margin: 0; padding-left: 20px; display: grid; gap: 7px; font-weight: 600; font-size: 15px; color: #3b3870; }
.m-list li::marker { color: var(--acc); }
.m-tags { margin-top: 18px; }
.m-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.m-btn { display: inline-block; padding: 10px 18px; border: 3px solid var(--ink); border-radius: 14px; background: var(--pri); color: var(--ink); font: 900 italic 15px var(--head); text-decoration: none; box-shadow: 4px 5px 0 var(--soft); transition: transform .15s, box-shadow .15s; }
.m-btn:hover { transform: translate(-1px,-2px); box-shadow: 6px 7px 0 var(--acc); }
@media (max-width: 760px) {
  .m-card { grid-template-columns: 1fr; overflow: auto; }
  .m-media { border-right: 0; border-bottom: 3.5px solid var(--ink); overflow: visible; }
  .m-main { max-height: 40dvh; }
  .m-hero.kj { min-height: 170px; }
  .m-body { overflow: visible; padding: 24px 20px 26px; }
}
@media (prefers-reduced-motion: reduce) { .modal[open] .m-card, .modal::backdrop { animation: none; } }

.m-th.logo { background: #fff; }
.m-th.logo img { object-fit: contain; padding: 4px; }
.m-partners { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 18px; padding: 12px 14px; border: 2.5px dashed var(--soft); border-radius: 14px; }
.m-partners span { font: 800 12px var(--head); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.m-partners img { height: 34px; width: auto; max-width: 140px; object-fit: contain; display: block; }

/* logo-only project cards */
.card-media.lg { display: grid; place-items: center; background: #fff; }
.card-media.lg img { width: auto; height: 72%; max-width: 70%; object-fit: contain; }
.card:hover .card-media.lg img { transform: scale(1.05); }

/* timeline: line and dots share one centre axis, dot sits on the avatar's centre */
.timeline { --axis: 11px; --dot: 22px; padding-left: 36px; }
.timeline::before { left: calc(var(--axis) - 2px); width: 4px; }
.t-item::before { box-sizing: border-box; left: calc(var(--axis) - 36px - var(--dot) / 2); top: calc(18px + 48px - var(--dot) / 2); width: var(--dot); height: var(--dot); border: 4px solid var(--ink); }
@media (max-width: 560px) { .t-item::before { top: calc(18px + 32px - var(--dot) / 2); } }

/* scrolling fix: each column is capped to the card's inner height and scrolls on its own */
.m-card { grid-template-rows: minmax(0, 1fr); }
.m-media, .m-body { max-height: calc(100dvh - 31px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--pri) transparent; }
@media (max-width: 760px) {
  .m-card { overflow-y: auto; overscroll-behavior: contain; }
  .m-media, .m-body { max-height: none; overflow: visible; }
}

/* ── round avatars ── */
.t-av, .edu-logo { border-radius: 50%; }
.t-av img { border-radius: 50%; }
.t-av.logo img { padding: 14%; box-sizing: border-box; }
.t-av.logo.bleed img { padding: 0; object-fit: cover; }
.t-av.kj { font-size: 36px; }
.edu-logo img { padding: 14%; box-sizing: border-box; }
.m-main.bleed { padding: 0; min-height: 0; }
.m-th.bleed img { padding: 0; object-fit: cover; }
.m-th.logo { border-radius: 50%; }
.m-th.logo img { border-radius: 50%; }

/* ── journey controls on one straight line ── */
.journey-ctrl { align-items: center; align-self: flex-end; gap: 12px 28px; }
.journey-ctrl sakuga-tabs, .journey-ctrl sakuga-toggle { margin: 0; }
.m-th.logo { width: 54px; height: 54px; }

/* ───────── wide role sheet (Work and Leadership) ───────── */
.m-sheet, .m-viewer { display: none; }
.modal.sheet { width: min(1120px, 100% - 24px); }
.modal.sheet .m-card { display: block; overflow: hidden; }
.modal.sheet .m-media, .modal.sheet .m-body { display: none; }
.modal.sheet .m-sheet { display: block; max-height: calc(100dvh - 31px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--pri) transparent; padding: 38px 44px 40px; }

.sh-head { display: flex; align-items: center; gap: 26px; padding-right: 56px; }
.sh-av { flex: none; width: 112px; height: 112px; border-radius: 50%; border: 3.5px solid var(--ink); overflow: hidden; background: #fff; box-shadow: 4px 5px 0 var(--soft); display: grid; place-items: center; }
.sh-av img { width: 100%; height: 100%; object-fit: contain; padding: 14%; box-sizing: border-box; display: block; }
.sh-av.bleed img { padding: 0; object-fit: cover; }
.sh-av.kj { background: repeating-conic-gradient(rgba(255,255,255,.14) 0 6deg, transparent 6deg 14deg), linear-gradient(135deg, var(--ink), #3a36a8); color: #fff; font: 400 46px/1 var(--jp); }
.sh-id { min-width: 0; }
.sh-title { font: 900 italic clamp(28px, 3.6vw, 44px)/1.05 var(--head); letter-spacing: -.02em; }
.sh-org { margin-top: 6px; font: 800 17px/1.3 var(--head); color: #3b3870; }
.sh-when { margin-top: 3px; font: 800 14px var(--head); color: var(--acc); letter-spacing: .03em; }

/* the long line running to the right */
.sh-rule { height: 5px; margin: 26px 0 30px; border-radius: 5px; background: linear-gradient(90deg, var(--acc) 0 132px, var(--ink) 132px); }

.sh-body { display: grid; gap: 4px; }
.sh-text { display: grid; gap: 12px; max-width: 880px; }
.sh-about { font: 600 18px/1.65 "Nunito", system-ui, sans-serif; color: #3b3870; }
.sh-facts { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 24px 0 8px; }
.sh-list { columns: 2; column-gap: 40px; display: block; }
.sh-list li { break-inside: avoid; margin-bottom: 9px; }

/* supporting attachments */
.sh-att { margin-top: 14px; }
.sh-att .m-h small { margin-left: 8px; padding: 1px 10px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--acc); color: #fff; font: 900 12px var(--head); vertical-align: middle; }
.sh-grid { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.sh-card { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: zoom-in; background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 4px 5px 0 var(--soft); transition: transform .22s cubic-bezier(.3,1.6,.5,1), box-shadow .22s; }
.sh-card:hover { transform: translate(-2px,-4px) rotate(-.6deg); box-shadow: 8px 9px 0 var(--soft); }
.sh-card:focus-visible { outline: 3px solid var(--acc); outline-offset: 4px; }
.sh-thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-bottom: 3px solid var(--ink); border-radius: 13px 13px 0 0; background: var(--paper-2); }
.sh-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; transition: transform .4s; }
.sh-card:hover .sh-thumb img { transform: scale(1.05); }
.sh-cap { display: block; padding: 10px 12px 12px; font: 800 13px/1.3 var(--head); color: #3b3870; }
.modal.sheet .m-partners, .modal.sheet .m-tags, .modal.sheet .m-links { margin-top: 22px; }

/* full-size viewer for an attachment (lives inside the dialog) */
.modal.sheet .m-viewer:not([hidden]) { display: grid; position: absolute; inset: 0; z-index: 8; grid-template-columns: 64px 1fr 64px; grid-template-rows: auto 1fr; background: #0d0b2b; animation: fade .2s ease; }
.m-vback { grid-column: 1 / -1; justify-self: start; margin: 14px; padding: 8px 18px; border: 3px solid #fff; border-radius: 999px; background: transparent; color: #fff; font: 900 italic 15px var(--head); cursor: pointer; transition: background .15s, color .15s; }
.m-vback:hover { background: #fff; color: var(--ink); }
.m-vfig { grid-column: 2; grid-row: 2; margin: 0; min-height: 0; display: grid; grid-template-rows: 1fr auto; justify-items: center; gap: 12px; padding-bottom: 18px; }
.m-vfig img { max-width: 100%; max-height: calc(100dvh - 170px); object-fit: contain; border-radius: 10px; background: #fff; align-self: center; }
.m-vfig figcaption { color: #fff; font: 800 14px/1.4 var(--head); text-align: center; max-width: 80ch; }
.m-vnav { grid-row: 2; align-self: center; justify-self: center; width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff; background: transparent; color: #fff; font: 900 26px/1 var(--head); cursor: pointer; transition: background .15s, color .15s; }
.m-vnav:hover { background: #fff; color: var(--ink); }
.m-vnav.prev { grid-column: 1; } .m-vnav.next { grid-column: 3; }

@media (max-width: 760px) {
  .modal.sheet .m-sheet { padding: 28px 20px 30px; }
  .sh-head { flex-direction: column; align-items: flex-start; gap: 16px; padding-right: 0; }
  .sh-av { width: 92px; height: 92px; }
  .sh-list { columns: 1; }
  .sh-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .modal.sheet .m-viewer:not([hidden]) { grid-template-columns: 44px 1fr 44px; }
  .m-vnav { width: 38px; height: 38px; font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .modal.sheet .m-viewer:not([hidden]) { animation: none; } }
.sh-thumb { background: #f6f5ff; }
.sh-thumb img { object-fit: contain; object-position: center; }

/* tag icons */
.tags li { display: inline-flex; align-items: center; gap: 6px; }
.tags .ti { width: 16px; height: 16px; object-fit: contain; flex: none; display: block; }

/* projects share the journey timeline: highlight pill + tag row */
.t-hl { display: inline-block; margin-left: 8px; padding: 1px 11px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--acc); color: #fff; font: 900 italic 12px/1.5 var(--head); letter-spacing: .02em; vertical-align: middle; transform: rotate(-2deg); }
.t-tags { margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.t-tags + .more { margin-top: 14px; }
#projTimeline { margin-top: 4px; }

/* role title: one line, sized by fitTitle() */
.sh-title { white-space: nowrap; overflow: hidden; line-height: 1.15; font-size: 30px; padding-bottom: 2px; }
.sh-id { flex: 1 1 auto; min-width: 0; }

/* fact cards: icon + number, justified reading text */
.sh-facts li { display: flex; flex-direction: column; gap: 8px; }
.sh-facts .fh { display: flex; align-items: center; gap: 10px; }
.sh-facts .fi { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #ffe3f1; border: 2px solid var(--ink); display: grid; place-items: center; }
.sh-facts .fi img { width: 18px; height: 18px; display: block; }
.sh-facts .fh b { font-size: 28px; }
.sh-facts span { margin-top: 0; }
.sh-about, .sh-list li { text-align: justify; text-justify: inter-word; hyphens: auto; }
.sh-text, .sh-about { max-width: none; }
.sh-about, .sh-list li { hyphens: manual; }

/* phones: wrap the role title, 2-column facts, ragged-right reading text */
@media (max-width: 640px) {
  .sh-title { white-space: normal; font-size: 24px !important; line-height: 1.2; }
  .sh-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sh-facts .fh b { font-size: 22px; }
  .sh-about, .sh-list li { text-align: left; }
}
