:root {
    --db-purple: #351c75;
    --db-purple-dark: #201047;
    --db-nav: #11152f;
    --db-orange: #ffc84a;
    --db-ink: #17131f;
    --db-muted: #645d70;
    --db-line: #e8e2f4;
    --db-bg: #f8f7fb;
    --db-surface: #ffffff;
    --db-soft: #f3eefb;
    --content-width: 1180px;
    --article-width: 740px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    color: var(--db-ink);
    background: var(--db-bg);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

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

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

.site-frame {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
}

.site-header {
    width: 100%;
    min-height: 82px;
    margin: 0;
    padding: 0 max(18px, calc((100vw - var(--content-width)) / 2));
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto minmax(120px, 1fr);
    align-items: center;
    gap: 24px;
    color: white;
    background: var(--db-nav);
    border-bottom: 4px solid var(--db-orange);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.brand-logo {
    width: auto;
    height: 42px;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: white;
    background: var(--db-purple);
    border-radius: 7px;
    font-weight: 800;
}

.brand-name {
    color: white;
    font-weight: 800;
}

.primary-nav,
.section-nav,
.footer-links {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.92rem;
    font-weight: 700;
}

.primary-nav a,
.section-nav a,
.footer-links a {
    color: var(--db-muted);
}

.site-header .primary-nav a {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.86rem;
    text-transform: uppercase;
}

.primary-nav a:hover,
.section-nav a:hover,
.footer-links a:hover {
    color: var(--db-purple);
}

.site-header .primary-nav a:hover {
    color: white;
}

.header-cta,
.button-link {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    color: white;
    background: var(--db-purple);
    border-radius: 7px;
    font-size: 0.92rem;
    font-weight: 800;
}

.site-header .header-cta {
    color: var(--db-nav);
    background: var(--db-orange);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--db-orange);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.content-band {
    width: min(var(--content-width), calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0;
    border-top: 1px solid var(--db-line);
}

.daily-hero {
    background: linear-gradient(180deg, var(--db-nav) 0%, var(--db-purple-dark) 100%);
    color: white;
    border-bottom: 4px solid var(--db-orange);
}

.daily-hero-inner {
    width: min(var(--content-width), calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 36px;
}

.daily-hero-heading {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(260px, 0.45fr);
    gap: 42px;
    align-items: end;
    margin-bottom: 26px;
}

.daily-hero .eyebrow {
    color: var(--db-orange);
}

.daily-hero .post-card-meta {
    color: rgba(255, 255, 255, 0.72);
}

.daily-hero-heading h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(2.55rem, 6vw, 5.6rem);
    line-height: 0.92;
    letter-spacing: 0;
}

.daily-hero-heading p:not(.eyebrow) {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
}

.daily-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) repeat(2, minmax(220px, 0.55fr));
    gap: 18px;
}

.hero-main,
.hero-side-card {
    min-width: 0;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-main {
    grid-row: span 2;
}

.hero-main a,
.hero-side-card a {
    display: grid;
    min-height: 100%;
    color: white;
}

.hero-main img,
.hero-side-card img {
    width: 100%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.12);
}

.hero-main img {
    height: 100%;
    min-height: 520px;
    grid-area: 1 / 1;
}

.hero-main-copy {
    grid-area: 1 / 1;
    align-self: end;
    padding: 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0));
}

.hero-main h2 {
    max-width: 700px;
    margin: 12px 0 10px;
    font-size: clamp(2rem, 4vw, 4.2rem);
    line-height: 0.96;
    letter-spacing: 0;
}

.hero-main p {
    max-width: 640px;
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-weight: 650;
}

.hero-side-card img {
    aspect-ratio: 16 / 9;
}

.hero-side-card div {
    padding: 16px;
}

.hero-side-card h3 {
    margin: 8px 0 0;
    font-size: 1.24rem;
    line-height: 1.08;
    letter-spacing: 0;
}

.daily-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px;
    align-items: stretch;
}

.hero-top-stories {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.8fr);
    grid-template-rows: 1fr 1fr;
    gap: 18px;
}

