/* =====================================================================
   NOCTURNE WEBSITE
   Visual system taken from the in-game menu (src/Features/UI/Widgets.hpp):
   same surfaces, same lavender accent, same card + switch + segment shapes.
   ===================================================================== */

:root {
    /* ---- Menu palette (1:1 from Widgets.hpp) ---- */
    --page:         #0f0f11;  /* ColorPage */
    --rail:         #0b0b0d;  /* ColorSidebar */
    --card:         #151517;  /* ColorCard */
    --card-head:    #1c1c1f;  /* ColorCardHeader */
    --surface:      #1b1b1e;  /* ColorSurface */
    --surface-2:    #232327;  /* ColorSurface2 */
    --inset:        #0d0d0f;  /* ColorInset */
    --line:         #222226;  /* ColorBorderSoft */
    --line-strong:  #2c2c31;  /* ColorBorder */
    --hover:        #3a3a41;  /* ColorHover */

    --text:         #ededf0;  /* ColorText */
    --label:        #c4c4cc;  /* ColorLabel */
    --body:         #a9a9b3;
    --dim:          #8b8b95;  /* ColorTextDim */
    --disabled:     #5a5a63;  /* ColorTextDisabled */

    --accent:       #ad72ff;  /* ColorAccent */
    --accent-hover: #bd8cff;  /* ColorAccentHover */
    --accent-ink:   #dcc6ff;  /* ColorAccentInk */
    --on-accent:    #13091f;

    --success:      #34d399;
    --warning:      #fbbf24;
    --danger:       #f87171;
    --mint:         #5ee6c4;  /* ESP cluster */
    --discord:      #5865f2;

    /* ---- Shape (menu Rounding / CardRounding) ---- */
    --r-control: 7px;
    --r-card:    10px;
    --r-window:  12px;

    --font-sans: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-ui:   var(--font-sans); /* menu font (JUST Sans) is EULA-licensed, not served on the web */

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --top-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.035);

    /* ---- Legacy aliases (tutorials.css and docs still use these) ---- */
    --bg-base: var(--page);
    --bg-panel: rgba(21, 21, 23, 0.82);
    --bg-panel-solid: var(--card);
    --accent-soft: rgba(173, 114, 255, 0.12);
    --accent-light: var(--accent-hover);
    --accent-gradient: linear-gradient(135deg, #bd8cff 0%, #ad72ff 55%, #8f55e6 100%);
    --text-high: var(--text);
    --text-med: var(--label);
    --text-dim: var(--dim);
    --border: var(--line-strong);
    --border-inner: var(--line);
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
    --shadow-deep: 0 30px 60px -12px rgba(0, 0, 0, 0.75);
    --radius-xl: 16px;
    --radius-lg: var(--r-card);
    --radius-md: var(--r-control);
    --radius-full: 9999px;
    --transition: all 0.4s var(--ease-out);
}

/* ---------------------------------------------------------------------
   Base
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    background: var(--page); /* tutorials.css makes body transparent */
    color-scheme: dark;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 100px;
    scrollbar-width: thin;
    scrollbar-color: var(--hover) var(--page);
}

body {
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.6;
    color: var(--body);
    background: transparent; /* html carries the page colour, so the layers behind the content stay visible */
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
strong { color: var(--text); font-weight: 600; }
code {
    font-family: var(--font-ui);
    font-size: 0.92em;
    color: var(--accent-ink);
    background: rgba(173, 114, 255, 0.1);
    border: 1px solid rgba(173, 114, 255, 0.2);
    padding: 1px 6px;
    border-radius: 5px;
}
::selection { background: rgba(173, 114, 255, 0.3); color: #fff; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

h1, h2, h3, h4 { color: var(--text); font-weight: 600; line-height: 1.15; }

.container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 24px;
}
.container-narrow { max-width: 880px; }

/* Scroll progress (created by main.js) */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 0;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(173, 114, 255, 0.7);
    z-index: 1001;
    pointer-events: none;
}

/* Kept for pages that still use it (tutorials) */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.reveal.active { opacity: 1; transform: none; }
.parallax-layer { pointer-events: none; }

/* ---------------------------------------------------------------------
   Shared menu primitives
   --------------------------------------------------------------------- */

/* The 3px accent bar that sits left of every card title in the menu */
.m-bar {
    display: inline-block;
    flex: none;
    width: 3px;
    height: 0.95em;
    border-radius: 2px;
    background: var(--accent);
}

/* Switch: 36 x 20, track turns accent, knob slides */
.m-switch {
    position: relative;
    flex: none;
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    transition: background 0.25s var(--ease-out), border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.m-switch::after {
    content: "";
    position: absolute;
    top: 2px; left: 2px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #8c8c99;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    transition: transform 0.28s var(--ease-out), background 0.25s;
}
.m-switch.is-on {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(173, 114, 255, 0.1);
}
.m-switch.is-on::after { transform: translateX(16px); background: #fff; }
.m-switch:hover { border-color: var(--hover); }
.m-switch.is-on:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Segmented control with a sliding pill (SubTabBar) */
.m-seg {
    position: relative;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding: 4px;
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    isolation: isolate;
}
.m-seg > button, .m-seg-item {
    position: relative;
    z-index: 1;
    height: 32px;
    padding: 0 14px;
    color: var(--dim);
    border-radius: var(--r-control);
    white-space: nowrap;
    transition: color 0.2s;
    display: grid;
    place-items: center;
}
.m-seg > button:hover { color: var(--label); }
.m-seg > .is-active { color: var(--text); }
.m-seg-pill {
    position: absolute;
    z-index: 0;
    top: 4px; bottom: 4px;
    left: 0;
    width: 0;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-control);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: transform 0.45s var(--ease-out), width 0.45s var(--ease-out);
}

/* Status badge with a pulsing dot */
.m-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 26px;
    padding: 0 11px;
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--label);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    white-space: nowrap;
}
.m-badge i, .pulse-dot {
    position: relative;
    flex: none;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--dim);
}
.m-badge.is-on { color: var(--text); }
.m-badge.is-on i, .pulse-dot { background: var(--success); }
.m-badge.is-on i::after, .pulse-dot::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 1.4px solid var(--success);
    animation: pulse-ring 1.45s ease-out infinite;
}
@keyframes pulse-ring {
    from { transform: scale(1); opacity: 0.5; }
    to   { transform: scale(2.6); opacity: 0; }
}

