/* ═══════════════════════════════════════════════════════
   GoTalk — Design System (aligned with app palette)
   ═══════════════════════════════════════════════════════ */

/* --- Fonts --- */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/css/fonts/inter-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/css/fonts/inter-500.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/css/fonts/inter-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/css/fonts/inter-700.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('/css/fonts/inter-800.woff2') format('woff2');
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/css/fonts/jetbrains-mono-400.woff2') format('woff2');
}

html {
    scroll-behavior: smooth;
}

/* --- Design Tokens: Light (CSS default) --- */

:root {
    color-scheme: light;

    --bg-base: #f6f8fb;
    --bg-primary: #eef2f6;
    --bg-secondary: #edf1f5;
    --bg-elevated: #ffffff;
    --bg-surface: #e3e8ee;
    --bg-overlay: rgba(246, 248, 251, 0.88);

    --text-primary: #09090b;
    --text-secondary: #384252;
    --text-muted: #667186;
    --text-faint: #7b8798;

    --brand: #1777d6;
    --brand-light: #4f9ef1;
    --brand-dark: #115aa4;
    --brand-glow: rgba(23, 119, 214, 0.15);
    --brand-muted: rgba(23, 119, 214, 0.16);

    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;

    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.14);
    --border-brand: rgba(23, 119, 214, 0.22);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.10);
    --shadow-glow: 0 0 40px rgba(23, 119, 214, 0.08);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --radius-full: 999px;

    --nav-height: 64px;
    --max-width: 1120px;
    --font-sans: 'Inter', 'Segoe UI Variable Text', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Design Tokens: Dark (matches app :root.dark) --- */

:root.dark {
    color-scheme: dark;

    --bg-base: #0a0f16;
    --bg-primary: #10161e;
    --bg-secondary: #171d26;
    --bg-elevated: #1f2630;
    --bg-surface: #29303b;
    --bg-overlay: rgba(10, 15, 22, 0.88);

    --text-primary: #edf2f8;
    --text-secondary: #bac4d1;
    --text-muted: #8e9aae;
    --text-faint: #687487;

    --brand: #3d9cff;
    --brand-light: #79bbff;
    --brand-dark: #1777d6;
    --brand-glow: rgba(61, 156, 255, 0.20);
    --brand-muted: rgba(61, 156, 255, 0.17);

    --accent-green: #23a559;
    --accent-red: #f23f42;
    --accent-yellow: #f0b132;

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.10);
    --border-brand: rgba(61, 156, 255, 0.20);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.20);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.40);
    --shadow-glow: 0 0 40px rgba(61, 156, 255, 0.12);
}

/* --- Reset --- */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input {
    font: inherit;
    border: none;
    background: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

ul, ol {
    list-style: none;
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}

/* --- Utilities --- */

.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 200;
    padding: 10px 16px;
    border-radius: var(--radius-full);
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
}

.skip-link:focus {
    top: 16px;
}

/* --- Site Shell --- */

.site-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.page-main {
    flex: 1;
    padding-bottom: 80px;
}

/* --- Background Decoration --- */

.page-main::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 600px 400px at 50% 10%, var(--brand-glow) 0, transparent 70%),
        radial-gradient(ellipse 500px 350px at 80% 80%, rgba(114, 128, 255, 0.06) 0, transparent 70%);
    pointer-events: none;
}

/* --- Navbar --- */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: var(--nav-height);
    padding: 0 24px;
    background: var(--bg-overlay);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-bottom: 1px solid transparent;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.navbar.is-scrolled {
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.navbar-brand svg,
.footer-brand svg {
    color: var(--brand);
    flex-shrink: 0;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.navbar-links a {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 150ms ease, background 150ms ease;
}

.navbar-links a:hover {
    color: var(--text-primary);
    background: var(--border);
}

.navbar-links a.active {
    color: var(--text-primary);
    background: var(--border-hover);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.theme-toggle:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--border);
}

.theme-toggle svg {
    width: 15px;
    height: 15px;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 150ms ease;
}

.nav-toggle:hover {
    background: var(--border);
}

.nav-toggle svg {
    width: 18px;
    height: 18px;
}

.navbar-menu {
    display: none;
}

/* --- Buttons --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    transition: transform 200ms var(--ease-out), box-shadow 200ms ease, background 200ms ease, border-color 200ms ease;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand), #5b7dff);
    color: #fff;
    box-shadow: 0 4px 16px var(--brand-glow);
}

.btn-primary:hover {
    box-shadow: 0 6px 24px var(--brand-glow), var(--shadow-glow);
}

.btn-secondary {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: transparent;
}

.btn-secondary:hover {
    border-color: var(--brand);
    color: var(--brand-light);
    background: var(--brand-muted);
}

/* --- Hero --- */

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 80px 0 64px;
}

