/* Rustomat -- marketing + account site
   Dark/space theme matching the logo: black background, white bold
   type, silver ring accent, a cool blue glow as the one accent color. */

:root {
    --bg: #06060a;
    --bg-elevated: #0e0e16;
    --bg-card: #111119;
    --border: #23232f;
    --text: #f2f2f5;
    --text-dim: #9a9aac;
    --text-faint: #5a5a6c;
    --accent: #6fb1ff;
    --accent-dim: #3d7cc9;
    --ring: #b9b9c4;
    --success: #5fd88a;
    --danger: #ff6b6b;
    --warn: #f0c674;
    --radius: 10px;
    --radius-lg: 16px;
    --max-width: 1120px;

    --accent-2: #a78bfa;
    --glow-sm: 0 0 16px rgba(111, 177, 255, 0.35);
    --glow-md: 0 0 1px rgba(111, 177, 255, 0.8), 0 0 32px rgba(111, 177, 255, 0.32), 0 0 70px rgba(111, 177, 255, 0.12);
    --glass-border: linear-gradient(135deg, rgba(111, 177, 255, 0.55), rgba(167, 139, 250, 0.28) 45%, rgba(255, 255, 255, 0.06) 80%);
}

* { box-sizing: border-box; }
/* overflow-x:hidden alone on body (below) doesn't reliably stop the page
   from horizontally scrolling/growing on mobile -- it's html (the actual
   root scroller in standards mode, especially on iOS Safari) that decides
   whether overflowing descendants expand the layout viewport. Without
   this, the hero's absolutely-positioned ::after bloom blob (480px wide,
   positioned well right of center) pushed the effective page width past
   the real device width, which is what showed up as a big empty region on
   the right on phones -- the whole page was laid out wider than the
   screen and fit-to-width, not literally missing content. */
/* overscroll-behavior-x: none is a second, independent layer on top of
   overflow-x:hidden -- it specifically disables the touch-drag rubber-band
   gesture past the content edge (what was reported as "drag right and
   there's empty space"), which overflow-x:hidden governs scrolling but
   doesn't always fully suppress as a gesture on mobile Safari. */
html { scroll-behavior: smooth; overflow-x: hidden; overscroll-behavior-x: none; }

body {
    margin: 0;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.35) 0, transparent 0),
        radial-gradient(1px 1px at 70% 65%, rgba(255,255,255,0.25) 0, transparent 0),
        radial-gradient(1.5px 1.5px at 40% 80%, rgba(255,255,255,0.3) 0, transparent 0),
        radial-gradient(1px 1px at 90% 15%, rgba(255,255,255,0.2) 0, transparent 0),
        radial-gradient(1px 1px at 55% 45%, rgba(255,255,255,0.15) 0, transparent 0);
    background-repeat: repeat;
    background-size: 400px 400px;
}

.wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #fff; }

h1, h2, h3 { font-weight: 800; letter-spacing: -0.01em; margin: 0 0 0.5em; }
p { color: var(--text-dim); }