.m-tag {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--label);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    white-space: nowrap;
    transition: color 0.3s, background 0.3s, border-color 0.3s;
}
.m-tag-accent  { color: var(--accent-ink); background: rgba(173, 114, 255, 0.1); border-color: rgba(173, 114, 255, 0.3); }
.m-tag-success { color: var(--success); background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.28); }
.m-tag-warning { color: var(--warning); background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.28); }
.m-tag-danger  { color: var(--danger); background: rgba(248, 113, 113, 0.08); border-color: rgba(248, 113, 113, 0.28); }

/* ---------------------------------------------------------------------
   Buttons (TechButton / TechButtonPrimary)
   --------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    color: var(--label);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-control);
    box-shadow: var(--top-highlight);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.3s, transform 0.2s var(--ease-out);
}
.btn:hover { background: var(--surface-2); border-color: var(--hover); color: var(--text); }
.btn:active { transform: translateY(1px); }

.btn-primary {
    color: var(--on-accent);
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 10px 28px -12px rgba(173, 114, 255, 0.9);
}
.btn-primary:hover {
    color: var(--on-accent);
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 14px 34px -12px rgba(173, 114, 255, 1);
}

/* ghost / secondary / outline share the neutral menu button */
.btn-ghost, .btn-secondary, .btn-outline { color: var(--label); }

.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-lg { height: 50px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------------
   Navbar
   --------------------------------------------------------------------- */
.navbar {
    position: fixed;
    top: 14px; left: 0; right: 0;
    z-index: 1000;
    pointer-events: none;
}
.navbar .container {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 20px;
    height: 60px;
    max-width: 1200px;
    padding: 0 10px 0 14px;
    background: rgba(21, 21, 23, 0.72);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--line);
    border-radius: var(--r-window);
    box-shadow: var(--top-highlight), 0 16px 40px -20px rgba(0, 0, 0, 0.9);
    transition: background 0.3s, border-color 0.3s;
    width: calc(100% - 32px);
}
.navbar.scrolled .container { background: rgba(15, 15, 17, 0.9); border-color: var(--line-strong); }

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}
.logo::before {
    content: "";
    width: 30px; height: 30px;
    flex: none;
    background: url("/assets/menu/nocturne_logo.png") center / contain no-repeat;
    filter: drop-shadow(0 0 10px rgba(173, 114, 255, 0.35));
}
.logo span { color: var(--dim); font-weight: 500; }

.nav-links {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}
.nav-links > a:not(.btn) {
    position: relative;
    z-index: 1;
    padding: 8px 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--dim);
    text-decoration: none;
    border-radius: var(--r-control);
    transition: color 0.2s;
}
.nav-links > a:not(.btn):hover { color: var(--text); }
.nav-links > a.is-current { color: var(--text); }
.nav-links .btn-download { margin-left: 10px; }

/* Language switcher (rendered by i18n.js; stays hidden while only English is available) */
.lang-switch { position: relative; z-index: 2; margin-left: 4px; }
.lang-switch[hidden] { display: none; }
.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--dim);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--r-control);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.lang-btn:hover, .lang-switch.is-open .lang-btn { color: var(--text); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.03); }
.lang-btn svg { opacity: 0.8; }
.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: rgba(21, 21, 23, 0.98);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-control);
    box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.85);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.18s, visibility 0.18s, transform 0.2s;
}
.lang-switch.is-open .lang-menu { opacity: 1; visibility: visible; transform: none; }
.lang-menu li {
    padding: 8px 10px;
    font-size: 14px;
    color: var(--dim);
    border-radius: 5px;
    cursor: pointer;
    outline: none;
}
.lang-menu li:hover, .lang-menu li:focus-visible { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.lang-menu li[aria-selected="true"] { color: var(--accent-ink); background: rgba(173, 114, 255, 0.10); }

/* Plain link row for sub pages (guides) */
.nav-simple { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-simple > a:not(.btn) {
    padding: 8px 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--dim);
    text-decoration: none;
    transition: color 0.2s;
}
.nav-simple > a:not(.btn):hover { color: var(--text); }

/* Sliding pill behind the current section link, like the rail selection */
.nav-pill {
    position: absolute;
    z-index: 0;
    top: 50%;
    left: 0;
    height: 36px;
    width: 0;
    margin-top: -18px;
    opacity: 0;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-control);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.45s var(--ease-out), width 0.45s var(--ease-out), opacity 0.3s;
    pointer-events: none;
}

.hamburger {
    display: none;
    margin-left: auto;
    width: 42px; height: 42px;
    border-radius: var(--r-control);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.hamburger span {
    display: block;
    width: 18px; height: 2px;
    border-radius: 2px;
    background: var(--label);
    transition: transform 0.3s var(--ease-out), opacity 0.2s;
}
.hamburger.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: 132px 0 72px;
    overflow-x: clip; /* vertical overflow stays visible, so the moon fades out instead of being cut off */
}

