:root {
    --bg-0: #02060d;
    --bg-1: #07111d;
    --bg-2: #0b1d31;
    --bg-3: #123455;
    --line: rgba(118, 170, 255, 0.18);
    --text: #eef6ff;
    --muted: #98acc5;
    --neon-cyan: #63e6ff;
    --neon-lime: #6dffb1;
    --neon-amber: #ffb84d;
    --neon-pink: #ff5fd2;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
    --readout-accent: #63e6ff;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI Variable Text", "Bahnschrift", "Trebuchet MS", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(99, 230, 255, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(255, 95, 210, 0.16), transparent 32%),
        radial-gradient(circle at 50% 120%, rgba(109, 255, 177, 0.16), transparent 30%),
        linear-gradient(145deg, var(--bg-0) 0%, var(--bg-1) 28%, var(--bg-2) 65%, var(--bg-3) 100%);
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    background:
        linear-gradient(rgba(123, 174, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(123, 174, 255, 0.06) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, rgba(255, 255, 255, 0.75), transparent 82%);
}

body::after {
    background:
        radial-gradient(circle at 20% 18%, rgba(99, 230, 255, 0.2), transparent 18%),
        radial-gradient(circle at 84% 24%, rgba(255, 95, 210, 0.18), transparent 16%),
        radial-gradient(circle at 54% 82%, rgba(109, 255, 177, 0.14), transparent 18%);
    filter: blur(48px);
    opacity: 0.9;
}

.app-shell {
    position: relative;
    z-index: 1;
    width: min(1240px, calc(100% - 32px));
    margin: 24px auto 48px;
}

.panel {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 30px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
        linear-gradient(180deg, rgba(6, 14, 26, 0.92), rgba(4, 10, 20, 0.86));
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    opacity: 0.55;
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 24px;
    padding: 32px;
}

.hero-copy {
    display: grid;
    align-content: center;
    gap: 16px;
}

.hero-badge,
.panel-kicker,
.orbital-badge,
.metric-label,
.meta-pill {
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.hero-badge {
    display: inline-flex;
    width: fit-content;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(99, 230, 255, 0.1);
    border: 1px solid rgba(99, 230, 255, 0.22);
    color: var(--neon-cyan);
    font-size: 0.74rem;
    font-weight: 800;
}

.title-row {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.page-title {
    margin: 0;
    font-family: "Segoe UI Variable Display", "Bahnschrift", "Trebuchet MS", sans-serif;
    font-size: clamp(2.8rem, 7vw, 5.4rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0.06em;
    text-transform: uppercase;
}

.language-switcher {
    display: inline-flex;
    gap: 10px;
    padding: 8px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.lang-flag {
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 4px;
    background: transparent;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.lang-flag img {
    display: block;
    width: 46px;
    height: 30px;
    object-fit: cover;
    border-radius: 10px;
}

.lang-flag:hover,
.lang-flag:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(99, 230, 255, 0.22);
    box-shadow: 0 14px 30px rgba(99, 230, 255, 0.14);
    outline: none;
}

.lang-flag.is-active {
    border-color: rgba(109, 255, 177, 0.42);
    box-shadow:
        0 0 0 1px rgba(109, 255, 177, 0.28),
        0 14px 30px rgba(109, 255, 177, 0.16);
}

.hero-text,
.panel-heading p,
.orbital-caption,
.hint-copy,
.footer-copy,
#privacyBody {
    color: var(--muted);
}

.hero-text {
    margin: 0;
    max-width: 62ch;
    font-size: 1.08rem;
    line-height: 1.7;
}

.hero-visual {
    display: grid;
    place-items: center;
    min-height: 340px;
}

.orbital-display {
    display: grid;
    gap: 18px;
    justify-items: center;
    width: min(100%, 340px);
}

.orbital-badge {
    display: inline-flex;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(112, 161, 255, 0.12);
    border: 1px solid rgba(112, 161, 255, 0.22);
    color: #b7cbff;
    font-size: 0.72rem;
    font-weight: 800;
}

.orbital-core {
    position: relative;
    display: grid;
    place-items: center;
    width: min(100%, 320px);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, rgba(99, 230, 255, 0.18), transparent 38%),
        radial-gradient(circle at center, rgba(4, 13, 24, 0.92) 0%, rgba(3, 8, 16, 0.94) 62%, rgba(2, 5, 11, 1) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(114, 170, 255, 0.22),
        inset 0 0 70px rgba(99, 230, 255, 0.08),
        0 30px 60px rgba(0, 0, 0, 0.35);
}

.orbital-ring {
    position: absolute;
    inset: 0;
    margin: auto;
    border-radius: 50%;
    border: 1px solid rgba(112, 161, 255, 0.18);
}

.ring-a {
    width: 100%;
    height: 100%;
    animation: spin 18s linear infinite;
}

.ring-b {
    width: 76%;
    height: 76%;
    border-style: dashed;
    animation: spin-reverse 14s linear infinite;
}

.ring-c {
    width: 54%;
    height: 54%;
    border-color: rgba(109, 255, 177, 0.18);
    animation: pulse-soft 4s ease-in-out infinite;
}

.orbital-readout {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 8px;
    justify-items: center;
    text-align: center;
    padding: 18px;
}

.orbital-note,
.tuner-note,
.metric-value {
    color: var(--readout-accent);
}

.orbital-note {
    font-size: clamp(3.2rem, 9vw, 4.8rem);
    line-height: 0.95;
    font-weight: 900;
    letter-spacing: -0.06em;
    text-shadow: 0 0 24px rgba(99, 230, 255, 0.24);
}

.orbital-frequency {
    font-size: 1.1rem;
    font-weight: 700;
}

.orbital-caption {
    margin: 0;
    max-width: 20ch;
    line-height: 1.5;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 24px;
    margin-top: 24px;
}

.tuner-panel {
    padding: 28px;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.live-pill,
.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.meta-pill {
    font-size: 0.76rem;
    font-weight: 800;
    color: #b7cbff;
}

.signal-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 0 0 rgba(109, 255, 177, 0);
    transition: background 180ms ease, box-shadow 180ms ease;
}

.signal-dot.is-live {
    background: var(--neon-lime);
    box-shadow: 0 0 0 0.45rem rgba(109, 255, 177, 0.16);
    animation: pulse-ring 1.8s ease-out infinite;
}

.readout-stage {
    display: grid;
    justify-items: center;
    gap: 24px;
    padding-top: 24px;
}

.tuner-note {
    font-size: clamp(4.6rem, 13vw, 8rem);
    line-height: 0.92;
    font-weight: 900;
    letter-spacing: -0.08em;
    text-shadow: 0 0 30px rgba(99, 230, 255, 0.22);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
}

.metric-card {
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    text-align: center;
}

.metric-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--muted);
}

.metric-value {
    font-size: 1.26rem;
    font-weight: 800;
}

.tuner-meter {
    position: relative;
    width: min(100%, 620px);
    padding-top: 30px;
}

.tuner-scale {
    position: relative;
    height: 16px;
    border-radius: 999px;
    overflow: hidden;
    background: linear-gradient(90deg, #ff6b6b 0%, #ffb84d 24%, #6dffb1 50%, #ffb84d 76%, #ff5fd2 100%);
}

.tuner-scale::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transform: translateX(-100%);
    animation: sweep 3.2s linear infinite;
}

.tuner-meter-fill {
    position: absolute;
    top: 30px;
    left: 50%;
    height: 16px;
    width: 0;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    transition: width 160ms ease, background 160ms ease;
}

.tuner-meter-fill.is-good {
    background: rgba(109, 255, 177, 0.46);
}

.tuner-needle {
    position: absolute;
    top: 12px;
    left: 50%;
    width: 4px;
    height: 52px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.35);
    transform: translateX(-50%);
    transition: left 160ms ease;
}

.tuner-scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.88rem;
}

