/* MoonLightOS — moonlightos.eu
 *
 * Light, airy, grid-based: white and pale sections with deep night-blue
 * bands for the hero, the closing call and the footer. The palette, the
 * accent and the radii are the ones the system's own themes are generated
 * from (tools/gen-themes.py). A dark theme is one toggle away.
 */

/* --- fonts (self-hosted; nothing is fetched from a third party) ------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin.woff2") format("woff2"); 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: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-greek.woff2") format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-greek-ext.woff2") format("woff2"); unicode-range: U+1F00-1FFF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-vietnamese.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2"); 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"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/jetbrains-mono-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/jetbrains-mono-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/jetbrains-mono-greek.woff2") format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }

/* --- tokens ----------------------------------------------------------- */
:root {
  --font-ui: "Inter", "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, "Noto Sans Arabic", "Noto Sans JP", "Noto Sans SC", "Noto Sans KR", "Hiragino Sans", "Microsoft YaHei", "Malgun Gothic", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, "Liberation Mono", Menlo, monospace;

  /* light, the default */
  --bg: #ffffff;
  --bg-alt: #f4f6fb;
  --card: #ffffff;
  --hover: #eef2fa;
  --border: #d9e0ec;
  --border-strong: #c3cdde;
  --fg: #141a24;
  --dim: #5a6578;
  --faint: #8a94a6;
  --accent: #3b6fe0;
  --accent-hover: #2f5fcb;
  --accent-fg: #ffffff;
  --sel: rgba(59, 111, 224, 0.12);
  --danger: #d13438;
  --warning: #b96a00;
  --success: #1f7a4d;
  --code-bg: #f4f6fb;
  --code-fg: #141a24;
  --code-border: #d9e0ec;
  --shadow: 0 12px 40px rgba(16, 24, 40, 0.14);

  /* the night band, the same in both themes */
  --night: #0f1420;
  --night-deep: #06090f;
  --night-fg: #e4eaf5;
  --night-dim: #9aa6bc;
  --night-border: rgba(255, 255, 255, 0.10);
  --night-accent: #5b8cff;
  --night-accent-soft: #9fbeff;

  --radius: 6px;
  --container: 1200px;
  --section: clamp(56px, 7vw, 96px);
}

[data-theme="dark"] {
  --bg: #0f1420;
  --bg-alt: #171e2c;
  --card: #1c2433;
  --hover: #222b3c;
  --border: #2a3448;
  --border-strong: #3a465e;
  --fg: #e4eaf5;
  --dim: #9aa6bc;
  --faint: #6b7689;
  --accent: #5b8cff;
  --accent-hover: #7aa2ff;
  --sel: rgba(91, 140, 255, 0.22);
  --danger: #e5484d;
  --warning: #f2a33c;
  --success: #3dbe78;
  --code-bg: #0a0f1a;
  --code-fg: #dbe4f3;
  --code-border: #232c3d;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --night: #06090f;
}

/* --- reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; font-family: var(--font-ui); font-size: 16px; line-height: 1.6; color: var(--fg); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.015em; font-weight: 600; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-inline-start: 1.3em; }
code, kbd, pre { font-family: var(--font-mono); font-size: .92em; }
code { background: var(--hover); border-radius: 4px; padding: .1em .35em; }
pre code { background: none; padding: 0; font-size: inherit; }
kbd { display: inline-block; padding: .1em .45em; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--bg); font-size: .85em; line-height: 1.5; white-space: nowrap; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: start; vertical-align: top; padding: .6em .75em; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
th { font-weight: 600; }
figure { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }

.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100; padding: .5em 1em; background: var(--accent); color: var(--accent-fg); border-radius: var(--radius); }
.skip:focus { top: 8px; }

.container { width: min(var(--container), 100% - 2 * clamp(16px, 4vw, 48px)); margin-inline: auto; }
.narrow { max-width: 800px; }
.center { text-align: center; }
.muted { color: var(--dim); }
.small { font-size: .9rem; }
.lead { font-size: 1.15rem; line-height: 1.6; color: var(--dim); max-width: 64ch; }
.prose p { max-width: 70ch; }
.prose > p + h3 { margin-top: 1.5em; }

/* The icon sprite must not take up layout space. This is a class, not an
   inline style="display:none", because the CSP sets style-src 'self' with
   no unsafe-inline: an inline style attribute is dropped and the sprite then
   renders at the SVG default 300x150, pushing the whole page down. */
