:root {
    --color-bg: #0f172a;
    --color-surface: rgba(15, 23, 42, 0.7);
    --color-surface-strong: rgba(15, 23, 42, 0.85);
    --color-text: #e2e8f0;
    --color-muted: #94a3b8;
    --color-accent: #a855f7;
    --color-accent-soft: rgba(168, 85, 247, 0.2);
    --shadow-soft: 0 30px 70px -45px rgba(15, 23, 42, 0.8);
    --font-sans: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--color-text);
    background:
        radial-gradient(circle at 16% 28%, rgba(148, 163, 184, 0.14), transparent 55%),
        radial-gradient(circle at 82% 0%, rgba(96, 165, 250, 0.18), transparent 60%),
        var(--color-bg);
    line-height: 1.6;
    transition: background 0.6s ease, color 0.6s ease;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 8% 90%, var(--color-accent-soft), transparent 65%),
        radial-gradient(circle at 92% 80%, rgba(59, 130, 246, 0.18), transparent 65%);
    opacity: 0.8;
    z-index: -1;
    transition: background 0.6s ease, opacity 0.6s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(1100px, 92vw);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(18px);
    background: linear-gradient(180deg, rgba(10, 20, 45, 0.85), transparent);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 0.25rem;
}

.logo {
    font-weight: 700;
    font-size: 1.45rem;
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    height: 40px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

.main-nav ul {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    padding: 0.4rem 0;
    font-weight: 500;
    color: var(--color-muted);
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link[aria-current="page"] {
    color: var(--color-text);
}

.nav-link.secondary {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: var(--color-text);
    transition: border 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.nav-link.secondary:hover,
.nav-link.secondary:focus-visible {
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.theme-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem 0.6rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--color-muted);
    font-size: 0.9rem;
    box-shadow: 0 18px 36px -28px rgba(15, 23, 42, 0.8);
}

.theme-switcher .theme-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.12);
    color: var(--color-accent);
}

.custom-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    min-height: 2.7rem;
    padding: 0.75rem 1.15rem;
    padding-right: 3rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background-color: rgba(15, 23, 42, 0.68);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.3;
    cursor: pointer;
    transition: border 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, background 0.25s ease;
    text-align: left;
    text-align-last: left;
    display: inline-block;
    box-shadow: 0 12px 28px -20px rgba(15, 23, 42, 0.8);
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(148, 163, 184, 0.78) 50%),
        linear-gradient(-45deg, transparent 50%, rgba(148, 163, 184, 0.78) 50%),
        linear-gradient(to right, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.18));
    background-position: calc(100% - 1.1rem) center, calc(100% - 0.7rem) center, calc(100% - 1.85rem) center;
    background-size: 7px 7px, 7px 7px, 1px 60%;
    background-repeat: no-repeat;
}

.custom-select:hover {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.22), 0 14px 34px -22px rgba(168, 85, 247, 0.45);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--color-accent) 50%),
        linear-gradient(-45deg, transparent 50%, var(--color-accent) 50%),
        linear-gradient(to right, rgba(168, 85, 247, 0.24), rgba(168, 85, 247, 0.24));
}

.custom-select:focus,
.custom-select:focus-visible {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.28), 0 16px 36px -22px rgba(168, 85, 247, 0.5);
    transform: translateY(-1px) scale(1.01);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--color-accent) 50%),
        linear-gradient(-45deg, transparent 50%, var(--color-accent) 50%),
        linear-gradient(to right, rgba(168, 85, 247, 0.26), rgba(168, 85, 247, 0.26));
}

.custom-select option {
    background-color: rgba(10, 19, 35, 0.98);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.65rem 1rem;
}

.custom-select option:checked {
    background-color: rgba(168, 85, 247, 0.32);
}

.custom-select option:hover {
    background-color: rgba(148, 163, 184, 0.2);
}

select::-ms-expand {
    display: none;
}

