:root {
  color-scheme: dark;
  --sage: #b9d0c1;
  --sage-bright: #d9e8dd;
  --muted: rgba(232, 240, 235, 0.62);
  --line: rgba(232, 242, 236, 0.09);
  --glass: rgba(8, 11, 10, 0.39);
  --mac-cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='29' viewBox='0 0 26 34'%3E%3Cpath d='M3 2.5v25l6.3-5.2 4.1 9.2 4.2-1.9-4.1-9h8.7L3 2.5Z' fill='%23050505' stroke='%23fff' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E") 2 2, default;
}

* { box-sizing: border-box; }

html, body { min-width: 320px; min-height: 100%; margin: 0; }

body {
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  color: #f2f5f3;
  background: #07100d;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizeLegibility;
  cursor: var(--mac-cursor);
}

button, input { font: inherit; }
button, input, a { cursor: var(--mac-cursor); }
button:focus-visible { outline: 2px solid var(--sage-bright); outline-offset: 3px; }

html, body, body *, body *::before, body *::after {
  cursor: var(--mac-cursor) !important;
}

[hidden] { display: none !important; }

.site { min-height: 100svh; isolation: isolate; }

.background-poster,
.background-video,
.background-shade {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.background-poster {
  z-index: -4;
  pointer-events: none;
  background: #07100d url("/assets/poster.webp") center / cover no-repeat;
}

.background-video {
  z-index: -3;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  object-fit: cover;
  object-position: center;
  background: transparent;
  opacity: 0;
  filter: saturate(.8) contrast(1.05) brightness(.73) blur(5px);
  transform: scale(1.025);
  transition: opacity 720ms ease, filter 900ms ease, transform 1200ms cubic-bezier(.22,.7,.22,1);
}

.video-ready .background-video { opacity: 1; }

.background-poster {
  filter: saturate(.8) contrast(1.05) brightness(.73) blur(5px);
  transform: scale(1.025);
  transition: filter 900ms ease, transform 1200ms cubic-bezier(.22,.7,.22,1);
}

.entered .background-poster,
.entered .background-video {
  filter: saturate(.8) contrast(1.05) brightness(.73) blur(0);
  transform: scale(1);
}

.background-shade {
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 43%, transparent 18%, rgba(1,6,4,.18) 64%, rgba(0,3,2,.58) 100%),
    linear-gradient(180deg, rgba(3,8,6,.1), rgba(2,7,5,.36));
}

.page-shell {
  width: min(640px, calc(100vw - 32px));
  min-height: 100svh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 0 max(24px, env(safe-area-inset-bottom));
  display: grid;
  align-content: center;
  gap: 16px;
  opacity: 0;
  transform: translate3d(0, 10px, 0) scale(.99);
  will-change: opacity, transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: opacity 700ms ease 160ms, transform 800ms cubic-bezier(.2,.75,.2,1) 140ms;
}

.entered .page-shell { opacity: .999; transform: translate3d(0, 0, 0) scale(1); }

.profile-card,
.player-card {
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: 0 22px 72px rgba(0,0,0,.27);
  -webkit-backdrop-filter: blur(7px) saturate(1.04);
  backdrop-filter: blur(7px) saturate(1.04);
}

.profile-card {
  min-height: 444px;
  padding: 38px 30px 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-radius: 30px;
}

.avatar-wrap { position: relative; width: 124px; height: 124px; }
.avatar-wrap::before { content: ""; position: absolute; inset: -4px; border: 1px solid rgba(207,229,215,.2); border-radius: 50%; }
.avatar { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 50%; box-shadow: 0 12px 38px rgba(0,0,0,.4); }

.presence {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 14px;
  height: 14px;
  border: 3px solid #101714;
  border-radius: 50%;
  background: #9cc6a9;
  box-shadow: 0 0 16px rgba(156,198,169,.75);
}

