:root {
  --paper: #2a282c;
  --paper-deep: #1e1c21;
  --frame: #0c0b0e;
  --ink: #cccad1;
  --ink-strong: #eceaf1;
  --ink-pill: #cbc9d0;
  --ink-pill-hover: #dedce3;
  --ink-dark: #232127;
  --ink-soft: rgba(204, 202, 209, 0.72);
  --ink-faint: rgba(204, 202, 209, 0.46);
  --ink-ghost: rgba(204, 202, 209, 0.14);
  --sans: "Libre Franklin", "HarmonyOS Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--frame);
}

body {
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(204, 202, 209, 0.28);
  color: #fff;
}

#stage {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
  touch-action: manipulation;
  outline: none;
}

body.is-ready #stage {
  opacity: 1;
}

/* --------------------------------------------------------- shadowbox frame */

.frame {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  border: 11px solid var(--frame);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.55),
    inset 0 0 26px rgba(8, 7, 10, 0.68);
}

/* ------------------------------------------------------------------ sheet */

.sheet {
  position: fixed;
  z-index: 4;
  top: 14px;
  right: 14px;
  bottom: 116px;
  left: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(204, 202, 209, 0.18) transparent;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 4%,
    #000 91%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 4%,
    #000 91%,
    transparent 100%
  );
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition:
    opacity 0.45s var(--ease),
    transform 0.45s var(--ease),
    visibility 0s linear 0.45s;
}

.sheet::-webkit-scrollbar {
  width: 5px;
}

.sheet::-webkit-scrollbar-thumb {
  background: rgba(204, 202, 209, 0.16);
  border-radius: 99px;
}

.sheet.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.58s var(--ease) 0.12s,
    transform 0.58s var(--ease) 0.12s,
    visibility 0s;
}

.sheet__inner {
  position: relative;
  z-index: 2;
  margin-left: 31.5vw;
  width: min(372px, 26vw);
  padding: 11vh 0 6vh;
  pointer-events: auto;
}

.sheet__inner--wide {
  width: min(440px, 44vw);
  padding-top: 8.5vh;
}

.sheet__inner--bare {
  padding-top: 12.5vh;
}

.sheet__title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}

.sheet__meta {
  margin: 0 0 22px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.sheet__body {
  font-size: 13.8px;
  font-weight: 400;
  line-height: 1.78;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.sheet__body p {
  margin: 0 0 1.12em;
}

.sheet__body p:last-child {
  margin-bottom: 0;
}

.sheet__body p:last-child:has(a) {
  margin-top: 1.65em;
}

.sheet__body a,
.sheet__body mark {
  color: var(--ink-strong);
  background: none;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3.5px;
  text-decoration-color: rgba(204, 202, 209, 0.62);
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}

.sheet__body a:hover {
  color: #fff;
  text-decoration-color: #fff;
}

.sheet__body mark {
  color: var(--ink);
  text-decoration-color: rgba(204, 202, 209, 0.45);
}

.sheet__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 22px;
}

.sheet__actions a {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3.5px;
  text-decoration-color: rgba(204, 202, 209, 0.55);
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}

.sheet__actions a:hover {
  color: #fff;
  text-decoration-color: #fff;
}

.sheet__actions .arrow {
  font-family: var(--mono);
  font-size: 10.5px;
  opacity: 0.72;
}

/* ----------------------------------------------------- timeline & tracks */

.rows {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink-ghost);
}

.rows li {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--ink-ghost);
}

.rows .when {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  padding-top: 3px;
}

.rows .what {
  font-size: 13.2px;
  line-height: 1.58;
  color: var(--ink);
}

.rows .what strong {
  font-weight: 500;
  color: var(--ink-strong);
  margin-right: 6px;
}

.rows .row-link {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  color: var(--ink-strong);
  text-decoration: none;
}

.rows .row-link strong {
  margin-right: 2px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(204, 202, 209, 0.42);
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}

.rows .row-link:hover strong {
  color: #fff;
  text-decoration-color: #fff;
}

