/* Palette sampled from the background: blade light, eye glow, violet shade. */
:root {
  --ink: #140a24;
  --text: #fbf7ff;
  --muted: rgba(246, 238, 255, .68);
  --faint: rgba(246, 238, 255, .42);
  --hair: rgba(255, 255, 255, .12);
  --blade: #ffb8ec;
  --violet: #a77bff;
  --eye: #ff4d6d;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI Variable", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 96px; background: var(--ink); }
body { margin: 0; color: var(--text); font: 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; letter-spacing: .005em; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
::selection { background: rgba(255, 184, 236, .45); }

/* ---------- Scene ---------- */
.scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--ink); }
.scene .art {
  position: absolute; inset: -4%;
  background: url("/assets/bg.webp") 62% 45% / cover no-repeat;
  filter: saturate(1.12) contrast(1.06) brightness(.8);
  transform: translate3d(var(--bx, 0), var(--by, 0), 0) scale(1.03);
  transition: transform 1.2s var(--ease), opacity 1.4s ease;
  opacity: 0;
}
.scene.ready .art { opacity: 1; }
/* The blade's light breathes; the eyes smoulder. Positions come from JS. */
.scene .glow {
  position: absolute; inset: 0; mix-blend-mode: screen; pointer-events: none;
  background:
    radial-gradient(38vmax 14vmax at var(--l1x, 46%) var(--l1y, 56%), rgba(255, 150, 230, .38), transparent 70%),
    radial-gradient(26vmax 12vmax at var(--l2x, 93%) var(--l2y, 70%), rgba(150, 90, 255, .32), transparent 70%),
    radial-gradient(6vmax 6vmax at var(--l3x, 60%) var(--l3y, 40%), rgba(255, 60, 100, .35), transparent 70%);
  animation: breathe 7s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
.scene .grade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(20, 8, 40, .78) 0%, rgba(20, 8, 40, .35) 45%, rgba(20, 8, 40, 0) 70%),
    linear-gradient(180deg, rgba(20, 8, 40, .25) 0%, rgba(20, 8, 40, .2) 40%, rgba(14, 5, 28, .82) 100%),
    rgba(14, 5, 28, var(--dim, 0));
}
.scene .cursor {
  position: absolute; left: 0; top: 0; width: 560px; height: 560px; margin: -280px 0 0 -280px;
  border-radius: 50%; pointer-events: none; mix-blend-mode: soft-light; opacity: 0;
  background: radial-gradient(closest-side, rgba(255, 200, 240, .9), rgba(170, 120, 255, .35) 45%, transparent 75%);
  transform: translate3d(var(--cx, -999px), var(--cy, -999px), 0);
  transition: opacity .6s ease;
}
.scene.pointer .cursor { opacity: .9; }
.scene .shader { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.4s ease; }
.scene.gl.ready .shader { opacity: 1; }
.scene.gl .art, .scene.gl .glow, .scene.gl .cursor { display: none; }
.scene.gl .grade { background: linear-gradient(90deg, rgba(20, 8, 40, .7) 0%, rgba(20, 8, 40, .28) 45%, rgba(20, 8, 40, 0) 70%), linear-gradient(180deg, rgba(20, 8, 40, .15) 0%, rgba(20, 8, 40, .1) 40%, rgba(14, 5, 28, .75) 100%), rgba(14, 5, 28, var(--dim, 0)); }

