.api-hero {
    position: relative;
    overflow: hidden;
    padding: 5rem 0 4.25rem;
}

.api-hero::after {
    content: '';
    position: absolute;
    width: 32rem;
    height: 32rem;
    right: -12rem;
    top: -15rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3), transparent 68%);
    pointer-events: none;
}

.api-hero .container {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.api-eyebrow,
.api-group-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #c7d2fe;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.api-eyebrow {
    padding: 0.55rem 0.9rem;
    border: 1px solid rgba(165, 180, 252, 0.28);
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.13);
}

.api-hero h1 {
    max-width: 900px;
    margin: 1.25rem auto 1rem;
    color: #f8fafc;
    font-size: clamp(2.25rem, 6vw, 4.8rem);
    line-height: 1.02;
    letter-spacing: -0.055em;
}

.api-hero p {
    max-width: 780px;
    margin: 0 auto;
    color: #cbd5e1;
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.7;
}

.api-hero-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
}

.api-primary-action,
.api-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.75rem 1.15rem;
    border-radius: 12px;
    font-weight: 750;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.api-primary-action {
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 12px 28px rgba(79, 70, 229, 0.3);
}

.api-secondary-action {
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(15, 23, 42, 0.35);
}

.api-primary-action:hover,
.api-secondary-action:hover {
    transform: translateY(-2px);
}

.api-primary-action:focus-visible,
.api-secondary-action:focus-visible,
.api-filter:focus-visible,
.api-view-button:focus-visible,
.api-card a:focus-visible,
.api-search-wrap:focus-within {
    outline: 3px solid rgba(34, 211, 238, 0.65);
    outline-offset: 3px;
}

.api-main {
    padding: 3rem 0 5rem;
    background: #f8fafc;
}

.api-main > .container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 2rem;
}

.api-notice {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding: 1.15rem 1.25rem;
    border: 1px solid #bfdbfe;
    border-radius: 18px;
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
    color: #1e3a8a;
}

.api-notice-icon {
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #ffffff;
    background: #2563eb;
    font-weight: 900;
}

.api-notice h2,
.api-notice p {
    margin: 0;
}

.api-notice h2 {
    font-size: 1rem;
}

.api-notice p {
    margin-top: 0.3rem;
    font-size: 0.92rem;
    line-height: 1.55;
}

.api-toolbar {
    position: sticky;
    top: 0.75rem;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    gap: 0.85rem 1rem;
    align-items: center;
    margin-bottom: 2.5rem;
    padding: 1rem;
    border: 1px solid rgba(203, 213, 225, 0.82);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 16px 45px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(18px);
}

.api-search-label {
    grid-column: 1 / -1;
    font-size: 0.82rem;
    font-weight: 800;
    color: #475569;
}

.api-search-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 48px;
    padding: 0 0.9rem;
    border: 1px solid #cbd5e1;
    border-radius: 13px;
    background: #ffffff;
    color: #64748b;
}

.api-search-wrap input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #0f172a;
    font: inherit;
}

.api-filters {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.api-filter {
    min-height: 38px;
    padding: 0.48rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 750;
    cursor: pointer;
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.api-filter:hover,
.api-filter.is-active {
    color: #ffffff;
    border-color: #4f46e5;
    background: #4f46e5;
}

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

.api-result-count {
    grid-column: 1 / -1;
    margin: 0;
    color: #64748b;
    font-size: 0.84rem;
}

.api-groups {
    display: grid;
    gap: 3rem;
}

.api-group[hidden],
.api-card[hidden] {
    display: none !important;
}

.api-group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.api-group-kicker {
    color: #4f46e5;
}

.api-group-header h2 {
    margin: 0.35rem 0 0.45rem;
    color: #0f172a;
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    letter-spacing: -0.035em;
}

.api-group-header p {
    max-width: 760px;
    margin: 0;
    color: #64748b;
    line-height: 1.55;
}

.api-group-count {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    min-width: 44px;
    height: 44px;
    border-radius: 14px;
    color: #4338ca;
    background: #e0e7ff;
    font-weight: 900;
}

.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
    gap: 1rem;
}

.api-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 245px;
    padding: 1.25rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.07);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.api-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
    opacity: 0;
    transition: opacity 180ms ease;
}

.api-card:hover {
    transform: translateY(-4px);
    border-color: #a5b4fc;
    box-shadow: 0 18px 44px rgba(79, 70, 229, 0.14);
}

.api-card:hover::before {
    opacity: 1;
}

.api-card-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.api-card-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0.28rem 0.58rem;
    border-radius: 999px;
    color: #3730a3;
    background: #e0e7ff;
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.api-badge-legacy {
    color: #92400e;
    background: #fef3c7;
}

.api-badge-verify {
    color: #9f1239;
    background: #ffe4e6;
}

.api-badge-free {
    color: #166534;
    background: #dcfce7;
}

.api-card-domain {
    max-width: 52%;
    overflow: hidden;
    color: #94a3b8;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.api-card h3 {
    margin: 0 0 0.55rem;
    color: #0f172a;
    font-size: 1.16rem;
    letter-spacing: -0.02em;
}

