:root {
    --background: #09090b;
    --foreground: #fafafa;
    --card: rgba(24, 24, 27, 0.72);
    --card-foreground: #fafafa;
    --popover: #18181b;
    --popover-foreground: #fafafa;
    --primary: #a855f7;
    --primary-foreground: #fafafa;
    --secondary: rgba(39, 39, 42, 0.92);
    --secondary-foreground: #fafafa;
    --muted: rgba(39, 39, 42, 0.7);
    --muted-foreground: #a1a1aa;
    --accent: rgba(161, 161, 170, 0.12);
    --accent-foreground: #f4f4f5;
    --destructive: #ef4444;
    --border: rgba(63, 63, 70, 0.82);
    --input: rgba(63, 63, 70, 0.78);
    --ring: rgba(168, 85, 247, 0.42);
    --radius: 8px;
    --gold: #d6bd7f;
    --text: var(--foreground);
    --dim: var(--muted-foreground);
    --panel: var(--card);
    --font-display: "Grandiflora One", serif;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color-scheme: dark;
}

* {
    letter-spacing: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background:
        linear-gradient(180deg, rgba(24, 24, 27, 0.7), rgba(9, 9, 11, 0) 260px),
        var(--background) !important;
    color: var(--foreground);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::after {
    display: none;
}

a {
    text-underline-offset: 4px;
}

body > nav:not(.tabs) {
    position: sticky !important;
    top: 0;
    z-index: 30;
    background: rgba(5, 5, 10, 0) !important;
    border-bottom: 1px solid transparent !important;
    box-shadow: none;
    backdrop-filter: blur(0);
    transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease, backdrop-filter 220ms ease;
}

body > nav:not(.tabs).is-scrolled {
    background: rgba(5, 5, 10, 0.82) !important;
    border-bottom-color: rgba(63, 63, 70, 0.72) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(16px);
}

.nav-inner {
    min-height: 64px !important;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 22px !important;
    font-weight: 400 !important;
    letter-spacing: 0.02em !important;
}

.brand::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.14);
}

.links,
.nav-links {
    gap: 8px !important;
}

.links a,
.nav-links a,
.back {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    border-radius: 0;
    padding: 0 10px;
    color: var(--muted-foreground) !important;
    font-size: 14px !important;
    font-weight: 500;
    text-decoration-color: transparent;
    transition: opacity 160ms ease, color 160ms ease, text-decoration-color 160ms ease;
}

.links a:hover,
.nav-links a:hover,
.back:hover {
    background: transparent;
    color: var(--accent-foreground) !important;
    opacity: 0.82;
    text-decoration: underline;
    text-decoration-color: currentColor;
}

main {
    position: relative;
    z-index: 1;
}

.kicker,
.eyebrow,
.ticker-label {
    font-family: var(--font-sans);
    color: var(--gold) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em !important;
}

h1 {
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--foreground);
    letter-spacing: 0;
}

h2,
.card h3,
.item h3,
.panel h2 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0;
}

.subtitle,
.lead {
    font-family: var(--font-display);
    font-size: clamp(19px, 2.4vw, 26px) !important;
    line-height: 1.62 !important;
}

.lead,
.subtitle,
.notice,
.note,
.meta,
.source,
.role,
.message,
.empty,
.card p,
.item p {
    color: var(--muted-foreground) !important;
}

.card,
.panel,
.item,
.empty,
.status,
.ticker,
.hero-stat,
.lookup-result,
.code-box,
.modal {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    background: var(--card) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

.card:hover,
.item:hover,
.hero-stat:hover {
    border-color: rgba(113, 113, 122, 0.9) !important;
}

.btn,
.pill,
button,
.tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    background: var(--secondary) !important;
    color: var(--secondary-foreground) !important;
    padding: 0 14px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.16);
    transition: transform 100ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.btn:hover,
.pill:hover,
button:hover,
.tab:hover {
    background: rgba(63, 63, 70, 0.92) !important;
}

.btn,
.pill,
.privacy-page .back-link {
    min-height: auto;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--foreground) !important;
    padding: 0 !important;
    box-shadow: none;
    font-weight: 600 !important;
    text-decoration-color: transparent;
    transition: opacity 160ms ease, transform 100ms ease, text-decoration-color 160ms ease;
}