.rows .row-link .arrow {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
}

.rows .what span {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 12.2px;
}

.tracks {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink-ghost);
}

.tracks li {
  border-bottom: 1px solid var(--ink-ghost);
}

.tracks button {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  padding: 8px 2px;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

.tracks button:hover,
.tracks button.is-playing {
  color: var(--ink-strong);
}

.tracks .idx {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-faint);
}

.tracks .name {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
}

.tracks .tag {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-faint);
}

.tracks .state {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.tracks button:hover .state,
.tracks button.is-playing .state {
  opacity: 1;
}

.tracks button.is-playing .state {
  color: var(--ink-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------- taped newsprint collage (2x2) */

.sheet__collage {
  position: absolute;
  top: 10vh;
  left: 59.5vw;
  width: min(356px, 33vw);
  height: 380px;
  pointer-events: auto;
}

.photo {
  position: absolute;
  margin: 0;
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.42s var(--ease), z-index 0s;
}

/* 4-photo overlapping zine cluster (matches 31-me-clicked) */
.photo:nth-child(1) {
  top: 0;
  left: 0;
  width: 49%;
  z-index: 2;
}

.photo:nth-child(2) {
  top: 38px;
  left: 45%;
  width: 51%;
  z-index: 3;
}

.photo:nth-child(3) {
  top: 162px;
  left: 2%;
  width: 47%;
  z-index: 1;
}

.photo:nth-child(4) {
  top: 192px;
  left: 39%;
  width: 53%;
  z-index: 4;
}

/* 3-photo cat zine cluster (1 live video print + 2 halftone photos) */
.sheet__collage[data-count="3"] .photo:nth-child(1) {
  top: 4px;
  left: 0;
  width: 52%;
  z-index: 3;
}

.sheet__collage[data-count="3"] .photo:nth-child(2) {
  top: 32px;
  left: 46%;
  width: 51%;
  z-index: 2;
}

.sheet__collage[data-count="3"] .photo:nth-child(3) {
  top: 186px;
  left: 24%;
  width: 50%;
  z-index: 4;
}

/* 2-photo project cluster */
.sheet__collage[data-count="2"] .photo:nth-child(1) {
  top: 14px;
  left: 0;
  width: 58%;
  z-index: 2;
}

.sheet__collage[data-count="2"] .photo:nth-child(2) {
  top: 144px;
  left: 34%;
  width: 58%;
  z-index: 3;
}

/* 1-photo project print */
.sheet__collage[data-count="1"] .photo:nth-child(1) {
  top: 24px;
  left: 6%;
  width: 68%;
  z-index: 2;
}

.photo:hover {
  z-index: 10 !important;
  transform: rotate(0deg) scale(1.035);
}

.photo__frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: #222026;
  box-shadow: 0 10px 26px rgba(6, 5, 8, 0.52);
}

.photo__frame[data-src] {
  aspect-ratio: var(--ratio, 1.15);
  background: rgba(24, 22, 28, 0.65);
}

.photo__frame canvas,
.photo__frame video {
  display: block;
  width: 100%;
  height: auto;
}

.photo--link {
  cursor: pointer;
}

.photo__frame--video {
  aspect-ratio: var(--ratio, 1);
  background: #1f1d23;
  border: 1px solid rgba(14, 13, 17, 0.65);
}

.photo__frame--video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.26) brightness(0.94);
  transition: filter 0.35s var(--ease);
}

.photo:hover .photo__frame--video video {
  filter: grayscale(0.22) contrast(1.08) brightness(0.98);
}

/* Fine lithograph halftone screen overlaid on live video prints */
.photo__frame--video::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(22, 20, 26, 0.42) 0.75px, transparent 0.75px);
  background-size: 2.6px 2.6px;
  mix-blend-mode: multiply;
  transition: opacity 0.35s var(--ease);
}

.photo:hover .photo__frame--video::after {
  opacity: 0.32;
}

.sheet__voice-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 5px 13px;
  border: 0;
  border-radius: 999px;
  background: var(--ink-pill);
  color: var(--ink-dark);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.36);
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease);
}