.theme-switcher .custom-select {
    width: auto;
    min-width: 150px;
    background-color: rgba(15, 23, 42, 0.55);
}

.hero {
    padding: 7rem 0 5rem;
}

.hero-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    align-items: center;
}

.hero-text .eyebrow {
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-size: 0.75rem;
    color: var(--color-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-text h1 {
    margin: 0 0 1.2rem;
    font-size: clamp(2.5rem, 6vw, 3.6rem);
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.hero-text .lead {
    margin: 0 0 2rem;
    max-width: 34rem;
    color: var(--color-muted);
    font-size: 1.05rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    justify-content: center;
    padding: 0.85rem 1.6rem;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.button.primary {
    background: var(--color-accent);
    color: #0f172a;
    box-shadow: 0 25px 40px -25px var(--color-accent);
}

.button.primary:hover,
.button.primary:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 30px 46px -20px var(--color-accent);
}

.button.ghost {
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: var(--color-text);
    background: transparent;
}

.button.ghost:hover,
.button.ghost:focus-visible {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.hero-visual {
    display: grid;
    place-items: center;
}

.orbital {
    position: relative;
    width: clamp(240px, 42vw, 340px);
    aspect-ratio: 1;
}

.planet {
    position: absolute;
    width: 46%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 25% 25%, #ffffff, var(--color-accent) 55%, rgba(15, 23, 42, 0.25) 100%);
    top: 28%;
    left: 28%;
    animation: pulse 7s ease-in-out infinite;
    box-shadow: 0 28px 60px -30px var(--color-accent), inset -12px -18px 34px rgba(15, 23, 42, 0.3);
}

.planet::after {
    content: "";
    position: absolute;
    inset: 16% 20% 44%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 65%);
    opacity: 0.9;
    filter: blur(2px);
}

.ring,
.ring.secondary {
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    border: 2px dashed rgba(148, 163, 184, 0.25);
    animation: spin 14s linear infinite;
}

.ring.secondary {
    inset: 24%;
    animation-duration: 18s;
    border-style: solid;
    border-color: rgba(148, 163, 184, 0.18);
}

.section {
    padding: 5rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    margin: 0 0 0.75rem;
    font-size: clamp(2.2rem, 5vw, 3rem);
    letter-spacing: -0.01em;
}

.section-header p {
    margin: 0 auto;
    max-width: 36rem;
    color: var(--color-muted);
}

.section-footer {
    margin-top: 3rem;
    text-align: center;
}

.text-link {
    color: var(--color-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.text-link:hover,
.text-link:focus-visible {
    color: var(--color-accent);
    transform: translateY(-2px);
}

.feature-grid {
    display: grid;
    gap: 1.8rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.feature-grid--expanded {
    gap: 2rem;
}

.feature-card {
    padding: 2.2rem;
    border-radius: 1.6rem;
    background: var(--color-surface);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, border 0.3s ease;
}

.feature-card:hover,
.feature-card:focus-within {
    transform: translateY(-6px);
    border-color: var(--color-accent);
}

.feature-card h3,
.feature-card h2 {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
}

.feature-card p {
    margin: 0;
    color: var(--color-muted);
}

.icon-badge {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(168, 85, 247, 0.14);
    color: var(--color-accent);
    margin-bottom: 1.4rem;
    font-size: 1.3rem;
}

.commands-section {
    padding-bottom: 6rem;
}

.commands-card {
    border-radius: 1.8rem;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 40px 90px -60px rgba(15, 23, 42, 0.9);
    padding: clamp(1.8rem, 4vw, 2.6rem);
}

.commands-toolbar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 1.8rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: min(280px, 100%);
}

.field-label {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    color: var(--color-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.field input {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    background: rgba(15, 23, 42, 0.6);
    padding: 0.75rem 1.2rem;
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border 0.3s ease, box-shadow 0.3s ease, transform 0.25s ease;
}

.field input:focus,
.field input:focus-visible {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.16);
    transform: translateY(-1px);
}

.field .custom-select {
    width: 100%;
}

.command-table-wrapper {
    border-radius: 1.2rem;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.command-table {
    width: 100%;
    border-collapse: collapse;
}

.command-table thead {
    background: rgba(148, 163, 184, 0.08);
    text-align: left;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.command-table th,
.command-table td {
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.command-table tbody tr:last-child td {
    border-bottom: none;
}

.command-table tbody tr {
    transition: background 0.3s ease;
}

.command-table tbody tr:hover {
    background: rgba(148, 163, 184, 0.06);
}

.command-table td:nth-child(1) {
    font-weight: 600;
}

.command-table td:nth-child(2) {
    color: var(--color-accent);
    font-weight: 500;
}

.command-table td:nth-child(3) {
    color: var(--color-muted);
    font-family: "Fira Code", "Source Code Pro", Consolas, monospace;
}

.team-section {
    padding: 3rem 0 6rem;
}

[data-team-section] {
    position: relative;
    overflow: hidden;
}

[data-team-section]::before {
    content: "";
    position: absolute;
    top: clamp(-160px, -12vw, -120px);
    left: 50%;
    transform: translateX(-50%);
    width: min(420px, 70vw);
    aspect-ratio: 1;
    background-image: var(--team-backdrop-image, none);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.6;
    pointer-events: none;
    filter: drop-shadow(0 40px 80px rgba(15, 23, 42, 0.65));
    z-index: 0;
}

[data-team-section]:not(.has-backdrop)::before {
    display: none;
}

[data-team-section] .section-header,
[data-team-section] .team-grid,
[data-team-section] .section-footer {
    position: relative;
    z-index: 1;
}

.team-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.team-grid--expanded {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.team-card {
    padding: 2.2rem;
    border-radius: 1.6rem;
    background: var(--color-surface);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: var(--shadow-soft);
    text-align: center;
    transition: transform 0.3s ease, border 0.3s ease;
}

.team-card:hover,
.team-card:focus-within {
    transform: translateY(-6px);
    border-color: var(--color-accent);
}

.avatar {
    width: 96px;
    height: 96px;
    margin: 0 auto 1.3rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.45);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.avatar-initial {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.06em;
    color: var(--color-text);
    background: rgba(148, 163, 184, 0.22);
}

.team-card h2,
.team-card h3 {
    margin: 0 0 0.6rem;
    font-size: 1.25rem;
}

.team-card .role {
    margin: 0 0 1.1rem;
    color: var(--color-accent);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.team-card p {
    margin: 0;
    color: var(--color-muted);
}

.team-links {
    margin: 1.4rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.team-links a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(148, 163, 184, 0.12);
    color: var(--color-muted);
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.team-links a:hover,
.team-links a:focus-visible {
    color: var(--color-text);
    background: var(--color-accent);
    transform: translateY(-2px);
}

.team-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 2.5rem 1.5rem;
    border-radius: 1.4rem;
    border: 1px dashed rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.45);
    color: var(--color-muted);
    text-align: center;
    font-size: 0.95rem;
}

.site-footer {
    padding: 2.4rem 0;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(10, 19, 35, 0.8);
    animation: fade-in 0.9s ease both;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.4rem;
    color: var(--color-muted);
}

.footer-title {
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 0 0.3rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--color-muted);
    transition: color 0.3s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--color-accent);
}

#back-to-top {
    position: fixed;
    right: 1.8rem;
    bottom: 1.8rem;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: var(--color-accent);
    color: #0f172a;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 22px 40px -25px var(--color-accent);
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.page-hero {
    padding: 6rem 0 3rem;
}

.page-hero-content h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.4rem, 5vw, 3.1rem);
}

.page-hero-content p {
    margin: 0;
    color: var(--color-muted);
    max-width: 40rem;
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 920px) {
    .nav-container {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .theme-switcher {
        order: 3;
    }

    .hero {
        padding-top: 5.5rem;
    }
}

.legal-section {
    padding: 3rem 0 6rem;
}

.legal-article {
    margin-bottom: 4rem;
    padding: 2.5rem;
    border-radius: 1.6rem;
    background: var(--color-surface);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: var(--shadow-soft);
}

.legal-article h2 {
    margin: 0 0 1rem;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    color: var(--color-accent);
}

.legal-article h3 {
    margin: 2rem 0 1rem;
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    color: var(--color-text);
}

.legal-article p {
    margin: 0 0 1rem;
    color: var(--color-muted);
    line-height: 1.7;
}

.legal-article ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
    color: var(--color-muted);
}

.legal-article li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.legal-updated {
    font-size: 0.9rem;
    color: var(--color-muted);
    font-style: italic;
    margin-bottom: 2rem !important;
}

.legal-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.legal-card {
    padding: 2.5rem;
    border-radius: 1.6rem;
    background: var(--color-surface);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.legal-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.legal-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 1rem;
    background: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: white;
    font-size: 1.8rem;
}

.legal-card h2 {
    margin: 0 0 1rem;
    font-size: clamp(1.5rem, 3vw, 1.8rem);
    color: var(--color-text);
}

.legal-card-updated {
    font-size: 0.85rem;
    color: var(--color-muted);
    font-style: italic;
    margin: 0 0 1rem;
}

.legal-card-desc {
    color: var(--color-muted);
    line-height: 1.6;
    margin: 0 0 1.5rem;
    flex-grow: 1;
}

.legal-card-btn {
    margin-top: auto;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1.6rem;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    background: var(--color-accent);
    color: #0f172a;
    box-shadow: 0 25px 40px -25px var(--color-accent);
    font-size: 1rem;
}

.legal-card-btn:hover,
.legal-card-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 30px 46px -20px var(--color-accent);
}

.legal-card-btn:active {
    transform: translateY(0);
}

/* Legal Modal */
.legal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.legal-modal.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.legal-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.legal-modal.active .legal-modal-overlay {
    opacity: 1;
}

.legal-modal-container {
    position: relative;
    background: var(--color-surface);
    border-radius: 1.6rem;
    max-width: 900px;
    max-height: 90vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.legal-modal.active .legal-modal-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.legal-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.legal-modal-header h2 {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--color-accent);
}

.legal-modal-close {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.2);
    font-size: 1.8rem;
    line-height: 1;
    color: var(--color-text);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 300;
}

.legal-modal-close:hover,
.legal-modal-close:focus-visible {
    background: rgba(148, 163, 184, 0.1);
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: rotate(90deg);
}

.legal-modal-close:active {
    transform: rotate(90deg) scale(0.95);
}

.legal-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.legal-modal-article {
    color: var(--color-muted);
}

.legal-modal-article h2 {
    margin: 0 0 1rem;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    color: var(--color-accent);
}

.legal-modal-article h3 {
    margin: 2rem 0 1rem;
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    color: var(--color-text);
}

.legal-modal-article p {
    margin: 0 0 1rem;
    color: var(--color-muted);
    line-height: 1.7;
}

.legal-modal-article ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
    color: var(--color-muted);
}

.legal-modal-article li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .legal-cards-grid {
        grid-template-columns: 1fr;
    }

    .legal-modal {
        padding: 1rem;
    }

    .legal-modal-container {
        max-height: 95vh;
    }

    .legal-modal-header,
    .legal-modal-body {
        padding: 1.5rem;
    }
}

@media (max-width: 640px) {
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .commands-toolbar {
        flex-direction: column;
    }

    .field {
        width: 100%;
    }

    #back-to-top {
        right: 1.2rem;
        bottom: 1.2rem;
    }

    .legal-article {
        padding: 1.5rem;
    }
}
