@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap");

:root {
    color-scheme: dark;
    --bg: #000000;
    --text: #f8fafc;
    --muted: rgba(255, 255, 255, 0.6);
    --muted-strong: rgba(255, 255, 255, 0.8);
    --panel: rgba(0, 0, 0, 0.55);
    --border: rgba(255, 255, 255, 0.12);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    --accent-1: #10b981;
    --accent-2: #3b82f6;
    --accent-3: #a855f7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Space Grotesk", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

html,
body {
    overscroll-behavior-y: none;
}

.backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.glow {
    position: absolute;
    width: 52rem;
    height: 52rem;
    border-radius: 999px;
    filter: blur(120px);
    opacity: 0.35;
    mix-blend-mode: screen;
}

.glow.one {
    background: radial-gradient(
        circle,
        rgba(16, 185, 129, 0.65) 0%,
        rgba(16, 185, 129, 0) 70%
    );
    top: -20rem;
    left: -12rem;
}

.glow.two {
    background: radial-gradient(
        circle,
        rgba(59, 130, 246, 0.65) 0%,
        rgba(59, 130, 246, 0) 70%
    );
    bottom: -24rem;
    right: -16rem;
}

.glow.three {
    background: radial-gradient(
        circle,
        rgba(168, 85, 247, 0.6) 0%,
        rgba(168, 85, 247, 0) 70%
    );
    top: 10%;
    right: 20%;
}

.grain {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.15'/%3E%3C/svg%3E");
    opacity: 0.2;
    mix-blend-mode: soft-light;
}

.page {
    width: 100%;
    margin: 0 auto;
    padding: 72px clamp(24px, 4vw, 64px);
    display: grid;
    gap: 36px;
}

.hero {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    align-items: center;
    animation: rise 0.8s ease-out both;
}

.hero-main {
    display: grid;
    gap: 16px;
}

.hero-card {
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.6);
    padding: 18px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(100%, 720px);
    justify-self: end;
}

.hero-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.api-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.api-item {
    display: grid;
    gap: 8px;
}

.hero-card .card-copy {
    color: var(--muted-strong);
    font-size: 1rem;
}

.hero-card .api-link {
    font-family:
        "Space Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", monospace;
    font-size: 0.85rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    padding: 6px 10px;
    border-radius: 8px;
    display: inline-block;
    align-self: flex-start;
    white-space: nowrap;
    text-decoration: none;
    border: 1px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.hero-card .api-link:hover {
    border-color: rgba(255, 255, 255, 0.35);
    color: var(--text);
    background: rgba(255, 255, 255, 0.12);
}

.hero-card .api-link:focus-visible {
    outline: 2px solid rgba(16, 185, 129, 0.7);
    outline-offset: 3px;
}

.card-label {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    margin-top: 6px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    width: fit-content;
    justify-self: start;
}

.pulse {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--accent-1);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
    animation: pulse 1.8s ease-in-out infinite;
}