/* ---------- Liquid glass ---------- */
.glass {
  --r: 28px;
  position: relative; isolation: isolate;
  border-radius: var(--r);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05) 38%, rgba(255, 255, 255, .03) 62%, rgba(255, 255, 255, .09)),
    rgba(40, 18, 70, .22);
  -webkit-backdrop-filter: blur(26px) saturate(185%) brightness(1.04);
  backdrop-filter: blur(26px) saturate(185%) brightness(1.04);
  box-shadow:
    inset 0 1px .5px rgba(255, 255, 255, .45),
    inset 0 -1px .5px rgba(255, 255, 255, .08),
    inset 0 0 0 .5px rgba(255, 255, 255, .14),
    inset 0 0 28px rgba(255, 255, 255, .05),
    0 24px 60px -24px rgba(8, 0, 24, .75),
    0 2px 6px rgba(8, 0, 24, .25);
}
/* Rim light facing the scene's light source (--la, --li from JS). */
.glass::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1.2px; pointer-events: none;
  background: linear-gradient(var(--la, 200deg),
    rgba(255, 200, 242, calc(.95 * var(--li, .6))) 0%,
    rgba(255, 255, 255, .18) 22%, rgba(255, 255, 255, .04) 50%,
    rgba(255, 255, 255, .1) 78%, rgba(170, 125, 255, calc(.55 * var(--li, .6))) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* Reflections: the blade's glow on the facing side, plus the pointer's sheen. */
.glass::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(70% 90% at var(--lx, 30%) var(--ly, 120%), rgba(255, 150, 225, calc(.22 * var(--li, .6))), transparent 70%),
    radial-gradient(320px circle at var(--px, 50%) var(--py, -40%), rgba(255, 255, 255, var(--ps, 0)), transparent 70%);
  mix-blend-mode: screen;
  transition: --ps .4s ease;
}
@property --ps { syntax: "<number>"; inherits: false; initial-value: 0; }
.glass.lit { --ps: .14; }

/* Small glass controls (pills, chips). */
.pill {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; border: 0; cursor: pointer; font: inherit; color: var(--text); text-decoration: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .07));
  box-shadow: inset 0 1px .5px rgba(255, 255, 255, .55), inset 0 -1px .5px rgba(255, 255, 255, .1), inset 0 0 0 .5px rgba(255, 255, 255, .18), 0 6px 16px -8px rgba(8, 0, 24, .7);
  transition: transform .45s var(--spring), background .3s ease, box-shadow .3s ease;
}
.pill:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, .1)); }
.pill:active { transform: scale(.94); transition-duration: .12s; }

/* ---------- Bar ---------- */
.bar {
  --r: 999px;
  position: sticky; top: 14px; z-index: 3;
  display: flex; align-items: center; gap: 24px;
  width: min(1080px, calc(100% - 28px)); margin: 14px auto 0; height: 56px; padding: 0 10px 0 22px;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand .mark { font-weight: 800; font-size: 17px; letter-spacing: .02em; }
.brand .mark::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 4px; border-radius: 50%; background: var(--blade); box-shadow: 0 0 10px var(--blade); }
.brand .sub { color: var(--muted); font-size: 13px; }
.bar nav { display: flex; gap: 2px; margin-left: auto; font-size: 14px; }
.bar nav a { text-decoration: none; color: var(--muted); padding: 7px 14px; border-radius: 999px; transition: color .25s, background .25s; }
.bar nav a:hover { color: var(--text); background: rgba(255, 255, 255, .1); }
.lang select {
  appearance: none; font: inherit; font-size: 13px; color: var(--text); cursor: pointer;
  padding: 8px 30px 8px 14px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .1) url("/assets/chevron.svg") right 12px center no-repeat;
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .2);
  transition: background-color .25s;
}
.lang select:hover { background-color: rgba(255, 255, 255, .16); }
.lang option { color: #1b1030; }
@media (max-width: 640px) { .bar nav { display: none; } .lang { margin-left: auto; } }

main { width: min(1080px, calc(100% - 28px)); margin: 0 auto; }

/* ---------- Hero ---------- */
.hero { padding: clamp(72px, 14vh, 150px) 8px clamp(48px, 9vh, 96px); max-width: 640px; }
.eyebrow {
  display: inline-flex; gap: 8px; margin: 0 0 22px; padding: 6px 12px; border-radius: 999px;
  font: 500 12px/1 var(--mono); letter-spacing: .06em; color: var(--muted);
  background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.eyebrow b { color: var(--text); font-weight: 600; }
.hero h1 {
  margin: 0; font-size: clamp(38px, 6.4vw, 72px); line-height: 1.04; letter-spacing: -.035em; font-weight: 700;
  text-shadow: 0 2px 30px rgba(20, 8, 40, .55);
}
.lede { margin: 18px 0 0; color: var(--muted); font-size: clamp(16px, 1.7vw, 18px); max-width: 30em; text-shadow: 0 1px 16px rgba(20, 8, 40, .7); }
.stamp { margin: 22px 0 0; font: 12px var(--mono); color: var(--faint); }

/* ---------- Download cards ---------- */
.cards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 800px) { .cards { grid-template-columns: minmax(0, 1fr); } .card, .log, .verify { padding: 24px 20px; } }
.card { display: flex; flex-direction: column; gap: 20px; padding: 30px; min-width: 0; }
.tag { font: 600 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--blade); }
#server .tag { color: #c9b3ff; }
.card h2 { margin: 10px 0 0; font-size: 30px; letter-spacing: -.025em; font-weight: 700; }
.ver { margin: 6px 0 0; font: 500 14px var(--mono); color: var(--text); overflow-wrap: anywhere; }
.date { margin: 2px 0 0; font-size: 13px; color: var(--faint); }

