@font-face {
  font-family: "Unbounded";
  src: url("/fonts/unbounded-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Unbounded";
  src: url("/fonts/unbounded-cyrillic.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jbmono-latin.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jbmono-cyrillic.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  color-scheme: dark;
  --bg: #0b0a0d;
  --ink: #ecebf1;
  --muted: #85838f;
  --faint: #ffffff14;
  --don: #f04b3c;
  --kat: #4598e0;
  --display: "Unbounded", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --jp: "Noto Sans CJK JP", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

a { -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  background:
    radial-gradient(ellipse 60% 40% at 88% -5%, #f04b3c1c, transparent 70%),
    radial-gradient(ellipse 40% 35% at 100% 10%, #4598e014, transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E"),
    var(--bg);
  overflow-x: hidden;
}

::selection { background: var(--don); color: #fff; }

/* quiet language switch in the top-right corner */
.lang {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 2px;
  font: 0.72rem var(--mono);
  color: var(--muted);
  opacity: 0.55;
  transition: opacity .2s;
}
.lang:hover, .lang:focus-within { opacity: 1; }
.lang button {
  padding: 6px 4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.lang button[aria-pressed="true"] { color: var(--ink); }
.lang span { opacity: 0.5; }

/* drum face in the corner: don centre, kat rim; at the top of the page, clipped so it
   can't widen it */
.drums {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 700px;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.drum {
  position: absolute;
  top: -260px;
  right: -260px;
  width: 660px;
  height: 660px;
  z-index: 0;
  pointer-events: none;
}
.drum circle { fill: none; stroke-width: 1; }
.drum .c1 { stroke: var(--don); stroke-opacity: .16; }
.drum .c2 { stroke: var(--don); stroke-opacity: .08; }
.drum .c3 { stroke: var(--kat); stroke-opacity: .12; }
.drum .c4 { stroke: var(--kat); stroke-opacity: .05; }
.drum circle { transform-box: fill-box; transform-origin: center; }
/* lit by the lane: don hits the centre, kat the rim */
.drum.drum-hit { opacity: 0; will-change: opacity, transform; }
.drum-hit circle { stroke-width: 2; }
.drum-hit circle + circle { stroke-opacity: .5; }
.drum-hit.hd circle { stroke: var(--don); }
.drum-hit.hk circle { stroke: var(--kat); }

main {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 auto;
  padding: clamp(56px, 11vh, 120px) 0 48px;
}

/* hero */
h1 {
  margin: 0;
  font: 700 clamp(3.2rem, 13vw, 5.4rem)/0.95 var(--display);
  letter-spacing: -0.04em;
  display: flex;
  align-items: baseline;
}

.word, .word > span { display: inline-block; }

/* the full stop is a don note */
.note-dot {
  position: relative;
  display: inline-block;
  width: 0.24em;
  height: 0.24em;
  margin-left: 0.08em;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #ff8a7c, var(--don) 62%, #c8321f);
  box-shadow: 0 0 0 0.028em #fff, 0 0 0 0.05em #0009, 0 0 0.35em #f04b3c55;
}

.role {
  margin: 22px 0 0;
  font: 0.92rem/1.5 var(--mono);
  color: var(--muted);
}
.role em { font-style: normal; color: var(--ink); }
.role em b { font-weight: 500; color: var(--don); }

/* taiko lane */
.lane {
  --h: 54px;
  --tx: 34px;
  position: relative;
  height: var(--h);
  margin-top: 30px;
  border-block: 1px solid;
  /* fades out on the right like the notes (no mask-image: it made phones repaint the lane every frame) */
  border-image: linear-gradient(90deg, var(--faint) 85%, transparent) 1;
  background: linear-gradient(90deg, #ffffff0a, #ffffff03 40%, transparent);
  overflow: hidden;
}
/* notes and bar lines are drawn here by the page script */
.lane .notes {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}
.lane .target {
  position: absolute;
  left: var(--tx);
  top: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  border: 2px solid #ffffff3a;
  box-shadow: inset 0 0 0 5px var(--bg), inset 0 0 0 6px #ffffff1f;
}
.lane .n {
  position: absolute;
  top: 50%;
  left: 0;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border-radius: 50%;
  box-shadow: 0 0 0 2.5px #fff, 0 0 0 4px #0009;
  will-change: transform;
}
.lane .n.big { width: 34px; height: 34px; margin: -17px 0 0 -17px; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #0009; }
.lane .n.d { background: radial-gradient(circle at 38% 32%, #ff8a7c, var(--don) 62%, #c8321f); }
.lane .n.k { background: radial-gradient(circle at 38% 32%, #8cc4f5, var(--kat) 62%, #2c6fb0); }
/* kiai: the lane flashes on every beat */
.lane .kf {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ff8a1a33, #ff8a1a0d 55%, transparent);
  opacity: 0;
}
.lane .target { transition: border-color .3s; }
.lane.kiai .target { border-color: #ff8a1a99; }
/* a cleared map: a light sweep and the rank */
.lane .sweep {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 30%;
  background: linear-gradient(90deg, transparent, #ffffff1c, transparent);
  transform: translateX(-100%);
}
.lane .result {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 20001;
  display: flex;
  align-items: baseline;
  gap: 10px;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.lane .result b {
  font: 700 1.7rem/1 var(--display);
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff6c8, #ffd75e 55%, #e8a21c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px #ffb80066);
}
.lane .result span { font: 500 0.8rem var(--mono); color: var(--ink); }
.lane .judge {
  position: absolute;
  left: var(--tx);
  top: 50%;
  translate: -50% -50%;
  font: 700 1.05rem var(--jp);
  color: #ffd75e;
  text-shadow: 0 0 8px #ffb80080;
  z-index: 20000;  /* above notes, which are stacked by z-index */
  opacity: 0;
  pointer-events: none;
}

.np {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 10px;
  min-width: 0;
  font: 0.78rem/1.5 var(--mono);
  color: var(--muted);
  text-decoration: none;
}
.np-label { flex: none; color: var(--don); }
.np-title {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink);
  transition: color .2s;
}
.np-diff {
  flex: 0 1 auto;
  max-width: 45%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.np:hover .np-title { color: var(--don); }
.np-combo {
  flex: none;
  margin-left: auto;
  padding-left: 6px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}
.links a {
  --dot: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px 8px 13px;
  border: 1px solid var(--faint);
  border-radius: 999px;
  color: var(--ink);
  font: 0.86rem var(--mono);
  text-decoration: none;
  background: #ffffff05;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.links a::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 0 8px var(--dot);
}
.links a:hover {
  border-color: var(--dot);
  background: #ffffff0a;
  box-shadow: 0 0 16px -6px var(--dot);
}
.motion .links a:hover::before { animation: dot-hit .45s ease-out; }

/* sections */
section { margin-top: 88px; }
h2 {
  margin: 0 0 14px;
  font: 500 0.75rem var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

/* BN request status: a row in the same style as the project list */
.rows .queue-row { --c: var(--muted); }
.rows .queue-row[data-state="open"] { --c: #3ba55d; }
.rows .queue-row[data-state="closed"] { --c: var(--don); }
.queue-row .num { display: flex; align-items: center; height: 1.47rem; }
.qdot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.queue-row .name em { font-style: normal; color: var(--c); }
.prefs { display: grid; gap: 2px; margin-top: 6px; font: 0.8rem/1.6 var(--mono); color: var(--muted); }
.prefs b { margin-right: 0.5em; font-weight: 500; color: var(--ink); }

/* Discord server: a row like the others, server icon in place of the number */
.rows .server-row { --c: #5865f2; }
.server-row .num { display: flex; align-items: flex-start; }
.server-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 0 0 1px #ffffff1a;
}
.server-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  margin-top: 2px;
  font: 0.8rem/1.6 var(--mono);
  color: var(--muted);
}
.server-meta > span { display: inline-flex; align-items: center; gap: 7px; }
.server-meta > span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6f6d78;
}
.server-meta .on::before { background: #3ba55d; box-shadow: 0 0 6px #3ba55d; }
.server-meta b { color: var(--ink); font-weight: 500; }

/* project with a gameplay clip under its description */
.clip {
  display: block;
  margin-top: 8px;
  aspect-ratio: 960 / 678;
  overflow: hidden;
  border-radius: 12px;
  background: #05090b;
  box-shadow: 0 0 0 1px var(--faint);
  transition: box-shadow .25s;
}
.clip video { display: block; width: 100%; height: 100%; object-fit: cover; }
.rows a:hover .clip { box-shadow: 0 0 0 1px var(--c), 0 0 24px -6px var(--c); }

.rows { position: relative; list-style: none; margin: 0; padding: 1px 0 0; }
.rows::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--faint);
  transform-origin: left;
}
.rows li { border-bottom: 1px solid var(--faint); }
.rows a {
  --c: var(--don);
  position: relative;
  display: grid;
  grid-template-columns: 2.4rem 1fr auto;
  gap: 16px;
  padding: 22px 4px;
  color: inherit;
  text-decoration: none;
}
.rows li:nth-child(even) a { --c: var(--kat); }
.rows a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: var(--c);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s cubic-bezier(.2,.7,.3,1);
}
.rows a:hover::after { transform: scaleX(1); }
.num { font: 0.8rem/1.9 var(--mono); color: var(--muted); }
.body { display: grid; gap: 6px; }
.name { font: 600 1.05rem/1.4 var(--display); letter-spacing: -0.01em; transition: color .2s; }
.desc { color: var(--muted); font-size: 0.93rem; }
.go {
  font: 1.1rem var(--mono);
  color: var(--muted);
  transition: transform .25s, color .2s;
}
.rows a:hover .name, .rows a:hover .go { color: var(--c); }
.rows a:hover .go { transform: translate(3px, -3px); }

footer {
  margin-top: 96px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font: 0.78rem var(--mono);
  color: var(--muted);
}

a:focus-visible { outline: 2px solid var(--kat); outline-offset: 3px; border-radius: 6px; }

/* phones */
@media (max-width: 520px) {
  main { padding: 48px 0 40px; }

  h1 { font-size: clamp(3.2rem, 18.5vw, 5.4rem); }

  .role { margin-top: 18px; font-size: 0.88rem; }
  .role em { display: block; }
  .role .sep { display: none; }

  /* the lane runs edge to edge like a playfield */
  .lane { margin: 26px -20px 0; --h: 58px; }

  .np {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 10px;
    row-gap: 2px;
    margin-top: 12px;
  }
  .np { grid-template-columns: auto 1fr auto; }
  .np-label { grid-area: 1 / 1; }
  .np-diff { grid-area: 1 / 2; max-width: none; }
  .np-combo { grid-area: 1 / 3; }
  .np-title {
    grid-area: 2 / 1 / 3 / 4;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  /* link-in-bio style buttons */
  .links { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 28px; }
  .links a { padding: 14px 18px 14px 16px; font-size: 0.92rem; border-radius: 14px; }
  .links a::after { content: "↗"; margin-left: auto; color: var(--muted); }

  section { margin-top: 64px; }
  .rows .queue-row { grid-template-columns: 10px 1fr auto; gap: 14px; }
  .queue-row .num { display: flex; }
  .rows .server-row { grid-template-columns: 26px 1fr auto; gap: 14px; }
  .server-row .num { display: flex; }
  .server-icon { width: 26px; height: 26px; border-radius: 8px; }
  .rows a { grid-template-columns: 1fr auto; padding: 20px 2px; }
  .clip { border-radius: 10px; }
  .num { display: none; }
  footer { margin-top: 56px; }

  .drum { width: 420px; height: 420px; top: -230px; right: -230px; opacity: .7; }
}

/* ---- motion: only with html.motion, which is set when reduced motion isn't asked for ---- */

/* ?fps meter */
.fps {
  position: fixed;
  left: 8px;
  bottom: 8px;
  z-index: 10;
  padding: 4px 8px;
  border-radius: 6px;
  background: #000c;
  font: 12px var(--mono);
  color: #3ba55d;
}

/* a judgement where a link is pressed */
.tap {
  position: fixed;
  z-index: 10;
  font: 700 1.1rem var(--jp);
  color: #ffd75e;
  text-shadow: 0 0 8px #ffb80080;
  pointer-events: none;
}

/* the intro plays like the start of a map: the drum rings open, the letters land one by
   one, the full stop scrolls in as a don note and gets hit, then the lane and links pop in */
.intro .drum > circle { animation: ring-in 1.1s cubic-bezier(.2,.7,.3,1) backwards; }
.intro .drum .c2 { animation-delay: .08s; }
.intro .drum .c3 { animation-delay: .16s; }
.intro .drum .c4 { animation-delay: .24s; }

.intro h1 .word > span {
  animation: letter-in .55s cubic-bezier(.2,.8,.3,1.15) backwards;
  animation-delay: calc(60ms + var(--i) * 55ms);
}

/* hidden until its flying copy (.flying, added by the page script) lands on it */
.intro .note-dot:not(.landed):not(.flying) { opacity: 0; }
.note-dot.flying { position: absolute; margin: 0; }
.note-dot.landed { animation: dot-land .32s ease-out; }
/* the hit on landing: 良 above it and a ring */
.note-dot::before {
  content: "良";
  position: absolute;
  left: 50%;
  bottom: 125%;
  translate: -50% 0;
  font: 700 0.24em/1 var(--jp);
  color: #ffd75e;
  text-shadow: 0 0 8px #ffb80080;
  opacity: 0;
  pointer-events: none;
}
.note-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #ffd75e, 0 0 14px #f04b3c;
  opacity: 0;
  pointer-events: none;
}
.note-dot.landed::before { animation: judge-up .6s ease-out; }
.note-dot.landed::after { animation: ring-burst .55s ease-out; }

.intro .role { animation: wipe .7s cubic-bezier(.3,.6,.3,1) .45s backwards; }
.intro .lane { animation: wipe .6s cubic-bezier(.3,.6,.3,1) .55s backwards; }
.intro .lane .target { animation: pop .45s cubic-bezier(.3,1.6,.5,1) .85s backwards; }

.intro .links a { animation: pill-in .5s cubic-bezier(.2,.8,.3,1.1) .8s backwards; }
.intro .links a::before { animation: dot-hit .45s ease-out 1.05s; }
.intro .links a:nth-child(2), .intro .links a:nth-child(2)::before { animation-delay: .87s; }
.intro .links a:nth-child(3), .intro .links a:nth-child(3)::before { animation-delay: .94s; }
.intro .links a:nth-child(2)::before { animation-delay: 1.12s; }
.intro .links a:nth-child(3)::before { animation-delay: 1.19s; }

.intro .lang { animation: fade-in .6s ease-out 1s backwards; }

/* sections come in from the right like notes once scrolled into view; --d0 holds the
   ones already on screen until the intro is over */
.motion section > h2 {
  clip-path: inset(-20% -5% -20% 0);
  transition: clip-path .5s cubic-bezier(.2,.7,.3,1) var(--d0, 0ms);
}
.motion section:not(.in) > h2 { clip-path: inset(-20% 100% -20% 0); }
.motion .rows::before { transition: transform .8s cubic-bezier(.2,.7,.3,1) calc(var(--d0, 0ms) + 60ms); }
.motion section:not(.in) .rows::before { transform: scaleX(0); }
.motion .rows > li {
  transition: opacity .45s ease-out, transform .65s cubic-bezier(.2,.8,.3,1);
  transition-delay: calc(var(--d0, 0ms) + 120ms + var(--i, 0) * 80ms);
}
.motion section:not(.in) .rows > li { opacity: 0; transform: translateX(min(48px, 4vw)); }
/* and get hit when they land */
.motion section.in .rows .num { animation: num-hit .5s ease-out calc(var(--d0, 0ms) + 460ms + var(--i, 0) * 80ms); }
.motion .queue-row[data-state="open"] .qdot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--c);
  animation: radar 2.4s ease-out infinite;
}
.motion .server-meta .on::before { animation: breathe 2.4s ease-in-out infinite; }

@keyframes ring-in { from { opacity: 0; transform: scale(.4); } }
@keyframes letter-in { from { opacity: 0; transform: translateY(.45em) scale(.9); filter: blur(8px); } }
@keyframes dot-land { 30% { transform: scale(1.35); } }
@keyframes judge-up {
  0% { opacity: 1; transform: translateY(0) scale(1.2); }
  100% { opacity: 0; transform: translateY(-14px) scale(1); }
}
@keyframes ring-burst {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(3.4); }
}
@keyframes wipe {
  from { clip-path: inset(-20% 100% -20% 0); }
  to { clip-path: inset(-20% -5% -20% 0); }
}
@keyframes pop { from { opacity: 0; transform: scale(0); } }
@keyframes pill-in { from { opacity: 0; transform: translateY(10px) scale(.94); } }
@keyframes dot-hit { 35% { transform: scale(1.9); box-shadow: 0 0 12px 3px var(--dot); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes num-hit { 35% { color: var(--c); text-shadow: 0 0 12px var(--c); transform: scale(1.18); } }
@keyframes radar {
  0% { opacity: .6; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(3.2); }
}
@keyframes breathe { 50% { opacity: .45; } }

@media (prefers-reduced-motion: reduce) {
  .links a, .rows a::after, .go, .clip { transition: none; }
}