/* ---------------------------------------------------------------------
   Header
--------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(6, 6, 10, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 0.02em;
}
.brand:hover { color: var(--text); }
.brand-mark { width: 28px; height: 28px; object-fit: contain; }
.brand-o-img {
    width: 34px;
    height: 34px;
    vertical-align: middle;
    /* Negative left/right margin pulls RUST and MAT back together despite
       the image's larger box -- it renders bigger than its own layout
       footprint and visually overlaps into the neighboring letters
       (touching them) instead of pushing them apart. */
    margin: -3px -7px 0;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(111, 177, 255, 0.5));
}
.brand-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    line-height: 1;
}
.brand-group .brand { line-height: 1; }
.users-online {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    line-height: 1;
}
.users-online-text { display: inline-flex; align-items: baseline; }
.users-online-label { margin-left: 3px; text-transform: lowercase; }
.users-online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px rgba(95, 216, 138, 0.7);
    animation: users-online-pulse 2s ease-in-out infinite;
}
@keyframes users-online-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { color: var(--text-dim); font-weight: 600; font-size: 14px; }
.site-nav a:hover { color: var(--text); }
.site-nav .btn-primary, .site-nav .btn-primary:hover { color: #fff; }

/* ---------------------------------------------------------------------
   Buttons / forms
--------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 15px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #04070d; }
.btn-primary:hover { background: #85bcff; color: #04070d; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-small { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #200; }

.auth-card, .panel-card {
    max-width: 420px;
    margin: 64px auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
}
.auth-card {
    max-width: 500px;
    padding: 44px 48px;
}
.auth-card h1 { text-align: center; }
.auth-sub { margin-top: -8px; margin-bottom: 20px; text-align: center; }
.auth-form label {
    display: block;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dim);
}
.auth-form input, .auth-form select {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 11px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
}
.auth-form input:focus, .auth-form select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--glow-sm);
}
/* Cloudflare injects the actual widget as a fixed-width iframe inside
   this div -- it isn't full-width like the inputs above, so without this
   it just sits flush left with empty space to its right. */
.cf-turnstile {
    display: flex;
    justify-content: center;
}
/* Login/register "field hint" -- a one-line aside under the form that
   swaps based on whichever input currently has focus (see each input's
   data-hint attribute and main.js's focusin/focusout handler). Reserves
   its height even when empty so the form doesn't jump as it fades in. */
.field-hint {
    min-height: 18px;
    margin: -10px 0 18px;
    font-size: 13px;
    color: var(--accent);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.field-hint.visible { opacity: 1; transform: translateY(0); }
.auth-alt { margin-top: 18px; font-size: 14px; text-align: center; }
/* admin/roles.php's permission picker -- plain flex rows, no box/border/
   background, just checkbox+text side by side. Flex (not
   vertical-align:middle) is what actually keeps the checkbox and text
   aligned -- native checkboxes render inconsistently across browsers, and
   vertical-align only approximates it. .perm-checklist .perm-row (two
   classes) outranks .auth-form label (one class + one element) on
   specificity, so this doesn't depend on source order in the file. */
.perm-checklist .perm-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 400;
    color: var(--text);
    cursor: pointer;
}
.perm-checklist .perm-row:last-child { margin-bottom: 0; }
/* .auth-form input targets EVERY input inside the form, checkboxes
   included -- display:block + width:100% there is what was actually
   blowing this apart (a checkbox forced to 100% width inside a flex row
   shoves the label text off to the side instead of sitting next to it).
   Every property .auth-form input sets gets explicitly undone here. */
.perm-checklist .perm-row input[type="checkbox"] {
    display: inline-block;
    width: auto;
    height: auto;
    margin-top: 0;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    flex-shrink: 0;
    margin: 0;
}
.form-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.35);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 18px;
}
.form-success {
    background: rgba(95, 216, 138, 0.1);
    border: 1px solid rgba(95, 216, 138, 0.35);
    color: var(--success);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 18px;
}

/* ---------------------------------------------------------------------
   Hero
--------------------------------------------------------------------- */
.hero {
    padding: 44px 0 72px;
    text-align: center;
}
.hero-logo { width: 96px; height: 96px; object-fit: contain; margin-bottom: 16px; }
.hero h1 {
    font-size: clamp(36px, 6vw, 64px);
    margin-bottom: 18px;
}
.hero .accent { color: var(--accent); }
.hero p.lede {
    max-width: 620px;
    margin: 0 auto 32px;
    font-size: 18px;
    color: var(--text-dim);
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-video {
    margin: 56px auto 0;
    max-width: 900px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 40px 120px -40px rgba(111, 177, 255, 0.25);
}
.hero-video video { display: block; width: 100%; }

/* ---------------------------------------------------------------------
   Sections
--------------------------------------------------------------------- */
section { padding: 88px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 52px; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); }
.eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
}

.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 24px;
    margin-bottom: 12px;
}
.faq-item summary {
    cursor: pointer;
    padding: 18px 0;
    font-weight: 700;
    font-size: 16px;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    flex-shrink: 0;
    font-size: 22px;
    font-weight: 400;
    color: var(--accent);
    transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding-bottom: 18px; margin: 0; }