.btn:hover,
.pill:hover,
.privacy-page .back-link:hover {
    background: transparent !important;
    opacity: 0.72;
    text-decoration: underline;
    text-decoration-color: currentColor;
}

button.primary,
.tab.active {
    border-color: transparent !important;
    background: var(--primary) !important;
    color: var(--primary-foreground) !important;
}

.actions .btn.primary[href="apply.html"],
#applyButton {
    min-height: 42px;
    border: 1px solid rgba(168, 85, 247, 0.42) !important;
    border-radius: var(--radius) !important;
    background: rgba(168, 85, 247, 0.18) !important;
    color: var(--primary-foreground) !important;
    padding: 0 16px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    text-decoration: none;
}

.actions .btn.primary[href="apply.html"]:hover,
#applyButton:hover {
    background: rgba(168, 85, 247, 0.26) !important;
    opacity: 1;
}

.tab,
button,
button.primary {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    background: var(--secondary) !important;
    color: var(--secondary-foreground) !important;
    padding: 0 14px !important;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.16);
}

button.primary,
.tab.active {
    border-color: transparent !important;
    background: var(--primary) !important;
    color: var(--primary-foreground) !important;
}

button.danger {
    color: #fecaca !important;
    border-color: rgba(239, 68, 68, 0.34) !important;
    background: rgba(127, 29, 29, 0.34) !important;
}

input,
textarea,
select {
    font-family: var(--font-sans);
    border: 1px solid var(--input) !important;
    border-radius: var(--radius) !important;
    background: rgba(9, 9, 11, 0.72) !important;
    color: var(--foreground) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

input::placeholder,
textarea::placeholder {
    color: #71717a;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
.btn:focus-visible,
.pill:focus-visible,
.tab:focus-visible,
a:focus-visible {
    outline: 2px solid var(--ring) !important;
    outline-offset: 2px;
    border-color: rgba(168, 85, 247, 0.72) !important;
}

label {
    color: var(--muted-foreground) !important;
    font-size: 13px !important;
    font-weight: 650 !important;
}

.badge {
    border-color: rgba(214, 189, 127, 0.28) !important;
    border-radius: 999px !important;
    background: rgba(214, 189, 127, 0.1) !important;
    color: #f5e6b8 !important;
}

.value,
.hero-stat strong,
.result-title,
.item-title {
    font-family: var(--font-sans);
    color: var(--foreground) !important;
}

.savebar {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    background: rgba(9, 9, 11, 0.92) !important;
}

.emblem-scene {
    max-width: 420px;
}

.hero-logo {
    border-radius: 16px !important;
    filter: drop-shadow(0 24px 42px rgba(0, 0, 0, 0.46)) !important;
}

#legalModal {
    background: rgba(9, 9, 11, 0.82) !important;
    backdrop-filter: blur(10px);
}

.privacy-page {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.privacy-page .container {
    width: min(860px, calc(100% - 32px));
    margin: 56px auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    padding: 28px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.privacy-page h1 {
    border-bottom: 1px solid var(--border);
    color: var(--foreground);
}

.privacy-page h2 {
    color: var(--foreground);
}

.privacy-page p,
.privacy-page li {
    color: var(--muted-foreground);
}

.privacy-page .back-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    margin-bottom: 18px;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    color: var(--secondary-foreground);
    text-decoration: none;
}

@media (max-width: 760px) {
    .nav-inner {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 10px !important;
        padding: 12px 0 !important;
    }

    .links,
    .nav-links {
        width: 100%;
        flex-wrap: wrap;
    }

    .links a,
    .nav-links a,
    .back {
        min-height: 34px;
        padding: 0 8px;
    }

    .btn,
    .pill,
    button,
    .tab {
        min-height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        transition-duration: 1ms !important;
    }
}

.site-main {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 72px 0 80px;
}

.site-main.narrow {
    width: min(860px, calc(100% - 32px));
}

.home-hero {
    min-height: calc(100vh - 120px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 420px);
    gap: 42px;
    align-items: center;
}

.home-hero h1,
.page-hero h1,
.article-header h1 {
    margin: 10px 0 18px;
    font-size: clamp(42px, 7vw, 82px);
    line-height: 1.02;
}

.page-hero {
    margin-bottom: 34px;
}

.page-hero .lead,
.home-hero .lead {
    max-width: 760px;
}

.hero-emblem {
    width: 100%;
    max-width: 420px;
    justify-self: end;
    border-radius: 16px;
    filter: drop-shadow(0 26px 46px rgba(0, 0, 0, 0.46));
}

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

.content-band {
    padding: 34px 0;
    border-top: 1px solid var(--border);
}

.content-band.two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.section-head {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.section-head h2,
.content-band h2,
.article-sidebar h2,
.related h2,
.prose h2,
.contact-grid h2 {
    font-size: clamp(25px, 3vw, 36px);
    line-height: 1.15;
}

.section-head p,
.content-band p,
.article-sidebar p,
.contact-grid p,
.prose p {
    color: var(--muted-foreground);
    line-height: 1.75;
}

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

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

.post-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
}

.post-card-body {
    padding: 16px;
}

.post-card h3 {
    margin: 8px 0 10px;
    font-size: 20px;
    line-height: 1.35;
}

.post-card h3 a {
    color: var(--foreground);
    text-decoration: none;
}

.post-card h3 a:hover {
    text-decoration: underline;
}

.post-card p,
.article-meta,
.meta {
    color: var(--muted-foreground);
    line-height: 1.65;
}

.thumb {
    display: grid;
    min-height: 148px;
    place-items: end start;
    padding: 16px;
    background:
        linear-gradient(135deg, rgba(214, 189, 127, 0.18), rgba(255, 255, 255, 0.035)),
        linear-gradient(180deg, rgba(24, 24, 27, 0.96), rgba(9, 9, 11, 0.96));
    color: var(--foreground);
}

.thumb span {
    max-width: 16rem;
    font-family: var(--font-display);
    font-size: 25px;
    line-height: 1.1;
}

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 760px) 300px;
    gap: 34px;
    align-items: start;
}

