:root {
    --bg: #050610;
    --bg2: #070b1c;
    --surface: rgba(255, 255, 255, 0.08);
    --surface-2: rgba(255, 255, 255, 0.12);
    --border: rgba(255, 255, 255, 0.14);
    --text: rgba(255, 255, 255, 0.92);
    --muted: rgba(255, 255, 255, 0.70);
    --muted-2: rgba(255, 255, 255, 0.56);

    --accent: #a78bfa;
    --accent-2: #34d399;
    --accent-3: #38bdf8;
    --accent-4: #fb7185;

    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.40);
    --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.30);
    --ring: 0 0 0 4px rgba(139, 92, 246, 0.28);

    --card: rgba(255, 255, 255, 0.10);
    --card-hover: rgba(255, 255, 255, 0.14);
    --card-border: rgba(255, 255, 255, 0.16);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg2);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 28px 18px 48px;
}

.header {
    padding: 18px 18px 16px;
    border: 1px solid var(--card-border);
    border-radius: 18px;
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: "";
    position: absolute;
    inset: -120px -160px auto auto;
    width: 340px;
    height: 340px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.30), transparent 60%),
        radial-gradient(circle at 70% 70%, rgba(56, 189, 248, 0.22), transparent 60%),
        radial-gradient(circle at 30% 80%, rgba(34, 197, 94, 0.18), transparent 62%);
    filter: blur(10px);
    opacity: 0.9;
    pointer-events: none;
}

.header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-3), var(--accent-2), var(--accent-4));
    opacity: 0.95;
    pointer-events: none;
}

h1 {
    margin: 0;
    font-size: 24px;
    letter-spacing: -0.03em;
    font-weight: 800;
}

.subhead {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.meta {
    margin: 10px 0 0;
    color: var(--muted-2);
    font-size: 13px;
}

.meta strong {
    color: var(--text);
    font-weight: 700;
}

.story-list {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.story {
    border: 1px solid var(--card-border);
    border-radius: 16px;
    background: var(--card);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    position: relative;
}

.story::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.50), rgba(56, 189, 248, 0.30), rgba(34, 197, 94, 0.26), rgba(251, 113, 133, 0.28));
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 160ms ease;
    pointer-events: none;
}

.story-link {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    text-decoration: none;
    color: inherit;
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.story-link:hover {
    background: var(--card-hover);
    transform: translateY(-2px);
}

.story:hover::before {
    opacity: 1;
}

.story:hover {
    box-shadow: var(--shadow);
}

.story-link:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: 14px;
}

.votes {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.20), rgba(56, 189, 248, 0.16));
    font-variant-numeric: tabular-nums;
    font-weight: 750;
    font-size: 13px;
}

.votes::after {
    content: " votes";
    color: var(--muted);
    font-weight: 650;
    margin-left: 4px;
}

.title {
    font-size: 15px;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.chevron {
    color: var(--muted);
    font-size: 16px;
    transition: transform 160ms ease, color 160ms ease;
}

.story-link:hover .chevron {
    transform: translateX(3px);
    color: var(--accent);
}

.empty {
    margin: 18px 0 0;
    padding: 16px 18px;
    border: 1px dashed var(--card-border);
    border-radius: 16px;
    color: var(--muted);
    background: var(--card);
    box-shadow: var(--shadow-soft);
}

@media (min-width: 720px) {
    h1 {
        font-size: 30px;
    }

    .story-link {
        padding: 16px 16px;
    }

    .votes {
        min-width: 64px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .story-link,
    .chevron,
    .story,
    .story::before {
        transition: none;
    }

    .story-link:hover {
        transform: none;
    }
}