/* Crescent from the menu's DrawMoonMark, at landscape scale */
.hero-moon {
    position: absolute;
    z-index: -1;
    top: -14vh;
    right: -10vw;
    width: min(78vw, 900px);
    aspect-ratio: 1;
    border-radius: 50%;
    /* kept faint on purpose: atmosphere, not a focal point */
    background:
        radial-gradient(circle at 22% 78%, rgba(220, 198, 255, 0.10), transparent 30%),
        radial-gradient(circle at 50% 50%, rgba(173, 114, 255, 0.065), rgba(173, 114, 255, 0.02) 50%);
    box-shadow:
        inset 26px -26px 80px rgba(220, 198, 255, 0.06),
        inset 2px -2px 0 rgba(220, 198, 255, 0.10);
    -webkit-mask-image: radial-gradient(circle at 72.5% 31%, transparent 43%, #000 33.4%);
    mask-image: radial-gradient(circle at 72.5% 31%, transparent 43%, #000 33.4%);
    pointer-events: none;
    will-change: transform;
}

#logo-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 56px;
    align-items: center;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 32px;
    padding: 0 14px;
    font-family: var(--font-ui);
    font-size: 15px;
    color: var(--label);
    text-decoration: none;
    background: rgba(27, 27, 30, 0.7);
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    transition: border-color 0.2s, color 0.2s;
}
.status-pill:hover { border-color: var(--hover); color: var(--text); }

.hero h1 {
    margin-top: 28px;
    font-size: clamp(44px, 6vw, 78px);
    line-height: 1.02;
    letter-spacing: -0.035em;
    font-weight: 600;
    max-width: 11ch;
    text-wrap: balance;
}
.hero .lead {
    margin-top: 24px;
    max-width: 44ch;
    font-size: 19px;
    line-height: 1.6;
    color: var(--label);
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}
.hero-note {
    margin-top: 20px;
    font-size: 14px;
    color: var(--dim);
    max-width: 44ch;
}

.hero-visual {
    position: relative;
    will-change: transform;
}

/* Launcher screenshot in the hero */
.dashboard-mockup {
    max-width: 640px;
    margin-left: auto;
    background: var(--card);
    border: 6px solid var(--line-strong);
    border-radius: var(--r-window);
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9), 0 0 110px -60px rgba(173, 114, 255, 0.45);
    overflow: hidden;
    animation: floatMockup 6s ease-in-out infinite;
}
.dashboard-mockup img { display: block; width: 100%; cursor: zoom-in; }
@keyframes floatMockup {
    0%, 100% { transform: perspective(1200px) rotateY(-8deg) rotateX(4deg) translateY(0); }
    50% { transform: perspective(1200px) rotateY(-6deg) rotateX(5deg) translateY(-12px); }
}
@media (prefers-reduced-motion: reduce) { .dashboard-mockup { animation: none; transform: none; } }

/* ---------------------------------------------------------------------
   Menu replica
   --------------------------------------------------------------------- */
.menu {
    --rail-w: 64px;
    position: relative;
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.25;
    color: var(--label);
    background: var(--page);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-window);
    box-shadow:
        var(--top-highlight),
        0 50px 90px -40px rgba(0, 0, 0, 0.95),
        0 0 0 6px rgba(15, 15, 17, 0.5),
        0 0 140px -50px rgba(173, 114, 255, 0.45);
    transform: perspective(1400px) rotateY(var(--tilt-y, -7deg)) rotateX(var(--tilt-x, 3deg));
    transform-style: preserve-3d;
    transition: transform 0.6s var(--ease-out);
}

.menu-rail {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 0 14px;
    background: var(--rail);
    border-right: 1px solid var(--line);
    border-radius: var(--r-window) 0 0 var(--r-window);
}
.menu-logo { width: 34px; height: 34px; margin: 2px 0 8px; filter: drop-shadow(0 0 8px rgba(173, 114, 255, 0.4)); }
.rail-sep { width: 34px; height: 1px; background: var(--line); margin-bottom: 8px; }
.rail-tab {
    position: relative;
    z-index: 1;
    width: 42px; height: 42px;
    border-radius: 10px;
    transition: background 0.2s;
}
.rail-tab::before {
    content: "";
    position: absolute;
    inset: 11px;
    background: var(--dim);
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
    transition: background 0.2s;
}
.rail-tab:hover { background: rgba(255, 255, 255, 0.04); }
.rail-tab:hover::before { background: var(--text); }
.rail-tab.is-active::before { background: var(--accent-ink); }
.rail-tab-danger { margin-top: auto; }
.rail-tab-danger:hover::before, .rail-tab-danger.is-active::before { background: var(--danger); }
.rail-pill {
    position: absolute;
    z-index: 0;
    left: 50%;
    top: 0;
    width: 42px; height: 42px;
    margin-left: -21px;
    border-radius: 10px;
    background: rgba(173, 114, 255, 0.14);
    border: 1px solid rgba(173, 114, 255, 0.32);
    box-shadow: 0 0 0 3px rgba(173, 114, 255, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: transform 0.45s var(--ease-out), background 0.3s, border-color 0.3s;
}
.rail-pill::before {
    content: "";
    position: absolute;
    left: calc(-1 * (var(--rail-w) - 42px) / 2 - 1px);
    top: 11px; bottom: 11px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: var(--accent);
}
.rail-pill.is-danger { background: rgba(248, 113, 113, 0.14); border-color: rgba(248, 113, 113, 0.32); }
.rail-pill.is-danger::before { background: var(--danger); }
.rail-avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: 32px; height: 32px;
    margin-top: 10px;
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    background: #5a3d86;
    border: 1px solid rgba(220, 198, 255, 0.35);
}
.rail-avatar i {
    position: absolute;
    right: -2px; bottom: -2px;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--success);
    border: 3px solid var(--rail);
}

.menu-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 0 16px 16px;
    border-radius: 0 var(--r-window) var(--r-window) 0;
}
.menu-head {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 64px;
    margin: 0 -16px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(90deg, rgba(173, 114, 255, 0.05), transparent 55%);
    border-radius: 0 var(--r-window) 0 0;
}
.menu-icon-tile {
    position: relative;
    flex: none;
    width: 38px; height: 38px;
    border-radius: 10px;
    background: rgba(173, 114, 255, 0.12);
    border: 1px solid rgba(173, 114, 255, 0.26);
}
.menu-icon-tile::before {
    content: "";
    position: absolute;
    inset: 10px;
    background: var(--accent-ink);
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}
.menu-title-wrap { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.menu-title { font-size: 21px; color: var(--text); letter-spacing: 0.02em; transition: opacity 0.25s, transform 0.25s var(--ease-out); }
.menu-title.is-switching { opacity: 0; transform: translateX(-6px); }
.menu-sub { font-size: 14px; color: var(--dim); }
.menu-head .m-badge { margin-left: auto; }

.menu-main > .m-seg > button { font-family: var(--font-ui); font-size: 15px; height: 30px; padding: 0 8px; }

.menu-body { position: relative; }
.m-panel { display: none; flex-direction: column; gap: 14px; }
.m-panel.is-active { display: flex; animation: panel-in 0.35s var(--ease-out); }
@keyframes panel-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Card (BeginCard) */
.m-card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--top-highlight);
    padding-bottom: 6px;
}
.m-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 38px;
    padding: 0 12px 0 14px;
    margin-bottom: 4px;
    font-family: var(--font-ui);
    font-size: 15px;
    color: var(--text);
    background: var(--card-head);
    border-bottom: 1px solid var(--line);
    border-radius: calc(var(--r-card) - 1px) calc(var(--r-card) - 1px) 0 0;
}
.m-card-head .m-switch, .m-card-head .m-badge, .m-head-note { margin-left: auto; }
.m-head-note { font-size: 14px; color: var(--dim); }