.stats-box {
    max-width: 640px;
    margin: 48px auto 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 40px;
}
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 64px;
    flex-wrap: wrap;
    text-align: center;
}
.stats-item {
    flex: 1 1 140px;
    text-align: center;
}
.stats-number {
    font-size: 40px;
    font-weight: 800;
    color: var(--text);
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
    .stats-number {
        background: linear-gradient(90deg, var(--text), var(--accent) 140%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
    }
}
.stats-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    margin-top: 4px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
}
.feature-card .icon { font-size: 26px; margin-bottom: 14px; display: block; }
.feature-card .icon-svg { width: 26px; height: 26px; margin-bottom: 14px; display: block; }
.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; margin: 0; }

.pricing-grid {
    display: grid;
    /* Max track size capped at 393px (75% of the 524px each card rendered
       at before -- was uncapped via 1fr, stretching to fill half the
       section) -- auto-fit still drops to a single column on narrow
       viewports via the 280px floor. justify-content centers the now-
       narrower tracks instead of leaving them flush left with empty
       space trailing. */
    grid-template-columns: repeat(auto-fit, minmax(280px, 393px));
    justify-content: center;
    gap: 24px;
    align-items: stretch;
}
.price-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    flex-direction: column;
}
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.price-card h3 { font-size: 20px; }
.price-card .tagline { font-size: 13px; color: var(--text-faint); margin-bottom: 20px; }
.price-amount { font-size: 42px; font-weight: 800; margin: 6px 0 4px; }
.price-amount span { font-size: 15px; color: var(--text-faint); font-weight: 600; }
.price-terms { font-size: 13px; color: var(--text-faint); margin-bottom: 22px; }
.price-list { list-style: none; margin: 0 0 26px; padding: 0; flex: 1; }
.price-list li {
    padding: 9px 0;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-dim);
}
.price-list li:first-child { border-top: none; }
.price-list li::before { content: "\2713  "; color: var(--success); font-weight: 800; }

/* ---------------------------------------------------------------------
   Footer
--------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; }
.site-footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--text-faint);
    font-size: 13px;
}
.site-footer-inner nav { display: flex; gap: 18px; }
.site-footer-inner a { color: var(--text-faint); }
.site-footer-inner a:hover { color: var(--text); }

/* ---------------------------------------------------------------------
   Account / admin panels
--------------------------------------------------------------------- */
.dash-wrap { max-width: 960px; margin: 48px auto; padding: 0 24px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 32px; }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.stat-card .label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); font-weight: 700; }
.stat-card .value { font-size: 28px; font-weight: 800; margin-top: 6px; }
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.badge-ok { background: rgba(95, 216, 138, 0.15); color: var(--success); }
.badge-warn { background: rgba(240, 198, 116, 0.15); color: var(--warn); }
.badge-danger { background: rgba(255, 107, 107, 0.15); color: var(--danger); }

table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 32px; }
table.data-table th, table.data-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

/* ---- expandable per-row edit panel (admin/users.php) -------------------
   Clicking "Edit" toggles a full-width row directly below the compact
   user row (see main.js's data-toggle-row handler) instead of cramming
   every moderation action into one narrow cell. */
tr.edit-row td {
    background: var(--bg-elevated);
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}
.edit-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.edit-section h4 {
    margin: 0 0 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
}
.edit-section-danger h4 { color: var(--danger); }
table.data-table th { color: var(--text-faint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }

.admin-nav-wrap { border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.admin-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 22px 0 16px;
}
.admin-nav a { display: inline-flex; align-items: center; color: var(--text-dim); font-weight: 700; font-size: 14px; line-height: 1; }
.admin-nav a.active, .admin-nav a:hover { color: var(--accent); }

.rank-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.rank-bar-label { width: 80px; font-size: 13px; color: var(--text-dim); text-transform: capitalize; flex-shrink: 0; }
.rank-bar-track { flex: 1; height: 10px; background: var(--bg-elevated); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.rank-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 10px rgba(111, 177, 255, 0.4); border-radius: 999px; transition: width 0.6s ease; }
.rank-bar-count { width: 120px; text-align: right; font-size: 13px; color: var(--text-faint); flex-shrink: 0; }

.bar-chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; margin-top: 18px; }
.bar-chart .bar {
    flex: 1;
    min-width: 3px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    border-radius: 3px 3px 0 0;
    box-shadow: 0 0 10px rgba(111, 177, 255, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.bar-chart .bar:hover { transform: scaleY(1.04); box-shadow: var(--glow-sm); }
.bar-chart-caption { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-faint); margin-top: 8px; }

.qr-code-img {
    display: block;
    margin: 6px auto 22px;
    background: #fff;
    padding: 14px;
    border-radius: 12px;
    box-shadow: var(--glow-sm);
}

.mono { font-family: 'Consolas', 'Cascadia Code', monospace; }
.secret-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    font-family: 'Consolas', 'Cascadia Code', monospace;
    font-size: 16px;
    letter-spacing: 0.04em;
    word-break: break-all;
    margin: 12px 0;
}