.svg-sprite { display: none; }

.ic { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-sm { width: 1em; height: 1em; }
.ic-lg { width: 2rem; height: 2rem; stroke-width: 1.6; color: var(--accent); }
.ic-check { width: 1.1rem; height: 1.1rem; stroke-width: 2.5; }
[dir="rtl"] .link-arrow .ic { transform: scaleX(-1); }

/* --- buttons ---------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: .5em; padding: .65em 1.25em; border-radius: var(--radius); border: 1px solid transparent; font-weight: 600; line-height: 1.3; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-fg); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--hover); color: var(--fg); }
.btn-lg { padding: .85em 1.6em; font-size: 1.05rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75em; }
.link-arrow { display: inline-flex; align-items: center; gap: .35em; font-weight: 600; }
.copy-btn { display: inline-flex; align-items: center; gap: .35em; padding: .3em .6em; font-size: .8rem; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--dim); cursor: pointer; }
.copy-btn:hover { color: var(--fg); background: var(--hover); }
.copy-btn.done { color: var(--success); border-color: var(--success); }

/* --- top bar ---------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--fg); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; color: var(--fg); }
.brand-mark { width: 34px; height: 34px; }
.brand-os { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 1.25rem; flex: 1; align-self: stretch; }
.nav-links { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; align-self: stretch; }
.nav-links li { display: flex; }
.nav-links a { display: flex; align-items: center; padding: 0 .9em; color: var(--dim); font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.nav-links a:hover { color: var(--fg); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }
.nav-tools { display: flex; align-items: center; gap: .5rem; margin-inline-start: auto; }
.nav-toggle { display: none; margin-inline-start: auto; width: 44px; height: 44px; border: 1px solid var(--border); background: transparent; border-radius: var(--radius); align-items: center; justify-content: center; cursor: pointer; }
.btn-nav { padding: .5em 1em; }
.theme-toggle { width: 40px; height: 40px; border-radius: var(--radius); border: 1px solid var(--border); background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--dim); }
.theme-toggle:hover { color: var(--fg); background: var(--hover); }
.theme-toggle .ic-sun { display: none; }
[data-theme="dark"] .theme-toggle .ic-sun { display: block; }
[data-theme="dark"] .theme-toggle .ic-moon { display: none; }

.lang-menu { position: relative; }
.lang-menu summary { list-style: none; display: inline-flex; align-items: center; gap: .4em; padding: .45em .75em; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; color: var(--dim); font-weight: 500; user-select: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { color: var(--fg); background: var(--hover); }
.lang-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); width: min(560px, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; z-index: 60; }
.lang-note { font-size: .85rem; color: var(--dim); margin: 0 0 .75rem; }
.lang-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .15rem; }
.lang-grid a { display: block; padding: .4em .6em; border-radius: 4px; color: var(--fg); }
.lang-grid a:hover { background: var(--hover); text-decoration: none; }
.lang-grid a[aria-current="true"] { background: var(--sel); font-weight: 600; }

/* --- the night band: hero --------------------------------------------- */
.hero { position: relative; overflow: hidden; color: var(--night-fg); background: var(--night); isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(900px 520px at 78% 20%, rgba(91, 140, 255, .28), transparent 60%),
  radial-gradient(600px 400px at 10% 100%, rgba(159, 190, 255, .10), transparent 60%),
  linear-gradient(180deg, var(--night-deep), var(--night)); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .7; background-image:
  radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.55) 50%, transparent 51%),
  radial-gradient(1px 1px at 28% 62%, rgba(255,255,255,.35) 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 41% 30%, rgba(255,255,255,.5) 50%, transparent 51%),
  radial-gradient(1px 1px at 63% 12%, rgba(255,255,255,.45) 50%, transparent 51%),
  radial-gradient(1px 1px at 77% 70%, rgba(255,255,255,.4) 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 88% 36%, rgba(255,255,255,.5) 50%, transparent 51%),
  radial-gradient(1px 1px at 52% 84%, rgba(255,255,255,.3) 50%, transparent 51%); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; padding-block: clamp(56px, 8vw, 112px) clamp(48px, 7vw, 96px); }