.m-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 38px;
    padding: 3px 14px;
    font-family: var(--font-ui);
    font-size: 15px;
    color: var(--label);
}
.m-row > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-row > .m-switch, .m-row > .m-combo, .m-row > .m-tag { margin-left: auto; }

.m-combo {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 28px;
    max-width: 62%;
    padding: 0 30px 0 10px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-control);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.m-combo::after {
    content: "";
    position: absolute;
    right: 11px; top: 50%;
    width: 6px; height: 6px;
    margin-top: -5px;
    border-right: 1.5px solid var(--dim);
    border-bottom: 1.5px solid var(--dim);
    transform: rotate(45deg);
}
.m-slider {
    position: relative;
    flex: 0 0 34%;
    height: 6px;
    border-radius: 3px;
    background: var(--inset);
    border: 1px solid var(--line);
}
.m-slider::before {
    content: "";
    position: absolute;
    left: 0; top: -1px; bottom: -1px;
    width: calc(var(--v) * 100%);
    border-radius: 3px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(173, 114, 255, 0.45);
    transition: width 0.6s var(--ease-out);
}
.m-slider i {
    position: absolute;
    top: 50%;
    left: calc(var(--v) * 100%);
    width: 12px; height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(173, 114, 255, 0.25), 0 1px 3px rgba(0, 0, 0, 0.5);
    transition: left 0.6s var(--ease-out);
}
.m-val { min-width: 52px; text-align: right; color: var(--text); white-space: nowrap; }

.m-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 6px 14px 8px;
}
.m-stats div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: var(--r-control);
    min-width: 0;
}
.m-stats span { font-size: 13px; color: var(--dim); }
.m-stats b { font-weight: normal; font-size: 17px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-stats .m-state { color: var(--success); }

/* ---------------------------------------------------------------------
   Engine strip (ControlBar with status edge)
   --------------------------------------------------------------------- */
.engine-strip {
    position: relative;
    display: flex;
    align-items: center;
    gap: 32px;
    min-height: 72px;
    padding: 12px 28px;
    background: linear-gradient(90deg, rgba(52, 211, 153, 0.06), transparent 40%), var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--top-highlight);
    overflow: hidden;
}
.engine-strip::before {
    content: "";
    position: absolute;
    left: 0; top: 18px; bottom: 18px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: var(--success);
}
.engine-state {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-ui);
    font-size: 16px;
    color: var(--text);
    white-space: nowrap;
}
.engine-stats {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.engine-stats > div {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    padding: 4px 12px;
    border-left: 1px solid var(--line);
}
.engine-stats dd { order: -1; font-size: 26px; font-weight: 600; color: var(--text); letter-spacing: -0.02em; white-space: nowrap; }
.engine-stats dt { font-size: 14px; color: var(--dim); white-space: nowrap; }

/* ---------------------------------------------------------------------
   Sections
   --------------------------------------------------------------------- */
.section { position: relative; padding: 128px 0 0; }
main > .section:last-child { padding-bottom: 128px; }

.section-head {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 18px;
}
.section-head h2 {
    flex: none;
    max-width: 100%;
    font-size: clamp(32px, 4.2vw, 50px);
    letter-spacing: -0.03em;
    line-height: 1.08;
}
.section-head .rule {
    flex: 1;
    min-width: 32px;
    height: 1px;
    background: linear-gradient(90deg, var(--line-strong), var(--line) 60%, transparent);
}
.section-lead {
    max-width: 58ch;
    margin-bottom: 56px;
    font-size: 18px;
    color: var(--body);
}
.section-lead-tight { margin-bottom: 32px; }

.chip {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 9px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    white-space: nowrap;
}
.chip-new {
    color: var(--accent-ink);
    background: rgba(173, 114, 255, 0.12);
    border: 1px solid rgba(173, 114, 255, 0.32);
}

/* ---------------------------------------------------------------------
   Live demos inside the feature cards
   --------------------------------------------------------------------- */
/* Mount demo */
.m-seg-inset { margin: 10px 10px 0; }
.m-seg-inset .m-seg-item { font-family: var(--font-ui); font-size: 15px; height: 30px; }
.m-seg-inset .m-seg-item.is-active { color: var(--text); }
.mount-scene {
    position: absolute;
    left: 10px; right: 10px; top: 56px; bottom: 10px;
    margin: 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 100% 22px,
        var(--inset);
    border: 1px solid var(--line);
    border-radius: var(--r-control);
    overflow: hidden;
}
.mount-ground {
    position: absolute;
    left: 0; right: 0; bottom: 22px;
    height: 1px;
    background: var(--line-strong);
}
.mount-path {
    position: absolute;
    left: 6%; right: 6%; bottom: 22px;
    height: 70px;
    border-top: 1.5px dashed rgba(173, 114, 255, 0.35);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    opacity: 0;
    transition: opacity 0.5s;
}
.demo-mount[data-state="2"] .mount-path { opacity: 1; }
.mount-rider {
    position: absolute;
    left: 50%;
    bottom: 22px;
    width: 14px; height: 14px;
    margin-left: -7px;
    border-radius: 50%;
    background: var(--accent-ink);
    box-shadow: 0 0 0 4px rgba(173, 114, 255, 0.18), 0 0 18px rgba(173, 114, 255, 0.8);
    transform: translateY(0);
    transition: transform 0.9s var(--ease-out);
}
.mount-rider::after {
    content: "";
    position: absolute;
    left: 50%; top: 100%;
    width: 30px; height: 3px;
    margin: 3px 0 0 -15px;
    border-radius: 2px;
    background: var(--accent);
    opacity: 0;
    transform: scaleX(0.4);
    transition: opacity 0.4s, transform 0.4s var(--ease-out);
}
.demo-mount[data-state="1"] .mount-rider::after,
.demo-mount[data-state="2"] .mount-rider::after { opacity: 1; transform: none; }
.demo-mount[data-state="2"] .mount-rider { transform: translateY(-62px); }
.demo-mount[data-state="1"] .mount-rider { transform: translateY(-4px); }

/* Hotkey slot demo */
.slot-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    height: 100%;
    padding: 10px;
}
.slot-grid li {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    padding: 8px;
    font-family: var(--font-ui);
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: var(--r-control);
    transition: border-color 0.4s, background 0.4s;
}
.slot-grid kbd {
    align-self: flex-start;
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--text);
    padding: 2px 7px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 5px;
}
.slot-name {
    font-size: 13px;
    line-height: 1.2;
    color: var(--text);
    min-height: 2.4em;
}
.slot-type { margin-top: auto; font-size: 13px; color: var(--dim); }
.slot-grid li.is-read[data-type="skill"] { border-color: rgba(173, 114, 255, 0.35); background: linear-gradient(180deg, rgba(173, 114, 255, 0.08), transparent 70%), var(--inset); }
.slot-grid li.is-read[data-type="skill"] .slot-type { color: var(--accent-ink); }
.slot-grid li.is-read[data-type="item"] { border-color: rgba(94, 230, 196, 0.3); background: linear-gradient(180deg, rgba(94, 230, 196, 0.07), transparent 70%), var(--inset); }
.slot-grid li.is-read[data-type="item"] .slot-type { color: var(--mint); }
.slot-grid li.is-read[data-type="empty"] { border-style: dashed; }
.slot-grid li.is-read[data-type="empty"] .slot-name { color: var(--disabled); }
.slot-grid li.is-reading .slot-name { color: var(--accent); }