.top-story {
    min-width: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    overflow: hidden;
}

.top-story:first-child {
    grid-row: span 2;
}

.top-story a {
    display: grid;
    min-height: 100%;
    color: white;
}

.top-story img,
.top-story .media-placeholder {
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
    grid-area: 1 / 1;
}

.top-story:not(:first-child) {
    min-height: 346px;
}

.top-story:first-child img,
.top-story:first-child .media-placeholder {
    height: 100%;
    min-height: 720px;
    grid-area: 1 / 1;
}

.top-story-copy {
    grid-area: 1 / 1;
    align-self: end;
    padding: 18px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.82) 50%, rgba(0, 0, 0, 0) 100%);
}

.top-story:first-child .top-story-copy {
    padding: 28px;
    padding-top: 100px;
}

.top-story:not(:first-child) .top-story-copy {
    padding-top: 50px;
}

.top-story h2 {
    margin: 9px 0 0;
    font-size: 1.05rem;
    line-height: 1.12;
    letter-spacing: 0;
    color: white;
}

.top-story .post-card-meta {
    color: rgba(255, 255, 255, 0.85);
}

.top-story:first-child h2 {
    max-width: 660px;
    font-size: clamp(1.5rem, 2.6vw, 2.4rem);
    line-height: 1.1;
}

.top-story p {
    display: none;
}

.media-placeholder {
    display: grid;
    place-items: center;
    min-height: 220px;
    color: rgba(255, 255, 255, 0.68);
    background:
        linear-gradient(135deg, rgba(255, 200, 74, 0.2), rgba(53, 28, 117, 0.45)),
        var(--db-purple-dark);
    font-weight: 900;
}

.media-placeholder.small {
    min-height: 96px;
    aspect-ratio: 16 / 9;
    color: var(--db-orange);
    background:
        linear-gradient(135deg, rgba(255, 200, 74, 0.18), rgba(17, 21, 47, 0.5)),
        var(--db-purple-dark);
}

.top-headlines {
    color: white;
    display: flex;
    flex-direction: column;
}

.top-headlines h2 {
    margin: 0 0 10px;
    font-size: 1.25rem;
    line-height: 1.1;
    letter-spacing: 0;
}

.top-headlines-list {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0;
}

.top-headlines-list a {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    flex: 1;
    align-content: center;
}

.top-headlines-list a::before {
    content: "";
    width: 5px;
    height: 5px;
    margin-top: 7px;
    background: var(--db-orange);
}

.top-headlines-list span {
    font-weight: 850;
    line-height: 1.16;
    font-size: 0.95rem;
}

.top-headlines-list time {
    grid-column: 2;
    color: rgba(255, 255, 255, 0.64);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-top: 2px;
}

.latest-layout,
.home-section {
    width: min(var(--content-width), calc(100% - 32px));
    margin: 0 auto;
}

.latest-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 36px;
    padding: 52px 0;
}

.block-heading {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.block-heading h2 {
    margin: 0;
    color: var(--db-purple-dark);
    font-size: clamp(2.35rem, 5vw, 4.8rem);
    line-height: 0.95;
    letter-spacing: 0;
}

.block-heading a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid currentColor;
    border-radius: 999px;
    color: var(--db-purple);
    font-weight: 850;
}

.latest-list {
    min-width: 0;
}

.latest-item {
    border-top: 1px solid #cfd8cf;
}

.latest-item a {
    display: grid;
    grid-template-columns: 172px minmax(0, 1fr);
    gap: 22px;
    padding: 16px 0;
}

.latest-item img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--db-soft);
}

.latest-item h3 {
    margin: 7px 0 6px;
    color: var(--db-ink);
    font-size: 1.18rem;
    line-height: 1.14;
    letter-spacing: 0;
}

.latest-item p {
    margin: 0;
    color: var(--db-muted);
    font-size: 0.93rem;
}

.home-sidebar {
    display: grid;
    align-content: start;
    gap: 22px;
}