.notes h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.notes ul { margin: 0; padding-left: 1.1em; color: var(--muted); }
.notes li + li { margin-top: 4px; }
.notes li::marker { color: var(--faint); }
.notes .fold { max-height: 8.6em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); transition: max-height .5s var(--ease); }
.notes .fold.open { max-height: 60em; -webkit-mask-image: none; mask-image: none; }
.link { font: inherit; font-size: 13px; color: var(--blade); background: none; border: 0; padding: 0; margin-top: 8px; cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.files { display: grid; gap: 10px; }
.file {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: center;
  padding: 14px 14px 12px 16px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03));
  box-shadow: inset 0 1px .5px rgba(255, 255, 255, .22), inset 0 0 0 .5px rgba(255, 255, 255, .1);
  transition: background .3s ease, transform .5s var(--spring);
}
.file:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .05)); }
.file .meta { display: flex; flex-direction: column; min-width: 0; }
.file .plat { font-weight: 600; }
.file .plat small { margin-left: 8px; font: 11px var(--mono); color: var(--faint); }
.file .size { font: 12px var(--mono); color: var(--muted); }
.file .name { display: none; }
.dl {
  grid-row: 1 / span 2; grid-column: 2;
  padding: 10px 18px; font-size: 14px; font-weight: 600;
  background: linear-gradient(180deg, rgba(255, 190, 240, .55), rgba(190, 120, 255, .35));
  box-shadow: inset 0 1px .5px rgba(255, 255, 255, .7), inset 0 -1px .5px rgba(255, 255, 255, .15), inset 0 0 0 .5px rgba(255, 255, 255, .3), 0 8px 24px -10px rgba(255, 120, 220, .8);
}
.dl:hover { background: linear-gradient(180deg, rgba(255, 200, 244, .7), rgba(200, 135, 255, .45)); box-shadow: inset 0 1px .5px rgba(255, 255, 255, .8), inset 0 0 0 .5px rgba(255, 255, 255, .35), 0 10px 30px -10px rgba(255, 120, 220, 1); }
.dl svg { width: 15px; height: 15px; transition: transform .45s var(--spring); }
.dl:hover svg { transform: translateY(2px); }
.sha { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-width: 0; margin-top: 6px; font: 11px var(--mono); color: var(--faint); }
.sha code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.ghost { padding: 3px 10px; font-size: 11px; }
.hint { margin: 0; font-size: 13px; color: var(--faint); }