/* Giant demo */
.radar-wrap {
    margin: 10px 14px 6px;
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: var(--r-control);
    overflow: hidden;
}
.demo-giant { position: absolute; inset: 0; display: grid; place-items: center; }
.radar { display: block; width: 100%; height: auto; aspect-ratio: 520 / 300; }

/* ---------------------------------------------------------------------
   Features (card grid)
   --------------------------------------------------------------------- */
.feature-wrap {
    position: relative;
    overflow: hidden;
}
.feature-wrap::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 180px;
    background: linear-gradient(to bottom, transparent, var(--page) 92%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s;
}
.feature-wrap.is-collapsed::after { opacity: 1; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 16px;
}
.feature-card {
    display: flex;
    flex-direction: column;
    padding: 12px 12px 20px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--top-highlight);
    transition: border-color 0.25s;
}
.feature-card:hover { border-color: var(--line-strong); }
.feature-card h3 {
    margin: 0 6px 6px;
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.feature-card p {
    margin: 0 6px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--body);
    /* every card holds exactly three lines, so all cards line up */
    min-height: calc(1.55em * 3);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Preview slot: GIF, image, video or a live demo. All slots share one size. */
.feature-media {
    position: relative;
    flex: none;
    aspect-ratio: 16 / 10;
    margin-bottom: 16px;
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: var(--r-control);
    overflow: hidden;
    isolation: isolate;   /* keeps z-index of slides/tags inside, so the "Show all" fade still covers them */
}
.feature-media > img, .feature-media > video { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Shown 1:1 at its own pixel size (no resampling, text stays sharp); centered in the slot. */
.feature-media > img.media-native { object-fit: none; object-position: center; }

/* Real footage (GIF/video) is far brighter than the dark UI around it. Instead of just dimming it,
   grade it into the site palette:
   ::before multiplies a violet grade over it (near-white in the middle, deep violet at the edges),
            so bright snow turns cool lavender while yellow ESP labels stay yellow;
   ::after  fades the very edge into the card background and adds a faint accent glow on top.
   Neither layer resamples the picture, so text stays pixel-sharp. */
.feature-media > img, .feature-media > video { filter: saturate(0.9) contrast(1.04); }
.feature-media:has(> img, > video)::before,
.feature-media:has(> img, > video)::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.feature-media:has(> img, > video)::before {
    z-index: 3;
    mix-blend-mode: multiply;
    background: radial-gradient(ellipse 75% 80% at 50% 45%, #dcd8e4 0%, #bab3c9 55%, #4a445a 100%);
}
.feature-media:has(> img, > video)::after {
    z-index: 4;
    background:
        radial-gradient(ellipse 85% 90% at 50% 45%, transparent 60%, rgba(13, 13, 15, 0.55) 100%),
        linear-gradient(180deg, rgba(173, 114, 255, 0.08), transparent 40%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045);
}

/* Loading state (set by initMediaLoading in main.js): media stays hidden, a violet shimmer and a
   spinner run until it has loaded, then the media fades in and the loader fades out. */
.feature-media > img, .feature-media > video { transition: opacity 0.45s ease; }
.feature-media.is-loading > img, .feature-media.is-loading > video { opacity: 0; }
.media-loader {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    pointer-events: none;
    background:
        linear-gradient(100deg, transparent 30%, rgba(173, 114, 255, 0.09) 50%, transparent 70%) 0 0 / 250% 100%,
        radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 14px 14px,
        var(--inset);
    animation: media-shimmer 1.6s linear infinite;
    transition: opacity 0.45s ease;
}
.media-loader::after {
    content: "";
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(173, 114, 255, 0.18);
    border-top-color: var(--accent);
    animation: media-spin 0.8s linear infinite;
}
.feature-media:not(.is-loading) > .media-loader { opacity: 0; }
@keyframes media-shimmer { from { background-position: 150% 0, 0 0; } to { background-position: -50% 0, 0 0; } }
@keyframes media-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .media-loader { animation: none; }
    .media-loader::after { animation-duration: 2s; }
}
/* Neutral placeholder until a preview is added */
.feature-media:empty {
    background:
        radial-gradient(circle at 50% 50%, rgba(173, 114, 255, 0.10), transparent 60%),
        radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 14px 14px,
        var(--inset);
}
.feature-media:empty::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 46px; height: 46px;
    margin: -23px 0 0 -23px;
    border-radius: 50%;
    box-shadow: inset 9px -7px 0 0 rgba(220, 198, 255, 0.28);
    transform: rotate(-20deg);
}
.media-tag { position: absolute; right: 10px; bottom: 10px; z-index: 2; }

/* Stacked slides that crossfade in order 1, 2, 3, 1 ... (driven by initMediaFade in main.js).
   The slide marked .is-on is shown; without JS only that one is visible. */
.feature-media.media-fade > * { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease-in-out; }
.feature-media.media-fade > .is-on  { opacity: 1; z-index: 2; }
.feature-media.media-fade > .was-on { opacity: 1; z-index: 1; }

/* Slide for images that don't fit 16:10: shown whole, a blurred copy fills the rest.
   Usage: <div class="media-slide" style="--src:url(/path.png)"><img src="/path.png" alt=""></div> */
.media-slide { overflow: hidden; }
.media-slide::before {
    content: "";
    position: absolute;
    inset: -24px;
    background: var(--src) center / cover no-repeat;
    filter: blur(16px) brightness(0.5);
}
.media-slide > img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; }