.sidebar-card {
    border: 1px solid #cfd8cf;
    padding: 22px;
    background: white;
}

.subscribe-card {
    background: #eef8f1;
}

.subscribe-card h2 {
    margin: 0 0 20px;
    color: var(--db-purple-dark);
    font-size: 1.6rem;
    line-height: 1.05;
    letter-spacing: 0;
}

.subscribe-card a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    color: var(--db-nav);
    background: var(--db-orange);
    border-radius: 999px;
    font-weight: 900;
}

.popular-card {
    background: var(--db-purple);
    color: white;
    border-color: var(--db-purple);
}

.popular-card .eyebrow {
    color: var(--db-orange);
}

.popular-item {
    display: block;
    padding: 14px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    font-weight: 850;
    line-height: 1.18;
}

.home-section {
    padding: 44px 0 52px;
    border-top: 12px solid var(--db-purple);
}

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

.section-feature-grid .post-card:first-child {
    grid-column: span 2;
}

.section-feature-grid .post-card:first-child h2 {
    font-size: clamp(1.6rem, 3vw, 2.6rem);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.compact-heading {
    margin-bottom: 18px;
}

.section-heading h2,
.archive-header h1,
.article-header h1 {
    margin: 0;
    color: var(--db-purple-dark);
    font-size: clamp(1.9rem, 4vw, 3.2rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.section-heading a {
    color: var(--db-purple);
    font-weight: 800;
}

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

.post-grid-featured .post-card:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

.post-card {
    min-width: 0;
    background: var(--db-surface);
    border: 1px solid var(--db-line);
    border-radius: 8px;
    overflow: hidden;
}

.post-card-link {
    display: flex;
    min-height: 100%;
    flex-direction: column;
}

.post-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--db-soft);
}

.post-card-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 16px;
}

.post-card-meta,
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--db-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.post-card h2 {
    margin: 10px 0 8px;
    color: var(--db-purple-dark);
    font-size: 1.08rem;
    line-height: 1.18;
    letter-spacing: 0;
}

.post-card p {
    margin: 0;
    color: var(--db-muted);
    font-size: 0.9rem;
}

.split-band {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 38px;
    align-items: start;
}

.split-band .section-heading {
    display: block;
    margin: 0;
}

.compact-list {
    display: grid;
    gap: 10px;
}

.compact-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    padding: 16px 0;
    border-bottom: 1px solid var(--db-line);
    font-weight: 800;
}

.compact-item time {
    color: var(--db-muted);
    font-size: 0.86rem;
}

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

.pillar {
    min-height: 148px;
    padding: 22px;
    background: var(--db-purple);
    color: white;
    border-radius: 8px;
}

.pillar:nth-child(2) {
    background: var(--db-purple-dark);
}

.pillar:nth-child(3) {
    background: var(--db-orange);
    color: var(--db-ink);
}

.pillar:nth-child(4) {
    background: #eef6f0;
    color: var(--db-purple-dark);
    border: 1px solid #c9dfcf;
}