@media (max-width: 640px) {
    .hero { padding: 32px 0 48px; }
}

/* =======================================================================
   Glass / glow / bloom pass -- gradient-ring borders, neon hover glow,
   gloss sweep on buttons, ambient bloom blobs, scroll reveal, toasts,
   and a proper mobile nav (the old build just hid nav links under 640px
   with no way to reach them -- fixed here with a real toggle panel).
   ======================================================================= */

/* ---- glossy gradient-ring card treatment -----------------------------
   Two-layer background trick: an opaque fill in the padding-box, a
   gradient ring in the border-box showing through the 1px transparent
   border -- cheaper than a pseudo-element per card and keeps existing
   border-radius/box-shadow rules intact. */
.feature-card, .price-card, .stat-card, .panel-card, .auth-card, .stats-box {
    border: 1px solid transparent;
    background-image: linear-gradient(var(--bg-card), var(--bg-card)), var(--glass-border);
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.feature-card:hover, .price-card:hover, .stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--glow-md);
}
.price-card.featured {
    background-image: linear-gradient(var(--bg-card), var(--bg-card)),
        linear-gradient(135deg, var(--accent), var(--accent-2) 55%, rgba(255, 255, 255, 0.1) 85%);
    animation: pulse-glow 4.5s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 1px rgba(111, 177, 255, 0.5), 0 0 36px rgba(111, 177, 255, 0.22); }
    50%      { box-shadow: 0 0 0 1px rgba(111, 177, 255, 0.8), 0 0 60px rgba(111, 177, 255, 0.4); }
}

/* ---- buttons: gloss sweep + neon hover glow --------------------------- */
.btn { position: relative; overflow: hidden; }
.btn::after {
    content: '';
    position: absolute;
    top: 0; left: -60%;
    width: 40%; height: 100%;
    background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    transition: left 0.55s ease;
    pointer-events: none;
}
.btn:hover::after { left: 130%; }
.btn-primary:hover { box-shadow: var(--glow-md); }
.btn-outline:hover { box-shadow: var(--glow-sm); }

/* ---- badges: soft glow matching their state --------------------------- */
.badge-ok { box-shadow: 0 0 14px rgba(95, 216, 138, 0.28); }
.badge-warn { box-shadow: 0 0 14px rgba(240, 198, 116, 0.25); }
.badge-danger { box-shadow: 0 0 14px rgba(255, 107, 107, 0.28); }

/* ---- header: neon underline instead of a flat border ------------------ */
.site-header {
    border-bottom: 1px solid rgba(111, 177, 255, 0.18);
    box-shadow: 0 1px 0 rgba(111, 177, 255, 0.12), 0 12px 40px -20px rgba(111, 177, 255, 0.35);
}
.brand-mark { filter: drop-shadow(0 0 8px rgba(111, 177, 255, 0.5)); }

/* ---- hero: ambient bloom blobs + shimmering accent text --------------- */
/* overflow:hidden clips the 480px blobs below to the hero's own box --
   relying only on html/body's overflow-x:hidden to contain them further
   up the tree isn't fully reliable on mobile (iOS Safari in particular
   can still let a touch-drag rubber-band past the visual edge into empty
   space even when the page itself can't be programmatically scrolled
   there) -- clipping at the actual source is the robust fix. */
.hero { position: relative; overflow: hidden; }
.hero::before, .hero::after {
    content: '';
    position: absolute;
    width: 480px; height: 480px;
    border-radius: 50%;
    filter: blur(110px);
    z-index: 0;
    pointer-events: none;
}
.hero::before { top: -160px; left: 50%; transform: translateX(-70%); background: rgba(111, 177, 255, 0.22); }
.hero::after { top: 40px; left: 50%; transform: translateX(20%); background: rgba(167, 139, 250, 0.16); }
.hero .wrap { position: relative; z-index: 1; }