.api-card p {
    flex: 1;
    margin: 0;
    color: #64748b;
    font-size: 0.91rem;
    line-height: 1.55;
}

.api-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.85rem;
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.api-card-actions a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #4f46e5;
    font-size: 0.87rem;
    font-weight: 800;
    text-decoration: none;
}

.api-card-actions a:hover {
    text-decoration: underline;
}

.api-card-actions .api-secondary-link {
    color: #64748b;
}

.api-view-switch {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
    padding: 0.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

.api-view-button {
    min-height: 34px;
    padding: 0.35rem 0.65rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
}

.api-view-button.is-active,
.api-view-button:hover {
    color: #ffffff;
    background: #4f46e5;
}

.api-view {
    display: none;
}

.api-view.is-active {
    display: block;
}

.api-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.api-table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
    color: #334155;
}

.api-table caption {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.api-table th,
.api-table td {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}

.api-table th {
    color: #475569;
    background: #f8fafc;
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.api-table tbody tr:last-child td {
    border-bottom: 0;
}

.api-table tbody tr:hover {
    background: #f8fafc;
}

.api-table-name,
.api-table-link {
    color: #4338ca;
    font-weight: 800;
    text-decoration: none;
}

.api-table-name:hover,
.api-table-link:hover {
    text-decoration: underline;
}

.api-table-domain,
.api-table-category {
    display: block;
    margin-top: 0.3rem;
    color: #94a3b8;
    font-size: 0.75rem;
}

.api-table td:nth-child(2) {
    min-width: 170px;
}

.api-table td:nth-child(3) {
    min-width: 290px;
    line-height: 1.5;
}

.api-table td:nth-child(4) {
    min-width: 170px;
}

.api-table td:nth-child(4) a {
    display: inline-flex;
    gap: 0.3rem;
    margin: 0 0.65rem 0.35rem 0;
    font-size: 0.83rem;
}

.api-noscript {
    padding: 1rem;
    border: 1px solid #fbbf24;
    border-radius: 14px;
    color: #78350f;
    background: #fffbeb;
}

[data-theme="dark"] .api-main {
    background: #020617;
}

[data-theme="dark"] .api-notice {
    color: #bfdbfe;
    border-color: rgba(59, 130, 246, 0.38);
    background: rgba(30, 64, 175, 0.16);
}

[data-theme="dark"] .api-toolbar {
    border-color: rgba(51, 65, 85, 0.9);
    background: rgba(15, 23, 42, 0.9);
}

[data-theme="dark"] .api-search-label,
[data-theme="dark"] .api-result-count,
[data-theme="dark"] .api-group-header p,
[data-theme="dark"] .api-card p,
[data-theme="dark"] .api-card-domain {
    color: #94a3b8;
}

[data-theme="dark"] .api-search-wrap,
[data-theme="dark"] .api-filter,
[data-theme="dark"] .api-card {
    color: #e2e8f0;
    border-color: #334155;
    background: linear-gradient(145deg, #111827, #0f172a);
}

[data-theme="dark"] .api-view-switch {
    border-color: #334155;
    background: #0f172a;
}

[data-theme="dark"] .api-view-button {
    color: #94a3b8;
}

[data-theme="dark"] .api-table-wrap {
    border-color: #334155;
    background: #0f172a;
}

[data-theme="dark"] .api-table {
    color: #cbd5e1;
}

[data-theme="dark"] .api-table th,
[data-theme="dark"] .api-table td {
    border-color: #334155;
}

[data-theme="dark"] .api-table th,
[data-theme="dark"] .api-table tbody tr:hover {
    background: #111827;
}

[data-theme="dark"] .api-table-name,
[data-theme="dark"] .api-table-link {
    color: #c7d2fe;
}

[data-theme="dark"] .api-search-wrap input {
    color: #f8fafc;
}

[data-theme="dark"] .api-filter:hover,
[data-theme="dark"] .api-filter.is-active {
    border-color: #818cf8;
    background: #4f46e5;
}

[data-theme="dark"] .api-group-kicker,
[data-theme="dark"] .api-group-header h2,
[data-theme="dark"] .api-card h3,
[data-theme="dark"] .api-card-actions a {
    color: #e0e7ff;
}

[data-theme="dark"] .api-group-count {
    color: #c7d2fe;
    background: rgba(79, 70, 229, 0.25);
}

@media (max-width: 840px) {
    .api-hero {
        padding: 4rem 0 3.25rem;
    }

    .api-toolbar {
        position: static;
        grid-template-columns: 1fr;
    }

    .api-filters {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .api-hero .container,
    .api-main > .container {
        padding: 0 1rem;
    }

    .api-notice {
        padding: 1rem;
    }

    .api-group-header {
        align-items: flex-start;
    }

    .api-group-count {
        min-width: 38px;
        height: 38px;
    }

    .api-card {
        min-height: 220px;
        padding: 1.05rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .api-primary-action,
    .api-secondary-action,
    .api-filter,
    .api-card {
        transition: none;
    }
}