h1 {
    margin: 0;
    font-size: clamp(2.8rem, 5vw, 3.8rem);
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.title-top {
    display: block;
    color: var(--text);
}

.title-gradient {
    display: block;
    margin-top: 6px;
    background: linear-gradient(
        90deg,
        var(--accent-1),
        var(--accent-2),
        var(--accent-3)
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lede {
    margin: 0;
    max-width: 720px;
    color: var(--muted);
    font-size: 1.08rem;
}

.controls {
    margin-top: 12px;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: end;
}

.field {
    display: grid;
    gap: 6px;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.field span {
    color: var(--muted);
    font-weight: 600;
}

.filter-summary {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.95rem;
    min-height: 48px;
    display: flex;
    align-items: center;
    width: 100%;
    font-family:
        "Space Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", monospace;
    color: var(--muted-strong);
    background: rgba(0, 0, 0, 0.45);
}

input {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: rgba(0, 0, 0, 0.55);
    transition:
        border 0.2s ease,
        box-shadow 0.2s ease;
}

input:focus {
    outline: none;
    border-color: rgba(16, 185, 129, 0.8);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.primary {
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(
        90deg,
        var(--accent-1),
        var(--accent-2),
        var(--accent-3)
    );
    color: #ffffff;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    box-shadow: 0 18px 40px rgba(16, 185, 129, 0.3);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 48px rgba(59, 130, 246, 0.35);
}

.status {
    font-size: 0.95rem;
    color: var(--muted);
}

.status[data-tone="success"] {
    color: rgba(52, 211, 153, 0.9);
}

.status[data-tone="error"] {
    color: rgba(248, 113, 113, 0.9);
}

.status[data-tone="info"] {
    color: rgba(96, 165, 250, 0.9);
}

.panel {
    background: var(--panel);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    backdrop-filter: blur(18px);
    animation: rise 0.9s ease-out 0.1s both;
}

.panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel h2 {
    margin: 0;
    font-size: 1.35rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sub {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.meta {
    font-size: 0.9rem;
    color: var(--muted);
    font-family:
        "Space Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", monospace;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.45);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
}

th,
td {
    padding: 12px 14px;
    text-align: left;
    font-size: 0.95rem;
}

tbody td {
    transition:
        padding 0.2s ease,
        line-height 0.2s ease,
        opacity 0.2s ease;
    line-height: 1.4;
    overflow: hidden;
}

th {
    background: rgba(255, 255, 255, 0.05);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    color: var(--muted);
}

th.eta-col {
    min-width: 120px;
    white-space: nowrap;
}

td {
    color: var(--muted-strong);
}

tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

tbody tr {
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

tbody tr.row-enter {
    opacity: 0;
    transform: translateY(6px);
}

tbody tr.row-exit {
    opacity: 0;
    transform: translateY(-6px);
}

tbody tr.row-enter td,
tbody tr.row-exit td {
    padding-top: 0;
    padding-bottom: 0;
    line-height: 0;
    opacity: 0;
}

tbody tr.row-filtered {
    display: none;
}

.mono {
    font-family:
        "Space Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", monospace;
    font-size: 0.86rem;
}

.leader-link {
    color: var(--muted-strong);
    text-decoration: none;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.25);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.leader-link:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.6);
}

.leader-link:focus-visible {
    outline: 2px solid rgba(16, 185, 129, 0.6);
    outline-offset: 2px;
    border-bottom-color: transparent;
}

.copyable {
    cursor: pointer;
    transition: color 0.2s ease;
}

.copyable:hover {
    color: var(--text);
}

.copyable:focus-visible {
    outline: 2px solid rgba(16, 185, 129, 0.6);
    outline-offset: 2px;
}

.eta {
    white-space: nowrap;
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 28px 12px;
}

.footer {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.footer-top {
  justify-self: end;
}

.footer-link {
  color: var(--muted-strong);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.35);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-link:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.7);
}

.footer-link:focus-visible {
  outline: 2px solid rgba(16, 185, 129, 0.7);
  outline-offset: 3px;
  border-bottom-color: transparent;
}

.donate-link {
    margin-left: 12px;
    font-size: 0.8rem;
    color: var(--muted-strong);
    text-decoration: none;
    border: none;
    padding: 0;
    background: none;
    font-family: inherit;
    cursor: pointer;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.35);
    transition:
        color 0.2s ease,
        border-color 0.2s ease;
}

.donate-link:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.7);
}

.donate-link:focus-visible {
    outline: 2px solid rgba(16, 185, 129, 0.7);
    outline-offset: 4px;
    border-bottom-color: transparent;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@media (max-width: 720px) {
    .page {
        padding: 64px 18px 54px;
    }

    .panel {
        padding: 18px;
    }

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

    table {
        min-width: 0;
    }
}

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

    .hero-card {
        max-width: 520px;
    }
}

@media (max-width: 640px) {
    .panel-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-wrap {
        overflow: visible;
    }

    table {
        display: block;
    }

    thead {
        display: none;
    }

    tbody {
        display: grid;
        gap: 12px;
    }

    tbody tr {
        display: grid;
        gap: 8px;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: rgba(0, 0, 0, 0.55);
    }

    tbody tr.row-enter td,
    tbody tr.row-exit td {
        padding-top: 0;
        padding-bottom: 0;
        line-height: 0;
    }

    tbody td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    tbody td:last-child {
        border-bottom: none;
    }

    tbody td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.72rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        min-width: 92px;
    }

    tbody td.empty {
        display: block;
        text-align: center;
        border-bottom: none;
    }

    tbody td.empty::before {
        content: "";
    }

    tbody tr:nth-child(even) td {
        background: transparent;
    }
}