/* Gradient shimmer text -- only applied where the browser actually
   supports clipping a background to text. Plenty of mobile browsers/
   in-app WebViews don't (or handle it inconsistently), and without this
   guard they'd render the gradient as a literal box behind invisible
   text instead of clipping it to the letters. The plain `color: accent`
   rule above stays as the fallback in every other browser. */
@supports (background-clip: text) or (-webkit-background-clip: text) {
    .hero .accent {
        background: linear-gradient(90deg, var(--accent), #eaf1ff, var(--accent-2), var(--accent));
        background-size: 300% auto;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
        animation: shine 7s linear infinite;
    }
}
@keyframes shine { to { background-position: -300% center; } }

.hero-video {
    box-shadow: 0 40px 120px -40px rgba(111, 177, 255, 0.25), var(--glow-sm);
}

/* ---- scroll reveal ------------------------------------------------------
   JS (main.js) tags .feature-card/.price-card/.stat-card with .reveal and
   flips .is-visible via IntersectionObserver; falls back to fully visible
   if JS never runs, so nothing depends on it to be usable. */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.feature-grid .reveal:nth-child(1) { transition-delay: 0ms; }
.feature-grid .reveal:nth-child(2) { transition-delay: 70ms; }
.feature-grid .reveal:nth-child(3) { transition-delay: 140ms; }
.feature-grid .reveal:nth-child(4) { transition-delay: 210ms; }
.feature-grid .reveal:nth-child(5) { transition-delay: 280ms; }
.feature-grid .reveal:nth-child(6) { transition-delay: 350ms; }
.pricing-grid .reveal:nth-child(2) { transition-delay: 100ms; }
.pricing-grid .reveal:nth-child(3) { transition-delay: 200ms; }
.dash-grid .reveal:nth-child(2) { transition-delay: 70ms; }
.dash-grid .reveal:nth-child(3) { transition-delay: 140ms; }
.dash-grid .reveal:nth-child(4) { transition-delay: 210ms; }

/* ============ /getting-started docs layout ============ */
/* Same "sidebar nav + prose main column" shape a lot of docs sites use
   (RustBuddy's /docs was the reference) -- reimplemented with this
   site's own tokens/components (feature-card, --accent, etc.) rather
   than copying another product's literal styling. */
.docs-layout {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 24px 80px;
}
.docs-sidebar {
    position: sticky;
    top: 90px;
    flex: 0 0 220px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}
.docs-nav-group { margin-bottom: 24px; }
.docs-nav-group-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 0 12px;
    margin-bottom: 8px;
}
.docs-nav a {
    display: block;
    padding: 7px 12px;
    margin-bottom: 2px;
    border-radius: 8px;
    border-left: 2px solid transparent;
    font-size: 14px;
    color: var(--text-dim);
}
.docs-nav a:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.docs-nav a.active {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-weight: 600;
    border-left-color: var(--accent);
}
.docs-main { flex: 1 1 auto; min-width: 0; max-width: 760px; }
.docs-breadcrumb { font-size: 13px; color: var(--text-faint); margin-bottom: 18px; }
.docs-breadcrumb a { color: var(--text-faint); }
.docs-breadcrumb a:hover { color: var(--text-dim); }
.docs-main h1 { font-size: 32px; margin-bottom: 10px; }
.docs-sub { color: var(--text-dim); font-size: 16px; margin-bottom: 32px; }
.docs-main h2 {
    font-size: 20px;
    margin: 40px 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.docs-main h3 { font-size: 16px; margin: 24px 0 8px; }
.docs-main p { color: var(--text-dim); line-height: 1.7; margin-bottom: 16px; }
.docs-main ul, .docs-main ol { color: var(--text-dim); line-height: 1.8; padding-left: 22px; margin-bottom: 16px; }
.docs-main li { margin-bottom: 6px; }
.docs-main li > strong { color: var(--text); }
.docs-main code {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 13px;
    color: var(--accent);
}
.docs-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 20px 0 32px; }
.docs-card { display: block; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.docs-card:hover { border-color: var(--accent-dim); }
.docs-card h3 { font-size: 15px; margin: 0 0 6px; }
.docs-card p { font-size: 13px; color: var(--text-dim); margin: 0; }
.docs-why-list { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 12px; }
.docs-why-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-dim); font-size: 14px; margin: 0; }
.docs-why-list .dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; }
.docs-why-list strong { color: var(--text); }
.docs-pagination { display: flex; justify-content: flex-end; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.docs-pagination a { display: block; padding: 12px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); }
.docs-pagination a:hover { border-color: var(--accent-dim); }
.docs-pagination .label { display: block; font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }
.docs-pagination .title { color: var(--text); font-weight: 600; }
@media (max-width: 860px) {
    .docs-layout { flex-direction: column; gap: 16px; }
    .docs-sidebar { position: static; max-height: none; width: 100%; }
}

