@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --bg: #10111b;
    --surface: #181a28;
    --surface-light: #202235;
    --border: #303249;
    --text: #f2f2fb;
    --muted: #a1a4bc;
    --purple: #a78bfa;
    --blue: #7c9cff;
    --green: #75e0ae;
    --danger: #ff8c9c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background:
        radial-gradient(ellipse at 50% 0%, #242044 0%, transparent 48%),
        var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    min-height: 100vh;
    line-height: 1.6;
}

button, textarea, select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 2px solid var(--purple);
    outline-offset: 3px;
}

.navbar {
    min-height: 76px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 7%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(16, 17, 27, 0.8);
}

.logo {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 21px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.logo-icon {
    color: var(--purple);
    font-size: 26px;
}

.accent {
    color: var(--purple);
}

.status {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e5bd6d;
}

.status.online .status-dot {
    background: var(--green);
    box-shadow: 0 0 10px #75e0ae55;
}

.status.offline .status-dot {
    background: var(--danger);
}

.container {
    width: min(100% - 40px, 1000px);
    margin: auto;
}

.hero {
    text-align: center;
    padding: 90px 0 68px;
}

.eyebrow,
.section-label {
    color: var(--purple);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
}

.hero h1 {
    margin-top: 20px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(48px, 8vw, 78px);
    line-height: 1.05;
    letter-spacing: -3px;
}

.gradient-text {
    background: linear-gradient(100deg, #b7a0ff, #7ca7ff, #82e6cb);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-description {
    max-width: 580px;
    margin: 24px auto;
    color: var(--muted);
    font-size: 15px;
}

.feature-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.feature-row span,
.local-badge {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 30px;
    color: #d3d4e8;
    font-size: 11px;
}

.workspace {
    padding: 30px;
    background: rgba(24, 26, 40, 0.88);
    border: 1px solid var(--border);
    border-radius: 20px;
}

.section-heading,
.result-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 25px;
}

.section-heading h2,
.result-heading h2 {
    margin-top: 6px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 23px;
}

.local-badge {
    color: var(--green);
    border-color: #75e0ae44;
    white-space: nowrap;
}

.input-card {
    padding: 22px;
    background: #131520;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.input-card > label {
    display: block;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
}

textarea {
    width: 100%;
    min-height: 220px;
    resize: vertical;
    padding: 16px;
    background: #1b1d2b;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    font-size: 14px;
    line-height: 1.8;
}

textarea::placeholder {
    color: #777b98;
}

textarea:focus,
select:focus {
    border-color: var(--purple);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 9px;
    color: var(--muted);
    font-size: 11px;
}

.text-button {
    background: none;
    border: none;
    color: var(--purple);
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: end;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 25px;
}

.select-wrapper {
    flex: 1;
    min-width: 190px;
}

.select-wrapper label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
}

select {
    width: 100%;
    padding: 12px;
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
}

.primary-button,
.secondary-button {
    padding: 13px 19px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    transition: transform 0.2s, opacity 0.2s;
}

.primary-button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    background: linear-gradient(110deg, #a78bfa, #7c9cff);
    color: #111321;
    border: none;
}

.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-2px);
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.6;
}

.hint {
    margin-top: 16px;
    color: var(--muted);
    font-size: 11px;
}

.results-section {
    margin-top: 38px;
}

.result-card,
.loading-card,
.error-box {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.result-card {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: #dedff0;
    font-size: 14px;
    line-height: 1.9;
}

.secondary-button {
    color: var(--text);
    background: var(--surface-light);
    border: 1px solid var(--border);
}

.loading-card {
    text-align: center;
    color: var(--muted);
}

.loading-card p {
    margin-top: 12px;
    color: var(--text);
}

.loading-card span {
    font-size: 12px;
}

.spinner {
    width: 27px;
    height: 27px;
    margin: auto;
    border: 3px solid var(--border);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-box {
    color: var(--danger);
    overflow-wrap: anywhere;
}

.how-it-works {
    padding: 75px 0 45px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 17px;
    margin-top: 25px;
}

.feature-card {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.feature-icon {
    font-size: 25px;
}

.feature-card h3 {
    margin: 17px 0 9px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
}

.feature-card p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

footer {
    padding: 25px 0 35px;
    text-align: center;
    color: var(--muted);
    font-size: 11px;
}

footer span {
    display: block;
    margin-top: 6px;
    color: #777b98;
}

[hidden] {
    display: none !important;
}

@media (max-width: 650px) {
    .navbar {
        padding: 16px 20px;
    }

    .logo {
        font-size: 17px;
    }

    .status {
        font-size: 10px;
    }

    .hero {
        padding: 65px 0 45px;
    }

    .hero h1 {
        letter-spacing: -2px;
    }

    .workspace {
        padding: 17px;
    }

    .input-card {
        padding: 14px;
    }

    .section-heading h2,
    .result-heading h2 {
        font-size: 19px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .controls {
        align-items: stretch;
    }

    .primary-button {
        width: 100%;
    }

    .local-badge {
        font-size: 9px;
        padding: 6px 8px;
    }

    .result-heading {
        align-items: flex-start;
    }
}