/* Show the Lyrics site. Dark like a Minecraft night, pink like the mod's own accent. */

:root {
  --bg: #0d0f15;
  --bg-2: #12151d;
  --card: #171b25;
  --card-2: #1d2230;
  --line: #272d3b;
  --text: #eef0f6;
  --muted: #98a0b3;
  --faint: #6b7385;
  --accent: #f090a8;
  --accent-2: #8fc9f2;
  --accent-ink: #20121a;
  --good: #7fe0bd;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --brand: "stl-righteous", var(--sans);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(240, 144, 168, .10), transparent 60%),
              radial-gradient(900px 500px at -10% 10%, rgba(143, 201, 242, .08), transparent 60%),
              var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--sans);
}
a { color: inherit; }
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px 56px; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }

/* ---- header ---- */

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px;
  background: rgba(13, 15, 21, .78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(39, 45, 59, .7);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #c98bf0);
  color: var(--accent-ink); font-size: 19px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(240, 144, 168, .35);
}
.brand-name { font: 21px/1 var(--brand); letter-spacing: .2px; white-space: nowrap; }
.top-nav { display: flex; align-items: center; gap: 8px; }
.top-nav > a:not(.button) { padding: 8px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; }
.top-nav > a:not(.button):hover { color: var(--text); background: var(--card); }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); text-decoration: none; cursor: pointer;
  font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
}
.button:hover { background: var(--card-2); border-color: #364055; }
.button:active { transform: translateY(1px); }
.button-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button-accent:hover { background: #f6a3b8; border-color: #f6a3b8; }
.button-small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }

.lang { position: relative; }
.lang-button {
  display: flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer;
}
.lang-button:hover { background: var(--card-2); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; margin: 0; padding: 6px;
  list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); max-height: 70vh; overflow: auto;
}
.lang-menu li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.lang-menu li:hover, .lang-menu li[aria-selected="true"] { background: var(--card-2); }
.lang-menu li[aria-selected="true"]::after { content: "✓"; color: var(--accent); }

/* ---- hero ---- */