.kicker { font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--night-accent-soft); margin-bottom: 1.25rem; }
.hero-title { font-size: clamp(2.2rem, 4.4vw, 3.5rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; margin-bottom: 1.25rem; text-wrap: balance; }
.hero-lead { font-size: clamp(1.05rem, 1.5vw, 1.25rem); line-height: 1.6; color: var(--night-dim); max-width: 54ch; margin-bottom: 1.75rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1.25rem; }
.hero .btn-primary { background: var(--night-accent); border-color: var(--night-accent); }
.hero .btn-primary:hover { background: #7aa2ff; border-color: #7aa2ff; }
.hero .btn-ghost { color: var(--night-fg); border-color: rgba(255, 255, 255, .35); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.hero-note { font-size: .9rem; color: var(--night-dim); margin: 0; }
.hero-visual { position: relative; min-width: 0; }
.hero-copy { min-width: 0; }
.hero .window { background: #171e2c; border: 1px solid var(--night-border); box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.hero .window-bar { background: #141a27; border-color: var(--night-border); }
.hero .kv-card { margin-top: 1.25rem; background: rgba(23, 30, 44, .9); border-color: var(--night-border); --border: rgba(255, 255, 255, .08); --dim: #b7c2d8; --fg: #e4eaf5; }
.hero .kv-card code { background: rgba(255, 255, 255, .08); color: #e4eaf5; }
.hero .callout { color: var(--night-fg); }
.hero-download .hero-inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }

/* the mark stays still; the light around it breathes (2.6 s and 3.1 s, out of step) */
.glow-logo { position: relative; width: 150px; height: 150px; margin: 0 auto 1.25rem; }
.glow-logo img { position: relative; z-index: 2; width: 150px; height: 150px; filter: drop-shadow(0 0 18px rgba(159, 190, 255, .45)); }
.halo { position: absolute; inset: 50% auto auto 50%; translate: -50% -50%; border-radius: 50%; z-index: 1; pointer-events: none; }
.halo-outer { width: 290px; height: 290px; background: radial-gradient(circle, rgba(91, 140, 255, .42) 0%, rgba(91, 140, 255, .18) 32%, rgba(91, 140, 255, 0) 68%); animation: breathe-outer 3.1s ease-in-out infinite alternate; }
.halo-inner { width: 210px; height: 210px; background: radial-gradient(circle, rgba(159, 190, 255, .55) 0%, rgba(159, 190, 255, .22) 35%, rgba(159, 190, 255, 0) 70%); animation: breathe-inner 2.6s ease-in-out infinite alternate; }
.glow-logo-sm { width: 120px; height: 120px; }
.glow-logo-sm img { width: 120px; height: 120px; }
@keyframes breathe-outer { from { opacity: .45; scale: .92; } to { opacity: 1; scale: 1.08; } }
@keyframes breathe-inner { from { opacity: .55; scale: 1.06; } to { opacity: 1; scale: .9; } }
@media (prefers-reduced-motion: reduce) { .halo { animation: none; } html { scroll-behavior: auto; } }

.window { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.window-bar { display: flex; gap: 6px; padding: 9px 12px; background: var(--bg-alt); border-bottom: 1px solid var(--border); }
.window-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.window-bar span:first-child { background: #e5484d; }
.window-bar span:nth-child(2) { background: #f2a33c; }
.window-bar span:nth-child(3) { background: #3dbe78; }
.window img { width: 100%; }
.window figcaption { padding: .6em .9em; font-size: .85rem; color: var(--dim); border-top: 1px solid var(--border); }
.window-sm { max-width: 760px; margin-block: 1.5rem; }
.window-sticky { position: sticky; top: 92px; align-self: start; }
.shot-inline { margin-top: 1.5rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--card); }
.shot-inline figcaption { padding: .55em .9em; font-size: .85rem; color: var(--dim); border-top: 1px solid var(--border); }

/* --- stats ------------------------------------------------------------ */
.stats { background: var(--bg-alt); border-bottom: 1px solid var(--border); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; padding-block: 2.25rem; }
.stat { display: flex; flex-direction: column; gap: .25rem; padding-top: 1rem; border-top: 2px solid var(--accent); }
.stat-value { font-size: 2.25rem; font-weight: 600; letter-spacing: -0.03em; color: var(--fg); line-height: 1.1; }
.stat-label { color: var(--dim); font-size: .95rem; }

/* --- sections --------------------------------------------------------- */
.section { padding-block: var(--section); }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-dark { background: var(--night); color: var(--night-fg); --fg: #e4eaf5; --dim: #9aa6bc; --card: #121826; --border: #232c3d; --hover: #1a2231; --bg-alt: #0f1420; --accent: #5b8cff; --accent-hover: #7aa2ff; }
.section-title { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 600; letter-spacing: -0.025em; text-wrap: balance; margin-bottom: .6em; }
.sub-title { font-size: 1.2rem; margin-top: 2rem; }
.section-head { max-width: 780px; margin-bottom: 2.5rem; }
.section-more { margin-top: 2rem; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.split > * { min-width: 0; }
.split-wide { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.split-copy .section-title { margin-top: 0; }
.page-head { padding-block: clamp(40px, 5vw, 72px) clamp(24px, 3vw, 40px); background: var(--bg-alt); border-bottom: 1px solid var(--border); }
.page-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; letter-spacing: -0.03em; }
.pills { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.25rem; }
.pills a { padding: .35em .85em; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--dim); font-size: .9rem; font-weight: 500; background: var(--card); }
.pills a:hover { color: var(--fg); border-color: var(--accent); text-decoration: none; }

.big-number { font-size: clamp(3.5rem, 8vw, 6rem); font-weight: 600; letter-spacing: -0.05em; line-height: 1; color: var(--accent); margin-bottom: .25em; }

/* --- cards ------------------------------------------------------------ */
.cards { display: grid; gap: 1.25rem; }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards + .cards { margin-top: 1.25rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; }
.card p { margin: 0; color: var(--dim); }
.card-title { font-size: 1.1rem; margin: 0 0 .45em; }
.card-tool img { width: 52px; height: 52px; margin-bottom: 1rem; }
.card-icon .ic-lg { margin-bottom: 1rem; }
.card-row { display: flex; gap: 1.1rem; align-items: flex-start; }
.card-row .ic-lg { margin: .15rem 0 0; }

.layout-sketch { position: relative; height: 92px; border-radius: 4px; background: linear-gradient(160deg, #2a3448, #1c2433); border: 1px solid #3a465e; margin-bottom: 1.1rem; overflow: hidden; }
.layout-sketch i { position: absolute; left: 0; right: 0; background: rgba(159, 190, 255, .8); }
.layout-1 i:first-child { bottom: 0; height: 12px; }
.layout-1 i:last-child { display: none; }
.layout-2 i:first-child { top: 0; height: 6px; }
.layout-2 i:last-child { bottom: 6px; left: 30%; right: 30%; height: 12px; border-radius: 6px; }
.layout-3 i:first-child { top: 0; height: 7px; }
.layout-3 i:last-child { display: none; }

/* --- the "switching" grid ------------------------------------------- */
.switch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 2.5rem; list-style: none; margin: 0; padding: 0; }
.switch-grid li { border-top: 1px solid var(--border-strong); padding-top: 1.25rem; }
.switch-grid .ic-lg { margin-bottom: .9rem; }
.switch-grid h3 { font-size: 1.1rem; margin-bottom: .4em; }
.switch-grid p { margin: 0; color: var(--dim); }

/* --- lists ------------------------------------------------------------ */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 2.5rem; }
.checklist-col { grid-template-columns: minmax(0, 1fr); }
.checklist li { display: flex; gap: .85rem; align-items: flex-start; }
.checklist .ic-check { color: var(--accent-fg); background: var(--accent); border-radius: 50%; padding: 3px; width: 22px; height: 22px; margin-top: .2rem; }
.checklist strong { display: block; margin-bottom: .2em; }
.checklist p { margin: 0; color: var(--dim); }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.feature-list li { border-top: 1px solid var(--border-strong); padding-top: 1rem; }
.feature-list strong { display: block; margin-bottom: .25em; }
.feature-list p { margin: 0; color: var(--dim); }
.feature-list.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2.5rem; }
.steps { list-style: none; margin: 0 0 1.25rem; padding: 0; counter-reset: step; display: grid; gap: 1.1rem; }
.steps li { position: relative; padding-inline-start: 3rem; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: 0; width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent); color: var(--accent-fg); font-weight: 600; display: grid; place-items: center; }
.steps strong { display: block; margin-bottom: .2em; }
.steps p { margin: 0; color: var(--dim); }
.steps-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 2.5rem; }

/* --- tables ----------------------------------------------------------- */
.kv th { width: 34%; color: var(--dim); font-weight: 500; }
.kv-wide th { width: 24%; }
.kv-mono th { width: 32%; }
.kv-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.kv-card th, .kv-card td { padding: .65em .9em; }
.kv-card tr:last-child th, .kv-card tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.table thead th { background: var(--bg-alt); color: var(--dim); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.table tr:last-child td, .table tr:last-child th { border-bottom: 0; }
.shortcuts td:not(:first-child) { white-space: nowrap; }
.hash { word-break: break-all; font-size: .85em; }

/* --- code ------------------------------------------------------------- */
.code { position: relative; margin: 0 0 1.25rem; padding: 2.35rem 1.1rem 1rem 1.1rem; background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--code-border); border-radius: var(--radius); overflow-x: auto; line-height: 1.55; font-size: .9rem; direction: ltr; text-align: left; }
.code::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2rem; background: rgba(16, 24, 40, .04); border-bottom: 1px solid var(--code-border); }
[data-theme="dark"] .code::before { background: rgba(255, 255, 255, .035); }
.code .copy-btn { position: absolute; top: .45rem; right: .55rem; }
.callout { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: var(--radius); background: var(--sel); border: 1px solid var(--accent); color: var(--fg); }
.callout .ic { color: var(--accent); margin-top: .15rem; }
.callout-warn { background: rgba(242, 163, 60, .12); border-color: var(--warning); }
.callout-warn .ic { color: var(--warning); }

/* --- tools page ------------------------------------------------------- */
.tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1.75rem; }
.tool { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; scroll-margin-top: 92px; }
.tool p { color: var(--dim); }
.tool-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.tool-head img { width: 60px; height: 60px; }
.tool-glyph { width: 60px; height: 60px; border-radius: var(--radius); background: var(--sel); display: grid; place-items: center; flex: none; }
.tool-name { font-size: 1.2rem; margin: 0 0 .15em; }
.tool-tag { margin: 0; font-size: .92rem; }
.tool-detail { font-size: .95rem; }
.tool-keys { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .9rem; margin: 0; }
.tool-keys kbd { white-space: normal; }
.tool-keys span { color: var(--faint); font-weight: 600; text-transform: uppercase; font-size: .75rem; letter-spacing: .08em; }
.wall-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-top: 1rem; }
.wall-grid img { border-radius: 4px; border: 1px solid var(--border); aspect-ratio: 16 / 9; object-fit: cover; }

/* --- guide ------------------------------------------------------------ */
.guide-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 3.5rem; padding-block: 2.5rem var(--section); align-items: start; }
.guide-toc { position: sticky; top: 88px; }
.toc-title { font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: .5rem; }
.toc { list-style: none; margin: 0; padding: 0; border-inline-start: 1px solid var(--border); }
.toc a { display: block; padding: .35em .9em; color: var(--dim); font-size: .95rem; border-inline-start: 2px solid transparent; margin-inline-start: -1px; }
.toc a:hover { color: var(--fg); text-decoration: none; }
.toc a.active { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.guide-section { scroll-margin-top: 92px; padding-bottom: 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--border); }
.guide-section:last-child { border-bottom: 0; }
.guide-section h2 { font-size: 1.75rem; letter-spacing: -0.02em; }
.guide-section h3 { font-size: 1.15rem; margin-top: 1.75rem; }
.guide-section .table-wrap, .guide-section .kv { margin-bottom: 1.25rem; }
.legal .guide-section h2 { font-size: 1.5rem; }
.legal { padding-block: 2.5rem var(--section); }

/* --- closing band ----------------------------------------------------- */
.cta { position: relative; overflow: hidden; color: var(--night-fg); background: var(--night); isolation: isolate; }
.cta::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(700px 420px at 50% 0%, rgba(91, 140, 255, .25), transparent 65%), linear-gradient(180deg, var(--night), var(--night-deep)); }
.cta-inner { padding-block: clamp(56px, 8vw, 104px); text-align: center; display: flex; flex-direction: column; align-items: center; }
.cta-title { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 600; letter-spacing: -0.03em; }
.cta .lead { color: var(--night-dim); }
.cta .hero-actions { justify-content: center; }
.cta .btn-primary { background: var(--night-accent); border-color: var(--night-accent); }
.cta .btn-primary:hover { background: #7aa2ff; border-color: #7aa2ff; }
.cta .btn-ghost { color: var(--night-fg); border-color: rgba(255, 255, 255, .35); }
.cta .btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* --- footer ----------------------------------------------------------- */
.footer { background: var(--night-deep); color: var(--night-dim); border-top: 1px solid #1c2433; padding-block: 3.5rem 2rem; font-size: .95rem; }
.footer a { color: #c7d0e0; }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 2rem; margin-bottom: 2.5rem; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.footer-h { font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #e4eaf5; margin-bottom: 1rem; }
.footer-mark { width: 52px; height: 52px; margin-bottom: 1rem; }
.footer-tag { color: #e4eaf5; font-weight: 600; margin-bottom: .5rem; }
.footer-built { font-size: .9rem; }
.footer-langs { border-top: 1px solid #1c2433; padding-top: 1.75rem; margin-bottom: 1.75rem; }
.footer-lang-list { display: flex !important; flex-wrap: wrap; gap: .35rem 1.25rem !important; }
.footer-lang-list a[aria-current="true"] { color: var(--night-accent-soft); font-weight: 600; }
.footer-legal { border-top: 1px solid #1c2433; padding-top: 1.5rem; font-size: .85rem; color: #6b7689; }
.footer-legal p { margin-bottom: .4em; }

.nf-mark { margin: 0 auto 1.5rem; }
.page-root .lang-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .5rem; }

/* --- responsive ------------------------------------------------------- */
@media (max-width: 1080px) {
  .cards-3, .switch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; inset-inline: 0; top: 100%; flex-direction: column; align-items: stretch; gap: .75rem; padding: 1rem clamp(16px, 4vw, 48px) 1.25rem; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
  .topbar.open .nav { display: flex; }
  .nav-links { flex-direction: column; margin: 0; }
  .nav-links a { padding: .6em .2em; border-bottom: 0; border-inline-start: 3px solid transparent; padding-inline-start: .8em; }
  .nav-links a[aria-current="page"] { border-inline-start-color: var(--accent); }
  .nav-tools { margin: 0; flex-wrap: wrap; }
  .lang-panel { position: static; width: 100%; margin-top: .5rem; }
  .hero-inner, .hero-download .hero-inner, .split, .split-wide { grid-template-columns: minmax(0, 1fr); }
  .hero-inner { padding-top: 48px; }
  .window-sticky { position: static; }
  .guide-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .guide-toc { position: static; }
  .toc { display: flex; flex-wrap: wrap; gap: .25rem; border: 0; }
  .toc a { border: 1px solid var(--border); border-radius: 999px; margin: 0; padding: .3em .8em; font-size: .88rem; }
  .toc a.active { background: var(--sel); }
  .tools-grid { grid-template-columns: minmax(0, 1fr); }
  .steps-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
  .cards-2, .cards-3, .checklist, .feature-list.cols-2, .switch-grid { grid-template-columns: minmax(0, 1fr); }
  .wall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .kv th { width: 40%; }
  .glow-logo { width: 120px; height: 120px; }
  .glow-logo img { width: 120px; height: 120px; }
  .halo-outer { width: 230px; height: 230px; }
  .halo-inner { width: 170px; height: 170px; }
  .btn-nav span { display: none; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-actions .btn { width: 100%; justify-content: center; }
}

@media print {
  .topbar, .footer, .cta, .halo, .copy-btn, .nav-toggle { display: none !important; }
  body { color: #000; background: #fff; }
  .hero { background: #fff; color: #000; }
  .code { background: #f4f4f4; color: #000; border-color: #ccc; }
}