/* ---------- Changelog ---------- */
.log { margin-top: 20px; padding: 30px 30px 26px; }
.log-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.log h2, .verify h2 { margin: 0; font-size: 28px; letter-spacing: -.025em; font-weight: 700; }
.filter {
  position: relative; display: flex; padding: 3px; border-radius: 999px;
  background: rgba(0, 0, 0, .18); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .14), inset 0 1px 3px rgba(0, 0, 0, .25);
}
.filter .thumb {
  position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, .12));
  box-shadow: inset 0 1px .5px rgba(255, 255, 255, .6), inset 0 0 0 .5px rgba(255, 255, 255, .22), 0 4px 12px -4px rgba(8, 0, 24, .6);
  transform: translateX(var(--tx, 3px)); width: var(--tw, 0);
  transition: transform .55s var(--spring), width .55s var(--spring);
}
.filter button {
  position: relative; z-index: 1; font: inherit; font-size: 13px; color: var(--muted);
  background: none; border: 0; padding: 6px 16px; border-radius: 999px; cursor: pointer; transition: color .25s;
}
.filter button[aria-selected="true"] { color: var(--text); }
.timeline { list-style: none; margin: 0; padding: 0; }
.entry { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 8px 28px; padding: 22px 0; border-top: 1px solid var(--hair); }
@media (max-width: 640px) { .entry { grid-template-columns: minmax(0, 1fr); } }
.entry .head { display: flex; flex-direction: column; gap: 2px; }
.entry .kind { font: 600 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--blade); }
.entry.server .kind { color: #c9b3ff; }
.entry code { font: 500 13px var(--mono); overflow-wrap: anywhere; }
.entry time { font-size: 12px; color: var(--faint); }
.entry .badge { align-self: flex-start; margin-top: 6px; font: 10px var(--mono); padding: 2px 8px; border-radius: 999px; color: var(--text); background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .2); }
.entry .badge.warn { color: #ffd0d8; background: rgba(255, 77, 109, .22); }
.entry h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.entry ul { margin: 0; padding-left: 1.1em; color: var(--muted); }
.entry li + li { margin-top: 3px; }
.entry li::marker { color: var(--faint); }
.entry .body { min-width: 0; }
.entry.hidden { display: none; }
.more { display: flex; margin: 18px auto 0; padding: 9px 20px; font-size: 13px; }
.source { margin: 18px 0 0; font-size: 12px; color: var(--faint); }
.source a { color: var(--muted); text-underline-offset: 3px; }

/* ---------- Verify ---------- */
.verify { margin: 20px 0 0; padding: 30px; }
.verify > p { color: var(--muted); max-width: 40em; }
.shell { display: grid; gap: 6px; margin-top: 16px; }
.shell p { margin: 10px 0 0; font-size: 12px; color: var(--faint); }
.shell pre { margin: 0; padding: 14px 16px; overflow-x: auto; border-radius: 16px; background: rgba(10, 4, 22, .42); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .12), inset 0 1px 4px rgba(0, 0, 0, .3); }
.shell code { font: 13px var(--mono); color: #ffe3f6; }

.foot { width: min(1080px, calc(100% - 28px)); margin: 0 auto; padding: 36px 8px 56px; font-size: 12px; color: var(--faint); }
.foot p { margin: 4px 0; max-width: 56em; }
.foot a { color: var(--muted); text-underline-offset: 3px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 5; --r: 999px;
  padding: 10px 18px; font-size: 13px;
  transform: translate(-50%, 16px) scale(.96); opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .5s var(--spring);
}
.toast.on { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ---------- Entrance ---------- */
.reveal { opacity: 0; transform: translateY(14px) scale(.985); transition: opacity .9s var(--ease), transform 1s var(--ease); }
.reveal.shown { opacity: 1; transform: none; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(36, 18, 62, .88); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .scene .cursor { display: none; }
}

@media (max-width: 700px) {
  .scene .grade, .scene.gl .grade { background: linear-gradient(180deg, rgba(20, 8, 40, .5) 0%, rgba(20, 8, 40, .55) 45%, rgba(14, 5, 28, .82) 100%), rgba(14, 5, 28, var(--dim, 0)); }
}

/* Liquid mode: the shader draws every glass surface; HTML keeps the content. */
html.liquid .glass, html.liquid .pill, html.liquid .file, html.liquid .shell pre, html.liquid .eyebrow,
html.liquid .lang select, html.liquid .filter .thumb {
  background-color: transparent; background-image: none;
  -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none;
}
html.liquid .lang select { background-image: url("/assets/chevron.svg"); }
html.liquid .glass::before, html.liquid .glass::after { display: none; }
html.liquid .card.reveal, html.liquid .log.reveal, html.liquid .verify.reveal { opacity: 1; transform: none; }
html.liquid .pill:hover { transform: scale(1.06); }
html.liquid .pill:active { transform: scale(.93); }
html.liquid .file { transition: transform .6s var(--spring); }
html.liquid .file:hover { transform: scale(1.012); }
html.liquid .filter { background: rgba(10, 4, 22, .35); }
