:root {
  color-scheme: dark;
  --bg: #101010;
  --ink: #ededeb;
  --muted: #a2a39f;
  --gutter: clamp(20px, 5.8vw, 24px);
  --measure: 418px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--ink); color: var(--bg); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip { position: absolute; top: -90px; left: 16px; z-index: 5; padding: 8px; background: var(--ink); color: var(--bg); }
.skip:focus { top: 10px; }

.shell { position: relative; width: min(100%, 568px); height: 100svh; height: 100dvh; margin-inline: auto; padding-inline: var(--gutter); }
.stage { position: absolute; top: clamp(112px, 23svh, 244px); bottom: max(24px, env(safe-area-inset-bottom)); left: max(var(--gutter), env(safe-area-inset-left)); right: max(var(--gutter), env(safe-area-inset-right)); display: flex; flex-direction: column; align-items: flex-start; min-height: 0; }
.identity { flex: 0 0 auto; width: 100%; text-align: left; }
.brand { margin: 0; font-size: 29px; font-weight: 500; letter-spacing: -.055em; line-height: 1.08; }
.brand a { position: relative; display: inline-block; color: var(--ink); }
.brand a::before { content: ""; position: absolute; inset: -10px -7px; }
.statement { max-width: 340px; margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.navigation { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; column-gap: 24px; row-gap: 0; margin-top: 5px; }
.navigation a { position: relative; display: inline-flex; align-items: center; min-height: 48px; color: var(--muted); font-size: 13px; line-height: 1; transition: color 160ms ease; }
.navigation a::after { content: ""; position: absolute; left: 0; bottom: 9px; width: 100%; height: 1px; background: currentColor; opacity: .45; transform: scaleX(.86); transform-origin: left center; transition: opacity 160ms ease, transform 160ms var(--ease); }
.navigation a[aria-current="page"] { color: var(--ink); }
.navigation a[aria-current="page"]::after, .navigation a:focus-visible::after { opacity: 1; transform: scaleX(1); }
.navigation a[data-route="/projects"][aria-current="page"]::after { transform: scaleX(var(--project-progress, .32)); }

.detail { flex: 1 1 auto; width: 100%; min-height: 0; margin-top: clamp(18px, 2.6vh, 26px); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.detail:focus-visible { outline: 1px solid var(--muted); outline-offset: 3px; }
.detail--about { max-height: 360px; }
.detail::-webkit-scrollbar { display: none; }
.detail.has-more { -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 26px), transparent 100%); mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 26px), transparent 100%); }
.about-body { max-width: 390px; color: var(--muted); }
.about-body p { margin: 0 0 16px; font-size: 13.5px; line-height: 1.62; }
.about-body p:first-child { color: var(--ink); font-size: 14.5px; }
.about-body p:last-child { margin-bottom: 0; padding-bottom: 8px; }
.privacy-note { position: sticky; top: 0; z-index: 1; width: min(100%, var(--measure)); margin: 0; padding: 0 4px 14px 0; background: var(--bg); color: var(--muted); font-size: 13px; line-height: 1.55; }
.privacy-note strong { color: var(--ink); font-weight: 500; }
.project-list { display: flex; flex-direction: column; width: min(100%, var(--measure)); padding: 0 4px 12px 0; margin: 0; list-style: none; }
.project-list a { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 92px; padding: 15px 0; border-bottom: 1px solid #262626; }
.project-name { color: var(--ink); font-size: 15px; line-height: 1.3; letter-spacing: -.01em; text-decoration: underline; text-decoration-color: #81827e; text-underline-offset: 4px; transition: transform 180ms var(--ease), text-decoration-color 180ms ease; }
.project-description { max-width: 390px; margin-top: 7px; color: var(--muted); font-size: 13.5px; line-height: 1.5; transition: color 180ms ease; }
.project-list a:focus-visible .project-name, .project-list a:active .project-name { transform: translate3d(2px, 0, 0); text-decoration-color: var(--ink); }
.project-list a:focus-visible .project-description, .project-list a:active .project-description { color: var(--ink); }

@media (hover: hover) {
  .navigation a:hover { color: var(--ink); }
  .navigation a:hover::after { opacity: 1; transform: scaleX(1); }
  .project-list a:hover .project-name { transform: translate3d(3px, 0, 0); text-decoration-color: var(--ink); }
  .project-list a:hover .project-description { color: var(--ink); }
}

@media (max-height: 620px) {
  .stage { top: clamp(64px, 18svh, 112px); bottom: max(14px, env(safe-area-inset-bottom)); }
  .statement { margin-top: 10px; }
  .navigation { margin-top: 0; }
  .detail { margin-top: 14px; }
  .project-list a { min-height: 76px; padding: 10px 0; }
  .privacy-note { padding-bottom: 10px; }
  .about-body p { margin-bottom: 12px; line-height: 1.5; }
}
@media (max-height: 500px) {
  .stage { top: clamp(40px, 12svh, 72px); bottom: max(10px, env(safe-area-inset-bottom)); }
  .brand { font-size: 27px; }
  .statement { margin-top: 8px; font-size: 12.5px; }
  .navigation { margin-top: 0; }
  .navigation a { min-height: 48px; font-size: 12.5px; }
  .detail { margin-top: 6px; }
  .project-list a { min-height: 72px; padding: 8px 0; }
  .about-body p { margin-bottom: 10px; font-size: 12.5px; }
}
@media (max-height: 410px) {
  .stage { top: 8svh; bottom: max(7px, env(safe-area-inset-bottom)); }
}
/* On phones, the document scrolls naturally rather than trapping touch input
   inside an invisible, independently scrolling projects panel. */
@media (max-width: 600px) {
  html, body { height: auto; min-height: 100%; overflow-x: clip; overflow-y: auto; }
  .shell { height: auto; min-height: 100dvh; }
  .stage { position: relative; top: auto; right: auto; bottom: auto; left: auto;
    padding-top: clamp(72px, 18svh, 160px);
    padding-bottom: max(32px, env(safe-area-inset-bottom)); }
  .detail, .detail--about { flex: 0 0 auto; max-height: none; overflow: visible; }
  .detail.has-more { -webkit-mask-image: none; mask-image: none; }
  .privacy-note { position: static; }
  .project-list { padding-bottom: 0; }
  .project-list a { min-height: 84px; }
}
@media (max-width: 240px) {
  html, body { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
  .shell { height: auto; min-height: 100dvh; }
  .stage { position: relative; top: auto; right: auto; bottom: auto; left: auto; padding-top: min(16vh, 64px); padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .detail, .detail--about { flex: 0 0 auto; max-height: none; overflow: visible; }
  .detail.has-more { -webkit-mask-image: none; mask-image: none; }
  .privacy-note { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