.sheet__voice-btn:hover {
  background: var(--ink-pill-hover);
  transform: translateY(-1px);
}

/* Stippled masking tape variants */
.tape {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background-color: rgba(206, 204, 211, 0.42);
  background-image: radial-gradient(rgba(28, 26, 32, 0.34) 0.75px, transparent 0.75px);
  background-size: 3px 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}

.tape--label {
  top: -8px;
  left: 50%;
  height: 15px;
  min-width: 56px;
  padding: 0 7px;
  transform: translateX(-50%) rotate(-2deg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(208, 206, 214, 0.58);
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #1f1d23;
  white-space: nowrap;
}

.tape--corner-l {
  top: -5px;
  left: -10px;
  width: 36px;
  height: 11px;
  transform: rotate(-36deg);
}

.tape--corner-r {
  top: -5px;
  right: -10px;
  width: 36px;
  height: 11px;
  transform: rotate(36deg);
}

.tape--slant {
  top: -6px;
  left: 14%;
  width: 44px;
  height: 12px;
  transform: rotate(-14deg);
}

.photo figcaption {
  margin-top: 5px;
  font-size: 10px;
  color: var(--ink-faint);
  text-align: center;
  opacity: 0;
  transition: opacity 0.22s var(--ease);
  pointer-events: none;
}

.photo:hover figcaption {
  opacity: 0.92;
}

/* ------------------------------------------- solid light-ink player pill */

.player {
  position: fixed;
  z-index: 8;
  right: 34px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  width: 326px;
  height: 27px;
  padding: 0 7px 0 5px;
  border-radius: 999px;
  background: var(--ink-pill);
  color: var(--ink-dark);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.44);
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.7s var(--ease) 0.35s,
    transform 0.7s var(--ease) 0.35s,
    background-color 0.2s var(--ease);
}

body.is-ready .player {
  opacity: 1;
  transform: none;
}

.player__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: rgba(30, 28, 35, 0.13);
  pointer-events: none;
  transition: width 0.2s linear;
}

.player__btn {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-dark);
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.86;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}

.player__btn:hover {
  opacity: 1;
  transform: scale(1.08);
}

.player__btn svg {
  width: 11.5px;
  height: 11.5px;
  fill: currentColor;
}

.player__open svg {
  fill: none;
}

.player .icon-pause {
  display: none;
}

.player.is-playing .icon-play {
  display: none;
}

.player.is-playing .icon-pause {
  display: block;
}

.player__now {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--ink-dark);
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.player__title {
  font-weight: 500;
  color: #1c1a20;
  flex-shrink: 0;
}