.hero-copy {
    max-width: 640px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--brand-muted);
    border: 1px solid var(--border-brand);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brand-light);
}

.hero-badge .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 10px rgba(35, 165, 89, 0.5);
}

.eyebrow,
.card-kicker {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand-light);
    margin-bottom: 8px;
}

.hero-title {
    margin-bottom: 16px;
    font-size: clamp(2.5rem, 5vw, 3.6rem);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -0.04em;
}

.hero-gradient {
    background: linear-gradient(135deg, var(--brand-light) 0%, #a3b8ff 50%, #d0d8ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

:root:not(.dark) .hero-gradient {
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 50%, var(--brand-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-description {
    margin-bottom: 28px;
    max-width: 520px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}

.pill-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.pill-row span {
    padding: 6px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

/* --- Sections --- */

.section {
    padding: 56px 0;
}

.section-header {
    max-width: 640px;
    margin-bottom: 32px;
}

.section-header.center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.section-title {
    margin-bottom: 12px;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

/* --- Card Base --- */

.card {
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
    transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms var(--ease-out);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

/* --- Grids --- */

.feature-grid,
.flow-grid,
.release-grid {
    display: grid;
    gap: 16px;
}

.feature-grid {
    grid-template-columns: repeat(2, 1fr);
}

.flow-grid,
.release-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* --- Feature Cards --- */

.feature-card {
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
    transition: border-color 250ms ease, box-shadow 250ms ease, transform 250ms var(--ease-out);
}

.feature-card:hover {
    border-color: var(--border-brand);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transform: translateY(-2px);
}

.feature-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--brand-muted);
    color: var(--brand-light);
    transition: background 200ms ease;
}

.feature-card:hover .feature-icon {
    background: var(--brand-glow);
}

.feature-icon svg {
    width: 20px;
    height: 20px;
}

.feature-card h3 {
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.feature-list,
.release-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.feature-list li,
.release-list li {
    position: relative;
    padding-left: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.feature-list li::before,
.release-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--brand);
}

/* --- Flow Steps --- */

.flow-step {
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
    transition: border-color 250ms ease, box-shadow 250ms ease;
}

.flow-step:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.flow-index {
    display: inline-block;
    margin-bottom: 12px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand-light);
}

.flow-step h3 {
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 700;
}

.flow-step p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* --- Trust Panel --- */

.trust-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 32px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-brand);
    background:
        linear-gradient(135deg, var(--brand-muted) 0%, var(--bg-elevated) 50%, rgba(91, 125, 255, 0.06) 100%);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.trust-panel h2 {
    margin-bottom: 8px;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.trust-panel p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 520px;
}

.trust-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

/* --- Download Page --- */

.download-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 16px;
}

.download-panel {
    padding: 32px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-md);
}

.download-version {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    margin-bottom: 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-brand);
    background: var(--brand-muted);
    color: var(--brand-light);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
}

