/* ============================================================
   Design tokens. The page is light: white ground, black text,
   red for the active state and a purple-to-red gradient for the
   main actions. Light text is kept for copy that sits on key
   art, and the dark glass tokens for the image lightbox.
   ============================================================ */
:root {
  color-scheme: light;
  --ink: #000000;
  --ink-2: #787878;
  --ink-3: #ABABAB;
  --track: #EBE8F1;
  --row-hover: #EEEBF3;
  --red: #EC4727;
  --purple: #7E2FDC;
  --grad-btn: linear-gradient(90deg, #7E2FDC 0%, #DE4C4B 100%);
  --grad-title: linear-gradient(90deg, #953FB0 0%, #DE714B 100%);
  --wash: 60, 43, 85;
  --paper-grey: #F3F3F3;
  --soft-shadow: 0 12px 30px rgba(60, 43, 85, 0.12);
  /* The caution box of the download dialog and the mark of a community
     build: warm, and apart from the red the page uses for what is active. */
  --notice-bg: #FFF7E8;
  --notice-line: #F1DDB4;
  --notice-ink: #7A4E0A;
  --notice-mark: #D48806;
  --art-text:   #F2F4F8;
  --art-text-2: rgba(235, 240, 248, 0.82);
  --art-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  --glass:        rgba(13, 15, 20, 0.60);
  --stroke:       rgba(255, 255, 255, 0.10);
  --text-3: rgba(226, 232, 244, 0.46);
  --bg: #FFFFFF;
  --font: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "JetBrains Mono", monospace;
  --container: 1280px;
  --topbar-h: 72px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
code { font-family: var(--mono); font-size: 0.92em; padding: 1px 6px; border-radius: 6px; background: var(--row-hover); color: #513879; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
.container { width: min(var(--container), 100% - 48px); margin-inline: auto; }
section[id] { scroll-margin-top: var(--topbar-h); }

/* Told to a visitor whose browser runs no scripts, above everything else. */
.noscript {
  position: relative; z-index: 60;
  padding: calc(var(--topbar-h) + 12px) 24px 14px;
  background: var(--row-hover);
  color: var(--ink);
  font-size: 14px;
  text-align: center;
}
.noscript a { color: var(--purple); text-decoration: underline; }

/* Skip link for keyboard users, visible only when focused. */
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: 999px; background: #FFF; color: var(--ink); box-shadow: var(--soft-shadow); }
.skip:focus { top: 16px; }

/* Inline SVG icons injected by the script share one sizing rule. */
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }
[data-icon] svg { width: 1em; height: 1em; display: block; }

/* ============================================================
   Top bar. Transparent with light text over the key art, white
   with dark text once scrolled.
   ============================================================ */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  color: var(--art-text);
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease, color .3s ease;
  /* The room in the bar, given up in three steps as the window narrows:
     first the community icons fold into one menu button, then the links
     sit closer together, then the links fold into the drawer and the
     actions move to the edge. Nothing is left out in any step. The steps
     are the classes `compact`, `tight` and `folded`, which the script
     sets when the contents do not fit, and the media rules at the end of
     this file, which do the same at the widths measured for the built-in
     labels. */
  --bar-gap: 28px;
  --link-pad: 17px;
  --socials-display: flex;
  --contact-display: none;
  --nav-display: flex;
  --menu-display: none;
  --actions-push: 0;
}
.topbar.compact { --socials-display: none; --contact-display: block; }
.topbar.tight { --bar-gap: 18px; --link-pad: 12px; }
.topbar.folded { --nav-display: none; --menu-display: flex; --actions-push: auto; }
.topbar.scrolled {
  background: rgba(255, 255, 255, 0.97);
  border-color: var(--track);
  box-shadow: 0 2px 14px rgba(60, 43, 85, 0.06);
  color: var(--ink);
}
.topbar-inner {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: var(--bar-gap);
  width: min(1440px, 100% - 48px);
  margin-inline: auto;
}
/* Nothing in the top bar wraps or shrinks, whatever the language, and
   every language keeps every element at the same size. */
.brand, .bar-menu, .actions { flex: none; }
.brand .name, .brand .sub, .nav a { white-space: nowrap; }
/* Korean breaks lines between words, never inside one. */
html:lang(ko) body { word-break: keep-all; }
/* Latin text runs longer than the same heading in Chinese, so the first
   screen's heading is set smaller in English to keep its two lines. */
html:lang(en) h1 { font-size: clamp(34px, 4.8vw, 66px); }
.brand { display: flex; align-items: center; gap: 13px; user-select: none; }
.brand img { width: 44px; height: 44px; border-radius: 11px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand .name { font-size: 20px; text-shadow: var(--art-shadow); }
.brand .sub { margin-top: 3px; font-size: 10px; letter-spacing: 3.5px; color: rgba(255, 255, 255, 0.72); text-shadow: var(--art-shadow); }
/* The spaced tagline is set for Chinese; Latin, Japanese and Korean run
   longer at that spacing, so they get less of it. */
html:lang(en) .brand .sub { letter-spacing: 1.5px; }
html:lang(ja) .brand .sub, html:lang(ko) .brand .sub { letter-spacing: 2px; }
.scrolled .brand img { box-shadow: 0 2px 8px rgba(60, 43, 85, 0.2); }
.scrolled .brand .name { text-shadow: none; }
.scrolled .brand .sub { color: var(--ink-2); text-shadow: none; }

.nav { display: var(--nav-display); gap: 4px; margin-left: auto; }
.nav a {
  padding: 8px var(--link-pad);
  border-radius: 999px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: var(--art-shadow);
  transition: background .15s ease, color .15s ease;
}
.nav a:hover { background: rgba(255, 255, 255, 0.14); color: #FFF; }
.nav a.active { background: #FFF; color: var(--ink); text-shadow: none; }
.scrolled .nav a { color: #333333; text-shadow: none; }
.scrolled .nav a:hover { background: var(--paper-grey); color: var(--ink); }
.scrolled .nav a.active { background: var(--row-hover); color: var(--ink); font-weight: 700; }
/* Three links carry a menu: a card under the link, shown while the
   pointer or the focus is on the link or on the card, which reaches up to
   the link so the pointer can cross the gap. The drawer lists the items
   under their link instead. */
.nav-group { position: relative; display: flex; }
.nav-menu {
  position: absolute; left: 50%; top: calc(100% + 8px); z-index: 60;
  display: none;
  min-width: 150px;
  padding: 6px;
  border-radius: 14px;
  list-style: none;
  background: #FFFFFF;
  border: 1px solid var(--track);
  box-shadow: 0 16px 40px rgba(60, 43, 85, 0.18);
  transform: translateX(-50%);
}
.nav-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.nav-group:focus-within .nav-menu, .nav-group.open .nav-menu { display: block; }
.nav-group:focus-within > a, .nav-group.open > a { background: rgba(255, 255, 255, 0.14); color: #FFF; }
.scrolled .nav-group:focus-within > a, .scrolled .nav-group.open > a { background: var(--paper-grey); color: var(--ink); }
/* Escape closes a menu the keyboard opened, until the focus leaves. */
.nav-group.closed .nav-menu { display: none; }
/* The pointer opens a menu only where one hovers; elsewhere a tap would
   leave the menu open under a hover that sticks to the tapped link. The
   pointer also opens a menu the keyboard closed. */
@media (hover: hover) {
  .nav-group:hover .nav-menu { display: block; }
  .nav-group:hover > a { background: rgba(255, 255, 255, 0.14); color: #FFF; }
  .scrolled .nav-group:hover > a { background: var(--paper-grey); color: var(--ink); }
}
.nav .nav-menu a {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 14px;
  color: #333333;
  text-shadow: none;
}
.nav .nav-menu a:hover { background: var(--paper-grey); color: var(--ink); }
.nav-menu small { font-size: 11px; color: var(--ink-3); }
/* A tab reached by its address stops under the bar, not behind it. */
[role="tab"] { scroll-margin-top: calc(var(--topbar-h) + 24px); }

.actions { display: flex; align-items: center; gap: 4px; margin-left: var(--actions-push); }
.socials { display: var(--socials-display); gap: 4px; }
.iconbtn {
  width: 36px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  color: inherit;
  transition: background .15s ease;
}
.iconbtn:hover { background: rgba(255, 255, 255, 0.14); }
.iconbtn svg { width: 17px; height: 17px; display: block; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.65)); }
.iconbtn b { font-size: 15px; font-weight: 700; }
/* The dark icon on the white bar needs its inner glyph light. */
.scrolled .iconbtn { color: #333333; --glyph: #FFFFFF; }
.scrolled .iconbtn:hover { background: var(--paper-grey); color: var(--ink); }
.scrolled .iconbtn svg { filter: none; }
.sep { width: 1px; height: 15px; background: rgba(255, 255, 255, 0.3); margin: 0 8px; }
.scrolled .sep { background: #DADADA; }

/* The two menus among the icon buttons are native disclosures: the language
   menu behind a globe, and the folded form of the community links behind a
   menu button, which the bar shows in place of the icon row when the row
   does not fit. Each summary is styled as one of the icon buttons and each
   list drops down as a white card. */
.bar-menu { position: relative; }
.contact { display: var(--contact-display); }
.bar-menu summary {
  width: 36px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  list-style: none;
  color: inherit;
  cursor: pointer;
  user-select: none;
  transition: background .15s ease;
}
.bar-menu summary::-webkit-details-marker { display: none; }
.bar-menu summary:hover, .bar-menu[open] summary { background: rgba(255, 255, 255, 0.14); }
.bar-menu summary [data-icon] { width: 17px; height: 17px; display: block; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.65)); }
.bar-menu summary [data-icon] svg { width: 100%; height: 100%; display: block; }
.scrolled .bar-menu summary { color: #333333; }
.scrolled .bar-menu summary:hover, .scrolled .bar-menu[open] summary { background: var(--paper-grey); color: var(--ink); }
.scrolled .bar-menu summary [data-icon] { filter: none; }
.bar-menu ul {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 150px;
  padding: 6px;
  border-radius: 14px;
  list-style: none;
  background: #FFFFFF;
  border: 1px solid var(--track);
  box-shadow: 0 16px 40px rgba(60, 43, 85, 0.18);
}
.bar-menu ul a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 14px;
  color: #333333;
  white-space: nowrap;
}
.bar-menu ul a:hover { background: var(--paper-grey); color: var(--ink); }
.bar-menu ul a[aria-current="true"] { background: var(--row-hover); color: var(--ink); font-weight: 700; }
/* The community links keep their icons in the folded list. The dark icon on
   the white card needs its inner glyph light. */
.bar-menu ul .mark { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; flex: none; --glyph: #FFFFFF; }
.bar-menu ul .mark svg { width: 16px; height: 16px; display: block; }
.bar-menu ul .mark b { font-size: 13px; font-weight: 700; }
.menu-btn { display: var(--menu-display); }

/* Drawer form of the nav on narrow screens. */
.nav.open {
  display: flex;
  position: fixed;
  top: var(--topbar-h);
  left: 16px; right: 16px;
  max-height: calc(100vh - var(--topbar-h) - 16px);
  max-height: calc(100dvh - var(--topbar-h) - 16px);
  overflow: auto;
  flex-direction: column;
  padding: 10px;
  border-radius: 16px;
  background: #FFFFFF;
  border: 1px solid var(--track);
  box-shadow: 0 16px 40px rgba(60, 43, 85, 0.18);
}
.nav.open a { color: #333333; text-shadow: none; }
.nav.open a:hover { background: var(--paper-grey); color: var(--ink); }
.nav.open a.active { background: var(--row-hover); color: var(--ink); font-weight: 700; }
.nav.open .nav-group { flex-direction: column; }
.nav.open .nav-menu { position: static; display: block; min-width: 0; padding: 0 0 4px 14px; border: 0; box-shadow: none; transform: none; }
.nav.open .nav-menu::before { display: none; }

/* ============================================================
   Buttons. The main action is a purple-to-red pill with a light
   badge; the secondary action is a white pill.
   ============================================================ */
.cta {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  height: 55px;
  padding: 0 34px 0 62px;
  border-radius: 999px;
  background: var(--grad-btn);
  color: #FFFFFF;
  font-size: 19px;
  white-space: nowrap;
  box-shadow: 0 10px 28px rgba(126, 47, 220, 0.32);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.cta:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 16px 36px rgba(126, 47, 220, 0.42); }
.cta:active { transform: translateY(0); filter: brightness(0.93); }
.cta .badge {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  font-size: 19px;
}
.cta .badge svg { width: 1em; height: 1em; display: block; }
.cta.sm { height: 42px; padding: 0 22px 0 48px; font-size: 15px; box-shadow: 0 6px 18px rgba(126, 47, 220, 0.28); }
.cta.sm .badge { left: 7px; width: 30px; height: 30px; font-size: 15px; }

.ghost {
  display: inline-flex; align-items: center; gap: 10px;
  height: 55px;
  padding: 0 28px;
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--ink);
  font-size: 17px;
  white-space: nowrap;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  transition: background .18s ease, transform .18s ease;
}
.ghost:hover { background: var(--row-hover); transform: translateY(-2px); }
.ghost [data-icon] { color: var(--red); }
.ghost [data-icon] { font-size: 16px; transition: transform .18s ease; }
.ghost:hover [data-icon] { transform: translateX(3px); }

/* ============================================================
   Hero. Three key-art layers crossfade under a slow zoom; a
   purple-black scrim keeps the copy on the left readable, and
   the bottom fades into the white page. Every layer keeps its
   zoom running, so a layer fading out does not jump back.
   ============================================================ */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden; background: #0F071E; color: var(--art-text); }
.hero-bg { position: absolute; inset: 0; }
.bg-layer {
  position: absolute;
  inset: -4%;
  background: center / cover no-repeat;
  opacity: 0;
  transition: opacity 1.8s ease;
  animation: kenburns 26s ease-in-out infinite alternate;
  will-change: transform, opacity;
}
.bg-layer.visible { opacity: 1; }
/* The first picture shows even when no script runs; the rotation fades the
   others over it and back. */
.bg-layer:first-child { opacity: 1; }
@keyframes kenburns {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.08) translate(-1.6%, 1%); }
}
.scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(18, 9, 34, 0.78) 0%, rgba(18, 9, 34, 0.44) 42%, rgba(18, 9, 34, 0.06) 72%, rgba(18, 9, 34, 0) 100%);
}
.vignette { position: absolute; left: 0; right: 0; pointer-events: none; }
.vignette.top { top: 0; height: 200px; background: linear-gradient(180deg, rgba(15, 7, 30, 0.58), transparent); }
.vignette.bottom { bottom: 0; height: 26%; background: linear-gradient(0deg, #FFFFFF 0%, rgba(255, 255, 255, 0.72) 30%, rgba(255, 255, 255, 0) 100%); }
.vignette.corner { top: 0; right: 0; left: auto; width: 520px; height: 180px; background: radial-gradient(ellipse at top right, rgba(15, 7, 30, 0.6), transparent 72%); }
#motes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: screen; }

.hero-inner {
  position: relative; z-index: 2;
  width: min(1440px, 100% - 48px);
  margin: auto;
  padding: 140px 0 120px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}
.hero-copy { animation: fadeSlideUp .8s .1s ease both; }
.pill.status {
  display: inline-flex; align-items: center; gap: 10px;
  height: 34px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  font-size: 13px;
  color: #333333;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 2.2s ease-out infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(236, 71, 39, 0.5); }
  70%  { box-shadow: 0 0 0 10px rgba(236, 71, 39, 0); }
  100% { box-shadow: 0 0 0 0 rgba(236, 71, 39, 0); }
}
.eyebrow { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 700; letter-spacing: 4px; color: var(--red); margin: 0 0 12px; }
.eyebrow::before { content: ""; width: 28px; height: 2px; border-radius: 2px; background: var(--red); }
.hero .eyebrow { margin-top: 28px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55); }
h1 {
  font-size: clamp(38px, 6.2vw, 86px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}
h1 .grad {
  background: linear-gradient(90deg, #DDB0FF 0%, #F4A27E 50%, #DDB0FF 100%);
  background-size: 200% 100%;
  animation: shimmer 9s ease-in-out infinite;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 24px rgba(149, 63, 176, 0.35));
}
@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.lede { max-width: 600px; margin: 22px 0 34px; font-size: 17px; color: var(--art-text-2); text-shadow: var(--art-shadow); }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.scroll-hint {
  position: absolute; z-index: 3;
  left: 50%; bottom: 28px;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 2px solid rgba(0, 0, 0, 0.26);
  border-radius: 14px;
  transition: border-color .2s ease;
}
.scroll-hint:hover { border-color: var(--ink); }
.scroll-hint span {
  position: absolute; left: 50%; top: 7px;
  width: 4px; height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--ink-2);
  animation: wheel 1.8s ease-out infinite;
}
@keyframes wheel {
  0%   { transform: translateY(0); opacity: 1; }
  70%  { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(14px); opacity: 0; }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   Section shell of the news and the entrance used by content
   blocks.
   ============================================================ */
.section { position: relative; padding: 120px 0; overflow: hidden; }
.section .container { position: relative; z-index: 1; }
.section-head { max-width: 760px; margin-bottom: 56px; }
h2 { font-size: clamp(32px, 4vw, 48px); font-weight: 700; line-height: 1.15; margin: 0 0 14px; }
.section-sub { font-size: 16px; color: var(--ink-2); }

/* Content is hidden for its entrance only after the script marks the
   page ready, so a page whose script never runs stays readable. */
.reveal-ready .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .25, 1); }
.reveal-ready .reveal.in { opacity: 1; transform: none; }

/* ============================================================
   Overlays: the announcement dialog and the gallery lightbox.
   ============================================================ */
.overlay {
  position: fixed; inset: 0;
  z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity .2s ease;
}
.overlay.open { opacity: 1; }
/* A closing overlay lets clicks through, so the page answers at once
   instead of after the fade. */
.overlay:not(.open), .lightbox:not(.open) { pointer-events: none; }
.card {
  position: relative;
  width: min(600px, 100%);
  max-height: min(80vh, 720px);
  display: flex; flex-direction: column;
  padding: 24px 26px 26px;
  border-radius: 20px;
  background: #FFFFFF;
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(15, 7, 30, 0.3);
  transform: translateY(14px) scale(0.97);
  transition: transform .24s cubic-bezier(.2, .9, .3, 1.15);
}
.overlay.open .card { transform: none; }
.cardclose {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px;
  color: var(--ink);
  transition: background .15s ease;
}
.cardclose:hover { background: var(--paper-grey); }
.cardclose svg { width: 12px; height: 12px; }
.dlg-meta { font-size: 12px; letter-spacing: 2px; color: var(--red); }
.card h3 { font-size: 21px; font-weight: 700; margin: 6px 0 14px; padding-right: 30px; }
.dlg-body {
  flex: 1; min-height: 0;
  overflow: auto;
  padding-top: 14px;
  border-top: 1px solid var(--track);
  font: inherit;
  font-size: 14.5px;
  line-height: 1.75;
  color: #333333;
  white-space: pre-wrap;
  word-break: break-word;
}

/* The dialog the download buttons open is wider than the announcement
   dialog: the package's versions on the left, in a group of the official
   builds and a group of the community builds, and the picked version's
   sources on the right. Each side scrolls on its own inside the card, so
   a long list of versions or of sources stays within the window. */
#sourceBox .card { width: min(920px, 100%); max-height: min(86vh, 780px); }
.src-body {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--track);
}
.src-side {
  display: flex; flex-direction: column; gap: 8px;
  min-height: 0;
  padding: 10px;
  border-radius: 16px;
  background: var(--paper-grey);
}
/* The search box, shown once a package lists enough versions to need it. */
.src-search { position: relative; display: block; flex: none; }
.src-search input {
  width: 100%; height: 36px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--track);
  border-radius: 10px;
  background: #FFFFFF;
  color: var(--ink);
  font: inherit; font-size: 14px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.src-search input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(126, 47, 220, 0.14); }
.src-search input::placeholder { color: var(--ink-3); }
.src-search [data-icon] { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 15px; color: var(--ink-3); pointer-events: none; }
/* The version list: one group per kind, each under a small heading. The
   picked version is lifted onto white with a red edge, the red underline
   of the page's tabs turned on its side. */
.src-picker { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; }
.src-group + .src-group { margin-top: 10px; }
.src-group-name {
  display: block;
  padding: 6px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ink-3);
}
html:lang(en) .src-group-name { letter-spacing: 1.5px; text-transform: uppercase; }
.src-picker [role="option"] {
  position: relative;
  display: flex; align-items: center;
  width: 100%; min-height: 40px;
  padding: 8px 12px 8px 16px;
  border-radius: 10px;
  text-align: left;
  font-size: 15px;
  color: #333333;
  transition: background .15s ease, color .15s ease;
}
.src-picker [role="option"]:hover { background: rgba(255, 255, 255, 0.7); color: var(--ink); }
.src-picker [role="option"][aria-selected="true"] {
  background: #FFFFFF;
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(60, 43, 85, 0.08);
}
.src-picker [role="option"][aria-selected="true"]::before {
  content: "";
  position: absolute; left: 6px; top: 25%;
  width: 3px; height: 50%;
  border-radius: 2px;
  background: var(--red);
}
.src-empty { flex: none; padding: 14px 10px; font-size: 13px; color: var(--ink-3); text-align: center; }
/* The right side: the picked version's kind and name, the notice a
   community build carries, and its sources. */
