:root {
    --ink: #171411;
    --charcoal: #221c14;
    --gold: #bf8d22;
    --gold-soft: #f3e7c6;
    --cream: #f8f3e7;
    --sand: #ece1ca;
    --white: #fffdf8;
    --line: rgba(34, 28, 20, 0.12);
    --shadow: 0 18px 45px rgba(34, 28, 20, 0.12);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(191, 141, 34, 0.14), transparent 32%),
        linear-gradient(180deg, #fdfaf2 0%, #f7f1e3 100%);
}

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

img {
    max-width: 100%;
}

.site-shell {
    min-height: 100vh;
}

.container {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(18px);
    background: rgba(253, 250, 242, 0.88);
    border-bottom: 1px solid var(--line);
}

.site-header__inner,
.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
}

.brand-mark__image {
    width: 170px;
    max-width: 42vw;
    height: auto;
    display: block;
}

.brand-mark__lockup {
    display: grid;
    gap: 0.15rem;
}

.brand-mark__lockup strong {
    font-size: 1.15rem;
    color: var(--charcoal);
}

.site-nav {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    align-items: center;
}

.site-nav a,
.text-link {
    color: #5c4520;
    font-weight: 600;
}

.inline-form {
    margin: 0;
}

.site-nav__button {
    border: 0;
    background: transparent;
    color: #5c4520;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.site-nav a.is-active {
    color: var(--charcoal);
    text-decoration: underline;
    text-decoration-color: rgba(191, 141, 34, 0.55);
    text-underline-offset: 0.35rem;
}

.site-nav a:hover,
.text-link:hover {
    color: var(--charcoal);
}

.hero,
.section {
    padding: 4rem 0;
}

.flash-shell {
    padding-top: 1rem;
}

.flash-message {
    padding: 0.95rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(191, 141, 34, 0.24);
    background: rgba(243, 231, 198, 0.9);
    color: #5c4520;
    font-weight: 700;
}

.section--tight {
    padding-bottom: 1.5rem;
}

.section--muted {
    background: rgba(255, 253, 248, 0.68);
    border-block: 1px solid var(--line);
}

.hero__grid,
.detail-page {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2rem;
    align-items: start;
}

.hero__copy h1,
.page-hero h1,
.detail-page h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.2rem, 4vw, 4.4rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
    color: var(--charcoal);
}

.hero__lead,
.page-hero__lead {
    font-size: 1.08rem;
    line-height: 1.7;
    color: #554738;
    max-width: 62ch;
}

.browse-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.75rem;
}

.browse-stat {
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    background: rgba(255, 253, 248, 0.7);
    border: 1px solid var(--line);
}

.browse-stat strong {
    display: block;
    font-size: 1.45rem;
    color: var(--charcoal);
}

.browse-stat span {
    color: #665947;
}