.hint-copy {
    margin: 0;
    min-height: 1.6em;
    font-size: 1rem;
    text-align: center;
}

.action-row {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 26px;
}

.action-button {
    min-width: 210px;
    min-height: 56px;
    border-radius: 999px;
    border: 0;
    padding: 0 24px;
    font-size: 0.98rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.action-button:hover,
.action-button:focus-visible {
    transform: translateY(-2px);
    filter: brightness(1.03);
    outline: none;
}

.action-primary {
    color: #08131f;
    background: linear-gradient(135deg, #63e6ff 0%, #6dffb1 100%);
    box-shadow: 0 20px 36px rgba(99, 230, 255, 0.22);
}

.action-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.action-install {
    color: var(--text);
    background: linear-gradient(135deg, rgba(255, 184, 77, 0.18), rgba(255, 95, 210, 0.14));
    border: 1px solid rgba(255, 184, 77, 0.26);
    box-shadow: 0 18px 34px rgba(255, 184, 77, 0.12);
}

.action-button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
    transform: none;
    filter: none;
}

.install-hint {
    margin: 14px 0 0;
    min-height: 1.6em;
    color: var(--muted);
    font-size: 0.94rem;
    text-align: center;
}

.side-column {
    display: grid;
    gap: 24px;
}

.side-panel {
    padding: 24px;
}

.panel-heading h2,
.local-processing h3 {
    margin: 10px 0 8px;
    font-size: 1.5rem;
}

.panel-heading p,
.local-processing p {
    margin: 0;
    line-height: 1.65;
}

.panel-kicker {
    display: inline-flex;
    width: fit-content;
    font-size: 0.68rem;
    font-weight: 800;
    color: #b7cbff;
}

.reference-list,
.tip-list {
    display: grid;
    gap: 12px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.reference-item,
.tip-card,
.local-processing {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.reference-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 20px;
}

.reference-name {
    font-weight: 700;
}

.reference-note {
    color: var(--neon-amber);
    font-weight: 800;
    white-space: nowrap;
}

.tip-card {
    padding: 14px 16px;
    border-radius: 18px;
    line-height: 1.6;
}

.local-processing {
    margin-top: 18px;
    padding: 18px;
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(99, 230, 255, 0.08), rgba(109, 255, 177, 0.06)),
        rgba(255, 255, 255, 0.04);
}

.footer-copy {
    margin: 16px 0 0;
    font-size: 0.94rem;
    line-height: 1.6;
}

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

@keyframes spin-reverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

@keyframes pulse-soft {
    0%,
    100% { transform: scale(1); opacity: 0.55; }
    50% { transform: scale(1.06); opacity: 1; }
}

@keyframes sweep {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(109, 255, 177, 0.24); }
    70% { box-shadow: 0 0 0 12px rgba(109, 255, 177, 0); }
    100% { box-shadow: 0 0 0 0 rgba(109, 255, 177, 0); }
}

@media (max-width: 1024px) {
    .hero-panel,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        min-height: 0;
    }
}

@media (max-width: 760px) {
    .app-shell {
        width: min(100% - 20px, 100%);
        margin: 10px auto 32px;
    }

    .hero-panel,
    .tuner-panel,
    .side-panel {
        padding: 20px;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .reference-item {
        grid-template-columns: 1fr;
    }

    .reference-note {
        white-space: normal;
    }

    .action-button {
        width: 100%;
        min-width: 0;
    }

    .title-row {
        align-items: flex-start;
    }
}
