/* =========================================================
   CoolText.CC — shell layer
   dark neon shell → app rail + workspace (two columns)
   ========================================================= */

:root {
    color-scheme: dark;

    /* surfaces (mix against --ink so light theme follows automatically) */
    --bg: #05060c;
    --bg-soft: #080a14;
    --solid: #0a0d17;
    --panel: color-mix(in srgb, var(--ink) 4%, transparent);
    --panel-2: color-mix(in srgb, var(--ink) 7%, transparent);
    --panel-3: color-mix(in srgb, var(--ink) 11%, transparent);
    --line: color-mix(in srgb, var(--ink) 10%, transparent);
    --line-2: color-mix(in srgb, var(--ink) 19%, transparent);

    /* text */
    --ink: #f3f5ff;
    --ink-2: #a7b0c9;
    --ink-3: #737e9b;

    /* brand spectrum */
    --brand: #8b5cf6;
    --brand-2: #22d3ee;
    --brand-3: #f472b6;
    --brand-deep: #6d28d9;
    --brand-soft: color-mix(in srgb, var(--brand) 20%, transparent);
    --on-brand: #ffffff;
    --accent: #22d3ee;
    --hot: #f472b6;
    --ok: #34d399;
    --warn: #fbbf24;

    /* glow */
    --glow-1: rgba(124, 58, 237, 0.46);
    --glow-2: rgba(34, 211, 238, 0.28);
    --glow-3: rgba(244, 114, 182, 0.22);

    /* shape */
    --radius-sm: 9px;
    --radius: 13px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-pill: 999px;

    /* depth */
    --shadow-sm: 0 1px 1px rgba(0, 0, 0, 0.5);
    --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.95);
    --shadow-lg: 0 40px 90px -40px rgba(0, 0, 0, 1);
    --ring: 0 0 0 1px color-mix(in srgb, var(--brand) 55%, transparent), 0 0 34px -6px var(--glow-1);

    /* type */
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "PingFang SC", "Hiragino Sans", "Microsoft YaHei", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    /* layout */
    --rail-w: 254px;
    --shell: 80%;
    --header-h: 60px;
    --stick-top: 26px;
    --safe-b: env(safe-area-inset-bottom, 0px);

    /* legacy aliases */
    --bg-2: var(--bg-soft);
    --card-bg: var(--panel);
    --card-border: var(--line);
    --card-radius: var(--radius-lg);
    --card-pad: 20px;
    --chip-bg: var(--panel);
    --chip-border: var(--line);
    --chip-radius: var(--radius-sm);
    --button-bg: var(--panel-2);
    --button-fg: var(--ink);
}

/* ===== reset ===== */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
    background: var(--bg);
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    background: transparent;
    color: var(--ink);
    font-family: var(--font);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* aurora + grid behind everything */
body::before {
    content: "";
    position: fixed;
    inset: -20vh -20vw;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(46vw 46vw at 6% -6%, var(--glow-1), transparent 62%),
        radial-gradient(40vw 40vw at 96% 4%, var(--glow-2), transparent 60%),
        radial-gradient(42vw 42vw at 62% 108%, var(--glow-3), transparent 62%);
    filter: blur(18px);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: 0.35;
    -webkit-mask-image: radial-gradient(120% 80% at 50% -10%, #000 0%, transparent 70%);
    mask-image: radial-gradient(120% 80% at 50% -10%, #000 0%, transparent 70%);
}

@media (prefers-reduced-motion: no-preference) {
    body::before { animation: aurora 34s ease-in-out infinite alternate; }
}

@keyframes aurora {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(4vw, 3vh, 0) scale(1.12); }
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { margin-inline-start: 20px; }

h1, h2, h3, h4 {
    line-height: 1.15;
    letter-spacing: -0.03em;
    font-weight: 750;
}

::selection { background: color-mix(in srgb, var(--brand) 45%, transparent); }

:focus-visible {
    outline: 2px solid var(--brand-2);
    outline-offset: 2px;
    border-radius: 6px;
}

[hidden] { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skiplink {
    position: fixed;
    top: 10px;
    inset-inline-start: 12px;
    z-index: 400;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: var(--bg);
    font-size: 0.86rem;
    font-weight: 700;
    transform: translateY(-220%);
    transition: transform 0.18s ease;
}

.skiplink:focus-visible { transform: none; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--line-2);
    border: 2px solid transparent;
    border-radius: 99px;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--brand) 55%, transparent); background-clip: content-box; }