.article-main {
    min-width: 0;
}

.article-header {
    margin-bottom: 24px;
}

.article-main > p {
    margin: 20px 0;
    color: #e4e4e7;
    font-size: 17px;
    line-height: 1.95;
}

.article-main .thumb {
    min-height: 220px;
    margin-top: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.article-sidebar {
    position: sticky;
    top: 92px;
    display: grid;
    gap: 18px;
}

.article-sidebar section,
.contact-grid article,
.prose,
.contact-form {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    padding: 22px;
}

.disclaimer-note {
    border-left: 2px solid var(--gold);
    padding-left: 14px;
    color: #f5e6b8 !important;
}

.source-box {
    margin: 30px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.025);
    padding: 20px;
}

.source-box h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.source-box ul {
    margin: 0;
    padding-left: 20px;
    color: var(--muted-foreground);
    line-height: 1.8;
}

.related {
    margin-top: 34px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.ad-slot {
    display: grid;
    min-height: 108px;
    place-items: center;
    margin: 28px 0;
    border: 1px dashed rgba(161, 161, 170, 0.36);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.025);
    color: var(--muted-foreground);
    font-size: 12px;
}

.ad-slot span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted-foreground);
}

.site-footer {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 44px;
    border-top: 1px solid var(--border);
    color: var(--muted-foreground);
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.site-footer strong {
    color: var(--foreground);
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 400;
}

.site-footer p {
    max-width: 620px;
    margin-top: 8px;
    line-height: 1.7;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-content: start;
}

.footer-links a,
.contact-grid a {
    color: var(--foreground);
}

.prose {
    display: grid;
    gap: 14px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 18px;
    align-items: start;
}

.contact-form {
    display: grid;
    gap: 10px;
}

.contact-form textarea {
    min-height: 150px;
}

@media (max-width: 900px) {
    .home-hero,
    .article-layout,
    .contact-grid,
    .content-band.two-col {
        grid-template-columns: 1fr;
    }

    .hero-emblem {
        justify-self: start;
        max-width: 300px;
    }

    .post-grid,
    .post-grid.small {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        position: static;
    }

    .site-footer {
        display: block;
    }

    .footer-links {
        margin-top: 16px;
    }
}
