:root {
  color-scheme: dark;
  --text: #f0eee8;
  --muted: #b0b4b1;
  --subtle: #b6b0c0;
  --accent: #d1baf3;
  --line: rgba(218, 201, 242, .13);
  --sprite-size: clamp(26rem, 76vmin, 48rem);
  --hero-field-size: clamp(32rem, 95vmin, 64rem);
  --star-edge-fade: clamp(32px, 4vw, 50px);
  --cloud-mask-size: clamp(30rem, 90vmin, 58rem);
  --orb-size: clamp(30rem, 95vmin, 62rem);
  --page-width: 960px;
  --page-gutter: max(32px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --header-height: calc(84px + env(safe-area-inset-top, 0px));
  --footer-height: calc(64px + env(safe-area-inset-bottom, 0px));
}

html { height: auto; scroll-padding-top: calc(var(--header-height) + 16px); scroll-padding-bottom: calc(var(--footer-height) + 16px); }
body {
  height: auto;
  overflow-x: clip;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  background-attachment: fixed;
}
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
[hidden] { display: none !important; }
::selection { color: #fff; background: #59416f; }
html.particle-dragging, html.particle-dragging * { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
/* Embedded documents must not swallow the release of a background-started drag. */
html.particle-dragging iframe { pointer-events: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 2px; }
.skip-link { position: fixed; left: 16px; top: 16px; padding: 12px 20px; background: #21182c; z-index: 20; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }

.scene { position: fixed; inset: 0; min-height: 0; padding: 0; overflow: hidden; pointer-events: none; }
.scene-shade { position: fixed; inset: 0; z-index: 2; pointer-events: none; background: rgba(4, 7, 9, .16); }
.starfield-viewport {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  /* Keep the edge fade anchored to the viewport while the stars pan inside it. */
  -webkit-mask-image:
    linear-gradient(to right, transparent 12px, #000 var(--star-edge-fade), #000 calc(100% - var(--star-edge-fade)), transparent calc(100% - 12px)),
    linear-gradient(to bottom, transparent 12px, #000 var(--star-edge-fade), #000 calc(100% - var(--star-edge-fade)), transparent calc(100% - 12px));
  mask-image:
    linear-gradient(to right, transparent 12px, #000 var(--star-edge-fade), #000 calc(100% - var(--star-edge-fade)), transparent calc(100% - 12px)),
    linear-gradient(to bottom, transparent 12px, #000 var(--star-edge-fade), #000 calc(100% - var(--star-edge-fade)), transparent calc(100% - 12px));
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
/* Overscan covers the full 36px upward parallax travel without exposing an edge. */
.scene-atmosphere { width: 100%; height: calc(100% + 72px); transform: translate3d(-50%, calc(-50% + var(--stars-scroll-offset, 0px)), 0); }
.scene-stars { width: 100%; height: 100%; opacity: .5; -webkit-mask-image: none; mask-image: none; }
.sprite-window { image-rendering: pixelated; }
.page-shell { position: relative; z-index: 3; width: min(var(--page-width), calc(100% - var(--page-gutter) - var(--page-gutter))); min-height: 100svh; margin-inline: auto; display: flex; flex-direction: column; justify-content: center; padding-block: calc(var(--header-height) + 24px) calc(var(--footer-height) + 28px); transform: translate3d(0, var(--content-scroll-offset, 0px), 0); }
.site-header, .site-footer {
  position: fixed;
  inset-inline: 0;
  z-index: 6;
  width: min(var(--page-width), calc(100% - var(--page-gutter) - var(--page-gutter)));
  margin-inline: auto;
  padding-inline: 3px;
  --fade-gutter: min(24px, var(--page-gutter));
}
/* Only the scrolling content column fades beneath the floating controls. */
.site-header::before, .site-footer::before {
  content: "";
  position: absolute;
  inset-inline: calc(-1 * var(--fade-gutter));
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade-gutter), #000 calc(100% - var(--fade-gutter)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--fade-gutter), #000 calc(100% - var(--fade-gutter)), transparent);
}
.site-header::before { top: 0; height: calc(var(--header-height) + 18px); background: linear-gradient(to bottom, #020202, #020202 calc(var(--header-height) - 20px), rgba(2, 2, 2, .7) var(--header-height), transparent); }
.site-footer::before { bottom: 0; height: calc(var(--footer-height) + 18px); background: linear-gradient(to top, #020202, #020202 calc(var(--footer-height) - 20px), rgba(2, 2, 2, .7) var(--footer-height), transparent); }
.site-header { top: 0; height: var(--header-height); display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: env(safe-area-inset-top, 0px); }
.wordmark { display: inline-flex; align-items: center; font-size: 22px; font-weight: 560; letter-spacing: -.8px; }
.brand-mark { width: 35px; height: 35px; margin-right: 11px; color: var(--accent); }
.wordmark-dot { color: var(--accent); }

.page-content { display: grid; gap: 36px; }
.page-content:focus { outline: none; }
.profile-panel, .music-note { position: relative; background: rgba(12, 15, 16, .75); border: 1px solid rgba(218, 201, 242, .19); border-radius: 5px; box-shadow: 0 24px 100px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .025); }
.profile-panel { display: grid; grid-template-columns: 1.12fr 1fr; }
.about { padding: 42px 45px 42px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(40px, 4.5vw, 52px); font-weight: 400; letter-spacing: -.055em; line-height: 1.04; margin: 0 0 25px; }
.name-dot { color: var(--accent); }
.bio { max-width: 36ch; font-size: 13px; line-height: 1.8; color: var(--muted); }
.bio p { margin: 0 0 14px; }
.bio p:last-child { margin-bottom: 0; }
.profile-links { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 16px; }
.profile-link { display: inline-flex; align-items: center; gap: 15px; min-height: 44px; color: var(--text); font-size: 11px; }
.profile-link span { color: var(--accent); font-size: 17px; transition: transform 180ms ease; }
.profile-link:hover { color: var(--accent); }
.profile-link:hover span { transform: translate(2px, -2px); }
.work { border-left: 1px solid var(--line); margin-block: 42px; padding: 0 35px; display: flex; flex-direction: column; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 15px; }
.section-heading h2 { margin: 0; font-size: 13px; font-weight: 500; letter-spacing: .01em; }
.section-heading > span { color: var(--subtle); font-family: "SFMono-Regular", Consolas, monospace; font-size: 8px; letter-spacing: .12em; }
.project-link { display: flex; align-items: center; gap: 15px; min-height: 84px; border-top: 1px solid var(--line); transition: background 180ms ease; }
.project-link:hover { background: rgba(209, 186, 243, .035); }
.project-icon { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(209, 186, 243, .14); border-radius: 6px; background: rgba(171, 133, 217, .045); }
.project-icon svg { width: 21px; height: 21px; }
.project-icon { color: var(--accent); }
.pixel-icon { shape-rendering: geometricPrecision; }
.project-back .pixel-icon, .project-action .pixel-icon { width: 18px; height: 18px; vertical-align: -.2em; }
.icon-scope { color: var(--accent); }
.icon-extractor { color: var(--accent); }
.icon-gauge { color: var(--accent); }
.icon-knight { color: var(--accent); }
.icon-golf { color: var(--accent); }
.project-copy { display: flex; flex-direction: column; gap: 7px; }
.project-title { font-size: 13px; font-weight: 500; letter-spacing: -.01em; }
.project-description { color: var(--subtle); font-size: 10px; line-height: 1.5; }
.link-arrow { width: 18px; height: 18px; flex: 0 0 auto; margin-left: auto; color: var(--accent); transition: color 180ms ease, transform 180ms ease; }
.project-link:hover .link-arrow { color: var(--accent); transform: translate(2px, -2px); }
.games { margin-top: 26px; }
.work-note { color: var(--subtle); font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 12px; margin: auto 0 0; padding-top: 22px; }

.music-note { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(280px, .88fr); align-items: start; gap: 36px; padding: 32px 45px; }
.music-copy { min-width: 0; }
.music-copy h2 { margin: 0 0 9px; color: var(--text); font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 400; letter-spacing: -.02em; }
.music-copy h3 { margin: 22px 0 8px; color: var(--text); font-size: 11px; font-weight: 500; letter-spacing: .035em; }
.music-copy p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.music-copy p a, .music-tools a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.music-copy p a:hover, .music-tools a:hover { color: var(--text); }
.music-player { min-width: 0; }
.player-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.player-heading h2, .player-heading h3 { margin: 0; color: var(--text); font-size: 13px; font-weight: 500; }
.player-heading > span { color: var(--subtle); font-size: 10px; }
.spotify-player, .soundcloud-player { display: block; width: 100%; border: 0; border-radius: 12px; background: #121212; }
.spotify-player { height: 352px; }
.soundcloud-player { height: 450px; }
.playlist-link, .soundcloud-link { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 12px; min-height: 44px; color: var(--accent); font-size: 11px; }
.music-icon { width: 20px; height: 20px; }
.playlist-link .link-arrow, .soundcloud-link .link-arrow { width: 15px; height: 15px; color: inherit; }
.playlist-link:hover, .soundcloud-link:hover { color: var(--text); }
.playlist-link:hover .link-arrow, .soundcloud-link:hover .link-arrow { transform: translate(2px, -2px); }

.music-tools, .soundcloud-section { grid-column: 1 / -1; min-width: 0; border-top: 1px solid var(--line); padding-top: 28px; }
.soundcloud-section { margin: 0 45px 32px; }
.music-tools h3 { margin: 0 0 10px; color: var(--text); font-size: 13px; font-weight: 500; }
.music-tools p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.tools-intro { max-width: 76ch; }
.tool-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 36px; margin-top: 24px; }
.tool-group { min-width: 0; }
.tool-group h4 { margin: 0 0 8px; color: var(--text); font-size: 11px; font-weight: 500; letter-spacing: .035em; }
.tool-list { list-style: none; margin: 0; padding: 0; }
.tool-list li { padding-block: 16px; border-top: 1px solid var(--line); }
.tool-list li:last-child { padding-bottom: 0; }
.tool-link { display: inline-block; padding-block: 4px; font-size: 13px; font-weight: 500; }
.tool-type { display: block; margin: 2px 0 8px; color: var(--subtle); font-size: 10px; line-height: 1.5; }
.tool-more { margin-top: 18px; border-top: 1px solid var(--line); }
.tool-more > summary { min-height: 44px; padding-block: 14px; color: var(--accent); cursor: pointer; font-size: 12px; line-height: 1.6; }
.tool-more > summary:hover { color: var(--text); }
.tool-more > summary::marker { color: var(--subtle); font-size: 10px; }
.tool-count { margin-left: 8px; color: var(--subtle); font-size: 10px; }
.tool-more .tool-list { padding-bottom: 6px; }

.site-footer { bottom: 0; height: var(--footer-height); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 12px; padding-block: 8px calc(8px + env(safe-area-inset-bottom, 0px)); color: var(--subtle); font-size: 10px; }
.footer-signoff { letter-spacing: .02em; }
.motion-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 3px; border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 400; }
.motion-toggle:hover { color: var(--text); }
.motion-toggle[aria-pressed="true"] { color: var(--pink); font-weight: 700; }
.motion-indicator { width: 5px; height: 5px; border: 1px solid var(--subtle); border-radius: 50%; }
.motion-toggle[aria-pressed="true"] .motion-indicator { border-color: currentColor; background: currentColor; box-shadow: 0 0 8px #ff78bd33; }
#pixel-field { position: fixed; inset: 0; z-index: 5; width: 100%; height: 100%; pointer-events: none; image-rendering: pixelated; }

html[data-motion="paused"] .scene *,
html[data-motion="paused"] .scene *::before,
html[data-motion="paused"] .scene *::after { animation-play-state: paused !important; }
html[data-motion="paused"] * { transition: none !important; }

@media (max-width: 760px) {
  :root {
    --page-width: 540px;
    --page-gutter: max(18px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
    --header-height: calc(72px + env(safe-area-inset-top, 0px));
    --footer-height: calc(88px + env(safe-area-inset-bottom, 0px));
  }
  .page-content { gap: 28px; }
  .profile-panel { grid-template-columns: 1fr; }
  .about { padding: 32px 30px 26px; }
  h1 { font-size: clamp(40px, 8vw, 52px); }
  .bio { max-width: 48ch; font-size: 13px; }
  .work { margin: 0 30px 30px; padding: 28px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .project-link { min-height: 80px; }
  .work-note { margin-top: 4px; }
  .music-note { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 26px 30px; }
  .soundcloud-section { margin: 0 30px 26px; }
  .tool-groups { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (pointer: coarse) {
  :root { --footer-height: calc(64px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 380px) {
  :root { --page-gutter: max(14px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); }
  .about { padding-inline: 23px; }
  .work { margin-inline: 23px; }
  .music-note { padding-inline: 23px; }
  .soundcloud-section { margin-inline: 23px; }
  .project-link { gap: 12px; }
  .project-title { font-size: 12px; }
}

/* Inline destination cues also work with JavaScript disabled. */
.external-link-icon { display: inline-block; width: 1em; height: 1em; vertical-align: -.13em; flex-shrink: 0; }
.link-arrow.external-link-icon { width: 18px; height: 18px; }
/* Text reflow must also work before editing attributes are added, or without JS. */
.page-content { overflow-wrap: anywhere; }

/* Normalize visible artwork, not the transparent square around each frame. */
.hero { --sprite-size: calc(min(74vmin, 720px) / var(--art-extent, .75)); }
@media (max-width: 850px) { .hero { --sprite-size: calc(88vw / var(--art-extent, .75)); } }