/* ===== shell ===== */
.shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: 32px;
}

.main {
    display: block;
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding: 34px 32px 0;
}

.main .shell { max-width: none; padding-inline: 0; }

.workspace {
    min-height: 100vh;
    margin-inline-start: var(--rail-w);
    display: flex;
    flex-direction: column;
}

.workspace > .footer { margin-top: auto; }

/* ===== left rail (first column) ===== */
.rail {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 70;
    width: var(--rail-w);
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 16px 16px;
    overflow-y: auto;
    background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 6%, transparent), transparent 46%);
    border-inline-end: 1px solid var(--line);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
}

.rail::before {
    content: "";
    position: absolute;
    inset-block-start: 0;
    inset-inline: 18px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand), var(--brand-2), transparent);
    opacity: 0.9;
}

.rail-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 0;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.rail-brand img {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    box-shadow: 0 0 22px -6px var(--glow-1);
}

.rail-brand em { font-style: normal; color: var(--ink-3); font-weight: 600; }

.rail-label {
    display: block;
    padding: 0 8px 8px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.rail-nav { display: flex; flex-direction: column; gap: 3px; }

.rail-link {
    position: relative;
    display: grid;
    grid-template-columns: 21px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--ink-2);
    font-size: 0.875rem;
    font-weight: 600;
    transition: 0.18s;
}

.rail-link i {
    display: grid;
    place-items: center;
    width: 21px;
    font-style: normal;
    font-size: 0.95rem;
    line-height: 1;
}

.rail-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rail-link b {
    color: var(--ink-3);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.rail-link:hover {
    color: var(--ink);
    background: var(--panel-2);
    border-color: var(--line);
}

.rail-link.is-active {
    color: var(--ink);
    background: linear-gradient(100deg, color-mix(in srgb, var(--brand) 22%, transparent), color-mix(in srgb, var(--brand-2) 8%, transparent));
    border-color: color-mix(in srgb, var(--brand) 42%, transparent);
    box-shadow: inset 0 0 24px -12px var(--glow-1);
}

.rail-link.is-active i { filter: drop-shadow(0 0 8px var(--glow-1)); }
.rail-link.is-active b { color: var(--brand-2); }

.rail-link.is-active::before {
    content: "";
    position: absolute;
    inset-block: 9px;
    inset-inline-start: -1px;
    width: 2px;
    border-radius: 3px;
    background: linear-gradient(var(--brand), var(--brand-2));
    box-shadow: 0 0 12px var(--brand);
}

.rail-divider {
    height: 1px;
    margin: 2px 8px;
    background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}

.rail-actions { display: flex; flex-direction: column; gap: 6px; }

.rail-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--ink-2);
    font-size: 0.82rem;
    font-weight: 600;
    transition: 0.18s;
}

.rail-btn svg { width: 17px; height: 17px; flex: none; }
.rail-btn:hover { color: var(--ink); border-color: color-mix(in srgb, var(--brand) 40%, transparent); background: var(--panel-2); }
.rail-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rail-card {
    position: relative;
    padding: 13px 13px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%), var(--panel);
    overflow: hidden;
}

.rail-card::after {
    content: "";
    position: absolute;
    inset-block-start: -40%;
    inset-inline-end: -30%;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glow-2), transparent 70%);
    pointer-events: none;
}

.rail-card b { display: block; font-size: 0.82rem; letter-spacing: -0.01em; }
.rail-card p { margin-top: 3px; font-size: 0.72rem; line-height: 1.55; color: var(--ink-3); }

.rail-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding: 0 6px;
    font-size: 0.68rem;
    color: var(--ink-3);
}

.rail-foot a:hover { color: var(--ink-2); }

/* dims the page behind the mobile rail drawer */
.rail-scrim { display: none; }

/* ===== mobile bar ===== */
.mobilebar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 75;
    align-items: center;
    gap: 8px;
    height: var(--header-h);
    padding-inline: 14px;
    background: color-mix(in srgb, var(--solid) 82%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.mobilebar .brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.mobilebar .brand img { width: 27px; height: 27px; border-radius: 8px; }
.mobilebar .brand em { font-style: normal; color: var(--ink-3); font-weight: 600; }

.iconbtn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: var(--ink-2);
    font-size: 1.1rem;
    line-height: 1;
    transition: 0.16s;
}