.profile-center { margin: auto 0; display: grid; justify-items: center; gap: 20px; }
.status-glyph { color: #a9d9cd; font-size: 27px; line-height: 1; text-shadow: 0 0 18px rgba(129,213,197,.55); }

.bio {
  max-width: 440px;
  margin: 0;
  color: rgba(242,246,243,.82);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: .02em;
}

.social-links { display: flex; justify-content: center; gap: 12px; }
.social-link {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: rgba(242,246,243,.94);
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 15px;
  background: rgba(244,248,245,.1);
  box-shadow: 0 0 20px rgba(205,225,214,.12);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.social-link:hover { transform: translateY(-2px) scale(1.04); background: rgba(244,248,245,.16); box-shadow: 0 0 26px rgba(205,225,214,.2); }
.social-link:active { transform: scale(.97); }
.social-link svg { width: 29px; height: 29px; fill: currentColor; }

.view-counter {
  margin-top: auto;
  padding-top: 8px;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(230,240,234,.58);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

.view-counter svg { width: 17px; height: 17px; }
.view-counter svg path { fill: none; stroke: currentColor; stroke-width: 1.6; }
.view-counter svg circle { fill: currentColor; }
.view-counter strong { color: rgba(246,250,247,.86); font-size: 12px; }

.player-card {
  position: relative;
  min-height: 94px;
  padding: 14px 17px;
  display: grid;
  grid-template-columns: 58px minmax(130px,.85fr) minmax(180px,1.5fr) auto;
  align-items: center;
  gap: 15px;
  border-radius: 25px;
}

.cover-art {
  width: 58px;
  height: 58px;
  display: block;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(173,203,184,.13), rgba(13,23,18,.32));
  box-shadow: 0 8px 22px rgba(0,0,0,.2);
}

.track-copy { min-width: 0; display: grid; align-content: center; gap: 5px; }
.track-copy strong, .track-copy > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-copy strong { color: rgba(247,250,248,.93); font-family: "Noto Serif JP", "Yu Mincho", serif; font-size: 13px; font-weight: 500; }
.track-copy > span:last-child { color: var(--muted); font-size: 11px; }

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  color: rgba(239,246,241,.82);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,.04);
}
.icon-button:disabled { cursor: not-allowed; opacity: .36; }
.icon-button svg { width: 20px; height: 20px; }
.icon-button svg path:not(.stroke) { fill: currentColor; }
.icon-button svg .stroke { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.icon-button svg.flip { transform: scaleX(-1); }

.transport { display: flex; align-items: center; gap: 5px; }
.transport .skip-button { width: 28px; height: 28px; border-color: transparent; background: transparent; }
.transport .skip-button svg { width: 16px; height: 16px; }
.transport .play-button { width: 38px; height: 38px; }
.transport .icon-button:hover { color: #fff; background: rgba(255,255,255,.08); }

.timeline { min-width: 0; display: grid; gap: 5px; }
.range-stack {
  position: relative;
  width: 100%;
  height: 16px;
  display: grid;
  align-items: center;
}
.range-stack > * { grid-area: 1 / 1; }
.range-progress {
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 99px;
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
  pointer-events: none;
  background: rgba(226,238,230,.18);
}
.range-progress::-webkit-progress-bar { background: rgba(226,238,230,.18); }
.range-progress::-webkit-progress-value { border-radius: 99px; background: var(--sage); }
.range-progress::-moz-progress-bar { border-radius: 99px; background: var(--sage); }
.range-input {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 16px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background: transparent;
  touch-action: none;
}
.range-input::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 99px;
  background: transparent;
}
.range-input::-webkit-slider-runnable-track,
.range-input::-webkit-slider-thumb,
.range-input::-moz-range-track,
.range-input::-moz-range-thumb {
  cursor: var(--mac-cursor) !important;
}
.range-input::-moz-range-track { height: 4px; border: 0; border-radius: 99px; background: transparent; }
.range-input::-moz-range-progress { height: 4px; border-radius: 99px; background: transparent; }
.range-input::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 50%;
  background: var(--sage-bright);
  box-shadow: 0 0 0 3px rgba(217,232,221,.08);
}
.range-input::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--sage-bright); }
.range-input:focus-visible { outline: 2px solid var(--sage-bright); outline-offset: 3px; border-radius: 99px; }
.time { display: flex; justify-content: space-between; color: rgba(230,239,233,.42); font-size: 9px; font-variant-numeric: tabular-nums; }

.sound-dock {
  position: fixed;
  z-index: 4;
  top: max(18px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 9px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5px);
  transition: opacity 500ms ease 300ms, transform 500ms ease 300ms;
}
.entered .sound-dock { opacity: 1; pointer-events: auto; transform: none; }

.sound-toggle {
  width: 52px;
  height: 52px;
  padding: 0;
  display: grid;
  place-items: center;
  color: rgba(247,250,248,.88);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  background: rgba(8,10,9,.36);
  box-shadow: 0 12px 36px rgba(0,0,0,.2);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  transition: background 180ms ease, border-color 180ms ease;
}
.sound-toggle:hover { background: rgba(230,239,233,.12); }
.sound-toggle svg { width: 25px; height: 25px; }
.sound-toggle svg path:not(.stroke) { fill: currentColor; }
.sound-toggle svg .stroke { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.volume-popover {
  width: 0;
  height: 52px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  color: rgba(237,245,240,.55);
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(8,10,9,.36);
  box-shadow: 0 12px 36px rgba(0,0,0,.18);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
  transition: width 260ms cubic-bezier(.2,.75,.2,1), padding 260ms ease, opacity 180ms ease, transform 260ms ease, border-color 180ms ease;
}
.sound-dock:hover .volume-popover,
.sound-dock:focus-within .volume-popover {
  width: 156px;
  padding: 0 14px;
  border-color: rgba(255,255,255,.09);
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.volume-range { min-width: 90px; flex: 1; }
.volume-input { min-width: 0; }
.volume-popover span { min-width: 21px; font-size: 9px; font-variant-numeric: tabular-nums; text-align: right; }

.enter-screen {
  position: fixed;
  z-index: 10;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #f4f7f5;
  border: 0;
  background: rgba(1,4,3,.52);
  opacity: 1;
  transition: opacity 680ms cubic-bezier(.22,.7,.22,1), background-color 680ms ease;
}

.enter-screen.is-leaving {
  pointer-events: none;
  opacity: 0;
  background: rgba(1,4,3,.44);
}

.enter-text { color: rgba(248,250,249,.9); font-size: 17px; font-weight: 600; letter-spacing: .02em; text-shadow: 0 8px 28px rgba(0,0,0,.5); transition: transform 180ms ease, color 180ms ease; }
.enter-screen:hover .enter-text { color: #fff; transform: scale(1.025); }

@media (max-width: 640px) {
  .page-shell { width: min(calc(100% - 24px), 430px); gap: 10px; }
  .profile-card { min-height: 390px; padding: 30px 22px 22px; border-radius: 25px; }
  .avatar-wrap { width: 112px; height: 112px; }
  .player-card { min-height: 122px; padding: 13px; grid-template-columns: 50px minmax(0,1fr) auto; grid-template-rows: auto auto; gap: 10px; border-radius: 21px; }
  .cover-art { width: 50px; height: 50px; }
  .timeline { grid-column: 1 / -1; grid-row: 2; }
  .sound-dock { top: 13px; left: 13px; }
  .sound-toggle { width: 46px; height: 46px; }
  .volume-popover { height: 46px; }
  .sound-dock:hover .volume-popover,
  .sound-dock:focus-within .volume-popover { width: 142px; padding: 0 12px; }
  .volume-range { min-width: 80px; }
}

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