.feature-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
}
.feature-more[hidden] { display: none; }
.feature-more-text {
    font-size: 14px;
    color: var(--text-muted, #888);
    margin: 0;
}

.callout {
    padding: 14px 16px;
    font-size: 15px;
    color: var(--label);
    border-radius: var(--r-control);
    border: 1px solid;
}
.callout-success { background: rgba(52, 211, 153, 0.06); border-color: rgba(52, 211, 153, 0.28); }
.callout-accent  { background: rgba(173, 114, 255, 0.06); border-color: rgba(173, 114, 255, 0.28); }
.callout-warning { background: rgba(251, 191, 36, 0.06); border-color: rgba(251, 191, 36, 0.28); }
.callout-discord { background: rgba(88, 101, 242, 0.07); border-color: rgba(88, 101, 242, 0.32); }

/* ---------------------------------------------------------------------
   Servers
   --------------------------------------------------------------------- */
.server-list-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.server-loading { grid-column: 1 / -1; padding: 48px; text-align: center; color: var(--dim); font-family: var(--font-ui); }

.server-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--top-highlight);
    transition: border-color 0.25s;
}
.server-card:hover { border-color: var(--line-strong); }
.server-card-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.server-logo {
    flex: none;
    display: grid;
    place-items: center;
    width: 52px; height: 52px;
    overflow: hidden;
    font-family: var(--font-ui);
    font-size: 18px;
    color: var(--accent-ink);
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
}
.server-logo-image { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.server-card-info { min-width: 0; }
.server-card-info h3 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.server-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.server-actions .btn { flex: 1; height: 36px; padding: 0 12px; font-size: 14px; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 24px;
    padding: 0 10px;
    font-family: var(--font-ui);
    font-size: 14px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
}
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-working { color: var(--success); }
.status-update  { color: var(--warning); }
.status-offline { color: var(--danger); }
.status-soon    { color: var(--accent-ink); }

/* "More coming" tile (AddTile) */
.server-card-add {
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    min-height: 148px;
    background: transparent;
    border: 1px dashed var(--line-strong);
    box-shadow: none;
}
.server-card-add .plus {
    display: grid;
    place-items: center;
    width: 34px; height: 34px;
    font-size: 22px;
    line-height: 1;
    color: var(--dim);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-control);
}
.server-card-add strong { font-size: 16px; }
.server-card-add span { font-size: 14px; color: var(--dim); }

/* ---------------------------------------------------------------------
   Showcase carousel
   --------------------------------------------------------------------- */
.section-showcase .section-head { margin-bottom: 0; }
.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 60px 0 124px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.carousel-track {
    display: flex;
    align-items: center;
    gap: 28px;
    will-change: transform;
}
.carousel-item {
    flex: 0 0 min(68%, 760px);
    aspect-ratio: 16 / 9;
    border-radius: var(--r-card);
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
    opacity: 0.35;
    transform: scale(0.9);
    filter: saturate(0.6);
    cursor: pointer;
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out), filter 0.8s, border-color 0.4s, box-shadow 0.8s;
}
.carousel-item.active {
    opacity: 1;
    transform: none;
    filter: none;
    cursor: zoom-in;
    border-color: var(--line-strong);
    box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(173, 114, 255, 0.2), 0 0 50px -20px rgba(173, 114, 255, 0.45);
}
.carousel-item img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
.carousel-nav {
    position: absolute;
    left: 50%; bottom: 52px;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}
.carousel-btn {
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    color: var(--label);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-control);
    box-shadow: var(--top-highlight);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.carousel-btn:hover { background: var(--surface-2); border-color: var(--hover); color: var(--text); }
.carousel-btn svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------------------
   Pricing
   --------------------------------------------------------------------- */
