:root {
  --black: #000;
  --blue: #1712ad;
  --blue-lift: #2823b3;
  --graphite: #1c1c1c;
  --white: #fff;
  --muted: #a9a9b8;
  --edge: rgba(255, 255, 255, 0.32);
  --gutter: clamp(24px, 5vw, 64px);
  --label: "Syne", system-ui, sans-serif;
  --body: "Syne", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--black); }
body { margin: 0; background: var(--black); color: var(--white); font-family: var(--body); line-height: 1.7; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--white); outline-offset: 4px; }

/* Wide-tracked labels used for nav and section titles */
.label {
  font-family: var(--label);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  text-decoration: none;
}

/* ---------- Hero ----------
   Full-bleed. Everything is sized from the hero height: --u is one unit of the
   1002-unit-tall design, so type and artwork scale together. */
.hero {
  --h: max(100svh, 600px);
  --u: calc(var(--h) / 1002);
  position: relative; overflow: hidden; background: #000;
  height: calc(var(--u) * var(--hu, 1002));   /* --hu is set by layoutHero() so the page scrolls to the end of the photo */
}
.hero__unit { position: absolute; top: 0; left: 0; width: 0; height: var(--h); pointer-events: none; }
.hero__art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__dots {
  position: absolute; inset: 0 0 auto 0; height: calc(var(--u) * 260); z-index: 1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 0.6px, transparent 0.8px);
  background-size: 6px 6px;
}

.hero__name { margin: 0; font: inherit; }
.hero__name a { text-decoration: none; }
.hero__first, .hero__last {
  position: absolute; z-index: 2; left: calc(var(--u) * 45);
  font-family: var(--label); font-weight: 600; text-transform: uppercase;
  font-size: calc(var(--u) * 35); line-height: 1; letter-spacing: 0.6em;
}
.hero__first { top: calc(var(--u) * 29); }
.hero__last  { top: calc(var(--u) * 209); }

/* Roles use the same typeface as the 9 on the original mock-up */
.hero__roles {
  position: absolute; z-index: 2; left: calc(var(--u) * 42); top: calc(var(--u) * 84); margin: 0; padding: 0; list-style: none;
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif; text-transform: uppercase;
  font-size: max(0.62rem, calc(var(--u) * 12)); line-height: max(1.3em, calc(var(--u) * 17.8));
  letter-spacing: 0.02em;
}
.hero__roles strong { font-weight: 700; }
.hero__roles .spark { margin-left: 0.4em; }

.hero__nav { position: absolute; z-index: 2; left: calc(var(--u) * 32); top: calc(var(--u) * 327); display: flex; flex-direction: column; }
.hero__nav a {
  width: fit-content;
  font-size: max(0.62rem, calc(var(--u) * 12));
  line-height: max(1.6rem, calc(var(--u) * 31));
  transition: opacity 0.2s;
}
.hero__nav a::after { content: " /"; }
.hero__nav a:hover { opacity: 0.55; }

