:root {
  color-scheme: light;
  --paper: #f6f5f1; --surface: #fff; --ink: #172a40; --muted: #526276;
  --blue: #245daf; --line: #dce2e8; --tint: #eaf0fa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--paper); font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
body:has(dialog[open]) { overflow: hidden; }
a { color: var(--blue); text-underline-offset: .22em; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p, figure { margin: 0; }
p, li { line-height: 1.65; }
main, .site-footer { width: min(1440px, calc(100% - 96px)); margin-inline: auto; }
.projects-trigger { display: none; }
.intro { grid-column: 1; max-width: 980px; padding: 54px 0 42px; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; }
h1 { margin: 0 0 20px; font-size: clamp(36px, 4.1vw, 58px); line-height: 1.12; letter-spacing: -.045em; font-weight: 650; }
.tagline-phrase { white-space: nowrap; }
.tagline-highlight { color: var(--blue); }
.intro-copy { max-width: 680px; color: var(--muted); font-size: 18px; }
.text-link { font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.text-link span { margin-left: 8px; }
.portfolio-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; column-gap: 48px; }
.project-list { grid-column: 1; min-width: 0; }
.project-index { grid-column: 2; grid-row: 1 / span 2; padding-top: 32px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.load-state { padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: white; margin-bottom: 24px; }
.load-state button { margin-top: 14px; padding: 9px 16px; border: 1px solid var(--line); background: var(--tint); border-radius: 6px; color: var(--blue); }
project-card { display: block; margin-bottom: 32px; }
.project-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: clip; box-shadow: 0 4px 18px #172a4004; scroll-margin-top: 24px; }
.card-header { padding: 30px 32px 24px; }
.card-top { display: flex; justify-content: space-between; align-items: start; gap: 24px; flex-wrap: wrap; }
.card-identity { min-width: 0; flex: 1 1 210px; }
.project-title { font-size: clamp(23px, 2.2vw, 30px); line-height: 1.2; letter-spacing: -.025em; overflow-wrap: anywhere; scroll-margin-top: 24px; }
.lens-tabs { display: inline-flex; padding: 4px; gap: 2px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.lens-tab { background: transparent; border: 0; color: var(--muted); font-size: 12px; font-weight: 600; padding: 10px 13px; border-radius: 5px; min-height: 40px; }
.lens-tab[aria-selected="true"] { background: var(--blue); color: white; box-shadow: 0 2px 5px #172a4010; }
.lens-tab:hover:not([aria-selected="true"]) { background: var(--tint); color: var(--blue); }
.project-summary { color: var(--muted); font-size: 16px; margin-top: 16px; max-width: 70ch; }
.project-links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 18px; }
.project-links a { font-size: 13px; font-weight: 600; }
.related-projects { margin-top: 16px; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.related-label { color: var(--muted); }
.related-projects a { padding-block: 7px; }
.screenshot-carousel { position: relative; margin: 0 32px 28px; }
.screenshot-carousel::before, .screenshot-carousel::after { content: ""; position: absolute; top: 0; bottom: 0; width: 0; z-index: 1; pointer-events: none; opacity: 0; }
.screenshot-carousel::before { left: 0; box-shadow: 6px 0 9px 3px #172a4066; clip-path: inset(0 -18px 0 0); }
.screenshot-carousel::after { right: 0; box-shadow: -6px 0 9px 3px #172a4066; clip-path: inset(0 0 0 -18px); }
.screenshot-carousel.has-more-left::before, .screenshot-carousel.has-more-right::after { opacity: 1; }
.screenshot-gallery { display: grid; grid-auto-flow: column; grid-auto-columns: min(30vh, calc((100% - 18px) / 2)); gap: 18px; padding-inline: 18px; scroll-padding-inline: 18px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
.screenshot-gallery::-webkit-scrollbar { display: none; }
.screenshot-gallery figure { min-width: 0; scroll-snap-align: start; }
.screenshot-gallery:focus-visible { outline-offset: -3px; }
.screenshot-button:focus-visible { outline-offset: -4px; }
.gallery-controls { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; pointer-events: none; z-index: 2; }
.gallery-arrow { flex-shrink: 0; width: 44px; height: 44px; margin-left: -22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--blue); font-size: 30px; line-height: 1; pointer-events: auto; }
.gallery-arrow:last-child { margin-left: 0; margin-right: -22px; }
.gallery-arrow:hover:enabled { background: var(--tint); }
.screenshot-button { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 9px; aspect-ratio: 1; overflow: hidden; background: #edf1f7; position: relative; }
.screenshot-button img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s ease; }
.screenshot-button:hover img { transform: scale(1.025); }
.image-expand { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 30px; height: 30px; background: white; color: var(--blue); border-radius: 6px; box-shadow: 0 2px 6px #172a4020; }
.image-unavailable { padding: 16px; color: var(--muted); font-size: 13px; }
.narratives { padding: 26px 32px 30px; }
.lens-panel > h4 { color: var(--blue); font-size: 11px; text-transform: uppercase; letter-spacing: .13em; margin-bottom: 20px; }
.narrative-section { max-width: 70ch; margin-top: 20px; }
.narrative-section:first-of-type { margin-top: 0; }
.narrative-section h5 { margin: 0 0 8px; font-size: 16px; font-weight: 650; }
.narrative-section p, .narrative-section li { color: var(--muted); font-size: 14px; }
.narrative-section p + p { margin-top: 10px; }
.narrative-section ul { padding-left: 20px; }
.index-sticky { position: sticky; top: 32px; padding: 23px 0 24px 24px; border-left: 1px solid var(--line); max-height: calc(100dvh - 64px); overflow-y: auto; }
.index-sticky nav { margin-top: 20px; }
.project-nav-list { list-style: none; padding: 0; margin: 0; }
.project-nav-list a { display: block; color: var(--muted); text-decoration: none; padding: 10px; border-radius: 6px; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.project-nav-list a:hover, .project-nav-list a[aria-current="location"] { background: var(--tint); color: var(--blue); }
.project-nav-list .is-child { margin-left: 10px; border-left: 1px solid var(--line); }
.project-nav-list small { display: block; font-size: 10px; margin-top: 4px; }
.site-footer { border-top: 1px solid var(--line); margin-top: 20px; padding: 30px 0 40px; display: flex; justify-content: space-between; gap: 20px; font-size: 13px; }
dialog { color: var(--ink); border: 1px solid var(--line); background: var(--surface); padding: 0; }
dialog::backdrop { background: #15253e99; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); }
.project-drawer { margin: 0 0 0 auto; width: min(408px, 100vw); max-width: none; height: 100dvh; max-height: none; padding: 0; border: 0; background: transparent; overflow: hidden; }
.drawer-panel { margin-left: 48px; height: 100%; overflow-y: auto; background: var(--surface); border-radius: 16px 0 0 16px; padding: 22px; padding-right: max(22px, env(safe-area-inset-right, 0px)); }
.project-drawer .projects-trigger { position: absolute; left: 0; right: auto; }
.projects-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.projects-trigger[aria-expanded="false"] { box-shadow: -3px 3px 14px #172a4026; }
.project-drawer[open] { animation: drawer-open .5s ease-out both; }
.project-drawer.is-closing { animation: drawer-close .25s ease-in both; }
.project-drawer[open]::backdrop { animation: backdrop-open .5s ease-out both; }
.project-drawer.is-closing::backdrop { animation: backdrop-close .25s ease-in both; }
@keyframes drawer-open { from { transform: translateX(calc(100% - 48px)); } to { transform: translateX(0); } }
@keyframes drawer-close { from { transform: translateX(0); } to { transform: translateX(calc(100% - 48px)); } }
@keyframes backdrop-open { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdrop-close { from { opacity: 1; } to { opacity: 0; } }
.drawer-header, .viewer-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.drawer-header h2 { font-size: 20px; line-height: 1.3; }
.project-drawer nav { margin-top: 24px; }
.project-drawer .project-nav-list a { padding: 14px 12px; font-size: 16px; }
.linkedin-contact { display: flex; align-items: center; gap: 12px; margin-top: 24px; padding-block: 12px; min-height: 44px; font-size: 14px; font-weight: 600; text-decoration: none; }
.linkedin-contact:hover span { text-decoration: underline; }
.linkedin-contact img { flex-shrink: 0; object-fit: contain; }
.project-index .linkedin-contact { margin-left: 5px; }
.mobile-contact { display: none; margin: 0; }
.image-viewer { width: calc(100vw - 40px); height: calc(100dvh - 40px); max-width: none; max-height: none; border-radius: 14px; }
.image-viewer[open] { display: flex; flex-direction: column; }
.viewer-header { padding: 15px 20px; flex-shrink: 0; }
.viewer-header h2 { font-size: 17px; overflow-wrap: anywhere; }
.viewer-viewport { flex: 1; min-height: 0; overflow: auto; background: #e9edf3; padding: 14px; touch-action: pan-x pan-y pinch-zoom; }
.viewer-viewport img { display: block; max-width: none; margin: auto; }
@media (min-width: 0px) {
  .narratives:has([role="tablist"]) .lens-tabs { display: flex; width: fit-content; padding: 0; gap: 16px; margin: 0 0 -3px 16px; border: 0; border-radius: 0; background: transparent; position: relative; z-index: 1; }
  .narratives:has([role="tablist"]) .lens-tab { padding: 12px 20px; border: 3px solid var(--line); border-bottom-color: var(--blue); border-radius: 12px 12px 0 0; background: var(--paper); color: var(--muted); font-size: 18px; font-weight: 700; box-shadow: none; }
  .narratives:has([role="tablist"]) .lens-tab[aria-selected="true"] { border-color: var(--blue); border-bottom-color: var(--surface); background: var(--surface); color: var(--blue); }
  .narratives:has([role="tablist"]) .lens-tab:not([aria-selected="true"]) { margin-bottom: 3px; border-bottom: 0; }
  .narratives:has([role="tablist"]) .lens-tab:hover:not([aria-selected="true"]) { background: var(--tint); color: var(--blue); }
  .narratives:has([role="tablist"]) .lens-panel { border: 3px solid var(--blue); border-radius: 16px; padding: 24px; }
  .narratives:has([role="tablist"]) .lens-panel > h4 { display: none; }
}
@media (max-width: 1050px) {
  main, .site-footer { width: calc(100% - 48px); }
  .portfolio-layout { grid-template-columns: minmax(0, 1fr); }
  .project-index { display: none; }
  .intro { padding-top: 76px; }
  .mobile-contact { display: flex; position: absolute; top: max(20px, env(safe-area-inset-top, 0px)); right: max(24px, env(safe-area-inset-right, 0px)); min-height: 0; padding: 0; }
  .projects-trigger { display: grid; place-items: center; position: fixed; z-index: 5; bottom: max(10vh, env(safe-area-inset-bottom, 0px)); right: 0; width: 48px; height: 96px; padding: 0; border: 0; border-radius: 14px 0 0 14px; color: var(--blue); background: var(--surface); box-shadow: none; }
}
@media (max-width: 700px) {
  main, .site-footer { width: calc(100% - 32px); }
  .intro { padding: 76px 0 30px; }
  .mobile-contact { right: max(16px, env(safe-area-inset-right, 0px)); }
  h1 { font-size: clamp(32px, 8vw, 45px); }
  .intro-copy { font-size: 16px; }
  .card-header { padding: 23px 20px 20px; }
  .project-title { font-size: 26px; }
  .narratives:has([role="tablist"]) .lens-tabs { gap: 8px; margin-left: 8px; }
  .narratives:has([role="tablist"]) .lens-tab { font-size: 17px; padding: 12px 10px; }
  .narratives:has([role="tablist"]) .lens-panel { padding: 18px 14px; }
  .project-summary { font-size: 15px; }
  .screenshot-carousel { margin: 0 20px 22px; }
  .screenshot-gallery { grid-auto-columns: calc((100% - 12px) / 2); gap: 12px; }
  .gallery-controls { display: none; }
  .image-expand { width: 25px; height: 25px; right: 6px; bottom: 6px; }
  .narratives { padding: 22px 20px; }

  .site-footer { align-items: start; }
  .image-viewer { width: calc(100vw - 16px); height: calc(100dvh - 16px); }
  .viewer-header { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Additional tabs stay accessible without widening the card. */
.narratives:has([role="tablist"]) .lens-tabs { max-width: calc(100% - 16px); overflow-x: auto; padding-right: 16px; clip-path: inset(0 16px 0 0); }
.narratives:has([role="tablist"]) .lens-tab { flex-shrink: 0; }

/* Scroll cues overlay tabs without intercepting clicks or changing layout. */
.narratives:has([role="tablist"]) .lens-tabs { scrollbar-width: none; --tab-gap: 16px; }
.narratives:has([role="tablist"]) .lens-tabs::-webkit-scrollbar { display: none; }
@supports (animation-timeline: scroll(nearest inline)) {
  .narratives:has([role="tablist"]) .lens-tabs::before,
  .narratives:has([role="tablist"]) .lens-tabs::after {
    content: "";
    position: sticky;
    flex: 0 0 0;
    align-self: stretch;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    animation-duration: auto;
    animation-timing-function: linear;
    animation-fill-mode: both;
    animation-timeline: scroll(nearest inline);
  }
  .narratives:has([role="tablist"]) .lens-tabs::before {
    left: 0;
    box-shadow: 6px 0 9px 3px #172a4066;
    animation-name: tab-shadow-in;
    animation-range: 0px 16px;
    margin-right: calc(-1 * var(--tab-gap));
  }
  .narratives:has([role="tablist"]) .lens-tabs::after {
    right: 0;
    box-shadow: -6px 0 9px 3px #172a4066;
    animation-name: tab-shadow-out;
    animation-range: calc(100% - 16px) 100%;
    margin-left: calc(-1 * var(--tab-gap));
  }
  @keyframes tab-shadow-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes tab-shadow-out { from { opacity: 1; } to { opacity: 0; } }
}

@media (max-width: 700px) {
  .narratives:has([role="tablist"]) .lens-tabs { --tab-gap: 8px; }
}
