:root {
    --bg: #ffffff;
    --bg-soft: #f8f5ff;
    --surface: rgba(255, 255, 255, 0.86);
    --surface-strong: #ffffff;
    --text: #1f1638;
    --muted: #6f668a;
    --line: rgba(117, 81, 196, 0.16);
    --primary: #6f3cf0;
    --primary-strong: #5825d9;
    --primary-soft: #ede5ff;
    --shadow: 0 24px 80px rgba(89, 37, 217, 0.12);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --max-width: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(125, 76, 255, 0.16), transparent 32%),
        radial-gradient(circle at top right, rgba(198, 174, 255, 0.22), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #fcfaff 100%);
    font-family: "Manrope", sans-serif;
}

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

a {
    color: inherit;
    text-decoration: none;
}

code {
    padding: 0.18rem 0.4rem;
    border-radius: 8px;
    background: var(--primary-soft);
    font-family: "Space Grotesk", monospace;
    font-size: 0.9em;
}

.page-shell {
    width: min(calc(100% - 32px), var(--max-width));
    margin: 0 auto;
    padding: 24px 0 56px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 10px 0 20px;
    backdrop-filter: blur(20px);
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 12px 40px rgba(111, 60, 240, 0.08);
}

.brand-logo-only {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.brand-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 0;
    background: transparent;
}

.eyebrow,
.meta-row,
.text-link,
.pagination-label,
.back-link {
    font-family: "Space Grotesk", sans-serif;
}

.top-nav,
.footer-links,
.legal-links {
    display: flex;
    align-items: center;
    gap: 14px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.top-nav {
    flex-wrap: wrap;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 12px 40px rgba(111, 60, 240, 0.08);
}

.nav-link {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.95rem;
}

.nav-link {
    color: var(--muted);
    transition: color 180ms ease;
}

.nav-link-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: #fff;
    box-shadow: 0 12px 28px rgba(111, 60, 240, 0.2);
    text-align: center;
}

.nav-link:hover {
    color: var(--primary-strong);
}

.nav-link-cta:hover {
    color: #fff;
}

.content-wrap {
    display: grid;
    gap: 24px;
}

.hero-panel,
.featured-post,
.message-card,
.post-card,
.article-layout {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.hero-panel {
    display: grid;
    grid-template-columns: 1.5fr minmax(240px, 0.8fr);
    gap: 24px;
    padding: 34px;
    border-radius: var(--radius-xl);
}

.hero-copy h1,
.featured-copy h2,
.section-heading h2,
.article-copy h1 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.hero-copy h1 {
    font-size: clamp(2.2rem, 4vw, 4.5rem);
    line-height: 0.98;
    max-width: 10ch;
}

.hero-copy p,
.featured-copy p,
.post-card p,
.message-card p,
.article-description {
    color: var(--muted);
    line-height: 1.75;
}

.hero-accent {
    position: relative;
    min-height: 220px;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 35% 35%, rgba(111, 60, 240, 0.28), transparent 25%),
        radial-gradient(circle at 72% 68%, rgba(198, 174, 255, 0.45), transparent 24%),
        linear-gradient(145deg, #ffffff 0%, #f2eaff 100%);
    border: 1px solid rgba(111, 60, 240, 0.14);
    overflow: hidden;
}

.accent-orb {
    position: absolute;
    border-radius: 999px;
}

.accent-orb-large {
    width: 240px;
    height: 240px;
    right: -28px;
    top: -20px;
    background: radial-gradient(circle, rgba(111, 60, 240, 0.42) 0%, rgba(111, 60, 240, 0.08) 65%, transparent 72%);
}

.accent-orb-small {
    width: 160px;
    height: 160px;
    left: 24px;
    bottom: 18px;
    background: radial-gradient(circle, rgba(211, 192, 255, 0.95) 0%, rgba(211, 192, 255, 0.2) 62%, transparent 72%);
}

.meta-row,
.eyebrow,
.pagination-label,
.back-link {
    color: var(--muted);
}

.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
}

.featured-post {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
    align-items: center;
    padding: 26px;
    border-radius: var(--radius-xl);
}

.featured-copy,
.article-copy {
    display: grid;
    gap: 16px;
}

.featured-image,
.article-hero-image,
.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(var(--radius-lg) - 4px);
}

.featured-image {
    min-height: 320px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
}

.section-heading h2 {
    font-size: clamp(1.8rem, 2.8vw, 3rem);
}

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

