@charset "UTF-8";

/* Interpolate the shared palette so all sections fade together. */
@property --paper { syntax: "<color>"; inherits: true; initial-value: #fff; }
@property --ink { syntax: "<color>"; inherits: true; initial-value: #292929; }
@property --muted { syntax: "<color>"; inherits: true; initial-value: #707070; }
@property --line { syntax: "<color>"; inherits: true; initial-value: #e9e9e9; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #444444; }
@property --highlight { syntax: "<color>"; inherits: true; initial-value: #f5f5f5; }
@property --surface { syntax: "<color>"; inherits: true; initial-value: #f2f2f2; }
@property --surface-hover { syntax: "<color>"; inherits: true; initial-value: #e9e9e9; }
@property --control { syntax: "<color>"; inherits: true; initial-value: #ffffffed; }
@property --selection { syntax: "<color>"; inherits: true; initial-value: #dedede; }
@property --nav-underline { syntax: "<color>"; inherits: true; initial-value: #898989; }


:root {
  transition: --paper var(--motion-theme-palette, 460ms) var(--motion-ease-symmetric, ease-in-out), --ink var(--motion-theme-palette, 460ms) var(--motion-ease-symmetric, ease-in-out), --muted var(--motion-theme-palette, 460ms) var(--motion-ease-symmetric, ease-in-out), --line var(--motion-theme-palette, 460ms) var(--motion-ease-symmetric, ease-in-out), --accent var(--motion-theme-palette, 460ms) var(--motion-ease-symmetric, ease-in-out), --highlight var(--motion-theme-palette, 460ms) var(--motion-ease-symmetric, ease-in-out), --surface var(--motion-theme-palette, 460ms) var(--motion-ease-symmetric, ease-in-out), --surface-hover var(--motion-theme-palette, 460ms) var(--motion-ease-symmetric, ease-in-out), --control var(--motion-theme-palette, 460ms) var(--motion-ease-symmetric, ease-in-out), --selection var(--motion-theme-palette, 460ms) var(--motion-ease-symmetric, ease-in-out), --nav-underline var(--motion-theme-palette, 460ms) var(--motion-ease-symmetric, ease-in-out);
  color-scheme: light;
  --paper: #fff;
  --ink: #292929;
  --muted: #707070;
  --line: #e9e9e9;
  --accent: #444444;
  --highlight: #f5f5f5;
  --surface: #f2f2f2;
  --surface-hover: #e9e9e9;
  --control: #ffffffed;
  --selection: #dedede;
  --nav-underline: #898989;
  --ease: var(--motion-ease-standard, cubic-bezier(.22, 1, .36, 1));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #161616;
  --ink: #ebebeb;
  --muted: #a6a6a6;
  --line: #333333;
  --accent: #bdbdbd;
  --highlight: #252525;
  --surface: #232323;
  --surface-hover: #2e2e2e;
  --control: #161616ed;
  --selection: #424242;
  --nav-underline: #929292;
}
.theme-toggle { position: fixed; z-index: 103; top: max(18px, env(safe-area-inset-top)); right: max(20px, env(safe-area-inset-right)); display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; background: var(--paper); }
.theme-toggle:hover { color: var(--ink); background: var(--highlight); }
.theme-toggle[aria-pressed="false"] { color: var(--accent); }
.lightbulb-icon { display: block; width: 20px; height: 20px; transform: translateY(0); transition: transform var(--motion-theme-icon-duration, 260ms) var(--ease); background: currentColor; mask: url('/assets/lightbulb.svg') center / contain no-repeat; -webkit-mask: url('/assets/lightbulb.svg') center / contain no-repeat; }

/* Optical centering includes the rays, with a minimum 9px inset in the lit state. */
.lightbulb-rays { position: absolute; top: 20.5px; left: 50%; width: 0; height: 0; pointer-events: none; }
.lightbulb-rays i { position: absolute; left: -.75px; width: 1.5px; height: 2.5px; border-radius: 2px; background: currentColor; opacity: 0; transform-origin: 50% 0; transform: rotate(calc(var(--ray-factor) * var(--motion-theme-ray-spread, 65deg))) translateY(calc(-1 * var(--motion-theme-ray-start, 8.5px))) scaleY(var(--motion-theme-ray-scale, .3)); transition: opacity var(--motion-theme-ray-fade, 220ms) var(--motion-ease-soft, ease), transform var(--motion-theme-ray-duration, 360ms) var(--motion-ease-rays, cubic-bezier(.2, 1.4, .4, 1)); }
.theme-toggle[data-lit="true"] .lightbulb-rays i { opacity: var(--motion-theme-ray-opacity, .85); transform: rotate(calc(var(--ray-factor) * var(--motion-theme-ray-spread, 65deg))) translateY(calc(-1 * var(--motion-theme-ray-end, 11px))) scaleY(1); transition-delay: calc(var(--ray-index) * var(--motion-theme-ray-stagger, 25ms)); }
.theme-toggle[data-lit="true"] .lightbulb-icon { transform: translateY(var(--motion-theme-icon-y, 2px)); }

* { box-sizing: border-box; }
html { scroll-behavior: auto; scrollbar-gutter: stable; }
body { margin: 0; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 3px; }
p { line-height: 1.7; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 500; }
::selection { background: var(--selection); }

button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
[hidden] { display: none !important; }
.portfolio-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 88px; max-width: 1240px; margin: 0 auto; padding: 88px 64px; align-items: start; transition: grid-template-columns var(--motion-layout, 480ms) var(--ease), column-gap var(--motion-layout, 480ms) var(--ease); }
.identity-shelf { position: sticky; top: 88px; min-width: 0; transition: opacity var(--motion-shelf-opacity, 220ms) var(--motion-ease-soft, ease), transform var(--motion-shelf-transform, 420ms) var(--ease), filter var(--motion-shelf-filter, 300ms) var(--motion-ease-soft, ease), visibility 0s; }
.shelf-inner { width: 220px; }
.identity-link { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 23px; }
.shelf-portrait { display: block; width: 72px; height: 72px; object-fit: cover; object-position: 60% center; border-radius: 50%; }
.identity-name { font-size: 1.25rem; font-weight: 680; line-height: 1.3; letter-spacing: -.035em; white-space: nowrap; }
.identity-role { width: fit-content; max-width: 220px; margin: 6px 0 0; color: var(--muted); font-size: .8125rem; line-height: 1.6; }
.inline-link { text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color var(--motion-link-color, 200ms) var(--motion-ease-soft, ease), text-decoration-color var(--motion-link-decoration, 200ms) var(--motion-ease-soft, ease); }
.social-links { display: flex; flex-wrap: wrap; align-items: center; gap: 15px; margin-top: 13px; color: var(--muted); font-size: .8125rem; line-height: 1.6; }
.social-links a { padding: 3px 0; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: color var(--motion-social-color, 180ms) var(--motion-ease-soft, ease), text-decoration-color var(--motion-social-decoration, 200ms) var(--motion-ease-soft, ease); }
.social-links span { display: inline-block; transition: transform var(--motion-social-arrow, 300ms) var(--ease); }
.shelf-nav { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 46px; }
.shelf-nav :is(a, summary) { position: relative; display: block; padding: 10px 0; font-size: .9375rem; line-height: 1.4; color: var(--muted); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 7px; text-decoration-thickness: 1px; transition: color var(--motion-nav-color, 220ms) var(--motion-ease-soft, ease), text-decoration-color var(--motion-nav-decoration, 220ms) var(--motion-ease-soft, ease), transform var(--motion-nav-hover, 350ms) var(--ease); }
.shelf-nav :is(a, summary)::before { content: ''; position: absolute; z-index: -1; inset: 1px -12px; border-radius: 8px; background: var(--highlight); opacity: 0; transform: scale(var(--motion-nav-highlight-scale, .96)); transition: opacity var(--motion-nav-highlight-fade, 200ms) var(--motion-ease-soft, ease), transform var(--motion-nav-highlight-motion, 350ms) var(--ease); }
.shelf-nav :is(a, summary)[data-selected="true"] { color: var(--ink); }
.shelf-nav :is(a, summary) { text-decoration: none; font-weight: 400; }
.nav-word { position: relative; display: inline-flex; white-space: nowrap; }
.nav-letter { display: inline-grid; }
.nav-letter > span { grid-area: 1 / 1; transition: opacity var(--motion-nav-letter-fade, 220ms) var(--motion-ease-soft, ease); }
.letter-regular { font-weight: 400; opacity: 1; }
.letter-bold { font-weight: 650; opacity: 0; }
[data-selected="true"] .letter-regular { opacity: 0; }
[data-selected="true"] .letter-bold { opacity: 1; }
[data-selected="true"] .nav-letter > span { transition-delay: calc(var(--letter-index) * var(--motion-nav-stagger, 24ms)); }
.nav-word::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: var(--nav-underline); transform: scaleX(0); transform-origin: left; transition: transform var(--motion-nav-underline, 480ms) var(--motion-ease-underline, cubic-bezier(.25, 1.35, .45, 1)); }
[data-selected="true"] .nav-word::after { transform: scaleX(1); }
[data-selection-motion="true"] .nav-letter { animation: letter-select var(--motion-nav-letter-duration, 420ms) var(--motion-ease-soft, ease) both; animation-delay: calc(var(--letter-index) * var(--motion-nav-stagger, 24ms)); }
@keyframes letter-select {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-1.5px); }
  70% { transform: translateY(.5px); }
}
.content-column { min-width: 0; position: relative; padding-top: 12px; }
.view-stage { position: relative; }
.view { display: none; min-width: 0; }
html[data-section="home"] [data-view="home"], html[data-section="experience"] [data-view="experience"], html[data-section="projects"] [data-view="projects"], html[data-section="photo"] [data-view="photo"], html[data-section="music"] [data-view="music"] { display: block; }
.view-stage:focus, .view h1:focus { outline: none; }
.home-main, .page-main { padding: 0 0 48px; }
.home-main { min-height: 480px; }
.page-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 42px; }
.page-title { font-size: 2rem; font-weight: 500; letter-spacing: -.04em; line-height: 1.2; margin: 0; }
.about-copy { max-width: 510px; }
.about-copy p { font-size: 1.0625rem; line-height: 1.85; color: var(--ink); margin-bottom: 24px; }
.about-copy .about-lead { color: var(--ink); font-size: 1.375rem; line-height: 1.65; letter-spacing: -.02em; }
.about-copy .about-location { font-size: .875rem; margin: 38px 0 0; }
.meta, .text-link { font-size: .875rem; color: var(--muted); }
.text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 5px; transition: color var(--motion-link-color, 200ms) var(--motion-ease-soft, ease), text-decoration-color var(--motion-link-decoration, 200ms) var(--motion-ease-soft, ease); }
.text-link span { display: inline-block; transition: transform var(--motion-link-arrow, 300ms) var(--ease); }
.experience-block { display: grid; grid-template-columns: 144px 1fr; gap: 48px; padding: 40px 0; border-top: 1px solid var(--line); }
.section-label { font-size: .8125rem; color: var(--muted); line-height: 1.65; margin-bottom: 0; }
.experience-block h2:not(.section-label) { font-size: 1.375rem; letter-spacing: -.025em; margin-bottom: 8px; }
.meta { line-height: 1.6; }
.roles { list-style: none; padding: 0; margin: 24px 0; }
.roles li { display: block; padding: 3px 0; margin-bottom: 8px; font-size: .9375rem; line-height: 1.6; }
.roles .meta { display: block; font-size: .8125rem; }
.teams-label { margin: 0 0 10px; font-size: .875rem; color: var(--muted); }
.teams-list { list-style: none; padding: 0; margin: 0; }
.teams-list > li { font-size: .9375rem; line-height: 1.6; }
.teams-list > li + li { margin-top: 6px; }
.team-details summary { display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; min-height: 32px; padding: 4px 0; list-style: none; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: text-decoration-color 120ms var(--ease); }
.team-details summary::-webkit-details-marker { display: none; }
.team-details summary:hover { text-decoration-color: var(--line); }
.team-chevron { flex: none; width: 6px; height: 6px; margin: -3px 3px 0 0; border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: rotate(45deg); transition: transform var(--motion-team-in, 260ms) var(--ease); }
.team-details[open] .team-chevron { transform: translateY(3px) rotate(225deg); }
.team-details:has(summary[aria-expanded="false"]) .team-chevron { transform: rotate(45deg); }
.team-content { overflow: hidden; }
.team-projects { list-style: none; padding: 3px 0 10px; margin: 0; color: var(--muted); font-size: .8125rem; line-height: 1.8; }
.team-projects > li { display: inline; }
.team-project-dot { white-space: pre; }
.education-entry + .education-entry { margin-top: 28px; }
.education-entry h3 { font-size: 1.0625rem; line-height: 1.5; letter-spacing: -.015em; margin-bottom: 6px; }
.education-entry p { font-size: .9375rem; margin-bottom: 6px; }
.education-entry .meta { font-size: .8125rem; }
.skills-list { margin: 0 0 10px; font-size: 1rem; line-height: 1.8; }

.project { border-top: 1px solid var(--line); padding-top: 30px; }
.project-top { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 32px; }
.project-identity { display: flex; gap: 16px; align-items: center; }
.app-icon { width: 48px; height: 48px; border-radius: 12px; }
.project h2 { font-size: 1.25rem; letter-spacing: -.02em; margin: 0 0 5px; }
.project .meta { margin: 0; font-size: .8125rem; }
.project-links { display: flex; gap: 24px; }
.project-visual { display: flex; justify-content: center; align-items: center; gap: 56px; padding: 40px; height: 480px; background: var(--surface); border-radius: 16px; overflow: hidden; transition: background var(--motion-project-background, 400ms) var(--motion-ease-soft, ease); }
.project-visual img { display: block; width: auto; max-width: 44%; height: 100%; object-fit: contain; transition: transform var(--motion-project-image, 600ms) var(--ease); }
.project-visual .comparison-phone { height: 94%; border-radius: 26px; box-shadow: 0 8px 22px #29292912; }
.project-visual:focus-visible { outline-offset: 8px; }
.project-copy { padding-top: 26px; max-width: 570px; }
.project-copy p { font-size: 1rem; color: var(--muted); margin: 0; }

/* Keep longer experience entries comfortable at both shelf widths. */
.experience-block { grid-template-columns: 108px minmax(0, 1fr); gap: 32px; padding: 32px 0; }
.project-top { flex-wrap: wrap; gap: 18px; }
.project-visual { height: 430px; gap: 32px; padding: 30px 20px; }
.project-visual .comparison-phone { border-radius: 23px; }
.project h2 a { transition: color var(--motion-project-color, 200ms) var(--motion-ease-soft, ease); }
.skip-link { position: absolute; top: 12px; left: 12px; transform: translateY(-200%); padding: 12px; background: var(--ink); color: var(--paper); z-index: 5; }
.skip-link:focus { transform: translateY(0); }
/* Small fallback shell used only by the 404 page. */
.shell { max-width: 1040px; margin: auto; padding: 0 48px; }
.site-header { display: flex; align-items: center; min-height: 120px; }
.wordmark { font-weight: 650; letter-spacing: -.09em; }
.site-footer { display: flex; justify-content: space-between; gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.site-footer div { display: flex; gap: 24px; }

@media (hover: hover) and (pointer: fine) {
  .inline-link:hover { color: var(--ink); text-decoration-color: var(--nav-underline); }
  .social-links a:hover { color: var(--ink); text-decoration-color: var(--nav-underline); }
  .social-links a:hover span { transform: translate(var(--motion-social-x, 2px), var(--motion-social-y, -2px)); }
  /* Keyboard selection uses its outline and cursor; fills belong to hover. */
  .shelf-nav :is(a, summary):hover:not([data-keyboard-selected]) { color: var(--ink); transform: translateX(var(--motion-nav-hover-distance, 3px)); }
  .shelf-nav :is(a, summary):hover:not([data-keyboard-selected])::before { opacity: 1; transform: scale(1); }
  .text-link:hover { color: var(--ink); text-decoration-color: var(--nav-underline); }
  .text-link:hover span { transform: translate(var(--motion-link-x, 2px), var(--motion-link-y, -2px)); }
  .project-visual:hover { background: var(--surface-hover); }
  .project-visual:hover .framed-phone { transform: translateY(var(--motion-phone-y, -4px)) rotate(var(--motion-phone-angle, -.5deg)); }
  .project-visual:hover .comparison-phone { transform: translateY(var(--motion-comparison-y, 3px)) rotate(var(--motion-comparison-angle, .5deg)); }
}
@media (min-width: 801px) and (max-width: 1100px) {
  .portfolio-layout { column-gap: 56px; padding-inline: 40px; }
  .experience-block { grid-template-columns: 1fr; gap: 16px; }
  .project-visual { height: 360px; gap: 22px; padding-inline: 16px; }
}
@media (max-width: 800px) {
  .portfolio-layout { display: block; max-width: 760px; padding: 48px 36px; }
  .identity-shelf { position: static; }
  .shelf-inner { width: auto; }
  .identity-link { gap: 18px; }
  .shelf-portrait { width: 64px; height: 64px; }
  .identity-name { font-size: 1.375rem; }
  .social-links { font-size: .875rem; gap: 20px; margin-top: 10px; }
  .shelf-nav { flex-direction: row; gap: 28px; margin-top: 28px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
  .shelf-nav :is(a, summary) { font-size: .9375rem; }
  .content-column { padding-top: 38px; }
  .home-main { min-height: 0; padding-bottom: 64px; }
  .page-heading { margin-bottom: 32px; }
  .page-title { font-size: 1.75rem; }
  .about-copy .about-lead { font-size: 1.25rem; }
  .about-copy p { font-size: 1rem; }
}
@media (max-width: 600px) {
  .portfolio-layout { padding: 38px 28px 24px; }
  .shelf-nav { gap: 26px; }
  .shelf-nav :is(a, summary)::before { inset-inline: -8px; }
  .page-main { padding-bottom: 32px; }
  .experience-block { grid-template-columns: 1fr; gap: 16px; padding: 28px 0; }
  .roles { margin: 20px 0; }
  .project-top { flex-direction: column; align-items: flex-start; gap: 18px; margin-bottom: 24px; }
  .project-links { gap: 22px; }
  .project-visual { height: 340px; padding: 24px 12px; gap: 18px; border-radius: 12px; }
  .project-visual .comparison-phone { border-radius: 18px; }
  .project-copy { padding-top: 24px; }
}
/* Portfolio uses the same shelf, typography, and theme as every section. */
.nav-stack { position: relative; isolation: isolate; }
.portfolio-menu { min-width: 0; }
.portfolio-menu:not([open]) .portfolio-nav { display: none; }
.shelf-nav .portfolio-entry { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.portfolio-menu[open] > .portfolio-entry:not([aria-expanded="false"]) { color: var(--ink); }
.portfolio-entry::-webkit-details-marker { display: none; }
/* Center the visible strokes beside the label; rotation shifts the down glyph's center. */
.nav-chevron { display: block; flex: 0 0 6px; width: 6px; height: 6px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform-origin: center; transform: translateY(var(--motion-menu-chevron-closed-y, 0px)) rotate(var(--motion-menu-chevron-collapsed-angle, -45deg)); transition: transform var(--motion-menu-chevron-duration, 240ms) var(--ease); }
.portfolio-menu[open] .nav-chevron { transform: translateY(var(--motion-menu-chevron-open-y, -2px)) rotate(var(--motion-menu-chevron-expanded-angle, 45deg)); }
.portfolio-menu:has([aria-expanded="false"]) .nav-chevron { transform: translateY(var(--motion-menu-chevron-closed-y, 0px)) rotate(var(--motion-menu-chevron-collapsed-angle, -45deg)); }

.portfolio-nav { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; overflow: hidden; margin: 2px -12px 0 0; padding: 0 12px 6px 16px; }
.portfolio-nav a { padding-block: 9px; font-size: .875rem; }
.portfolio-nav .letter-bold { font-weight: 550; }
.portfolio-nav a::before { inset-inline: -9px; }
.photo-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 42px 28px; }
.photo-study { margin: 0; min-width: 0; }
.photo-study:nth-child(2) { width: 82%; justify-self: end; }
.photo-wide { grid-column: 1 / -1; }
.photo-small { width: 80%; max-width: 360px; justify-self: end; align-self: center; }
.photo-small .photo-open img { max-width: 360px; }
.photo-open { display: block; position: relative; background: var(--surface); }
.photo-open img { display: block; width: 100%; height: auto; }
.photo-enlarge { position: absolute; display: flex; gap: 18px; align-items: center; bottom: 14px; right: 14px; border: 1px solid #ffffff33; border-radius: 40px; padding: 7px 12px; color: white; background: #151515a3; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font-size: .875rem; opacity: 0; transform: translateY(var(--motion-enlarge-y, 6px)); transition: opacity var(--motion-enlarge-fade, 220ms) var(--motion-ease-soft, ease), transform var(--motion-enlarge-motion, 300ms) var(--ease); }
.photo-open:hover .photo-enlarge, .photo-open:focus-visible .photo-enlarge { opacity: 1; transform: none; }
.photo-study figcaption { display: flex; justify-content: space-between; gap: 20px; padding-top: 12px; color: var(--muted); font-size: .75rem; }
.photo-study figcaption span:last-child { font-size: .75rem; font-variant-numeric: tabular-nums; }
.photo-lightbox { isolation: isolate; overflow: hidden; touch-action: pan-y pinch-zoom; color: var(--ink); background: transparent; border: 0; max-width: 100vw; max-height: 100dvh; width: 100vw; height: 100dvh; padding: 76px 8vw 44px; margin: 0; }
.photo-lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.photo-lightbox:focus { outline: none; }
.photo-lightbox::backdrop { background: transparent; }
.lightbox-backdrop { position: absolute; z-index: -1; inset: 0; background: var(--paper); }
.photo-lightbox img { position: relative; flex: none; transform-origin: 0 0; max-width: 100%; max-height: calc(100dvh - 174px); width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.photo-lightbox p { font-size: .875rem; color: var(--muted); margin: 18px 0 0; }
.lightbox-close { position: absolute; z-index: 2; right: max(30px, env(safe-area-inset-right)); top: max(20px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 18px; border: 1px solid var(--line); background: var(--control); border-radius: 30px; padding: 10px 18px; font-size: .875rem; }
.lightbox-step { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--control); color: var(--ink); font-size: 1.25rem; }
.lightbox-step:hover, .lightbox-close:hover { background: var(--highlight); }
.lightbox-previous { left: max(18px, env(safe-area-inset-left)); }
.lightbox-next { right: max(18px, env(safe-area-inset-right)); }
.lightbox-close span { font-size: 1.375rem; }
body:has(.photo-lightbox[open]) { overflow: hidden; }
@media (max-width: 800px) {
  /* Keep edge effects inside the scrollport without shifting the menu labels. */
  .shelf-nav { gap: 26px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; margin-inline: -14px; padding: 10px 14px 14px; scroll-padding-inline: 14px; scrollbar-width: none; }
  .shelf-nav::-webkit-scrollbar { display: none; }
  .shelf-nav > a, .portfolio-menu { flex: none; }
  .portfolio-menu { position: relative; }
  .portfolio-nav { position: absolute; left: 100%; top: -8px; width: max-content; flex-direction: row; align-items: center; gap: 18px; margin: 0; padding: 8px 14px 8px 28px; border: 0; }
  .portfolio-nav a { flex: none; padding-block: 10px; }
  /* Center the right-facing strokes in a fixed box before rotating the box. */
  .nav-chevron { position: relative; border: 0; transform: translateY(var(--motion-menu-chevron-closed-y, 0px)) rotate(calc(var(--motion-menu-chevron-compact-collapsed-angle, -45deg) + 45deg)); }
  .nav-chevron::after { content: ''; position: absolute; inset: 0; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: translateX(-1.75px) rotate(-45deg); }
  .portfolio-menu[open] .nav-chevron { transform: translateY(var(--motion-menu-chevron-closed-y, 0px)) rotate(calc(var(--motion-menu-chevron-compact-expanded-angle, 135deg) + 45deg)); }
  .portfolio-menu:has([aria-expanded="false"]) .nav-chevron { transform: translateY(var(--motion-menu-chevron-closed-y, 0px)) rotate(calc(var(--motion-menu-chevron-compact-collapsed-angle, -45deg) + 45deg)); }
  .photo-gallery { gap: 30px 18px; }
  .lightbox-step { top: auto; bottom: max(18px, env(safe-area-inset-bottom)); transform: none; }
  .lightbox-previous { left: max(24px, env(safe-area-inset-left)); }
  .lightbox-next { right: max(24px, env(safe-area-inset-right)); }
}
@media (max-width: 520px) {
  .photo-gallery { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .photo-study:nth-child(2) { width: 100%; }
  .photo-small { width: 82%; justify-self: center; }
  .photo-lightbox { padding-inline: 18px; }
}
@media (max-width: 440px) {
  .shelf-nav { gap: 19px; }
  .shelf-nav :is(a, summary) { font-size: .875rem; }
  .photo-enlarge { right: 12px; bottom: 12px; font-size: .75rem; padding: 8px 12px; }
}
@media (hover: none) { .photo-enlarge { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .shelf-nav :is(a, summary), .social-links span, .text-link span, .project-visual img { transform: none !important; }
}
@media print {
  :root[data-theme] { --paper: white; --ink: #292929; --muted: #707070; --line: #e9e9e9; }
  .portfolio-layout { display: block; padding: 0; }
  .content-column, .page-main { padding: 0; }
  .experience-block { break-inside: avoid; }
  body { background: white; padding: 0; }
}

/* Keyboard selection is independent of the current page's navigation underline. */
:root[data-keyboard="true"] [data-keyboard-selected]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
  border-radius: 3px;
  scroll-margin: 24px;
}
:root[data-keyboard="true"] .motion-panel [data-keyboard-selected]:focus { outline-offset: -3px; }
.keyboard-hint {
  position: fixed; bottom: 18px; left: 24px; z-index: 101;
  max-width: calc(100vw - 490px); margin: 0; padding: 6px 9px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--paper); color: var(--muted); font-size: .6875rem;
  line-height: 1.5; pointer-events: none;
}
@media (max-width: 800px) {
  .keyboard-hint { bottom: 78px; left: 16px; max-width: calc(100vw - 32px); }
  body:has(.motion-panel[data-expanded="true"]) .keyboard-hint { display: none; }
}
@media print { .keyboard-hint { display: none; } }

/* The focus cursor, short trail and quiet highlight stay outside clipped menus. */
.selection-frame {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 102;
  display: none; overflow: visible; pointer-events: none; color: var(--accent);
}
.selection-frame path { stroke: currentColor; }
.selection-dot {
  fill: var(--ink); stroke: var(--paper); stroke-width: 2; paint-order: stroke fill;
  filter: drop-shadow(0 0 1px #0005);
}
:root[data-keyboard="true"][data-selection-frame="true"] [data-keyboard-selected]:focus { outline: none; }
@media print { .selection-frame { display: none !important; } }