.src-main { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
/* The way back from a version's sources to the list, which only the
   narrow layout needs. */
.src-back { display: none; }
.src-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 28px; }
.src-kind {
  display: inline-flex; align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(126, 47, 220, 0.10);
  color: var(--purple);
  font-size: 12px;
  font-weight: 700;
}
.src-kind[data-kind="community"] { background: var(--notice-bg); color: var(--notice-ink); }
.src-version { font-size: 18px; font-weight: 700; }
.src-notice {
  flex: none;
  display: flex; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--notice-line);
  border-radius: 12px;
  background: var(--notice-bg);
  color: var(--notice-ink);
  font-size: 13px;
  line-height: 1.7;
}
.src-notice [data-icon] { flex: none; align-self: flex-start; margin-top: 3px; font-size: 16px; color: var(--notice-mark); }
/* One row per source: its name, then its note and the archive password
   on a second line, and the action at the end of the row. */
.src-list { list-style: none; flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.src-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name go" "meta go";
  align-items: center;
  column-gap: 14px; row-gap: 3px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--paper-grey);
}
.src-name { grid-area: name; font-size: 16px; font-weight: 700; }
.src-meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; color: var(--ink-2); }
.src-meta:empty { display: none; }
.src-go, .src-off {
  grid-area: go;
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 14px;
  white-space: nowrap;
}
.src-go { background: var(--grad-btn); color: #FFFFFF; transition: filter .2s ease; }
.src-go:hover { filter: brightness(1.08); }
.src-off { background: #E6E3EC; color: var(--ink-3); }

.lightbox {
  position: fixed; inset: 0;
  z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 56px 72px;
  background: rgba(4, 5, 8, 0.86);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity .2s ease;
}
.lightbox.open { opacity: 1; }
.lb-figure { max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lb-figure img {
  max-width: 100%; max-height: calc(100vh - 150px);
  border-radius: 12px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform: scale(0.97);
  transition: transform .24s cubic-bezier(.2, .9, .3, 1.15);
}
.lightbox.open .lb-figure img { transform: none; }
.lb-figure figcaption { font-size: 13px; letter-spacing: 2px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.lb-close {
  position: absolute; top: 18px; right: 18px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: var(--glass);
  color: #FFF;
  transition: background .15s ease;
}
.lb-close:hover { background: rgba(255, 255, 255, 0.14); }
.lb-close svg { width: 15px; height: 15px; }
.lb-arrow {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: var(--glass);
  color: #FFF;
  font-size: 18px;
  transition: background .15s ease;
}
.lb-arrow:hover { background: rgba(255, 255, 255, 0.14); }
.lb-arrow.prev { left: 16px; }
.lb-arrow.next { right: 16px; }

/* ============================================================
   Responsive rules for the shell. Section rules live beside
   their sections in sections.css.
   ============================================================ */
/* The widths at which the built-in labels stop fitting, measured in each
   language with room for a scrollbar; the script applies the same three
   steps from the contents' real width, so a page without scripts follows
   these and a page with other labels follows the script. The two Chinese
   label sets are the shortest. The Japanese one is the longest and does
   not fit the bar's full width beside the icon row at all, so its icons
   are always folded.

   Measure again after changing the labels in site.toml. Each width is the
   first at which the bar overflows, plus 20px for a scrollbar; the widths
   depend on the fonts the browser uses, so measure in the browser the site
   is checked in. tools/shot.mjs answers it for one width and language:
     node tools/shot.mjs "http://localhost:8090/?lang=<code>" out.png --w <width> \
       --eval "(() => { const i = document.querySelector('.topbar-inner'); return i.scrollWidth - i.clientWidth; })()"
   prints 0 when the bar fits. Take the reading with the steps forced off,
   by setting the bar's custom properties above on `#topbar` from the
   evaluated script, so the media rules do not hide the overflow. */
@media (max-width: 1150px) { .topbar { --socials-display: none; --contact-display: block; } }
@media (max-width: 990px) { .topbar { --bar-gap: 18px; --link-pad: 12px; } }
@media (max-width: 910px) { .topbar { --nav-display: none; --menu-display: flex; --actions-push: auto; } }
@media (max-width: 1270px) { html:lang(ko) .topbar { --socials-display: none; --contact-display: block; } }
@media (max-width: 1110px) { html:lang(ko) .topbar { --bar-gap: 18px; --link-pad: 12px; } }
@media (max-width: 1030px) { html:lang(ko) .topbar { --nav-display: none; --menu-display: flex; --actions-push: auto; } }
@media (max-width: 1480px) { html:lang(en) .topbar { --socials-display: none; --contact-display: block; } }
@media (max-width: 1320px) { html:lang(en) .topbar { --bar-gap: 18px; --link-pad: 12px; } }
@media (max-width: 1240px) { html:lang(en) .topbar { --nav-display: none; --menu-display: flex; --actions-push: auto; } }
html:lang(ja) .topbar { --socials-display: none; --contact-display: block; }
@media (max-width: 1390px) { html:lang(ja) .topbar { --bar-gap: 18px; --link-pad: 12px; } }
@media (max-width: 1310px) { html:lang(ja) .topbar { --nav-display: none; --menu-display: flex; --actions-push: auto; } }
@media (max-width: 900px) {
  .socials, .contact, .sep, .cta.sm { display: none; }
  .section { padding: 84px 0; }
  .hero-inner { padding: 120px 0 90px; }
  /* The narrow layout lays the sections on marble, so the hero fades into
     the marble's own tone rather than into white. */
  .vignette.bottom { background: linear-gradient(0deg, #ECEAF0 0%, rgba(236, 234, 240, 0.72) 30%, rgba(236, 234, 240, 0) 100%); }
  .lightbox { padding: 60px 12px; }
  .lb-arrow { width: 38px; height: 38px; }
  .lb-arrow.prev { left: 6px; }
  .lb-arrow.next { right: 6px; }
}
/* Under this width the dialog shows one side at a time. It opens on the
   list: each group's heading over its versions as full rows with a
   chevron, which the body scrolls through as one. A tap on a version
   turns the dialog to that version's sources, with a button back to the
   list at the top; the script switches the two with `showing-sources`. */
@media (max-width: 760px) {
  #sourceBox .card { max-height: 88vh; }
  .src-body { display: flex; flex-direction: column; gap: 12px; overflow: auto; }
  .src-side { flex: none; padding: 10px; }
  .src-picker { flex: none; overflow: visible; padding: 0; }
  .src-group { display: flex; flex-direction: column; gap: 6px; }
  .src-group + .src-group { margin-top: 14px; }
  .src-group-name { padding: 2px 6px 4px; }
  .src-picker [role="option"] {
    min-height: 50px;
    padding: 10px 40px 10px 16px;
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(60, 43, 85, 0.06);
    font-size: 15px;
    color: var(--ink);
  }
  .src-picker [role="option"]::after {
    content: "";
    position: absolute; right: 18px; top: 50%;
    width: 8px; height: 8px;
    border-right: 2px solid var(--ink-3);
    border-bottom: 2px solid var(--ink-3);
    transform: translateY(-50%) rotate(-45deg);
  }
  .src-picker [role="option"][aria-selected="true"] { box-shadow: 0 1px 2px rgba(60, 43, 85, 0.06); }
  .src-empty { padding: 6px 8px; }
  .src-main { display: none; flex: none; }
  #sourceBox .card.showing-sources .src-side { display: none; }
  #sourceBox .card.showing-sources .src-main { display: flex; }
  .src-back {
    display: inline-flex; align-items: center; gap: 2px;
    align-self: flex-start;
    margin: -2px 0 0 -8px;
    padding: 6px 10px 6px 6px;
    border-radius: 8px;
    color: var(--purple);
    font-size: 14px;
    font-weight: 700;
  }
  .src-back [data-icon] { font-size: 16px; }
  .src-list { flex: none; overflow: visible; }
}
@media (max-width: 560px) {
  .hero-actions .cta, .hero-actions .ghost { width: 100%; }
  .brand .sub { display: none; }
  /* On a phone the action takes its own line across the row. */
  .src-list li { grid-template-columns: minmax(0, 1fr); grid-template-areas: "name" "meta" "go"; }
  .src-go, .src-off { width: 100%; margin-top: 6px; }
}

/* With reduced motion the large movements stop: the art no longer drifts,
   the particles go, scrolling jumps and content appears in place. Hover
   feedback stays. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg-layer, .pill .dot, .scroll-hint span, h1 .grad { animation: none !important; }
  .reveal-ready .reveal { opacity: 1; transform: none; transition: none; }
  #motes { display: none; }
}