.player__artist {
  font-weight: 400;
  color: rgba(35, 33, 39, 0.62);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------- home audio note + left arrow */

.now {
  position: fixed;
  z-index: 7;
  right: 34px;
  bottom: 53px;
  width: 326px;
  padding-left: 24px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.42;
  text-align: left;
  color: rgba(204, 202, 209, 0.88);
  text-shadow: 0 0 10px var(--paper), 0 0 4px var(--paper);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.55s var(--ease);
}

.now span {
  display: block;
}

.now__arrow {
  position: absolute;
  left: -1px;
  top: 4px;
  width: 24px;
  height: 44px;
  overflow: visible;
  fill: none;
  stroke: rgba(204, 202, 209, 0.82);
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.is-ready[data-view="home"] .now {
  opacity: 1;
  transition-delay: 0.95s;
}

body[data-view="sheet"] .now,
body[data-view="branch"] .now {
  opacity: 0;
  transition-delay: 0s;
}

/* -------------------------------------------------------------- playlist */

.playlist {
  position: fixed;
  z-index: 9;
  right: 34px;
  bottom: 56px;
  width: min(326px, calc(100vw - 40px));
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding: 14px 16px 12px;
  border: 1px solid rgba(204, 202, 209, 0.18);
  border-radius: 10px;
  background: rgba(32, 30, 36, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.playlist.is-open {
  opacity: 1;
  transform: none;
}

.playlist__head {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.playlist ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.playlist li {
  border-top: 1px solid rgba(204, 202, 209, 0.09);
}

.playlist button {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: color 0.18s var(--ease);
}

.playlist button:hover,
.playlist button.is-playing {
  color: var(--ink-strong);
}

.playlist button.is-playing::after {
  content: "playing";
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.playlist__foot {
  margin: 10px 0 0;
  font-size: 10px;
  line-height: 1.5;
  color: var(--ink-faint);
}

/* ------------------------------------------- solid light-ink back pill */

.back {
  position: fixed;
  z-index: 8;
  left: 34px;
  bottom: 20px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 23px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--ink-pill);
  color: var(--ink-dark);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.42);
  cursor: pointer;
  opacity: 0;
  transform: translateY(5px);
  transition:
    opacity 0.28s var(--ease),
    transform 0.28s var(--ease),
    background-color 0.18s var(--ease);
}

.back[hidden] {
  display: none;
}

.back.is-visible {
  opacity: 1;
  transform: none;
}

.back:hover {
  background: var(--ink-pill-hover);
  transform: translateX(-1.5px);
}

.back svg {
  width: 26px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------- toast & a11y */

.toast {
  position: fixed;
  z-index: 15;
  left: 50%;
  bottom: 62px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--ink-pill);
  color: var(--ink-dark);
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  pointer-events: none;
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sr-nav {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.noscript {
  position: fixed;
  inset: auto 28px 90px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1120px) {
  .sheet__inner {
    margin-left: 33vw;
    width: min(460px, 56vw);
  }

  .sheet__collage {
    position: relative;
    top: auto;
    left: auto;
    width: min(440px, 56vw);
    height: auto;
    margin: 28px 0 24px 33vw;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 16px;
  }

  .photo,
  .photo:nth-child(1),
  .photo:nth-child(2),
  .photo:nth-child(3),
  .photo:nth-child(4),
  .sheet__collage[data-count="3"] .photo:nth-child(1),
  .sheet__collage[data-count="3"] .photo:nth-child(2),
  .sheet__collage[data-count="3"] .photo:nth-child(3),
  .sheet__collage[data-count="2"] .photo:nth-child(1),
  .sheet__collage[data-count="2"] .photo:nth-child(2),
  .sheet__collage[data-count="1"] .photo:nth-child(1) {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
  }

  .photo:nth-child(2n) {
    margin-top: 16px;
  }
}

@media (max-width: 820px) {
  .frame {
    border-width: 5px;
  }

  body[data-view="sheet"] #stage {
    opacity: 0.22;
  }

  .sheet {
    top: 6px;
    right: 6px;
    bottom: 62px;
    left: 6px;
    background: linear-gradient(
      180deg,
      rgba(42, 40, 44, 0.45) 0%,
      rgba(42, 40, 44, 0.88) 18%,
      rgba(42, 40, 44, 0.96) 52%
    );
  }

  .sheet__inner,
  .sheet__inner--wide,
  .sheet__inner--bare {
    margin: 0;
    width: 100%;
    padding: 48px 22px 18px;
  }

  .sheet__collage {
    width: 100%;
    margin: 18px 0 0;
    padding: 0 22px 36px;
    grid-template-columns: 1fr 1fr;
    gap: 16px 14px;
  }

  .player {
    right: 14px;
    bottom: 14px;
    width: calc(100vw - 28px);
    max-width: 348px;
  }

  body[data-view="sheet"] .player,
  body[data-view="branch"] .player {
    width: calc(100vw - 84px);
    max-width: 310px;
  }

  .now {
    right: 14px;
    bottom: 46px;
    width: min(348px, calc(100vw - 28px));
    font-size: 11px;
  }

  .back {
    left: 14px;
    bottom: 16px;
    width: 44px;
    height: 23px;
  }

  .playlist {
    right: 14px;
    bottom: 48px;
    width: calc(100vw - 28px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