.promo-timer {
    display: none;
    margin: -12px 0 28px;
    font-family: var(--font-ui);
    font-size: 16px;
    color: var(--accent-ink);
}
.promo-active .promo-timer { display: block; }

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}
.price-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--top-highlight);
}
.price-card.featured {
    border-color: rgba(173, 114, 255, 0.5);
    box-shadow: var(--top-highlight), 0 0 0 4px rgba(173, 114, 255, 0.07), 0 30px 80px -40px rgba(173, 114, 255, 0.55);
}
.price-head {
    display: flex;
    align-items: center;
    gap: 11px;
    height: 50px;
    padding: 0 14px 0 18px;
    background: var(--card-head);
    border-bottom: 1px solid var(--line);
    border-radius: calc(var(--r-card) - 1px) calc(var(--r-card) - 1px) 0 0;
}
.price-head h3 { font-size: 18px; }
.price-badge {
    margin-left: auto;
    height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    font-size: 13px;
    font-weight: 600;
    color: var(--label);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    white-space: nowrap;
}
.price-badge-accent { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.price-badge-danger { color: var(--danger); background: rgba(248, 113, 113, 0.08); border-color: rgba(248, 113, 113, 0.32); }

.price-val { padding: 26px 18px 6px; }
.current-price {
    display: block;
    font-size: 54px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--text);
}
.price-val small { display: block; margin-top: 10px; font-size: 14px; color: var(--dim); }
.old-price-tag { display: none; }
.promo-active .old-price-tag {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 16px;
    color: var(--dim);
    text-decoration: line-through;
    text-decoration-color: var(--danger);
}

.feature-list {
    list-style: none;
    display: grid;
    gap: 9px;
    padding: 18px 18px 24px;
    margin-top: 12px;
    border-top: 1px solid var(--line);
}
.feature-list li {
    position: relative;
    padding-left: 24px;
    font-size: 15px;
    color: var(--label);
}
.feature-list li::before {
    content: "";
    position: absolute;
    left: 2px; top: 0.45em;
    width: 10px; height: 6px;
    border-left: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(-45deg);
}
.price-card .btn { margin: auto 18px 18px; }

.addons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 32px;
}
.addon {
    padding: 18px 20px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--top-highlight);
}
.addons h4 { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; font-size: 17px; }
.addons h4 span { margin-left: auto; font-size: 15px; font-weight: 600; color: var(--accent-ink); }
.addons p { font-size: 15px; color: var(--body); }

.payment-info { margin-top: 48px; text-align: center; }
.pay-chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}
.pay-chips li {
    padding: 5px 12px;
    font-size: 14px;
    color: var(--label);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-control);
}
.payment-info p { max-width: 62ch; margin-inline: auto; font-size: 15px; color: var(--dim); }

/* ---------------------------------------------------------------------
   FAQ
   --------------------------------------------------------------------- */
.faq-list {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--top-highlight);
    overflow: hidden;
}
.faq-panel { border-top: 1px solid var(--line); position: relative; }
.faq-panel:first-child { border-top: 0; }
.faq-panel::before {
    content: "";
    position: absolute;
    left: 0; top: 18px;
    width: 3px; height: 26px;
    border-radius: 0 2px 2px 0;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform 0.35s var(--ease-out);
}
.faq-panel.active::before { transform: none; }
.faq-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    padding: 20px 24px;
    text-align: left;
    transition: background 0.2s;
}
.faq-trigger:hover { background: rgba(255, 255, 255, 0.02); }
.faq-trigger h3 { font-size: 17px; font-weight: 500; color: var(--label); transition: color 0.2s; }
.faq-panel.active .faq-trigger h3, .faq-trigger:hover h3 { color: var(--text); }
.faq-trigger span {
    position: relative;
    flex: none;
    width: 28px; height: 28px;
    border-radius: var(--r-control);
    background: var(--surface);
    border: 1px solid var(--line-strong);
}
.faq-trigger span::before, .faq-trigger span::after {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 10px; height: 1.5px;
    margin: -0.75px 0 0 -5px;
    background: var(--label);
    border-radius: 1px;
    transition: transform 0.35s var(--ease-out);
}
.faq-trigger span::after { transform: rotate(90deg); }
.faq-panel.active .faq-trigger span { border-color: rgba(173, 114, 255, 0.4); background: rgba(173, 114, 255, 0.1); }
.faq-panel.active .faq-trigger span::after { transform: rotate(0deg); }
.faq-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s var(--ease-out);
}
.faq-panel.active .faq-content { grid-template-rows: 1fr; }
.faq-content-inner { overflow: hidden; }
.faq-content-inner p { padding: 0 24px 22px; max-width: 72ch; font-size: 16px; color: var(--body); }

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
.footer {
    position: relative;
    margin-top: 40px;
    padding: 64px 0 32px;
    background: var(--rail);
    border-top: 1px solid var(--line);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr));
    gap: 40px;
    padding-bottom: 48px;
}
.footer-brand p { margin: 16px 0 20px; max-width: 34ch; font-size: 15px; color: var(--dim); }
.footer-col h4 { margin-bottom: 14px; font-size: 15px; color: var(--text); }
.footer-links { list-style: none; display: grid; gap: 8px; }
.footer-links a { font-size: 15px; color: var(--dim); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--line);
    font-size: 14px;
    color: var(--disabled);
}

