:root {
  --bg: #05060b;
  --fg: #e9eaf2;
  --dim: rgba(233, 234, 242, .58);
  --mute: rgba(233, 234, 242, .36);
  --faint: rgba(233, 234, 242, .13);
  --accent: #9db4ff;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: 'Instrument Serif', 'Times New Roman', Georgia, serif;
  --gut: clamp(24px, 8vw, 132px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; background: var(--bg); }

body {
  color: var(--fg);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
body.ready { overflow-y: auto; }

body.xhair, body.xhair * { cursor: none !important; }

#sky {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
}

/* ---------- stage ---------- */
.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px var(--gut) 132px;
  width: min(100%, calc(var(--gut) + 560px));
  pointer-events: none;
}
.stage > * { pointer-events: auto; }

.name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(50px, 7.4vw, 112px);
  line-height: .95;
  letter-spacing: -.015em;
  white-space: nowrap;
  align-self: flex-start;
  max-width: 100%;
  transform-origin: 50% 50%;
  text-shadow: 0 2px 30px rgba(5, 6, 11, .55);
  pointer-events: none !important;
  will-change: transform;
}
.name .ch { display: inline-block; will-change: transform, opacity; }
.name .it { font-style: italic; }
.name .sp { display: inline-block; width: .24em; }
body.intro .name .ch { opacity: 0; }

/* ---------- list ---------- */
.links {
  list-style: none;
  margin-top: clamp(30px, 5vh, 52px);
  width: min(420px, 100%);
}

.item {
  border-top: 1px solid var(--faint);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: calc(var(--i, 0) * 85ms);
}
.item:last-child { border-bottom: 1px solid var(--faint); }
body.ready .item { opacity: 1; transform: none; }

.row, .srow {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: none;
  border: 0;
  color: var(--fg);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.row { padding: 17px 2px; font-size: 13.5px; letter-spacing: .1em; }
.row::before {
  content: '';
  position: absolute;
  inset: 0 -12px;
  background: linear-gradient(90deg, rgba(157, 180, 255, .09), transparent 80%);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 80%);
  opacity: 0;
  transform: scaleX(.6);
  transform-origin: left;
  transition: opacity .35s, transform .5s var(--ease);
  pointer-events: none;
}
.row:hover::before, .row:focus-visible::before, .row[aria-expanded="true"]::before { opacity: 1; transform: none; }
.row:focus-visible, .srow:focus-visible { outline: none; }

.row .n { font-size: 10px; color: var(--mute); letter-spacing: .14em; width: 20px; flex: none; transition: color .3s; }
.row .n.ico { font-size: 13px; letter-spacing: 0; text-align: center; color: var(--dim); }
.srow .sico { width: 16px; flex: none; text-align: center; font-size: 11.5px; color: var(--mute); transition: color .25s; margin-right: -4px; }
.srow:hover .sico, .srow:focus-visible .sico, .srow[aria-expanded="true"] .sico { color: var(--accent); }
.row .lbl { flex: 1; transition: transform .45s var(--ease); }
.row:hover .lbl, .row:focus-visible .lbl { transform: translateX(6px); }
.row:hover .n, .row:focus-visible .n, .row[aria-expanded="true"] .n { color: var(--accent); }

.ic { position: relative; width: 12px; height: 12px; flex: none; color: var(--dim); transition: transform .45s var(--ease), color .3s; }
.ic.go::before {
  content: '';
  position: absolute;
  right: 1px;
  top: 1px;
  width: 7px;
  height: 7px;
  border-top: 1.2px solid currentColor;
  border-right: 1.2px solid currentColor;
}
.ic.go::after {
  content: '';
  position: absolute;
  right: 1px;
  top: 1px;
  width: 13px;
  height: 1.2px;
  background: currentColor;
  transform-origin: right center;
  transform: rotate(-45deg);
}
.row:hover .ic, .srow:hover .ic, .row:focus-visible .ic, .srow:focus-visible .ic { color: var(--accent); }
.row:hover .ic.go, .srow:hover .ic.go, .row:focus-visible .ic.go { transform: translate(2px, -2px); }

