:root {
    color-scheme: light;
    --bg: #eef4ef;
    --bg-accent: radial-gradient(circle at top left, rgba(83, 187, 123, 0.28), transparent 34%), radial-gradient(circle at right, rgba(24, 70, 44, 0.12), transparent 30%), linear-gradient(180deg, #f7fbf8 0%, #edf4ef 100%);
    --surface: rgba(255, 255, 255, 0.78);
    --surface-strong: rgba(255, 255, 255, 0.94);
    --surface-border: rgba(20, 69, 43, 0.08);
    --text: #11311e;
    --text-soft: #4c6656;
    --green: #2f9d5b;
    --green-deep: #196a3b;
    --shadow: 0 22px 60px rgba(22, 52, 33, 0.12);
}

body[data-theme='dark'] {
    color-scheme: dark;
    --bg: #08110c;
    --bg-accent: radial-gradient(circle at top left, rgba(55, 163, 97, 0.22), transparent 30%), radial-gradient(circle at right, rgba(122, 255, 164, 0.12), transparent 26%), linear-gradient(180deg, #09130d 0%, #050906 100%);
    --surface: rgba(12, 25, 17, 0.8);
    --surface-strong: rgba(11, 19, 14, 0.94);
    --surface-border: rgba(145, 255, 183, 0.1);
    --text: #ecfff1;
    --text-soft: #9eb7a5;
    --green: #6bdd95;
    --green-deep: #98f0b8;
    --shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Manrope', sans-serif;
    background: var(--bg-accent);
    color: var(--text);
    transition: background 0.3s ease, color 0.3s ease;
}

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

code,
pre {
    font-family: Consolas, Monaco, monospace;
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 64px;
}

.hero {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px;
}

.hero-copy,
.hero-panel,
.selector-card,
.docs-card {
    backdrop-filter: blur(16px);
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.hero-copy {
    padding: 40px;
}

.hero-copy h1 {
    margin: 12px 0 14px;
    font-size: clamp(3rem, 8vw, 5.4rem);
    line-height: 0.92;
    letter-spacing: -0.06em;
}

.hero-copy p {
    max-width: 620px;
    color: var(--text-soft);
    font-size: 1.05rem;
    line-height: 1.7;
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(67, 179, 108, 0.12);
    color: var(--green-deep);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button.primary {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-deep) 100%);
    color: #fff;
}

.button.secondary {
    border: 1px solid var(--surface-border);
    color: var(--text);
    background: var(--surface-strong);
}

.hero-panel {
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
    font-weight: 600;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #49d17f 0%, #a1f2bf 100%);
    box-shadow: 0 0 0 6px rgba(77, 207, 123, 0.14);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 28px 0 0;
}

.metric-grid div {
    padding: 18px;
    border-radius: 20px;
    background: var(--surface-strong);
    border: 1px solid var(--surface-border);
}

.metric-grid dt {
    color: var(--text-soft);
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.metric-grid dd {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.selector-card,
.docs-card {
    padding: 28px;
    margin-bottom: 24px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.section-heading h2 {
    margin: 10px 0 0;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    letter-spacing: -0.04em;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 999px;
    background: var(--surface-strong);
    border: 1px solid var(--surface-border);
    font-weight: 700;
}

.theme-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--green);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 24px;
}

.search-input {
    display: grid;
    gap: 10px;
    flex: 1 1 320px;
}

.search-input span,
.api-pill span {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-soft);
}

.search-input input {
    width: 100%;
    min-height: 54px;
    border-radius: 16px;
    border: 1px solid var(--surface-border);
    background: var(--surface-strong);
    color: var(--text);
    padding: 0 16px;
    font: inherit;
    outline: none;
}

.search-input input:focus {
    border-color: rgba(54, 173, 98, 0.7);
    box-shadow: 0 0 0 4px rgba(53, 173, 97, 0.12);
}

.api-pill {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--surface-strong);
    border: 1px solid var(--surface-border);
}

.api-pill code {
    color: var(--green-deep);
    font-weight: 700;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.app-card {
    position: relative;
    display: block;
    overflow: hidden;
    min-height: 220px;
    padding: 22px;
    border-radius: 24px;
    background: var(--surface-strong);
    border: 1px solid var(--surface-border);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.app-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(72, 204, 122, 0.12) 0%, transparent 48%);
    pointer-events: none;
}

.app-card:hover {
    transform: translateY(-3px);
    border-color: rgba(54, 173, 98, 0.35);
    box-shadow: 0 22px 36px rgba(33, 90, 52, 0.12);
}

.app-card:focus-visible {
    outline: 3px solid rgba(54, 173, 98, 0.35);
    outline-offset: 3px;
}

.app-icon-wrap {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    margin-bottom: 22px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(228, 243, 233, 0.88));
}

body[data-theme='dark'] .app-icon-wrap {
    background: linear-gradient(180deg, rgba(24, 46, 31, 0.95), rgba(12, 24, 17, 0.95));
}

.app-icon {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.app-card-body {
    position: relative;
    z-index: 1;
}

.app-id {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--green-deep);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.app-card h3 {
    margin: 0 0 10px;
    font-size: 1.22rem;
}

.app-card p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.65;
}

.app-card.is-hidden {
    display: none;
}

.endpoint-list {
    display: grid;
    gap: 16px;
}

.endpoint-item {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    border-radius: 22px;
    border: 1px solid var(--surface-border);
    background: var(--surface-strong);
}

.endpoint-item div {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.method {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(54, 173, 98, 0.14);
    color: var(--green-deep);
    font-size: 0.78rem;
    font-weight: 800;
}

.endpoint-item p {
    margin: 0;
    color: var(--text-soft);
    max-width: 520px;
    text-align: right;
}

.code-showcase {
    margin-top: 22px;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--surface-border);
}

.code-showcase pre {
    margin: 0;
    padding: 22px;
    background: #0d1711;
    color: #dfffe8;
    overflow-x: auto;
}

@media (max-width: 980px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .app-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .endpoint-item {
        flex-direction: column;
    }

    .endpoint-item p {
        text-align: left;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100% - 20px, 1180px);
        padding-top: 20px;
    }

    .hero-copy,
    .hero-panel,
    .selector-card,
    .docs-card {
        border-radius: 22px;
    }

    .hero-copy,
    .selector-card,
    .docs-card {
        padding: 22px;
    }

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

    .section-heading,
    .toolbar {
        align-items: stretch;
    }
}