.pillar span {
    display: block;
    margin-bottom: 28px;
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.pillar strong {
    display: block;
    font-size: 1.35rem;
    line-height: 1.15;
}

.archive-header,
.article-header {
    width: min(var(--content-width), calc(100% - 32px));
    margin: 0 auto;
    padding: 58px 0 36px;
}

.archive-header p,
.article-excerpt {
    max-width: 720px;
    color: var(--db-muted);
    font-size: 1.15rem;
}

.author-header img {
    width: 96px;
    height: 96px;
    margin-bottom: 20px;
    border-radius: 8px;
    object-fit: cover;
}

.article {
    padding-bottom: 56px;
}

.article-header {
    width: min(920px, calc(100% - 32px));
}

.article-meta {
    margin-bottom: 18px;
}

.article-category {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--db-orange);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    color: var(--db-muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.byline a {
    color: var(--db-purple-dark);
    font-weight: 850;
}

.byline-sep {
    color: var(--db-muted);
    opacity: 0.7;
}

.byline img {
    width: 28px;
    height: 28px;
    margin-right: 4px;
    border-radius: 50%;
    object-fit: cover;
}

.article-image {
    width: min(var(--content-width), calc(100% - 32px));
    margin: 0 auto 38px;
}

.article-image img {
    width: 100%;
    max-height: 620px;
    border-radius: 8px;
    object-fit: cover;
}

.article-image figcaption {
    margin-top: 8px;
    color: var(--db-muted);
    font-size: 0.86rem;
}

.article-content,
.article-footer {
    width: min(var(--article-width), calc(100% - 32px));
    margin: 0 auto;
}

.article-content {
    font-size: 1.08rem;
}

.article-content h2,
.article-content h3 {
    margin: 2em 0 0.55em;
    color: var(--db-purple-dark);
    line-height: 1.1;
    letter-spacing: 0;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content pre {
    margin: 0 0 1.1em;
}

.article-content a {
    color: var(--db-purple);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--db-orange);
    text-underline-offset: 3px;
}

.article-content blockquote {
    padding: 0 0 0 18px;
    border-left: 4px solid var(--db-orange);
    color: var(--db-purple-dark);
    font-size: 1.24rem;
    font-weight: 700;
}

.article-content code,
.article-content pre {
    border-radius: 7px;
    background: #eee8f8;
}

.article-content code {
    padding: 0.16em 0.32em;
}

.article-content pre {
    overflow-x: auto;
    padding: 16px;
}

.article-content pre.prompt-code {
    background: var(--db-purple-dark);
    color: #f5efff;
    border-left: 4px solid var(--db-orange);
    padding: 22px 26px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.95rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.article-content pre.prompt-code code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.article-content .kg-width-wide {
    width: min(980px, calc(100vw - 32px));
    margin-left: 50%;
    transform: translateX(-50%);
}

.article-content .kg-width-full {
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}

.article-content .kg-width-wide img,
.article-content .kg-width-full img {
    width: 100%;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 34px;
}

.tag-list a {
    padding: 7px 10px;
    border: 1px solid var(--db-line);
    border-radius: 7px;
    color: var(--db-purple);
    font-size: 0.86rem;
    font-weight: 800;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 34px;
    color: var(--db-purple);
    font-weight: 800;
}

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

.site-footer strong {
    color: var(--db-purple-dark);
}

.site-footer p {
    max-width: 520px;
    margin: 6px 0 0;
}

@media (max-width: 880px) {
    .site-header {
        grid-template-columns: 1fr auto;
        gap: 14px;
        padding: 14px 16px;
    }

    .primary-nav {
        grid-column: 1 / -1;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .daily-hero-grid,
    .hero-top-stories,
    .latest-layout,
    .split-band {
        grid-template-columns: 1fr;
    }

    .daily-hero-inner {
        padding: 28px 0 34px;
    }

    .post-grid,
    .post-grid-featured,
    .pillar-grid,
    .section-feature-grid {
        grid-template-columns: 1fr;
    }

    .hero-main {
        grid-row: auto;
    }

    .top-story:first-child {
        grid-row: auto;
    }

    .top-story:first-child img,
    .top-story:first-child .media-placeholder {
        min-height: 320px;
    }

    .post-grid-featured .post-card:first-child {
        grid-column: auto;
        grid-row: auto;
    }

    .section-feature-grid .post-card:first-child {
        grid-column: auto;
    }

    .section-heading,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .header-cta {
        padding: 0 12px;
    }

    .daily-hero-heading h1 {
        font-size: 2.65rem;
    }

    .hero-main img {
        min-height: 360px;
    }

    .hero-main-copy {
        padding: 22px;
    }

    .hero-main h2 {
        font-size: 2rem;
    }

    .top-story:first-child h2 {
        font-size: 1.4rem;
        line-height: 1.15;
    }

    .top-story-copy,
    .top-story:first-child .top-story-copy {
        padding: 18px;
    }

    .compact-item,
    .latest-item a {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .latest-item img {
        max-width: 100%;
    }
}