.iconbtn svg { width: 18px; height: 18px; }
.iconbtn:hover { color: var(--ink); border-color: var(--line-2); background: var(--panel-2); }

.mobilebar-actions { display: inline-flex; align-items: center; gap: 7px; margin-inline-start: auto; }


/* ===== hero ===== */
.hero { padding: 10px 0 24px; }

.home-hero { padding: 6px 0 20px; }

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 40px;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 5px 13px;
    margin-bottom: 18px;
    border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--brand) 12%, transparent);
    color: var(--ink-2);
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-2);
    box-shadow: 0 0 10px var(--brand-2);
}

.hero h1 {
    max-width: 18ch;
    margin-bottom: 14px;
    font-size: clamp(2.2rem, 4.3vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.02;
    background: linear-gradient(102deg, #ffffff 2%, #c4b5fd 36%, #7dd3fc 74%, #f0abfc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-wrap: balance;
    filter: drop-shadow(0 6px 40px rgba(124, 58, 237, 0.35));
}

.hero p {
    max-width: 54ch;
    margin-bottom: 22px;
    color: var(--ink-2);
    font-size: 1rem;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 18px;
    margin-top: 18px;
    font-size: 0.78rem;
    color: var(--ink-3);
}

.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }

.hero-meta b {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand-2);
}

/* hero preview card */
.hero-preview {
    position: relative;
    padding: 15px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-lg);
    background: linear-gradient(160deg, color-mix(in srgb, var(--ink) 7%, transparent), transparent 60%), var(--panel);
    box-shadow: var(--shadow), inset 0 1px 0 color-mix(in srgb, var(--ink) 10%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
}

.hero-preview::before {
    content: "";
    position: absolute;
    inset-block-start: -60%;
    inset-inline-start: 10%;
    width: 70%;
    height: 140px;
    background: radial-gradient(ellipse, var(--glow-1), transparent 70%);
    pointer-events: none;
}

.hero-preview-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 3px 12px;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.hero-preview-dots { display: inline-flex; gap: 5px; }

.hero-preview-dots i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--line-2);
}

.hero-preview-dots i:first-child { background: var(--brand); box-shadow: 0 0 8px var(--brand); }
.hero-preview-dots i:nth-child(2) { background: var(--brand-2); box-shadow: 0 0 8px var(--brand-2); }

.mini-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--ink) 3%, transparent);
}

.mini-row + .mini-row { margin-top: 6px; }

.mini-label {
    flex: none;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.mini-sample {
    font-size: 1.06rem;
    line-height: 1.4;
    text-align: end;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-preview-foot {
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px dashed var(--line-2);
    border-radius: var(--radius-sm);
    color: var(--ink-3);
    font-size: 0.72rem;
    text-align: center;
}

@media (min-width: 1025px) and (prefers-reduced-motion: no-preference) {
    .hero-preview {
        transform: perspective(1200px) rotateY(-7deg) rotateX(2.5deg);
        transform-origin: 60% 50%;
        transition: transform 0.5s cubic-bezier(0.22, 0.68, 0, 1);
    }

    .hero-preview:hover { transform: none; }
}

/* ===== page head ===== */
.pagehead { padding: 6px 0 16px; }

.crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 12px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    color: var(--ink-3);
}

.crumbs a:hover { color: var(--brand-2); }
.crumbs span { color: var(--line-2); }

.pagehead h1 {
    margin-bottom: 8px;
    font-size: clamp(1.6rem, 2.9vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.pagehead p {
    max-width: 78ch;
    color: var(--ink-2);
    font-size: 0.92rem;
}

/* ===== sections ===== */
.section { padding: 22px 0; }

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px 20px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.section-head h2 { font-size: 1.16rem; letter-spacing: -0.03em; }
.section-head p { font-size: 0.82rem; color: var(--ink-3); }

.eyebrow {
    display: block;
    margin-bottom: 0;
    color: var(--ink-3);
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* ===== footer ===== */
.footer {
    margin-top: 40px;
    padding: 34px 0 calc(26px + var(--safe-b));
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--ink) 3%, transparent));
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 26px;
}

.footer-col { display: flex; flex-direction: column; gap: 7px; }

.footer-col h4 {
    margin-bottom: 3px;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.footer-col a {
    width: fit-content;
    font-size: 0.84rem;
    color: var(--ink-2);
    transition: color 0.16s;
}

.footer-col a:hover { color: var(--brand-2); }

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 5px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.footer-brand img { width: 25px; height: 25px; border-radius: 8px; }
.footer-col p { max-width: 32ch; font-size: 0.82rem; color: var(--ink-3); }

.footer-disclosure {
    max-width: 960px;
    margin-top: 24px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 0.72rem;
    line-height: 1.7;
    color: var(--ink-3);
}

.footer-disclosure a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.footer-disclosure a:hover { color: var(--brand-2); }

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 0.76rem;
    color: var(--ink-3);
}

.footer-note { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ===== legal ===== */
.legal {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 32px;
}

.legal h2 { margin: 26px 0 10px; font-size: 1.14rem; }
.legal h2:first-child { margin-top: 0; }
.legal h3 { margin: 20px 0 8px; font-size: 0.98rem; }
.legal p { margin-bottom: 14px; font-size: 0.92rem; color: var(--ink-2); }
.legal ul { margin: 0 0 16px 22px; font-size: 0.92rem; color: var(--ink-2); }
.legal li { margin-bottom: 7px; }
.legal a { color: var(--brand-2); text-decoration: underline; text-underline-offset: 2px; }
.legal strong { color: var(--ink); }

.legal code {
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--panel-2);
    font-family: var(--font-mono);
    font-size: 0.85em;
}

/* ===== 404 ===== */
.notfound { padding: 40px 0 8px; text-align: center; }
.notfound .shell { max-width: 720px; }

.notfound-code {
    margin-bottom: 12px;
    font-size: clamp(3.2rem, 12vw, 6rem);
    font-weight: 800;
    letter-spacing: -0.07em;
    line-height: 1;
    background: linear-gradient(120deg, var(--brand), var(--brand-2) 60%, var(--brand-3));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px var(--glow-1));
}