.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 36px; align-items: center; padding: 48px 0 28px; }
.hero h1 { margin: 0; font: clamp(36px, 5vw, 58px)/1.05 var(--brand); letter-spacing: -.5px; }
.hero h1 span { background: linear-gradient(90deg, var(--accent), #c98bf0 55%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 16px 0 0; font-size: 18px; color: var(--muted); max-width: 520px; }
.hero .hero-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.hero .stage { aspect-ratio: 16 / 9; border-radius: 18px; box-shadow: var(--shadow); }

/* ---- gallery toolbar ---- */

.toolbar { display: flex; align-items: center; gap: 12px; margin: 20px 0 18px; flex-wrap: wrap; }
.tabs { display: inline-flex; padding: 4px; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.tabs button { padding: 7px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 600; }
.tabs button[aria-pressed="true"] { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px #343c4f; }
.search { flex: 1; min-width: 220px; position: relative; }
.search input {
  width: 100%; padding: 10px 12px 10px 38px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit;
}
.search input::placeholder { color: var(--faint); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }

/* ---- cards ---- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-2px); border-color: #353e52; box-shadow: var(--shadow); }
.card .stage { aspect-ratio: 16 / 8; border-radius: 0; }
.card-body { padding: 12px 14px 14px; display: grid; gap: 10px; }
.card-head { display: flex; align-items: baseline; gap: 10px; }
.card-name { margin: 0; font-size: 16px; font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-name a { text-decoration: none; }
.card-name a:hover { color: var(--accent); }
.likes { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.likes svg { color: var(--accent); }
.card-author { color: var(--faint); font-size: 13px; margin-top: -6px; }
.card-foot { display: flex; align-items: center; gap: 8px; }
.code {
  font: 600 13px/1 ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: .5px;
  padding: 8px 10px; border-radius: 8px; background: var(--bg-2); border: 1px dashed #3a4357; color: var(--accent-2);
}
.card-foot .spacer { flex: 1; }

.state { text-align: center; padding: 56px 16px; color: var(--muted); }
.state h2 { color: var(--text); margin: 0 0 6px; font: 22px var(--brand); }
.more { display: flex; justify-content: center; margin-top: 22px; }

/* ---- a look's own page ---- */

.back { display: inline-flex; align-items: center; gap: 6px; margin: 26px 0 16px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--text); }
.look { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.look .stage { aspect-ratio: 16 / 9; border-radius: 18px; box-shadow: var(--shadow); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 14px; }
.panel h1 { margin: 0; font: 28px/1.15 var(--brand); }
.panel .meta { display: flex; gap: 14px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.big-code { display: flex; gap: 8px; align-items: stretch; }
.big-code .code { flex: 1; font-size: 20px; padding: 12px 14px; text-align: center; }
.steps { margin: 0; padding-left: 20px; color: var(--muted); display: grid; gap: 4px; }
.panel h2 { margin: 6px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--faint); }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; }
.specs dt { color: var(--faint); }
.specs dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; }
.swatch { width: 12px; height: 12px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.note { color: var(--faint); font-size: 13px; }

/* ---- footer ---- */

.foot { padding: 26px 20px 34px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; text-align: center; }
.foot p { margin: 3px 0; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); opacity: 0;
  padding: 10px 16px; border-radius: 12px; background: var(--card-2); border: 1px solid #3a4357; box-shadow: var(--shadow);
  transition: opacity .2s, transform .2s; pointer-events: none; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 30px; gap: 24px; }
  .look { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  main { padding: 0 16px 40px; }
  .top { padding: 10px 16px; gap: 8px; }
  .brand-name { display: none; }
  .top-nav > a:not(.button) { display: none; }
  .lang-current { display: none; }
}

/* ---- the stage: a lyric line drawn in a look ---- */

.stage {
  position: relative; overflow: hidden; display: grid; place-items: center;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff8, transparent), radial-gradient(1.5px 1.5px at 72% 12%, #fff6, transparent),
    radial-gradient(1px 1px at 38% 30%, #fff7, transparent), radial-gradient(1px 1px at 88% 34%, #fff5, transparent),
    radial-gradient(1px 1px at 55% 8%, #fff6, transparent), radial-gradient(1.5px 1.5px at 22% 40%, #fff4, transparent),
    linear-gradient(180deg, #141a33 0%, #23315a 55%, #3b4a74 100%);
}
.stage::after {
  /* A strip of blocky hills, so outlines and glows have something to sit on. */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26%;
  background:
    linear-gradient(90deg, #1b2a1f 0 8%, #20331f 8% 15%, #1a2a1c 15% 27%, #22381f 27% 33%, #1c2c1d 33% 46%, #233a20 46% 52%,
      #1b2b1d 52% 66%, #21351f 66% 74%, #1a2a1c 74% 88%, #22371f 88% 100%);
  clip-path: polygon(0 40%, 8% 40%, 8% 20%, 15% 20%, 15% 50%, 27% 50%, 27% 30%, 33% 30%, 33% 45%, 46% 45%, 46% 15%, 52% 15%,
    52% 40%, 66% 40%, 66% 25%, 74% 25%, 74% 45%, 88% 45%, 88% 30%, 100% 30%, 100% 100%, 0 100%);
  opacity: .9;
}
.lyric { position: relative; z-index: 1; padding: 0 6%; text-align: center; line-height: 1.25; max-width: 100%; }
.lyric-idle, .lyric-inner { display: inline-block; }
.lyric-inner { position: relative; }
.lyric-inner.boxed { padding: .08em .3em; border-radius: 3px; }
.w { display: inline-block; white-space: pre; }
.ch, .chi { display: inline-block; white-space: pre; }
.layout-words .w:first-child { display: block; font-size: 1.5em; margin-bottom: .05em; }
.layout-words-tilted .w { transform: rotate(var(--tilt, 0deg)); margin: 0 .08em; }
.layout-words-tilted .w:first-child { display: block; font-size: 1.45em; }

/* entrances */
.phase-in[data-in="TYPEWRITER"] .ch { animation: stl-show 1ms steps(1) both; animation-delay: calc(var(--i) * var(--type, 45ms)); }
.phase-in[data-in="FADE"] .lyric-inner { animation: stl-fade-in .4s ease-out both; }
.phase-in[data-in="POP"] .lyric-inner { animation: stl-pop-in .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.phase-in[data-in="DROP"] .ch { animation: stl-drop-in .38s cubic-bezier(.2, .9, .3, 1.25) both; animation-delay: calc(var(--i) * 22ms); }
.phase-in[data-in="RISE"] .ch { animation: stl-rise-in .38s cubic-bezier(.2, .9, .3, 1.25) both; animation-delay: calc(var(--i) * 22ms); }
.phase-in[data-in="WAVE"] .ch { animation: stl-wave-in .55s ease-out both; animation-delay: calc(var(--i) * 38ms); }
.phase-in[data-in="WORDS"] .w { animation: stl-pop-in .4s cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: calc(var(--wi) * 220ms); }

/* exits */
.phase-out[data-out="TYPEWRITER"] .ch { animation: stl-hide 1ms steps(1) both; animation-delay: calc(var(--ri) * 18ms); }
.phase-out[data-out="FADE"] .lyric-inner { animation: stl-fade-out .45s ease-in both; }
.phase-out[data-out="POP"] .lyric-inner { animation: stl-pop-out .35s ease-in both; }
.phase-out[data-out="DROP"] .ch { animation: stl-drop-out .45s ease-in both; animation-delay: calc(var(--i) * 14ms); }
.phase-out[data-out="RISE"] .ch { animation: stl-rise-out .45s ease-in both; animation-delay: calc(var(--i) * 14ms); }
.phase-out[data-out="WAVE"] .ch { animation: stl-wave-out .45s ease-in both; animation-delay: calc(var(--i) * 26ms); }
.phase-out[data-out="DRIFT"] .ch { animation: stl-drift-out .75s ease-in both; animation-delay: calc(var(--i) * 22ms); }
.phase-out[data-out="WORDS"] .w { animation: stl-fade-out .3s ease-in both; animation-delay: calc(var(--wi) * 120ms); }
.phase-out[data-out="NONE"] .lyric-inner, .phase-gone .lyric-inner { opacity: 0; }

/* karaoke: the line fills in as it is sung */
.phase-hold.karaoke .ch { animation: stl-sing .25s linear both; animation-delay: calc(var(--i) * var(--sing, 60ms)); }
.phase-in.karaoke .ch, .phase-in.karaoke[data-in="FADE"] .lyric-inner .ch { filter: brightness(.45); }

/* idle motion, per letter */
.idle-wave .chi { animation: stl-wave calc(1.6s / var(--spd, 1)) ease-in-out infinite; animation-delay: calc(var(--i) * -.12s); }
.idle-bounce .chi { animation: stl-bounce calc(1.4s / var(--spd, 1)) ease-in-out infinite; animation-delay: calc(var(--i) * -.07s); }
.idle-shake .chi { animation: stl-shake calc(.2s / var(--spd, 1)) steps(2) infinite; animation-delay: calc(var(--i) * -.05s); }
/* idle motion, the whole line */
.idle-pulse .lyric-idle { animation: stl-pulse calc(1.1s / var(--spd, 1)) ease-in-out infinite; }
.idle-float .lyric-idle { animation: stl-float calc(2.6s / var(--spd, 1)) ease-in-out infinite; }
.idle-sway .lyric-idle { animation: stl-sway calc(2.4s / var(--spd, 1)) ease-in-out infinite; }

/* rainbow flow: every letter a step round the hue wheel, the wheel turning */
@property --hue { syntax: "<number>"; inherits: true; initial-value: 0; }
.rainbow-flow { animation: stl-hue calc(6s / var(--flow, 1)) linear infinite; }
.rainbow-flow .chi { color: hsl(calc((var(--hue) - var(--i) * 14) * 1deg) 72% 76%); }

.sparkle { position: absolute; width: .4em; height: .4em; pointer-events: none; color: #fff; font-size: .7em; line-height: 1; animation: stl-twinkle 1.6s ease-in-out infinite; }
.party-note { position: absolute; z-index: 0; bottom: -10%; font-size: 18px; opacity: 0; animation: stl-note 6s linear infinite; }

@keyframes stl-show { from { opacity: 0; } to { opacity: 1; } }
@keyframes stl-hide { from { opacity: 1; } to { opacity: 0; } }
@keyframes stl-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes stl-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes stl-pop-in { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes stl-pop-out { to { opacity: 0; transform: scale(.7); } }
@keyframes stl-drop-in { from { opacity: 0; transform: translateY(-.7em); } to { opacity: 1; transform: none; } }
@keyframes stl-rise-in { from { opacity: 0; transform: translateY(.7em); } to { opacity: 1; transform: none; } }
@keyframes stl-wave-in { 0% { opacity: 0; transform: translateY(.5em); } 60% { opacity: 1; transform: translateY(-.15em); } 100% { opacity: 1; transform: none; } }
@keyframes stl-drop-out { to { opacity: 0; transform: translateY(.8em); } }
@keyframes stl-rise-out { to { opacity: 0; transform: translateY(-.8em); } }
@keyframes stl-wave-out { 40% { transform: translateY(-.15em); } to { opacity: 0; transform: translateY(.45em); } }
@keyframes stl-drift-out { to { opacity: 0; transform: translate(.7em, -.3em) rotate(10deg); } }
@keyframes stl-sing { from { filter: brightness(.45); } to { filter: brightness(1); } }
@keyframes stl-wave { 0%, 100% { transform: translateY(calc(.1em * var(--amp, 1))); } 50% { transform: translateY(calc(-.1em * var(--amp, 1))); } }
@keyframes stl-bounce { 0%, 70%, 100% { transform: none; } 82% { transform: translateY(calc(-.22em * var(--amp, 1))); } }
@keyframes stl-shake { 0% { transform: translate(calc(.03em * var(--amp, 1)), calc(-.03em * var(--amp, 1))); } 100% { transform: translate(calc(-.03em * var(--amp, 1)), calc(.03em * var(--amp, 1))); } }
@keyframes stl-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(calc(1 + .06 * var(--amp, 1))); } }
@keyframes stl-float { 0%, 100% { transform: translateY(calc(.12em * var(--amp, 1))); } 50% { transform: translateY(calc(-.12em * var(--amp, 1))); } }
@keyframes stl-sway { 0%, 100% { transform: rotate(calc(-3deg * var(--amp, 1))); } 50% { transform: rotate(calc(3deg * var(--amp, 1))); } }
@keyframes stl-hue { from { --hue: 0; } to { --hue: 360; } }
@keyframes stl-twinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
@keyframes stl-note { 0% { opacity: 0; transform: translateY(0) rotate(-8deg); } 15% { opacity: .85; } 85% { opacity: .6; } 100% { opacity: 0; transform: translateY(-260px) rotate(12deg); } }

/* Less motion asked for: the site keeps still, the lyric previews still play (they are the look). */
@media (prefers-reduced-motion: reduce) {
  .card, .button, .toast { transition: none; }
  .card:hover { transform: none; }
}