.download-meta {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.release-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* --- Release Cards --- */

.release-card {
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
    transition: border-color 250ms ease, box-shadow 250ms ease;
}

.release-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.release-card h2,
.release-card h3 {
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.release-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.release-meta {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.release-value {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* --- Legal Pages --- */

.legal-layout {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    align-items: start;
    gap: 32px;
    padding-top: 24px;
}

.legal-toc {
    position: sticky;
    top: calc(var(--nav-height) + 32px);
    align-self: start;
    width: 100%;
    max-height: calc(100vh - var(--nav-height) - 64px);
    overflow: auto;
    padding: 28px;
    border-radius: 24px;
    border: 1px solid color-mix(in srgb, var(--border-hover) 80%, var(--brand));
    background: var(--bg-primary);
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--border);
    backdrop-filter: blur(16px);
    z-index: 50;
    transition: transform 300ms ease;
}

:root.dark .legal-toc {
    background: linear-gradient(180deg, var(--bg-elevated), color-mix(in srgb, var(--bg-primary) 50%, var(--bg-elevated)));
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border-hover);
}

.legal-toc:hover {
    transform: translateY(-2px);
}

.legal-toc h2 {
    margin-bottom: 12px;
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.legal-toc h2::before {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    background-color: var(--brand);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='12' x2='21' y2='12'/%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cline x1='3' y1='18' x2='21' y2='18'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='12' x2='21' y2='12'/%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cline x1='3' y1='18' x2='21' y2='18'/%3E%3C/svg%3E");
}

.legal-toc-note {
    margin-bottom: 16px;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.legal-toc-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.legal-toc-list a {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 0.84rem;
    line-height: 1.4;
    color: var(--text-muted);
    font-weight: 500;
    background: transparent;
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.legal-toc-list a:hover {
    color: var(--text-primary);
    border-color: var(--border);
    background: color-mix(in srgb, var(--bg-primary) 84%, transparent);
    transform: translateX(2px);
}

.legal-toc-list a.is-active {
    color: var(--text-primary);
    border-color: var(--border-brand);
    background: var(--brand-muted);
}

.legal-content {
    display: grid;
    min-width: 0;
    gap: 24px;
    position: relative;
}

.legal-content::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--border), transparent);
    pointer-events: none;
}

.legal-intro {
    padding: 28px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-brand);
    background:
        radial-gradient(circle at top left, var(--brand-glow), transparent 46%),
        var(--brand-muted);
    box-shadow: var(--shadow-sm);
}

.legal-intro h2 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 700;
}

.legal-intro p {
    color: var(--text-secondary);
    font-size: 0.925rem;
    line-height: 1.7;
}

.legal-section {
    scroll-margin-top: calc(var(--nav-height) + 24px);
    position: relative;
    padding: 28px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-hover);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
    transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease, background 220ms ease;
}

.legal-section::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
    background: linear-gradient(90deg, transparent, var(--brand-light), transparent);
    opacity: 0.26;
}

.legal-section.is-current {
    transform: translateY(-2px);
    border-color: var(--border-brand);
    background: color-mix(in srgb, var(--bg-elevated) 92%, var(--brand-glow));
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08), 0 0 0 1px color-mix(in srgb, var(--brand) 12%, transparent);
}

.legal-section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.legal-section-number {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-muted);
    color: var(--brand-light);
    font-size: 0.82rem;
    font-weight: 800;
    font-family: var(--font-mono);
    flex-shrink: 0;
    transition: transform 220ms ease, background 220ms ease, color 220ms ease, box-shadow 220ms ease;
}

.legal-section.is-current .legal-section-number {
    transform: scale(1.04);
    background: color-mix(in srgb, var(--brand) 18%, var(--bg-primary));
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 10%, transparent);
}

.legal-formal {
    padding: 20px 22px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-primary) 78%, transparent);
    transition: border-color 220ms ease, background 220ms ease;
}

.legal-formal::before {
    content: 'Wersja formalna';
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 9px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.legal-formal p {
    font-size: 0.9rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.legal-simple {
    margin-top: 16px;
    position: relative;
    padding: 24px 26px;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--border-brand));
    background: color-mix(in srgb, var(--brand-muted) 40%, var(--bg-elevated));
    display: block;
    box-shadow: 0 8px 24px rgba(23, 119, 214, 0.08);
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, background 220ms ease;
}

/* Ogon dymka (speech bubble pointer) */
.legal-simple::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 48px;
    border-width: 0 10px 10px 10px;
    border-style: solid;
    border-color: transparent transparent color-mix(in srgb, var(--brand) 40%, var(--border-brand)) transparent;
    display: block;
    width: 0;
}

.legal-simple::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 48px;
    border-width: 0 10px 10px 10px;
    border-style: solid;
    border-color: transparent transparent color-mix(in srgb, var(--brand-muted) 40%, var(--bg-elevated)) transparent;
    display: block;
    width: 0;
    z-index: 1;
}

.legal-section.is-current .legal-simple {
    transform: translateY(-2px);
    border-color: var(--brand);
    box-shadow: 0 14px 32px rgba(23, 119, 214, 0.16);
}

/* Wyrniony nagwek z arwk */
.legal-simple-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 6px 14px 6px 10px;
    border-radius: var(--radius-full);
    border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
    background: color-mix(in srgb, var(--brand) 12%, transparent);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand-dark);
}

:root.dark .legal-simple-label {
    color: var(--brand-light);
}