.post-card {
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.post-image-link {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.post-image {
    transition: transform 220ms ease;
}

.post-card:hover .post-image {
    transform: scale(1.04);
}

.post-card-body {
    display: grid;
    gap: 14px;
    padding: 20px;
}

.post-card h3 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.35rem;
    line-height: 1.15;
}

.meta-row,
.chip-row,
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.meta-row {
    font-size: 0.9rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 0.88rem;
    font-weight: 700;
}

.button-primary,
.button-secondary,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    font-weight: 700;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button-primary,
.button-secondary {
    min-height: 48px;
    padding: 0 18px;
    border-radius: 999px;
}

.button-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: #fff;
    box-shadow: 0 16px 36px rgba(111, 60, 240, 0.25);
}

.button-secondary {
    background: #fff;
    border: 1px solid var(--line);
}

.text-link {
    color: var(--primary-strong);
}

.button-primary:hover,
.button-secondary:hover,
.text-link:hover {
    transform: translateY(-1px);
}

.message-card {
    padding: 28px;
    border-radius: var(--radius-xl);
}

.message-card h1,
.message-card h2 {
    margin-top: 0;
    font-family: "Space Grotesk", sans-serif;
}

.warning {
    background: linear-gradient(180deg, #fff9ef 0%, #ffffff 100%);
}

.error {
    background: linear-gradient(180deg, #fff0f2 0%, #ffffff 100%);
}

.pagination {
    justify-content: center;
    padding-top: 8px;
}

.site-footer {
    margin-top: 34px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.9fr 0.9fr;
    gap: 24px;
}

.footer-brand {
    display: grid;
    gap: 14px;
    align-content: start;
}

.footer-logo {
    width: fit-content;
}

.footer-brand p,
.copyright {
    color: var(--muted);
    line-height: 1.75;
}

.footer-column {
    display: grid;
    gap: 12px;
    align-content: start;
}

.footer-column h6 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
}

.footer-links {
    display: grid;
    gap: 10px;
    align-items: start;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding-top: 28px;
    margin-top: 28px;
    border-top: 1px solid var(--line);
}

.copyright a {
    color: var(--text);
    font-weight: 700;
}

.legal-links {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.article-shell {
    max-width: 1040px;
}

.back-link {
    display: inline-flex;
    width: fit-content;
    padding: 6px 2px;
    font-weight: 700;
}

.article-layout {
    padding: 28px;
    border-radius: var(--radius-xl);
}

.article-hero {
    display: grid;
    grid-template-columns: 1fr 0.88fr;
    gap: 26px;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.article-copy h1 {
    font-size: clamp(2rem, 4vw, 3.8rem);
    line-height: 1.02;
}

.article-hero-image {
    aspect-ratio: 4 / 3;
    min-height: 280px;
}

.prose {
    max-width: 100%;
    overflow-wrap: anywhere;
    line-height: 1.8;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
    margin: 1.5em 0 0.7em;
    font-family: "Space Grotesk", sans-serif;
    line-height: 1.15;
}

.prose p,
.prose li,
.prose blockquote {
    color: #372b57;
}

.prose img {
    border-radius: var(--radius-lg);
    margin: 28px auto;
}

.prose a {
    color: var(--primary-strong);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

.prose ul,
.prose ol {
    padding-left: 1.3rem;
}

.prose blockquote {
    margin: 24px 0;
    padding: 18px 20px;
    border-left: 4px solid var(--primary);
    background: var(--bg-soft);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.prose th,
.prose td {
    padding: 14px;
    border: 1px solid var(--line);
    text-align: left;
}

@media (max-width: 980px) {
    .header-bar,
    .footer-bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .footer-grid,
    .hero-panel,
    .featured-post,
    .article-hero,
    .posts-grid {
        grid-template-columns: 1fr;
    }

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

    .hero-copy h1 {
        max-width: 12ch;
    }
}

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

    .top-nav,
    .brand {
        width: 100%;
        border-radius: 24px;
    }

    .brand-logo {
        width: 96px;
        height: 96px;
    }

    .hero-panel,
    .featured-post,
    .message-card,
    .article-layout,
    .site-footer {
        padding: 20px;
    }

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

    .hero-copy h1,
    .article-copy h1 {
        max-width: 100%;
    }

    .legal-links {
        justify-content: flex-start;
    }
}