.rim { fill: none; stroke: url(#rim); stroke-width: 1.4; vector-effect: non-scaling-stroke; }

/* ---------- Content sections ---------- */
main { position: relative; z-index: 1; }
.section { padding: clamp(72px, 12vw, 160px) var(--gutter) 0; max-width: 1400px; }
.section__title { margin: 0 0 3rem; }
.section__sub { margin: 4rem 0 1.25rem; color: var(--muted); font-family: var(--body); font-size: 1rem; letter-spacing: 0.04em; font-weight: 400; }
.prose { max-width: 68ch; font-size: 1.05rem; color: #e6e6ee; }
.prose p { margin: 0 0 1.2em; }

.timeline { list-style: none; margin: 3rem 0 0; padding: 0; max-width: 68ch; }
.timeline li { padding: 1.25rem 0; border-top: 1px solid var(--edge); }
.timeline h3 { margin: 0; font-size: 1.1rem; font-weight: 400; }
.timeline .when { color: var(--muted); font-size: 0.9rem; }


.project { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .project { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.project h3 { margin: 0 0 1rem; font-weight: 400; font-size: 1.6rem; }

.link { display: inline-block; margin-top: 0.5rem; text-underline-offset: 5px; }
.buttons { display: flex; flex-wrap: wrap; gap: 14px; }
.button {
  display: inline-block; padding: 1.1rem 1.8rem; border: 1px solid var(--white);
  text-decoration: none; transition: background 0.2s, color 0.2s;
}
.button--solid { background: var(--blue); border-color: var(--blue); }
.button:hover { background: var(--white); border-color: var(--white); color: var(--black); }

.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  padding: 7rem var(--gutter) 3rem; color: var(--muted); font-size: 0.9rem;
}
.footer a { text-underline-offset: 4px; }


@media (max-width: 600px) {
  .label { letter-spacing: 0.4em; }
}

/* ---------- Inner pages ---------- */
.page-head {
  position: relative; background: var(--blue);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 1.7rem; padding: 1.7rem var(--gutter) 2.3rem;
}
.page-head::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 0.6px, transparent 0.8px);
  background-size: 6px 6px;
}
.page-head > * { position: relative; z-index: 1; }
.page-head__name { font-weight: 500; word-spacing: 3.2em; padding-left: 0.55em; }
.page-head__title {
  margin: 0; padding-left: 0.3em;
  font-family: var(--label); font-weight: 500; text-transform: uppercase;
  font-size: clamp(1.5rem, 4.6vw, 3rem); letter-spacing: 0.3em; line-height: 1.15;
}
.page-head__nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.8rem 1.4rem; padding-left: 0.55em; }
.page-head__nav span { font-family: var(--label); font-size: 0.7rem; letter-spacing: 0; }
.page-head a { transition: opacity 0.2s; }
.page-head a:hover { opacity: 0.6; }

.section--page { padding-top: clamp(40px, 6vw, 88px); }
.project + .project { margin-top: clamp(64px, 9vw, 120px); }

@media (max-width: 600px) {
  .page-head__title { letter-spacing: 0.14em; padding-left: 0.14em; }
  .page-head__name, .page-head__nav { padding-left: 0.4em; }
}

/* ---------- Past works ---------- */
.section--wide { max-width: none; }
.works { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .works { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .works { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 10px; } }
.work-card { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.work-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--graphite); transition: opacity 0.2s; }
.work-card:hover img { opacity: 0.8; }
.work-card__title { display: block; margin-top: 0.8rem; font-size: 0.95rem; }


/* ---------- Work pop-up ---------- */
body.is-locked { overflow: hidden; }
.wm {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.2s ease;
}
.wm[hidden] { display: none; }
.wm.is-open { opacity: 1; }
.wm__panel {
  --side: 340px; position: relative; display: grid; grid-template-columns: auto var(--side);
  max-width: min(1180px, 100%); max-height: calc(100vh - 48px); background: #0e0e0e; border: 1px solid rgba(255, 255, 255, 0.14);
  transform: scale(0.98); transition: transform 0.2s ease;
}
.wm.is-open .wm__panel { transform: none; }
.wm__stage { display: grid; place-items: center; background: #000; min-width: 0; }
.wm__stage img { display: block; width: auto; height: auto; max-height: calc(100vh - 50px); max-width: calc(min(1180px, 100vw - 48px) - var(--side)); }
.wm__side { display: flex; flex-direction: column; gap: 1rem; padding: 3.2rem 1.6rem 1.4rem; min-height: 360px; overflow-y: auto; border-left: 1px solid rgba(255, 255, 255, 0.14); }
.wm__title { margin: 0; font-weight: 600; font-size: 1.25rem; line-height: 1.3; }
.wm__desc { font-size: 0.95rem; color: #d6d6e0; }
.wm__desc p { margin: 0; white-space: pre-line; }
.wm__versions { display: flex; gap: 8px; margin-top: auto; }
.wm__versions button { padding: 0.55rem 0.9rem; background: none; color: var(--muted); border: 1px solid rgba(255, 255, 255, 0.28); font: inherit; font-size: 0.8rem; cursor: pointer; }
.wm__versions button[aria-pressed="true"] { color: var(--white); border-color: var(--white); }
.wm__count { margin: 0; color: var(--muted); font-size: 0.8rem; }
.wm__close { position: absolute; top: 0; right: 0; padding: 1rem 1.2rem; background: none; border: 0; color: var(--white); font-family: var(--label); font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; cursor: pointer; }
.wm__nav { position: fixed; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 50%; color: var(--white); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.wm__nav:hover { background: rgba(255, 255, 255, 0.18); }
.wm__prev { left: 12px; }
.wm__next { right: 12px; }

@media (max-width: 860px) {
  .wm { padding: 0; place-items: stretch; overflow-y: auto; }
  .wm__panel { --side: 100%; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; max-height: none; min-height: 100%; border: 0; }
  .wm__stage { align-self: start; }
  .wm__stage img { max-width: 100vw; max-height: 70vh; }
  .wm__side { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.14); padding-top: 1.4rem; min-height: 0; }
  .wm__close { background: rgba(0, 0, 0, 0.6); }
  .wm__nav { top: auto; bottom: 14px; transform: none; }
  .wm__prev { left: auto; right: 66px; }
  .wm__side { padding-bottom: 5rem; }
}
@media (prefers-reduced-motion: reduce) { .wm, .wm__panel { transition: none; } }

/* ---------- Experience and shared card extras ---------- */
.work-card__sub { display: block; margin-top: 0.1rem; color: var(--muted); font-size: 0.85rem; }
.work-card__ph, .wm__ph {
  display: grid; place-items: center; padding: 1rem; text-align: center; background: var(--blue);
  font-family: var(--label); font-weight: 600; font-size: 1.1rem; letter-spacing: 0.08em; line-height: 1.3;
}
.work-card__ph { aspect-ratio: 1 / 1; transition: opacity 0.2s; }
.work-card:hover .work-card__ph { opacity: 0.8; }
.wm__ph { width: min(560px, 100vw - 48px - var(--side)); min-width: 320px; aspect-ratio: 1 / 1; font-size: 1.5rem; }
.wm__ph[hidden], .wm__stage img[hidden] { display: none; }
.wm__sub { margin: -0.6rem 0 0; color: var(--muted); font-size: 0.9rem; }
.wm__sub[hidden] { display: none; }
.wm__link { display: inline-block; width: fit-content; padding: 0.8rem 1.2rem; border: 1px solid var(--white); text-decoration: none; font-size: 0.9rem; transition: background 0.2s, color 0.2s; }
.wm__link:hover { background: var(--white); color: var(--black); }
.wm__link[hidden] { display: none; }
.experience-intro { margin: 0 auto clamp(32px, 5vw, 56px); text-align: center; }
.centered .work-card { text-align: center; }
@media (max-width: 860px) { .wm__ph { width: 100%; min-width: 0; aspect-ratio: 16 / 9; } }

.wm__versions[hidden], .wm__nav[hidden], .wm__count[hidden] { display: none; }

/* ---------- Page transition ---------- */
.glitch-bar, .glitch-base { position: fixed; z-index: 100; pointer-events: none; }
.glitch-bar { will-change: transform; }
.glitch-base { top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 99; }
html.is-glitch, html.is-glitch body { overflow-x: hidden; }
/* The page eases back as the tiles arrive, then settles forward as the next page is revealed */
html.is-glitch #app { transform-origin: var(--gx, 50%) var(--gy, 50%); }
html.is-glitch-out #app { animation: page-push 0.25s cubic-bezier(0.55, 0, 1, 0.45) both; }
html.is-glitch-in #app { animation: page-settle 0.25s cubic-bezier(0, 0.55, 0.45, 1) both; }
@keyframes page-push { to { transform: scale(1.04); } }
@keyframes page-settle { from { transform: scale(0.96); } }
@media (prefers-reduced-motion: reduce) { .glitch-bar, .glitch-base { display: none; } }

/* ---------- floating music player (Apple-style glass) ---------- */
.player {
  position: fixed; z-index: 60; right: 1.25rem; bottom: 1.25rem;
  display: flex; align-items: center; gap: 1.1rem;
  width: min(21rem, calc(100vw - 2rem)); padding: 0.7rem 0.9rem 0.7rem 1.1rem;
  border-radius: 1.4rem; color: #fff; font-family: var(--label);
  background: rgba(40, 40, 46, 0.42);
  -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.player__info { flex: 1; min-width: 0; line-height: 1.25; }
.player__title, .player__artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__title { font-size: 0.95rem; font-weight: 600; }
.player__artist { font-size: 0.8rem; opacity: 0.65; }
.player__controls { display: flex; align-items: center; gap: 0.15rem; }
.player__btn {
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.player__btn svg { width: 1.35rem; height: 1.35rem; fill: currentColor; }
.player__btn--main svg { width: 1.7rem; height: 1.7rem; }
.player__btn:hover { background: rgba(255, 255, 255, 0.16); }
.player__btn:active { transform: scale(0.9); }
.player__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.player .i-pause { display: none; }
.player.is-playing .i-pause { display: block; }
.player.is-playing .i-play { display: none; }
@media (max-width: 600px) {
  .player { right: 1rem; left: 1rem; bottom: 0.9rem; width: auto; }
}
@media (prefers-reduced-motion: reduce) { .player__btn { transition: none; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .player { background: rgba(30, 30, 36, 0.88); }
}
:root {
  --black: #000;
  --blue: #1712ad;
  --blue-lift: #2823b3;
  --graphite: #1c1c1c;
  --white: #fff;
  --muted: #a9a9b8;
  --edge: rgba(255, 255, 255, 0.32);
  --gutter: clamp(24px, 5vw, 64px);
  --label: "Syne", system-ui, sans-serif;
  --body: "Syne", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--black); }
body { margin: 0; background: var(--black); color: var(--white); font-family: var(--body); line-height: 1.7; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--white); outline-offset: 4px; }

/* Wide-tracked labels used for nav and section titles */
.label {
  font-family: var(--label);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  text-decoration: none;
}

/* ---------- Hero ----------
   Full-bleed. Everything is sized from the hero height: --u is one unit of the
   1002-unit-tall design, so type and artwork scale together. */
.hero {
  --h: max(100svh, 600px);
  --u: calc(var(--h) / 1002);
  position: relative; overflow: hidden; background: #000;
  height: calc(var(--u) * var(--hu, 1002));   /* --hu is set by layoutHero() so the page scrolls to the end of the photo */
}
.hero__unit { position: absolute; top: 0; left: 0; width: 0; height: var(--h); pointer-events: none; }
.hero__art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__dots {
  position: absolute; inset: 0 0 auto 0; height: calc(var(--u) * 260); z-index: 1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 0.6px, transparent 0.8px);
  background-size: 6px 6px;
}

.hero__name { margin: 0; font: inherit; }
.hero__name a { text-decoration: none; }
.hero__first, .hero__last {
  position: absolute; z-index: 2; left: calc(var(--u) * 45);
  font-family: var(--label); font-weight: 600; text-transform: uppercase;
  font-size: calc(var(--u) * 35); line-height: 1; letter-spacing: 0.6em;
}
.hero__first { top: calc(var(--u) * 29); }
.hero__last  { top: calc(var(--u) * 209); }

/* Roles use the same typeface as the 9 on the original mock-up */
.hero__roles {
  position: absolute; z-index: 2; left: calc(var(--u) * 42); top: calc(var(--u) * 84); margin: 0; padding: 0; list-style: none;
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif; text-transform: uppercase;
  font-size: max(0.62rem, calc(var(--u) * 12)); line-height: max(1.3em, calc(var(--u) * 17.8));
  letter-spacing: 0.02em;
}
.hero__roles strong { font-weight: 700; }
.hero__roles .spark { margin-left: 0.4em; }

.hero__nav { position: absolute; z-index: 2; left: calc(var(--u) * 32); top: calc(var(--u) * 327); display: flex; flex-direction: column; }
.hero__nav a {
  width: fit-content;
  font-size: max(0.62rem, calc(var(--u) * 12));
  line-height: max(1.6rem, calc(var(--u) * 31));
  transition: opacity 0.2s;
}
.hero__nav a::after { content: " /"; }
.hero__nav a:hover { opacity: 0.55; }

.rim { fill: none; stroke: url(#rim); stroke-width: 1.4; vector-effect: non-scaling-stroke; }

/* ---------- Content sections ---------- */
main { position: relative; z-index: 1; }
.section { padding: clamp(72px, 12vw, 160px) var(--gutter) 0; max-width: 1400px; }
.section__title { margin: 0 0 3rem; }
.section__sub { margin: 4rem 0 1.25rem; color: var(--muted); font-family: var(--body); font-size: 1rem; letter-spacing: 0.04em; font-weight: 400; }
.prose { max-width: 68ch; font-size: 1.05rem; color: #e6e6ee; }
.prose p { margin: 0 0 1.2em; }

.timeline { list-style: none; margin: 3rem 0 0; padding: 0; max-width: 68ch; }
.timeline li { padding: 1.25rem 0; border-top: 1px solid var(--edge); }
.timeline h3 { margin: 0; font-size: 1.1rem; font-weight: 400; }
.timeline .when { color: var(--muted); font-size: 0.9rem; }


.project { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .project { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.project h3 { margin: 0 0 1rem; font-weight: 400; font-size: 1.6rem; }

.link { display: inline-block; margin-top: 0.5rem; text-underline-offset: 5px; }
.buttons { display: flex; flex-wrap: wrap; gap: 14px; }
.button {
  display: inline-block; padding: 1.1rem 1.8rem; border: 1px solid var(--white);
  text-decoration: none; transition: background 0.2s, color 0.2s;
}
.button--solid { background: var(--blue); border-color: var(--blue); }
.button:hover { background: var(--white); border-color: var(--white); color: var(--black); }

.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  padding: 7rem var(--gutter) 3rem; color: var(--muted); font-size: 0.9rem;
}
.footer a { text-underline-offset: 4px; }


@media (max-width: 600px) {
  .label { letter-spacing: 0.4em; }
}

/* ---------- Inner pages ---------- */
.page-head {
  position: relative; background: var(--blue);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 1.7rem; padding: 1.7rem var(--gutter) 2.3rem;
}
.page-head::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 0.6px, transparent 0.8px);
  background-size: 6px 6px;
}
.page-head > * { position: relative; z-index: 1; }
.page-head__name { font-weight: 500; word-spacing: 3.2em; padding-left: 0.55em; }
.page-head__title {
  margin: 0; padding-left: 0.3em;
  font-family: var(--label); font-weight: 500; text-transform: uppercase;
  font-size: clamp(1.5rem, 4.6vw, 3rem); letter-spacing: 0.3em; line-height: 1.15;
}
.page-head__nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.8rem 1.4rem; padding-left: 0.55em; }
.page-head__nav span { font-family: var(--label); font-size: 0.7rem; letter-spacing: 0; }
.page-head a { transition: opacity 0.2s; }
.page-head a:hover { opacity: 0.6; }

.section--page { padding-top: clamp(40px, 6vw, 88px); }
.project + .project { margin-top: clamp(64px, 9vw, 120px); }

@media (max-width: 600px) {
  .page-head__title { letter-spacing: 0.14em; padding-left: 0.14em; }
  .page-head__name, .page-head__nav { padding-left: 0.4em; }
}

/* ---------- Past works ---------- */
.section--wide { max-width: none; }
.works { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .works { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .works { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 10px; } }
.work-card { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.work-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--graphite); transition: opacity 0.2s; }
.work-card:hover img { opacity: 0.8; }
.work-card__title { display: block; margin-top: 0.8rem; font-size: 0.95rem; }


/* ---------- Work pop-up ---------- */
body.is-locked { overflow: hidden; }
.wm {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.2s ease;
}
.wm[hidden] { display: none; }
.wm.is-open { opacity: 1; }
.wm__panel {
  --side: 340px; position: relative; display: grid; grid-template-columns: auto var(--side);
  max-width: min(1180px, 100%); max-height: calc(100vh - 48px); background: #0e0e0e; border: 1px solid rgba(255, 255, 255, 0.14);
  transform: scale(0.98); transition: transform 0.2s ease;
}
.wm.is-open .wm__panel { transform: none; }
.wm__stage { display: grid; place-items: center; background: #000; min-width: 0; }
.wm__stage img { display: block; width: auto; height: auto; max-height: calc(100vh - 50px); max-width: calc(min(1180px, 100vw - 48px) - var(--side)); }
.wm__side { display: flex; flex-direction: column; gap: 1rem; padding: 3.2rem 1.6rem 1.4rem; min-height: 360px; overflow-y: auto; border-left: 1px solid rgba(255, 255, 255, 0.14); }
.wm__title { margin: 0; font-weight: 600; font-size: 1.25rem; line-height: 1.3; }
.wm__desc { font-size: 0.95rem; color: #d6d6e0; }
.wm__desc p { margin: 0; white-space: pre-line; }
.wm__versions { display: flex; gap: 8px; margin-top: auto; }
.wm__versions button { padding: 0.55rem 0.9rem; background: none; color: var(--muted); border: 1px solid rgba(255, 255, 255, 0.28); font: inherit; font-size: 0.8rem; cursor: pointer; }
.wm__versions button[aria-pressed="true"] { color: var(--white); border-color: var(--white); }
.wm__count { margin: 0; color: var(--muted); font-size: 0.8rem; }
.wm__close { position: absolute; top: 0; right: 0; padding: 1rem 1.2rem; background: none; border: 0; color: var(--white); font-family: var(--label); font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; cursor: pointer; }
.wm__nav { position: fixed; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 50%; color: var(--white); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.wm__nav:hover { background: rgba(255, 255, 255, 0.18); }
.wm__prev { left: 12px; }
.wm__next { right: 12px; }

@media (max-width: 860px) {
  .wm { padding: 0; place-items: stretch; overflow-y: auto; }
  .wm__panel { --side: 100%; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; max-height: none; min-height: 100%; border: 0; }
  .wm__stage { align-self: start; }
  .wm__stage img { max-width: 100vw; max-height: 70vh; }
  .wm__side { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.14); padding-top: 1.4rem; min-height: 0; }
  .wm__close { background: rgba(0, 0, 0, 0.6); }
  .wm__nav { top: auto; bottom: 14px; transform: none; }
  .wm__prev { left: auto; right: 66px; }
  .wm__side { padding-bottom: 5rem; }
}
@media (prefers-reduced-motion: reduce) { .wm, .wm__panel { transition: none; } }

/* ---------- Experience and shared card extras ---------- */
.work-card__sub { display: block; margin-top: 0.1rem; color: var(--muted); font-size: 0.85rem; }
.work-card__ph, .wm__ph {
  display: grid; place-items: center; padding: 1rem; text-align: center; background: var(--blue);
  font-family: var(--label); font-weight: 600; font-size: 1.1rem; letter-spacing: 0.08em; line-height: 1.3;
}
.work-card__ph { aspect-ratio: 1 / 1; transition: opacity 0.2s; }
.work-card:hover .work-card__ph { opacity: 0.8; }
.wm__ph { width: min(560px, 100vw - 48px - var(--side)); min-width: 320px; aspect-ratio: 1 / 1; font-size: 1.5rem; }
.wm__ph[hidden], .wm__stage img[hidden] { display: none; }
.wm__sub { margin: -0.6rem 0 0; color: var(--muted); font-size: 0.9rem; }
.wm__sub[hidden] { display: none; }
.wm__link { display: inline-block; width: fit-content; padding: 0.8rem 1.2rem; border: 1px solid var(--white); text-decoration: none; font-size: 0.9rem; transition: background 0.2s, color 0.2s; }
.wm__link:hover { background: var(--white); color: var(--black); }
.wm__link[hidden] { display: none; }
.experience-intro { margin: 0 auto clamp(32px, 5vw, 56px); text-align: center; }
.centered .work-card { text-align: center; }
@media (max-width: 860px) { .wm__ph { width: 100%; min-width: 0; aspect-ratio: 16 / 9; } }

.wm__versions[hidden], .wm__nav[hidden], .wm__count[hidden] { display: none; }

/* ---------- Page transition ---------- */
.glitch-bar, .glitch-base { position: fixed; z-index: 100; pointer-events: none; }
.glitch-bar { will-change: transform; }
.glitch-base { top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 99; }
html.is-glitch, html.is-glitch body { overflow-x: hidden; }
/* The page eases back as the tiles arrive, then settles forward as the next page is revealed */
html.is-glitch #app { transform-origin: var(--gx, 50%) var(--gy, 50%); }
html.is-glitch-out #app { animation: page-push 0.25s cubic-bezier(0.55, 0, 1, 0.45) both; }
html.is-glitch-in #app { animation: page-settle 0.25s cubic-bezier(0, 0.55, 0.45, 1) both; }
@keyframes page-push { to { transform: scale(1.04); } }
@keyframes page-settle { from { transform: scale(0.96); } }
@media (prefers-reduced-motion: reduce) { .glitch-bar, .glitch-base { display: none; } }

/* ---------- floating music player (Apple-style glass) ---------- */
.player {
  position: fixed; z-index: 60; right: 1.25rem; bottom: 1.25rem;
  display: flex; align-items: center; gap: 1.1rem;
  width: min(21rem, calc(100vw - 2rem)); padding: 0.7rem 0.9rem 0.7rem 1.1rem;
  border-radius: 1.4rem; color: #fff; font-family: var(--label);
  background: rgba(40, 40, 46, 0.42);
  -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.player__info { flex: 1; min-width: 0; line-height: 1.25; }
.player__title, .player__artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__title { font-size: 0.95rem; font-weight: 600; }
.player__artist { font-size: 0.8rem; opacity: 0.65; }
.player__controls { display: flex; align-items: center; gap: 0.15rem; }
.player__btn {
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.player__btn svg { width: 1.35rem; height: 1.35rem; fill: currentColor; }
.player__btn--main svg { width: 1.7rem; height: 1.7rem; }
.player__btn:hover { background: rgba(255, 255, 255, 0.16); }
.player__btn:active { transform: scale(0.9); }
.player__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.player .i-pause { display: none; }
.player.is-playing .i-pause { display: block; }
.player.is-playing .i-play { display: none; }
@media (max-width: 600px) {
  .player { right: 1rem; left: 1rem; bottom: 0.9rem; width: auto; }
}
@media (prefers-reduced-motion: reduce) { .player__btn { transition: none; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .player { background: rgba(30, 30, 36, 0.88); }
}

/* player: progress bar + sliding long text */
.player { flex-wrap: wrap; row-gap: 0.15rem; }
.player__info { overflow: hidden; }
.player__title span, .player__artist span {
  display: inline-block; transition: transform 0.4s ease-out; will-change: transform;
}
.player__title, .player__artist { text-overflow: clip; }
.player__time { flex: 1 0 100%; display: flex; align-items: center; gap: 0.6rem; font-size: 0.7rem; opacity: 0.85; font-variant-numeric: tabular-nums; }
.player__cur, .player__dur { min-width: 2.2em; }
.player__dur { text-align: right; }
.player__seek {
  --pct: 0%; flex: 1; min-width: 0; height: 1.2rem; margin: 0; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.player__seek:disabled { cursor: default; opacity: 0.5; }
.player__seek::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, #fff var(--pct), rgba(255,255,255,0.28) var(--pct));
}
.player__seek::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.28); }
.player__seek::-moz-range-progress { height: 4px; border-radius: 2px; background: #fff; }
.player__seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 0; height: 0; margin-top: 2px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 0 #fff; transition: width 0.15s, height 0.15s, margin 0.15s;
}
.player__seek::-moz-range-thumb { width: 0; height: 0; border: 0; border-radius: 50%; background: #fff; }
.player__seek:hover::-webkit-slider-thumb, .player__seek:focus-visible::-webkit-slider-thumb,
.player__seek:active::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4px; }
.player__seek:hover::-moz-range-thumb, .player__seek:focus-visible::-moz-range-thumb { width: 12px; height: 12px; }
.player__seek:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }
:root {
  --black: #000;
  --blue: #1712ad;
  --blue-lift: #2823b3;
  --graphite: #1c1c1c;
  --white: #fff;
  --muted: #a9a9b8;
  --edge: rgba(255, 255, 255, 0.32);
  --gutter: clamp(24px, 5vw, 64px);
  --label: "Syne", system-ui, sans-serif;
  --body: "Syne", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--black); }
body { margin: 0; background: var(--black); color: var(--white); font-family: var(--body); line-height: 1.7; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--white); outline-offset: 4px; }

/* Wide-tracked labels used for nav and section titles */
.label {
  font-family: var(--label);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  text-decoration: none;
}

/* ---------- Hero ----------
   Full-bleed. Everything is sized from the hero height: --u is one unit of the
   1002-unit-tall design, so type and artwork scale together. */
.hero {
  --h: max(100svh, 600px);
  --u: calc(var(--h) / 1002);
  position: relative; overflow: hidden; background: #000;
  height: calc(var(--u) * var(--hu, 1002));   /* --hu is set by layoutHero() so the page scrolls to the end of the photo */
}
.hero__unit { position: absolute; top: 0; left: 0; width: 0; height: var(--h); pointer-events: none; }
.hero__art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__dots {
  position: absolute; inset: 0 0 auto 0; height: calc(var(--u) * 260); z-index: 1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 0.6px, transparent 0.8px);
  background-size: 6px 6px;
}

.hero__name { margin: 0; font: inherit; }
.hero__name a { text-decoration: none; }
.hero__first, .hero__last {
  position: absolute; z-index: 2; left: calc(var(--u) * 45);
  font-family: var(--label); font-weight: 600; text-transform: uppercase;
  font-size: calc(var(--u) * 35); line-height: 1; letter-spacing: 0.6em;
}
.hero__first { top: calc(var(--u) * 29); }
.hero__last  { top: calc(var(--u) * 209); }

/* Roles use the same typeface as the 9 on the original mock-up */
.hero__roles {
  position: absolute; z-index: 2; left: calc(var(--u) * 42); top: calc(var(--u) * 84); margin: 0; padding: 0; list-style: none;
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif; text-transform: uppercase;
  font-size: max(0.62rem, calc(var(--u) * 12)); line-height: max(1.3em, calc(var(--u) * 17.8));
  letter-spacing: 0.02em;
}
.hero__roles strong { font-weight: 700; }
.hero__roles .spark { margin-left: 0.4em; }

.hero__nav { position: absolute; z-index: 2; left: calc(var(--u) * 32); top: calc(var(--u) * 327); display: flex; flex-direction: column; }
.hero__nav a {
  width: fit-content;
  font-size: max(0.62rem, calc(var(--u) * 12));
  line-height: max(1.6rem, calc(var(--u) * 31));
  transition: opacity 0.2s;
}
.hero__nav a::after { content: " /"; }
.hero__nav a:hover { opacity: 0.55; }

.rim { fill: none; stroke: url(#rim); stroke-width: 1.4; vector-effect: non-scaling-stroke; }

/* ---------- Content sections ---------- */
main { position: relative; z-index: 1; }
.section { padding: clamp(72px, 12vw, 160px) var(--gutter) 0; max-width: 1400px; }
.section__title { margin: 0 0 3rem; }
.section__sub { margin: 4rem 0 1.25rem; color: var(--muted); font-family: var(--body); font-size: 1rem; letter-spacing: 0.04em; font-weight: 400; }
.prose { max-width: 68ch; font-size: 1.05rem; color: #e6e6ee; }
.prose p { margin: 0 0 1.2em; }

.timeline { list-style: none; margin: 3rem 0 0; padding: 0; max-width: 68ch; }
.timeline li { padding: 1.25rem 0; border-top: 1px solid var(--edge); }
.timeline h3 { margin: 0; font-size: 1.1rem; font-weight: 400; }
.timeline .when { color: var(--muted); font-size: 0.9rem; }


.project { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .project { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.project h3 { margin: 0 0 1rem; font-weight: 400; font-size: 1.6rem; }

.link { display: inline-block; margin-top: 0.5rem; text-underline-offset: 5px; }
.buttons { display: flex; flex-wrap: wrap; gap: 14px; }
.button {
  display: inline-block; padding: 1.1rem 1.8rem; border: 1px solid var(--white);
  text-decoration: none; transition: background 0.2s, color 0.2s;
}
.button--solid { background: var(--blue); border-color: var(--blue); }
.button:hover { background: var(--white); border-color: var(--white); color: var(--black); }

.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  padding: 7rem var(--gutter) 3rem; color: var(--muted); font-size: 0.9rem;
}
.footer a { text-underline-offset: 4px; }


@media (max-width: 600px) {
  .label { letter-spacing: 0.4em; }
}

/* ---------- Inner pages ---------- */
.page-head {
  position: relative; background: var(--blue);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 1.7rem; padding: 1.7rem var(--gutter) 2.3rem;
}
.page-head::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 0.6px, transparent 0.8px);
  background-size: 6px 6px;
}
.page-head > * { position: relative; z-index: 1; }
.page-head__name { font-weight: 500; word-spacing: 3.2em; padding-left: 0.55em; }
.page-head__title {
  margin: 0; padding-left: 0.3em;
  font-family: var(--label); font-weight: 500; text-transform: uppercase;
  font-size: clamp(1.5rem, 4.6vw, 3rem); letter-spacing: 0.3em; line-height: 1.15;
}
.page-head__nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.8rem 1.4rem; padding-left: 0.55em; }
.page-head__nav span { font-family: var(--label); font-size: 0.7rem; letter-spacing: 0; }
.page-head a { transition: opacity 0.2s; }
.page-head a:hover { opacity: 0.6; }

.section--page { padding-top: clamp(40px, 6vw, 88px); }
.project + .project { margin-top: clamp(64px, 9vw, 120px); }

@media (max-width: 600px) {
  .page-head__title { letter-spacing: 0.14em; padding-left: 0.14em; }
  .page-head__name, .page-head__nav { padding-left: 0.4em; }
}

/* ---------- Past works ---------- */
.section--wide { max-width: none; }
.works { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .works { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .works { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 10px; } }
.work-card { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.work-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--graphite); transition: opacity 0.2s; }
.work-card:hover img { opacity: 0.8; }
.work-card__title { display: block; margin-top: 0.8rem; font-size: 0.95rem; }


/* ---------- Work pop-up ---------- */
body.is-locked { overflow: hidden; }
.wm {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.2s ease;
}
.wm[hidden] { display: none; }
.wm.is-open { opacity: 1; }
.wm__panel {
  --side: 340px; position: relative; display: grid; grid-template-columns: auto var(--side);
  max-width: min(1180px, 100%); max-height: calc(100vh - 48px); background: #0e0e0e; border: 1px solid rgba(255, 255, 255, 0.14);
  transform: scale(0.98); transition: transform 0.2s ease;
}
.wm.is-open .wm__panel { transform: none; }
.wm__stage { display: grid; place-items: center; background: #000; min-width: 0; }
.wm__stage img { display: block; width: auto; height: auto; max-height: calc(100vh - 50px); max-width: calc(min(1180px, 100vw - 48px) - var(--side)); }
.wm__side { display: flex; flex-direction: column; gap: 1rem; padding: 3.2rem 1.6rem 1.4rem; min-height: 360px; overflow-y: auto; border-left: 1px solid rgba(255, 255, 255, 0.14); }
.wm__title { margin: 0; font-weight: 600; font-size: 1.25rem; line-height: 1.3; }
.wm__desc { font-size: 0.95rem; color: #d6d6e0; }
.wm__desc p { margin: 0; white-space: pre-line; }
.wm__versions { display: flex; gap: 8px; margin-top: auto; }
.wm__versions button { padding: 0.55rem 0.9rem; background: none; color: var(--muted); border: 1px solid rgba(255, 255, 255, 0.28); font: inherit; font-size: 0.8rem; cursor: pointer; }
.wm__versions button[aria-pressed="true"] { color: var(--white); border-color: var(--white); }
.wm__count { margin: 0; color: var(--muted); font-size: 0.8rem; }
.wm__close { position: absolute; top: 0; right: 0; padding: 1rem 1.2rem; background: none; border: 0; color: var(--white); font-family: var(--label); font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; cursor: pointer; }
.wm__nav { position: fixed; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 50%; color: var(--white); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.wm__nav:hover { background: rgba(255, 255, 255, 0.18); }
.wm__prev { left: 12px; }
.wm__next { right: 12px; }

@media (max-width: 860px) {
  .wm { padding: 0; place-items: stretch; overflow-y: auto; }
  .wm__panel { --side: 100%; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; max-height: none; min-height: 100%; border: 0; }
  .wm__stage { align-self: start; }
  .wm__stage img { max-width: 100vw; max-height: 70vh; }
  .wm__side { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.14); padding-top: 1.4rem; min-height: 0; }
  .wm__close { background: rgba(0, 0, 0, 0.6); }
  .wm__nav { top: auto; bottom: 14px; transform: none; }
  .wm__prev { left: auto; right: 66px; }
  .wm__side { padding-bottom: 5rem; }
}
@media (prefers-reduced-motion: reduce) { .wm, .wm__panel { transition: none; } }

/* ---------- Experience and shared card extras ---------- */
.work-card__sub { display: block; margin-top: 0.1rem; color: var(--muted); font-size: 0.85rem; }
.work-card__ph, .wm__ph {
  display: grid; place-items: center; padding: 1rem; text-align: center; background: var(--blue);
  font-family: var(--label); font-weight: 600; font-size: 1.1rem; letter-spacing: 0.08em; line-height: 1.3;
}
.work-card__ph { aspect-ratio: 1 / 1; transition: opacity 0.2s; }
.work-card:hover .work-card__ph { opacity: 0.8; }
.wm__ph { width: min(560px, 100vw - 48px - var(--side)); min-width: 320px; aspect-ratio: 1 / 1; font-size: 1.5rem; }
.wm__ph[hidden], .wm__stage img[hidden] { display: none; }
.wm__sub { margin: -0.6rem 0 0; color: var(--muted); font-size: 0.9rem; }
.wm__sub[hidden] { display: none; }
.wm__link { display: inline-block; width: fit-content; padding: 0.8rem 1.2rem; border: 1px solid var(--white); text-decoration: none; font-size: 0.9rem; transition: background 0.2s, color 0.2s; }
.wm__link:hover { background: var(--white); color: var(--black); }
.wm__link[hidden] { display: none; }
.experience-intro { margin: 0 auto clamp(32px, 5vw, 56px); text-align: center; }
.centered .work-card { text-align: center; }
@media (max-width: 860px) { .wm__ph { width: 100%; min-width: 0; aspect-ratio: 16 / 9; } }

.wm__versions[hidden], .wm__nav[hidden], .wm__count[hidden] { display: none; }

/* ---------- Page transition ---------- */
.glitch-bar, .glitch-base { position: fixed; z-index: 100; pointer-events: none; }
.glitch-bar { will-change: transform; }
.glitch-base { top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 99; }
html.is-glitch, html.is-glitch body { overflow-x: hidden; }
/* The page eases back as the tiles arrive, then settles forward as the next page is revealed */
html.is-glitch #app { transform-origin: var(--gx, 50%) var(--gy, 50%); }
html.is-glitch-out #app { animation: page-push 0.25s cubic-bezier(0.55, 0, 1, 0.45) both; }
html.is-glitch-in #app { animation: page-settle 0.25s cubic-bezier(0, 0.55, 0.45, 1) both; }
@keyframes page-push { to { transform: scale(1.04); } }
@keyframes page-settle { from { transform: scale(0.96); } }
@media (prefers-reduced-motion: reduce) { .glitch-bar, .glitch-base { display: none; } }

/* ---------- floating music player (Apple-style glass) ---------- */
.player {
  position: fixed; z-index: 60; right: 1.25rem; bottom: 1.25rem;
  display: flex; align-items: center; gap: 1.1rem;
  width: min(21rem, calc(100vw - 2rem)); padding: 0.7rem 0.9rem 0.7rem 1.1rem;
  border-radius: 1.4rem; color: #fff; font-family: var(--label);
  background: rgba(40, 40, 46, 0.42);
  -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.player__info { flex: 1; min-width: 0; line-height: 1.25; }
.player__title, .player__artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__title { font-size: 0.95rem; font-weight: 600; }
.player__artist { font-size: 0.8rem; opacity: 0.65; }
.player__controls { display: flex; align-items: center; gap: 0.15rem; }
.player__btn {
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.player__btn svg { width: 1.35rem; height: 1.35rem; fill: currentColor; }
.player__btn--main svg { width: 1.7rem; height: 1.7rem; }
.player__btn:hover { background: rgba(255, 255, 255, 0.16); }
.player__btn:active { transform: scale(0.9); }
.player__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.player .i-pause { display: none; }
.player.is-playing .i-pause { display: block; }
.player.is-playing .i-play { display: none; }
@media (max-width: 600px) {
  .player { right: 1rem; left: 1rem; bottom: 0.9rem; width: auto; }
}
@media (prefers-reduced-motion: reduce) { .player__btn { transition: none; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .player { background: rgba(30, 30, 36, 0.88); }
}
:root {
  --black: #000;
  --blue: #1712ad;
  --blue-lift: #2823b3;
  --graphite: #1c1c1c;
  --white: #fff;
  --muted: #a9a9b8;
  --edge: rgba(255, 255, 255, 0.32);
  --gutter: clamp(24px, 5vw, 64px);
  --label: "Syne", system-ui, sans-serif;
  --body: "Syne", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--black); }
body { margin: 0; background: var(--black); color: var(--white); font-family: var(--body); line-height: 1.7; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--white); outline-offset: 4px; }

/* Wide-tracked labels used for nav and section titles */
.label {
  font-family: var(--label);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  text-decoration: none;
}

/* ---------- Hero ----------
   Full-bleed. Everything is sized from the hero height: --u is one unit of the
   1002-unit-tall design, so type and artwork scale together. */
.hero {
  --h: max(100svh, 600px);
  --u: calc(var(--h) / 1002);
  position: relative; overflow: hidden; background: #000;
  height: calc(var(--u) * var(--hu, 1002));   /* --hu is set by layoutHero() so the page scrolls to the end of the photo */
}
.hero__unit { position: absolute; top: 0; left: 0; width: 0; height: var(--h); pointer-events: none; }
.hero__art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__dots {
  position: absolute; inset: 0 0 auto 0; height: calc(var(--u) * 260); z-index: 1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 0.6px, transparent 0.8px);
  background-size: 6px 6px;
}

.hero__name { margin: 0; font: inherit; }
.hero__name a { text-decoration: none; }
.hero__first, .hero__last {
  position: absolute; z-index: 2; left: calc(var(--u) * 45);
  font-family: var(--label); font-weight: 600; text-transform: uppercase;
  font-size: calc(var(--u) * 35); line-height: 1; letter-spacing: 0.6em;
}
.hero__first { top: calc(var(--u) * 29); }
.hero__last  { top: calc(var(--u) * 209); }

/* Roles use the same typeface as the 9 on the original mock-up */
.hero__roles {
  position: absolute; z-index: 2; left: calc(var(--u) * 42); top: calc(var(--u) * 84); margin: 0; padding: 0; list-style: none;
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif; text-transform: uppercase;
  font-size: max(0.62rem, calc(var(--u) * 12)); line-height: max(1.3em, calc(var(--u) * 17.8));
  letter-spacing: 0.02em;
}
.hero__roles strong { font-weight: 700; }
.hero__roles .spark { margin-left: 0.4em; }

.hero__nav { position: absolute; z-index: 2; left: calc(var(--u) * 32); top: calc(var(--u) * 327); display: flex; flex-direction: column; }
.hero__nav a {
  width: fit-content;
  font-size: max(0.62rem, calc(var(--u) * 12));
  line-height: max(1.6rem, calc(var(--u) * 31));
  transition: opacity 0.2s;
}
.hero__nav a::after { content: " /"; }
.hero__nav a:hover { opacity: 0.55; }

.rim { fill: none; stroke: url(#rim); stroke-width: 1.4; vector-effect: non-scaling-stroke; }

/* ---------- Content sections ---------- */
main { position: relative; z-index: 1; }
.section { padding: clamp(72px, 12vw, 160px) var(--gutter) 0; max-width: 1400px; }
.section__title { margin: 0 0 3rem; }
.section__sub { margin: 4rem 0 1.25rem; color: var(--muted); font-family: var(--body); font-size: 1rem; letter-spacing: 0.04em; font-weight: 400; }
.prose { max-width: 68ch; font-size: 1.05rem; color: #e6e6ee; }
.prose p { margin: 0 0 1.2em; }

.timeline { list-style: none; margin: 3rem 0 0; padding: 0; max-width: 68ch; }
.timeline li { padding: 1.25rem 0; border-top: 1px solid var(--edge); }
.timeline h3 { margin: 0; font-size: 1.1rem; font-weight: 400; }
.timeline .when { color: var(--muted); font-size: 0.9rem; }


.project { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .project { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.project h3 { margin: 0 0 1rem; font-weight: 400; font-size: 1.6rem; }

.link { display: inline-block; margin-top: 0.5rem; text-underline-offset: 5px; }
.buttons { display: flex; flex-wrap: wrap; gap: 14px; }
.button {
  display: inline-block; padding: 1.1rem 1.8rem; border: 1px solid var(--white);
  text-decoration: none; transition: background 0.2s, color 0.2s;
}
.button--solid { background: var(--blue); border-color: var(--blue); }
.button:hover { background: var(--white); border-color: var(--white); color: var(--black); }

.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  padding: 7rem var(--gutter) 3rem; color: var(--muted); font-size: 0.9rem;
}
.footer a { text-underline-offset: 4px; }


@media (max-width: 600px) {
  .label { letter-spacing: 0.4em; }
}

/* ---------- Inner pages ---------- */
.page-head {
  position: relative; background: var(--blue);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 1.7rem; padding: 1.7rem var(--gutter) 2.3rem;
}
.page-head::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 0.6px, transparent 0.8px);
  background-size: 6px 6px;
}
.page-head > * { position: relative; z-index: 1; }
.page-head__name { font-weight: 500; word-spacing: 3.2em; padding-left: 0.55em; }
.page-head__title {
  margin: 0; padding-left: 0.3em;
  font-family: var(--label); font-weight: 500; text-transform: uppercase;
  font-size: clamp(1.5rem, 4.6vw, 3rem); letter-spacing: 0.3em; line-height: 1.15;
}
.page-head__nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.8rem 1.4rem; padding-left: 0.55em; }
.page-head__nav span { font-family: var(--label); font-size: 0.7rem; letter-spacing: 0; }
.page-head a { transition: opacity 0.2s; }
.page-head a:hover { opacity: 0.6; }

.section--page { padding-top: clamp(40px, 6vw, 88px); }
.project + .project { margin-top: clamp(64px, 9vw, 120px); }

@media (max-width: 600px) {
  .page-head__title { letter-spacing: 0.14em; padding-left: 0.14em; }
  .page-head__name, .page-head__nav { padding-left: 0.4em; }
}

/* ---------- Past works ---------- */
.section--wide { max-width: none; }
.works { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .works { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .works { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 10px; } }
.work-card { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.work-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--graphite); transition: opacity 0.2s; }
.work-card:hover img { opacity: 0.8; }
.work-card__title { display: block; margin-top: 0.8rem; font-size: 0.95rem; }


/* ---------- Work pop-up ---------- */
body.is-locked { overflow: hidden; }
.wm {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.2s ease;
}
.wm[hidden] { display: none; }
.wm.is-open { opacity: 1; }
.wm__panel {
  --side: 340px; position: relative; display: grid; grid-template-columns: auto var(--side);
  max-width: min(1180px, 100%); max-height: calc(100vh - 48px); background: #0e0e0e; border: 1px solid rgba(255, 255, 255, 0.14);
  transform: scale(0.98); transition: transform 0.2s ease;
}
.wm.is-open .wm__panel { transform: none; }
.wm__stage { display: grid; place-items: center; background: #000; min-width: 0; }
.wm__stage img { display: block; width: auto; height: auto; max-height: calc(100vh - 50px); max-width: calc(min(1180px, 100vw - 48px) - var(--side)); }
.wm__side { display: flex; flex-direction: column; gap: 1rem; padding: 3.2rem 1.6rem 1.4rem; min-height: 360px; overflow-y: auto; border-left: 1px solid rgba(255, 255, 255, 0.14); }
.wm__title { margin: 0; font-weight: 600; font-size: 1.25rem; line-height: 1.3; }
.wm__desc { font-size: 0.95rem; color: #d6d6e0; }
.wm__desc p { margin: 0; white-space: pre-line; }
.wm__versions { display: flex; gap: 8px; margin-top: auto; }
.wm__versions button { padding: 0.55rem 0.9rem; background: none; color: var(--muted); border: 1px solid rgba(255, 255, 255, 0.28); font: inherit; font-size: 0.8rem; cursor: pointer; }
.wm__versions button[aria-pressed="true"] { color: var(--white); border-color: var(--white); }
.wm__count { margin: 0; color: var(--muted); font-size: 0.8rem; }
.wm__close { position: absolute; top: 0; right: 0; padding: 1rem 1.2rem; background: none; border: 0; color: var(--white); font-family: var(--label); font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; cursor: pointer; }
.wm__nav { position: fixed; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 50%; color: var(--white); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.wm__nav:hover { background: rgba(255, 255, 255, 0.18); }
.wm__prev { left: 12px; }
.wm__next { right: 12px; }

@media (max-width: 860px) {
  .wm { padding: 0; place-items: stretch; overflow-y: auto; }
  .wm__panel { --side: 100%; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; max-height: none; min-height: 100%; border: 0; }
  .wm__stage { align-self: start; }
  .wm__stage img { max-width: 100vw; max-height: 70vh; }
  .wm__side { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.14); padding-top: 1.4rem; min-height: 0; }
  .wm__close { background: rgba(0, 0, 0, 0.6); }
  .wm__nav { top: auto; bottom: 14px; transform: none; }
  .wm__prev { left: auto; right: 66px; }
  .wm__side { padding-bottom: 5rem; }
}
@media (prefers-reduced-motion: reduce) { .wm, .wm__panel { transition: none; } }

/* ---------- Experience and shared card extras ---------- */
.work-card__sub { display: block; margin-top: 0.1rem; color: var(--muted); font-size: 0.85rem; }
.work-card__ph, .wm__ph {
  display: grid; place-items: center; padding: 1rem; text-align: center; background: var(--blue);
  font-family: var(--label); font-weight: 600; font-size: 1.1rem; letter-spacing: 0.08em; line-height: 1.3;
}
.work-card__ph { aspect-ratio: 1 / 1; transition: opacity 0.2s; }
.work-card:hover .work-card__ph { opacity: 0.8; }
.wm__ph { width: min(560px, 100vw - 48px - var(--side)); min-width: 320px; aspect-ratio: 1 / 1; font-size: 1.5rem; }
.wm__ph[hidden], .wm__stage img[hidden] { display: none; }
.wm__sub { margin: -0.6rem 0 0; color: var(--muted); font-size: 0.9rem; }
.wm__sub[hidden] { display: none; }
.wm__link { display: inline-block; width: fit-content; padding: 0.8rem 1.2rem; border: 1px solid var(--white); text-decoration: none; font-size: 0.9rem; transition: background 0.2s, color 0.2s; }
.wm__link:hover { background: var(--white); color: var(--black); }
.wm__link[hidden] { display: none; }
.experience-intro { margin: 0 auto clamp(32px, 5vw, 56px); text-align: center; }
.centered .work-card { text-align: center; }
@media (max-width: 860px) { .wm__ph { width: 100%; min-width: 0; aspect-ratio: 16 / 9; } }

.wm__versions[hidden], .wm__nav[hidden], .wm__count[hidden] { display: none; }

/* ---------- Page transition ---------- */
.glitch-bar, .glitch-base { position: fixed; z-index: 100; pointer-events: none; }
.glitch-bar { will-change: transform; }
.glitch-base { top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 99; }
html.is-glitch, html.is-glitch body { overflow-x: hidden; }
/* The page eases back as the tiles arrive, then settles forward as the next page is revealed */
html.is-glitch #app { transform-origin: var(--gx, 50%) var(--gy, 50%); }
html.is-glitch-out #app { animation: page-push 0.25s cubic-bezier(0.55, 0, 1, 0.45) both; }
html.is-glitch-in #app { animation: page-settle 0.25s cubic-bezier(0, 0.55, 0.45, 1) both; }
@keyframes page-push { to { transform: scale(1.04); } }
@keyframes page-settle { from { transform: scale(0.96); } }
@media (prefers-reduced-motion: reduce) { .glitch-bar, .glitch-base { display: none; } }

/* ---------- floating music player (Apple-style glass) ---------- */
.player {
  position: fixed; z-index: 60; right: 1.25rem; bottom: 1.25rem;
  display: flex; align-items: center; gap: 1.1rem;
  width: min(21rem, calc(100vw - 2rem)); padding: 0.7rem 0.9rem 0.7rem 1.1rem;
  border-radius: 1.4rem; color: #fff; font-family: var(--label);
  background: rgba(40, 40, 46, 0.42);
  -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.player__info { flex: 1; min-width: 0; line-height: 1.25; }
.player__title, .player__artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__title { font-size: 0.95rem; font-weight: 600; }
.player__artist { font-size: 0.8rem; opacity: 0.65; }
.player__controls { display: flex; align-items: center; gap: 0.15rem; }
.player__btn {
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.player__btn svg { width: 1.35rem; height: 1.35rem; fill: currentColor; }
.player__btn--main svg { width: 1.7rem; height: 1.7rem; }
.player__btn:hover { background: rgba(255, 255, 255, 0.16); }
.player__btn:active { transform: scale(0.9); }
.player__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.player .i-pause { display: none; }
.player.is-playing .i-pause { display: block; }
.player.is-playing .i-play { display: none; }
@media (max-width: 600px) {
  .player { right: 1rem; left: 1rem; bottom: 0.9rem; width: auto; }
}
@media (prefers-reduced-motion: reduce) { .player__btn { transition: none; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .player { background: rgba(30, 30, 36, 0.88); }
}

/* player: progress bar + sliding long text */
.player { flex-wrap: wrap; row-gap: 0.15rem; }
.player__info { overflow: hidden; }
.player__title span, .player__artist span {
  display: inline-block; transition: transform 0.4s ease-out; will-change: transform;
}
.player__title, .player__artist { text-overflow: clip; }
.player__time { flex: 1 0 100%; display: flex; align-items: center; gap: 0.6rem; font-size: 0.7rem; opacity: 0.85; font-variant-numeric: tabular-nums; }
.player__cur, .player__dur { min-width: 2.2em; }
.player__dur { text-align: right; }
.player__seek {
  --pct: 0%; flex: 1; min-width: 0; height: 1.2rem; margin: 0; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.player__seek:disabled { cursor: default; opacity: 0.5; }
.player__seek::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, #fff var(--pct), rgba(255,255,255,0.28) var(--pct));
}
.player__seek::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.28); }
.player__seek::-moz-range-progress { height: 4px; border-radius: 2px; background: #fff; }
.player__seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 0; height: 0; margin-top: 2px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 0 #fff; transition: width 0.15s, height 0.15s, margin 0.15s;
}
.player__seek::-moz-range-thumb { width: 0; height: 0; border: 0; border-radius: 50%; background: #fff; }
.player__seek:hover::-webkit-slider-thumb, .player__seek:focus-visible::-webkit-slider-thumb,
.player__seek:active::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4px; }
.player__seek:hover::-moz-range-thumb, .player__seek:focus-visible::-moz-range-thumb { width: 12px; height: 12px; }
.player__seek:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }

/* player: volume */
.player__vol { flex: 1 0 100%; display: flex; align-items: center; gap: 0.35rem; margin-top: -0.2rem; }
.player__btn--sm { width: 1.8rem; height: 1.8rem; }
.player__btn--sm svg { width: 1.1rem; height: 1.1rem; }
.player__volume { max-width: 8rem; }
.player .v-x { display: none; }
.player.is-muted .v-x { display: block; }
.player.is-muted .v-wave { display: none; }

/* "click for sound" nudge while the autoplay is still silent */
.player.is-silent::before {
  content: "Click anywhere for sound"; position: absolute; right: 0.4rem; bottom: calc(100% + 0.5rem);
  padding: 0.35rem 0.8rem; border-radius: 1rem; font-size: 0.75rem; white-space: nowrap; pointer-events: none;
  background: rgba(40, 40, 46, 0.5); border: 1px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}

/* player: draggable */
.player { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; max-width: calc(100vw - 1rem); }
.player.is-dragging { cursor: grabbing; box-shadow: 0 16px 44px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.player.is-dragging * { cursor: grabbing; }

/* links that follow you down the page */
.hero__nav { position: fixed; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45); }
.page-head { position: sticky; top: 0; z-index: 40; }

/* exact centring: each link ends with a trailing letter-space, so pull that back out instead of guessing with padding */
.page-head__name, .page-head__nav { padding-left: 0; }
.page-head__name, .page-head__nav a:last-of-type { margin-right: -0.55em; }
@media (max-width: 600px) { .page-head__name, .page-head__nav { padding-left: 0; } }