.hero__actions {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-top: 1.8rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.25rem;
    border-radius: 999px;
    font-weight: 700;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.button--primary {
    background: var(--charcoal);
    color: var(--white);
}

.button--ghost {
    border: 1px solid rgba(34, 28, 20, 0.15);
    background: rgba(255, 255, 255, 0.7);
}

.hero__panel,
.roadmap-panel,
.media-panel,
.related-panel,
.resource-panel,
.filter-panel,
.list-card,
.content-card {
    border: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.92);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.hero__panel {
    padding: 1.4rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.metric-card {
    background: linear-gradient(180deg, rgba(243, 231, 198, 0.76), rgba(255, 253, 248, 0.96));
    border-radius: var(--radius-md);
    padding: 1.2rem;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric-card--alert {
    background: linear-gradient(180deg, rgba(191, 141, 34, 0.16), rgba(255, 253, 248, 0.98));
    border: 1px solid rgba(191, 141, 34, 0.2);
}

.metric-card__value {
    font-size: clamp(1.8rem, 3vw, 3rem);
    font-weight: 800;
    color: var(--charcoal);
}

.metric-card__label,
.content-card p,
.list-card p,
.detail-body,
.site-footer p,
.empty-state,
.linked-video-card p {
    color: #5d5142;
    line-height: 1.65;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-heading--compact {
    margin-bottom: 1rem;
}

.section-caption {
    margin: 0;
    color: #7a6750;
    font-weight: 600;
}

.action-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.section-heading h2,
.media-panel h2,
.related-panel h2,
.resource-panel h2 {
    margin: 0.2rem 0 0;
    font-size: clamp(1.5rem, 2.6vw, 2.3rem);
    line-height: 1.05;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
}

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

.analytics-grid--summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-section-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 1.25rem;
}

.content-card,
.list-card,
.roadmap-panel,
.media-panel,
.related-panel,
.resource-panel {
    padding: 1.35rem;
}

.content-card h3,
.list-card h2 {
    margin: 0.7rem 0 0.7rem;
    font-size: 1.35rem;
}

.content-card__meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.94rem;
    color: #6d614f;
}

.content-list,
.resource-list,
.related-list {
    display: grid;
    gap: 1rem;
}

.auth-shell {
    display: grid;
    place-items: center;
}

.auth-card,
.editor-card {
    width: min(100%, 980px);
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 253, 248, 0.92);
    box-shadow: var(--shadow);
}

.stack-form {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.filter-panel {
    padding: 1.35rem;
    margin-bottom: 1.4rem;
}

.filter-form {
    display: grid;
    gap: 1rem;
}

.filter-form__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.45rem;
}

.field span,
.checkbox-field span,
.results-line,
.pagination-state {
    color: #5d5142;
}

.field span {
    font-size: 0.88rem;
    font-weight: 700;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid rgba(34, 28, 20, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    padding: 0.9rem 1rem;
    font: inherit;
    color: var(--charcoal);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 2px solid rgba(191, 141, 34, 0.35);
    outline-offset: 1px;
}

.field-error {
    color: #9a2e2e;
    font-weight: 700;
}

.filter-form__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.category-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(34, 28, 20, 0.1);
    background: rgba(255, 255, 255, 0.82);
    font-weight: 700;
    color: #5c4520;
}

.filter-chip strong {
    display: inline-grid;
    place-items: center;
    min-width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: rgba(191, 141, 34, 0.14);
    color: #7c5b17;
    font-size: 0.85rem;
}

.filter-chip.is-active {
    border-color: rgba(191, 141, 34, 0.45);
    background: rgba(243, 231, 198, 0.85);
}

.results-line {
    margin: 1rem 0 0;
}

.credentials-panel {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.identity-options {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.identity-options h2 {
    margin: 0 0 0.9rem;
    font-size: 1.2rem;
}

.identity-provider-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.identity-provider-card {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
}

.identity-provider-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.identity-provider-note,
.credentials-list code {
    color: #5d5142;
}

.helper-panel {
    padding: 1rem;
    border-radius: var(--radius-md);
    background: rgba(243, 231, 198, 0.45);
    border: 1px solid rgba(191, 141, 34, 0.2);
}

.credentials-panel h2 {
    margin: 0 0 0.75rem;
    font-size: 1.2rem;
}

.credentials-list {
    margin: 0;
    padding-left: 1.15rem;
    line-height: 1.8;
    color: #5d5142;
}

.editor-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 1.25rem;
}

.editor-main,
.editor-sidebar {
    display: grid;
    gap: 1rem;
}

.list-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.list-card__body {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
}

.detail-grid dt {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8a7452;
    margin-bottom: 0.35rem;
}

.detail-grid dd {
    margin: 0;
    font-weight: 600;
}

.pill,
.list-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.pill {
    background: rgba(191, 141, 34, 0.12);
    color: #7c5b17;
}

.pill--secondary {
    background: rgba(34, 28, 20, 0.08);
    color: var(--charcoal);
}

.pill--outline {
    border: 1px solid rgba(191, 141, 34, 0.28);
    background: transparent;
}

.list-badge {
    background: rgba(34, 28, 20, 0.92);
    color: var(--white);
}

.roadmap-panel {
    display: grid;
    gap: 1rem;
}

.roadmap-list {
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.8;
}

.detail-page__main,
.detail-page__sidebar {
    display: grid;
    gap: 1.25rem;
}

.embed-frame {
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    aspect-ratio: 16 / 9;
}

.embed-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.linked-video-card {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(243, 231, 198, 0.6), rgba(255, 253, 248, 0.96));
}

.media-provider-row,
.resource-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.resource-card,
.related-item {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(191, 141, 34, 0.12);
    color: #704f11;
    font-size: 0.88rem;
    font-weight: 700;
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    font-weight: 800;
    color: #91744a;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: #16120e;
    color: rgba(255, 253, 248, 0.88);
}

.site-footer .eyebrow,
.site-footer p,
.site-footer a {
    color: rgba(255, 253, 248, 0.86);
}

.footer-logo {
    display: block;
    width: 180px;
    max-width: 50vw;
    margin-bottom: 0.85rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.empty-panel {
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(34, 28, 20, 0.18);
    background: rgba(255, 255, 255, 0.55);
}

.empty-panel h2 {
    margin: 0.35rem 0 0.75rem;
}

.pagination-bar {
    margin-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6rem;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(34, 28, 20, 0.14);
    background: rgba(255, 255, 255, 0.82);
    font-weight: 700;
}

.pagination-link.is-disabled {
    opacity: 0.45;
}

@media (max-width: 960px) {
    .hero__grid,
    .detail-page,
    .card-grid,
    .analytics-section-grid {
        grid-template-columns: 1fr;
    }

    .browse-summary,
    .filter-form__grid,
    .editor-grid,
    .identity-provider-grid,
    .analytics-grid,
    .analytics-grid--summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 640px) {
    .hero,
    .section {
        padding: 3rem 0;
    }

    .metric-grid,
    .detail-grid,
    .browse-summary,
    .filter-form__grid,
    .editor-grid,
    .identity-provider-grid,
    .analytics-grid,
    .analytics-grid--summary {
        grid-template-columns: 1fr;
    }

    .container {
        width: min(100% - 1.25rem, 1180px);
    }

    .brand-mark__image {
        width: 130px;
    }
}