.ic.plus::before, .ic.plus::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 1.2px;
  margin: -.6px 0 0 -5.5px;
  background: currentColor;
  transition: transform .45s var(--ease);
}
.ic.plus::after { transform: rotate(90deg); }
[aria-expanded="true"] .ic.plus { transform: rotate(45deg); color: var(--accent); }

.panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .5s var(--ease);
}
.panel.open { grid-template-rows: 1fr; }
.panel > .inner { overflow: hidden; min-height: 0; }
.panel > .inner > * { opacity: 0; transform: translateY(-6px); transition: opacity .4s, transform .5s var(--ease); }
.panel.open > .inner > * { opacity: 1; transform: none; transition-delay: .12s; }

.mailbox { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; padding: 2px 0 20px 36px; }
.mailbox[hidden] { display: none; }
.sub .mailbox { padding: 2px 0 12px 0; }
.mail {
  font-size: clamp(15px, 1.9vw, 19px);
  color: var(--fg);
  text-decoration: none;
  letter-spacing: .01em;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--faint);
  transition: border-color .3s;
  user-select: text;
  -webkit-user-select: text;
  word-break: break-all;
}
.mail:hover, .mail:focus-visible { border-color: var(--accent); outline: none; }
.mail.wait { color: var(--mute); border-color: transparent; }
.copy {
  background: none;
  border: 0;
  color: var(--mute);
  font: inherit;
  font-size: 10px;
  letter-spacing: .28em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .25s;
}
.copy:hover, .copy:focus-visible { color: var(--accent); outline: none; }

.sub { list-style: none; padding: 0 0 14px 36px; }
.subitem { border-left: 1px solid var(--faint); padding-left: 16px; }
.srow { padding: 9px 0; font-size: 12.5px; letter-spacing: .08em; color: var(--dim); transition: color .25s; }
.srow .lbl { flex: 1; }
.srow:hover, .srow:focus-visible, .srow[aria-expanded="true"] { color: var(--fg); }
.sub .empty { color: var(--mute); font-size: 12px; padding: 6px 0; }
.sub .sub { padding: 0 0 8px 14px; }

.note {
  padding: 2px 0 20px 36px;
  max-width: 400px;
  font-size: 12.5px;
  line-height: 1.75;
  letter-spacing: .02em;
  color: var(--dim);
  white-space: pre-line;
  overflow-wrap: anywhere;
  user-select: text;
  -webkit-user-select: text;
}
.sub .note { padding: 2px 0 12px 0; }
.note a { color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--faint); transition: border-color .25s, color .25s; }
.note a:hover, .note a:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }

/* ---------- player ---------- */
.player {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 4;
  width: 320px;
  background: rgba(10, 12, 22, .55);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--faint);
  border-radius: 14px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .8s var(--ease) .5s, transform .8s var(--ease) .5s;
}
body.ready .player { opacity: 1; transform: none; }