/* ---------------------------------------------------------------------
   Modals (menu window)
   --------------------------------------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(5, 5, 7, 0.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.modal.open { opacity: 1; visibility: visible; }
.modal-pane {
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-window);
    box-shadow: var(--top-highlight), 0 50px 100px -30px rgba(0, 0, 0, 0.95), 0 0 120px -50px rgba(173, 114, 255, 0.5);
    transform: translateY(12px) scale(0.98);
    transition: transform 0.4s var(--ease-out);
    overflow: hidden;
}
.modal.open .modal-pane { transform: none; }
.modal-pane-wide { max-width: 700px; }
.modal-head {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    flex: none;
    padding: 0 10px 0 20px;
    background: var(--card-head);
    border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 19px; letter-spacing: -0.01em; }
.modal-close {
    display: grid;
    place-items: center;
    width: 36px; height: 36px;
    margin-left: auto;
    font-size: 24px;
    line-height: 1;
    color: var(--dim);
    border-radius: var(--r-control);
    transition: background 0.2s, color 0.2s;
}
.modal-close:hover { background: rgba(248, 113, 113, 0.12); color: var(--danger); }
.modal-body { padding: 22px 20px 24px; overflow-y: auto; display: grid; gap: 16px; font-size: 16px; }
.modal-body > p { color: var(--body); }
.modal-option {
    display: grid;
    gap: 10px;
    padding: 16px;
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
}
.modal-option h4 { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.modal-option p { font-size: 15px; color: var(--body); }
.modal-option a:not(.btn) { color: var(--accent-ink); }
.modal-option .btn { margin-top: 4px; }
.modal-sign { text-align: center; font-size: 15px; color: var(--dim) !important; }

.modal-feature-list { list-style: none; display: grid; gap: 2px; }
.modal-feature-list li {
    position: relative;
    padding: 7px 10px 7px 28px;
    font-size: 15px;
    color: var(--label);
    border-radius: 6px;
}
.modal-feature-list li:not(.feat-category):hover { background: rgba(255, 255, 255, 0.025); }
.modal-feature-list li:not(.feat-category)::before {
    content: "";
    position: absolute;
    left: 11px; top: 50%;
    width: 6px; height: 6px;
    margin-top: -3px;
    border-radius: 2px;
    background: var(--accent);
}
.modal-feature-list .feat-category {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0 6px;
}
.modal-feature-list .feat-category:first-child { padding-top: 0; }
.feat-category-text { font-family: var(--font-ui); font-size: 15px; color: var(--text); white-space: nowrap; }
.feat-category-line { flex: 1; height: 1px; background: var(--line); }

.modal-image { background: rgba(5, 5, 7, 0.92); }
.modal-image img {
    max-width: min(95vw, 1600px);
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: var(--r-card);
    border: 1px solid var(--line-strong);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.9);
    transform: scale(0.97);
    transition: transform 0.4s var(--ease-out);
}
.modal-image.open img { transform: none; }
.modal-close-float {
    position: absolute;
    top: 20px; right: 20px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
}

/* Back to top */
.back-to-top {
    position: fixed;
    right: 24px; bottom: 24px;
    z-index: 900;
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    color: var(--label);
    background: rgba(27, 27, 30, 0.85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-control);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s var(--ease-out), color 0.2s, border-color 0.2s;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { color: var(--text); border-color: var(--hover); }

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nav-links > a:not(.btn) { padding: 8px 9px; font-size: 14px; }
}

@media (max-width: 980px) {
    .hamburger { display: flex; }
    .nav-links {
        position: absolute;
        top: calc(100% + 8px);
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 8px;
        background: rgba(15, 15, 17, 0.97);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
        border: 1px solid var(--line-strong);
        border-radius: var(--r-window);
        box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
        transition: opacity 0.25s, visibility 0.25s, transform 0.3s var(--ease-out);
    }
    .nav-links.active { opacity: 1; visibility: visible; transform: none; }
    .nav-links > a:not(.btn) { padding: 12px 14px; font-size: 16px; }
    .nav-links .btn-download { margin: 6px 0 0; height: 44px; }
    .nav-pill { display: none; }
    .lang-switch { margin: 6px 0 0; }
    .lang-btn { width: 100%; height: 44px; justify-content: center; }
    .lang-menu { position: static; display: none; margin-top: 6px; box-shadow: none; transform: none; }
    .lang-switch.is-open .lang-menu { display: block; }

    .hero { min-height: 0; padding-top: 120px; }
    .hero-grid { grid-template-columns: 1fr; gap: 56px; }
    .hero h1 { max-width: 14ch; }
    .menu { margin-inline: auto; --tilt-y: 0deg; --tilt-x: 0deg; }
    .hero-moon { width: 120vw; right: -50vw; top: -10vh; }

    .engine-strip { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px 20px 18px 24px; }
    .engine-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 0; }
    .engine-stats > div { justify-content: flex-start; border-left: 0; padding: 0; }


    .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .addons { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    body { font-size: 16px; }
    .container { padding-inline: 16px; }
    .navbar { top: 10px; }
    .navbar .container { width: calc(100% - 20px); }
    .logo span, .nav-simple > a:not(.btn) { display: none; }
    .section { padding-top: 96px; }
    main > .section:last-child { padding-bottom: 96px; }
    .section-head { gap: 16px; }
    .section-head h2 { flex: 1 1 auto; }
    .section-head .rule { display: none; }
    .section-lead { font-size: 17px; margin-bottom: 40px; }

    .hero .lead { font-size: 17px; }
    .hero-actions .btn { flex: 1 1 auto; }

    .menu { --rail-w: 52px; font-size: 14px; }
    .menu-rail { gap: 4px; padding-top: 10px; }
    .menu-logo { width: 28px; height: 28px; }
    .rail-tab, .rail-pill { width: 36px; height: 36px; }
    .rail-pill { margin-left: -18px; }
    .rail-pill::before { left: calc(-1 * (var(--rail-w) - 36px) / 2 - 1px); top: 9px; bottom: 9px; }
    .rail-tab::before { inset: 9px; }
    .rail-avatar { width: 28px; height: 28px; }
    .menu-main { padding: 0 10px 10px; gap: 10px; }
    .menu-head { margin: 0 -10px; padding: 0 10px; height: 56px; gap: 10px; }
    .menu-icon-tile { display: none; }
    .menu-title { font-size: 17px; }
    .menu-head .m-badge { font-size: 13px; padding: 0 8px; }
    .menu-main > .m-seg > button { font-size: 14px; padding: 0 4px; }
    .m-row { font-size: 14px; padding: 3px 10px; gap: 8px; }
    .m-card-head { font-size: 14px; padding: 0 10px; }
    .m-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 6px 10px 8px; }
    .m-slider { flex-basis: 28%; }

    .m-seg-inset { margin-inline: 10px; }
    .m-seg-inset .m-seg-item { font-size: 14px; padding: 0 6px; }

    .feature-grid { grid-template-columns: 1fr; }

    .pricing-grid { grid-template-columns: 1fr; }
    .carousel-item { flex-basis: 86%; }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .faq-trigger { padding: 18px; }
    .faq-content-inner p { padding: 0 18px 20px; }
    .back-to-top { right: 16px; bottom: 16px; }
}

/* ---------------------------------------------------------------------
   Reduced motion
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
    .menu { transform: none; }
}