.rank-power-glow {
    animation: rank-power-pulse 2.4s ease-in-out infinite;
}
@keyframes rank-power-pulse {
    0%, 100% { text-shadow: 0 0 6px rgba(240, 198, 116, 0.45), 0 0 16px rgba(240, 198, 116, 0.25); }
    50%      { text-shadow: 0 0 10px rgba(240, 198, 116, 0.85), 0 0 28px rgba(240, 198, 116, 0.5); }
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .price-card.featured { animation: none; }
    .hero .accent { animation: none; }
    .btn::after { display: none; }
    .rank-power-glow { animation: none; text-shadow: 0 0 8px rgba(240, 198, 116, 0.5); }
    .users-online-dot { animation: none; }
}

/* ---- toast notifications ------------------------------------------------
   main.js lifts the server-rendered .form-error/.form-success flash divs
   (still real elements in the page, not conjured from nothing -- works
   with JS off, it just stays inline instead of floating) into this
   fixed stack with a slide-in/out animation. */
#toast-stack {
    position: fixed;
    top: 84px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 340px;
}
#toast-stack .toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 10px;
    padding: 13px 16px;
    font-size: 14px;
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.6), var(--glow-sm);
    animation: toast-in 0.35s ease forwards;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
#toast-stack .toast.form-success { border-left-color: var(--success); }
#toast-stack .toast.form-error { border-left-color: var(--danger); }
#toast-stack .toast.leaving { animation: toast-out 0.3s ease forwards; }
#toast-stack .toast button {
    background: none; border: none; color: var(--text-faint);
    cursor: pointer; font-size: 16px; line-height: 1; padding: 0;
}
#toast-stack .toast button:hover { color: var(--text); }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }
@media (max-width: 420px) {
    #toast-stack { left: 12px; right: 12px; max-width: none; top: 76px; }
}

/* ---- mobile nav: real toggle panel, not display:none on the links ----- */
.nav-toggle { display: none; }
@media (max-width: 640px) {
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px; height: 38px;
        background: transparent;
        border: 1px solid var(--border);
        border-radius: 8px;
        color: var(--text);
        cursor: pointer;
    }
    .site-nav {
        position: absolute;
        top: 68px; left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        background: rgba(10, 10, 16, 0.97);
        backdrop-filter: blur(14px);
        border-bottom: 1px solid rgba(111, 177, 255, 0.18);
        padding: 10px 20px 16px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    /* Generous on purpose, not tuned to a specific item count: the logged-
       out menu has 6 rows, a logged-in admin's has 7 (Features, Pricing,
       FAQ, Status, Account, Admin Panel, Log Out) -- each ~46px (12px+12px
       padding, ~21px line-height, 1px border) plus the panel's own 26px
       vertical padding. 260px clipped the last row or two via this
       container's overflow:hidden, which is exactly why "Get Started"
       (last row, logged out) and "Admin Panel" (near the end, logged in)
       were silently invisible on mobile -- not a display:none bug, an
       overflow one. 420px comfortably covers every real state with room
       to spare, so a future added nav link doesn't reintroduce this. */
    .site-nav.open { max-height: 420px; }
    .site-nav a { padding: 12px 4px; border-bottom: 1px solid var(--border); }
    .site-nav a.btn { margin-top: 8px; }
}