.notfound h1 { margin-bottom: 10px; font-size: 1.36rem; }
.notfound p { margin: 0 auto 22px; color: var(--ink-2); }
.notfound .composer { margin-inline: auto; text-align: start; }

/* ===== responsive ===== */
@media (max-width: 1180px) {
    .hero-grid { gap: 28px; }
    .footer-grid { gap: 22px; }
}

@media (max-width: 1024px) {
    :root { --shell: 100%; }
    .workspace { margin-inline-start: 0; }
    .mobilebar { display: flex; }
    .main { padding: 22px 20px 0; }

    .rail {
        width: 282px;
        max-width: 86vw;
        transform: translateX(-102%);
        transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
        box-shadow: 0 0 80px rgba(0, 0, 0, 0.6);
    }

    .rail.is-open { transform: none; }

    .rail-link { padding: 12px 12px; font-size: 0.92rem; }

    .rail-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 65;
        background: rgba(3, 4, 10, 0.62);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s ease;
    }

    .rail.is-open ~ .rail-scrim { opacity: 1; }

    :root { --stick-top: calc(var(--header-h) + 14px); }

    .hero { padding-top: 4px; }
    .hero-grid { grid-template-columns: 1fr; gap: 24px; }
    .hero h1 { max-width: none; }
    .hero-preview { display: none; }
}

[dir="rtl"] .rail { transform: translateX(102%); }
[dir="rtl"] .rail.is-open { transform: none; }

@media (max-width: 640px) {
    .main { padding: 18px 16px 0; }
    .shell { padding-inline: 16px; }
    .section { padding: 18px 0; }
    .hero { padding: 4px 0 14px; }
    .hero h1 { font-size: clamp(1.9rem, 8.4vw, 2.5rem); }
    .hero p { font-size: 0.94rem; }
    .legal { padding: 22px 18px; }

    .footer { padding: 28px 0 calc(22px + var(--safe-b)); }
    .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; }
    .footer-col:first-child { grid-column: 1 / -1; }
    .footer-col { gap: 4px; }
    .footer-col h4 { margin-bottom: 2px; font-size: 0.6rem; }
    .footer-col a { font-size: 0.78rem; }
    .footer-disclosure { margin-top: 14px; padding-top: 12px; font-size: 0.7rem; }
    .footer-bottom { margin-top: 14px; padding-top: 12px; font-size: 0.74rem; }
}

@media (max-width: 420px) {
    .mobilebar .brand em { display: none; }
    .mobilebar-actions { gap: 5px; }
    .iconbtn { width: 34px; height: 34px; }
}