/* Ikonka arwki zagniedona bezpiecznie jako to przed etykiet */
.legal-simple-label::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: currentColor;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.9 1.2 1.5 1.5 2.5'/%3E%3Cpath d='M9 18h6'/%3E%3Cpath d='M10 22h4'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.9 1.2 1.5 1.5 2.5'/%3E%3Cpath d='M9 18h6'/%3E%3Cpath d='M10 22h4'/%3E%3C/svg%3E");
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
}

.legal-simple-body p {
    font-size: 0.98rem;
    line-height: 1.75;
    color: var(--text-primary);
    font-weight: 500;
}

.legal-simple-icon {
    display: none;
}

.legal-page-header {
    max-width: 820px;
    padding: 32px 0 0;
}

.legal-page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-brand);
    background: var(--brand-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-light);
}

.legal-page-header h1 {
    margin-bottom: 8px;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.legal-page-subtitle {
    max-width: 720px;
    margin-bottom: 14px;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

.legal-page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.legal-page-meta span,
.legal-page-meta a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
    font-size: 0.84rem;
    color: var(--text-muted);
}

.legal-page-meta a:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.legal-page-header + .legal-layout {
    margin-top: 14px;
}

.legal-page-header p {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* --- 404 Page --- */

.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: calc(100vh - var(--nav-height) - 200px);
    padding: 48px 24px;
}

.error-code {
    font-size: clamp(6rem, 15vw, 10rem);
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 1;
    background: linear-gradient(135deg, var(--brand-light), #5b7dff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 16px;
}

.error-page h2 {
    margin-bottom: 12px;
    font-size: 1.5rem;
    font-weight: 700;
}

.error-page p {
    margin-bottom: 32px;
    max-width: 420px;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* --- Footer --- */

.footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 24px 28px;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-primary);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 150ms ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-note,
.footer-copy {
    font-size: 0.8rem;
    color: var(--text-faint);
    text-align: center;
}

/* --- Fade-in Animations --- */

.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}

.fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive: 980px --- */

@media (max-width: 860px) {
    .hero {
        padding-top: 56px;
    }

    .download-layout,
    .feature-grid,
    .flow-grid,
    .release-grid {
        grid-template-columns: 1fr;
    }

    .trust-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .legal-layout {
        grid-template-columns: 1fr;
    }

        .legal-toc {
        position: static;
        max-height: none;
        backdrop-filter: none;
        box-shadow: var(--shadow-sm);
        margin-bottom: 24px;
    }


    .legal-page-header {
        max-width: none;
    }

    .legal-page-subtitle {
        max-width: none;
    }

    .legal-content::before {
        display: none;
    }
}

/* --- Responsive: 760px --- */

@media (max-width: 760px) {
    .container,
    .navbar {
        padding-left: 16px;
        padding-right: 16px;
    }

    .navbar-links,
    .theme-toggle {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .navbar-menu {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        right: 16px;
        left: 16px;
        flex-direction: column;
        gap: 6px;
        padding: 12px;
        border-radius: var(--radius-lg);
        border: 1px solid var(--border);
        background: var(--bg-elevated);
        box-shadow: var(--shadow-md);
    }

    .navbar-menu.open {
        display: flex !important;
    }

    .navbar-menu a,
    .navbar-menu button {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 42px;
        border-radius: var(--radius-sm);
        color: var(--text-primary);
        font-weight: 500;
        font-size: 0.9rem;
        transition: background 150ms ease;
    }

    .navbar-menu a:hover,
    .navbar-menu button:hover {
        background: var(--border);
    }

    .section {
        padding: 40px 0;
    }

    .download-panel {
        padding: 20px;
    }

    .legal-page-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* --- Responsive: 640px --- */

@media (max-width: 640px) {
    .hero-title,
    .section-title {
        font-size: clamp(1.8rem, 8vw, 2.4rem);
    }

    .btn {
        width: 100%;
    }

    .hero-actions .btn,
    .trust-actions .btn,
    .release-actions .btn {
        width: 100%;
    }

    .feature-card,
    .flow-step,
    .release-card,
    .trust-panel,
    .download-panel {
        padding: 16px;
    }

    .footer-links {
        flex-direction: column;
        align-items: center;
    }

    .legal-page-header h1 {
        font-size: clamp(1.6rem, 7vw, 2.2rem);
    }

    .legal-intro,
    .legal-section,
    .legal-toc {
        padding: 20px;
    }

    .legal-simple {
        padding: 16px;
    }
}

/* --- Reduced Motion --- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .fade-in {
        opacity: 1;
        transform: none;
    }
}