.player .frame { height: 0; transition: height .5s var(--ease); }
.player .frame iframe { display: block; width: 100%; height: 100%; border: 0; border-radius: 12px 12px 0 0; background: #0b0d16; }
.player.open .frame { padding: 8px 8px 0; box-sizing: content-box; }

.player .bar { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 10px; }
.pp {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  border: 1px solid var(--faint);
  background: none;
  color: var(--fg);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color .3s, background .3s;
}
.pp:hover, .pp:focus-visible { border-color: var(--accent); outline: none; }
.eq { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 2px; height: 4px; background: currentColor; border-radius: 1px; }
.eq i:nth-child(2) { height: 8px; }
.eq i:nth-child(3) { height: 6px; }
.eq i:nth-child(4) { height: 10px; }
.player.open .eq i { animation: eq .9s ease-in-out infinite alternate; background: var(--accent); }
.player.open .eq i:nth-child(2) { animation-delay: -.3s; }
.player.open .eq i:nth-child(3) { animation-delay: -.6s; }
.player.open .eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { from { height: 2px; } to { height: 12px; } }

.meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.meta .t, .meta .a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta .t { font-size: 12px; letter-spacing: .04em; }
.meta .a { font-size: 10.5px; color: var(--mute); letter-spacing: .06em; }
.meta.swap { animation: swap .45s var(--ease); }
@keyframes swap { from { opacity: 0; transform: translateY(5px); } }

.ib {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 8px;
  color: var(--dim);
  cursor: pointer;
  transition: color .25s, background .25s, transform .4s var(--ease);
}
.ib[hidden] { display: none; }
.ib:hover, .ib:focus-visible { color: var(--accent); background: rgba(255, 255, 255, .04); outline: none; }
#pl-next:active { transform: rotate(-20deg) scale(.92); }
#pl-vbtn[aria-expanded="true"] { color: var(--accent); }
#pl-vbtn.low .w2, #pl-vbtn.mute .w1, #pl-vbtn.mute .w2 { opacity: .2; }

.vol { display: flex; align-items: center; gap: 12px; padding: 0 14px 12px 56px; }
.vol[hidden] { display: none; }
.vol span { font-size: 10px; color: var(--mute); letter-spacing: .1em; width: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.vol input {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 16px;
  background: transparent;
  cursor: pointer;
  --v: 70%;
}
.vol input::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--accent) var(--v), var(--faint) var(--v)); }
.vol input::-moz-range-track { height: 2px; border-radius: 2px; background: var(--faint); }
.vol input::-moz-range-progress { height: 2px; border-radius: 2px; background: var(--accent); }
.vol input::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 10px; margin-top: -4px; border-radius: 50%; background: var(--fg); border: 0; transition: transform .2s; }
.vol input::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: var(--fg); border: 0; }
.vol input:hover::-webkit-slider-thumb, .vol input:focus-visible::-webkit-slider-thumb { transform: scale(1.3); background: var(--accent); }
.vol input:focus-visible { outline: none; }

/* ---------- readout / skip ---------- */
.hud {
  position: fixed;
  left: 20px;
  bottom: 18px;
  z-index: 3;
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
  white-space: pre;
  pointer-events: none;
}
.skip {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 3;
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--mute);
  opacity: 0;
  transition: opacity .6s;
  pointer-events: none;
}
body.intro .skip.show { opacity: 1; }

/* ---------- crosshair ---------- */
#cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
  mix-blend-mode: difference;
}
body.xhair #cursor.live { opacity: 1; }
#cursor i { position: absolute; background: #fff; transition: transform .18s var(--ease); }
#cursor .t, #cursor .b { width: 1.5px; height: 6px; left: -.75px; }
#cursor .l, #cursor .r { height: 1.5px; width: 6px; top: -.75px; }
#cursor .t { top: -10px; }
#cursor .b { top: 4px; }
#cursor .l { left: -10px; }
#cursor .r { left: 4px; }
#cursor .d { width: 2px; height: 2px; left: -1px; top: -1px; }
#cursor.wide .t { transform: translateY(-4px); }
#cursor.wide .b { transform: translateY(4px); }
#cursor.wide .l { transform: translateX(-4px); }
#cursor.wide .r { transform: translateX(4px); }
#cursor.wide .d { transform: scale(0); }

.hit { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 31; pointer-events: none; }
.hit i {
  position: absolute;
  left: -4px;
  top: -.75px;
  width: 8px;
  height: 1.5px;
  background: #fff;
  animation: hit .3s ease-out forwards;
}
.hit i:nth-child(1) { --r: 45deg; }
.hit i:nth-child(2) { --r: 135deg; }
.hit i:nth-child(3) { --r: 225deg; }
.hit i:nth-child(4) { --r: 315deg; }
@keyframes hit {
  from { transform: rotate(var(--r)) translateX(7px); opacity: 1; }
  to { transform: rotate(var(--r)) translateX(13px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .item, .player, .panel, .panel .inner > * { transition: none !important; }
  .player.open .eq i { animation: none; }
}

@media (max-width: 819px) {
  .stage { justify-content: flex-start; padding-top: max(15vh, 84px); width: 100%; }
  .links { width: 100%; }
  .player { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .hud { left: auto; right: 16px; top: 16px; bottom: auto; font-size: 9.5px; }
}
