:root {
    --bg: #f7f2e7;
    --bg-strong: #efe2cb;
    --surface: rgba(255, 251, 245, 0.78);
    --surface-strong: #fff9f0;
    --border: rgba(93, 59, 34, 0.14);
    --text: #25160e;
    --muted: #6a5444;
    --accent: #b44f2d;
    --accent-dark: #7e3217;
    --accent-soft: rgba(180, 79, 45, 0.12);
    --shadow: 0 24px 60px rgba(66, 39, 24, 0.12);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --content-width: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 225, 188, 0.8), transparent 28%),
        radial-gradient(circle at top right, rgba(214, 117, 66, 0.14), transparent 32%),
        linear-gradient(180deg, #fcf7ef 0%, #f4ede0 100%);
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(14px);
    z-index: 0;
}

body::before {
    width: 220px;
    height: 220px;
    top: 70px;
    right: 4%;
    background: rgba(228, 170, 103, 0.24);
}

body::after {
    width: 180px;
    height: 180px;
    bottom: 12%;
    left: 3%;
    background: rgba(180, 79, 45, 0.12);
}

a {
    color: inherit;
}

.site-shell {
    position: relative;
    z-index: 1;
    width: min(calc(100% - 32px), var(--content-width));
    margin: 0 auto;
    padding: 20px 0 48px;
    width: 90%;
}

.topbar,
.hero-panel,
.section,
.site-footer {
    background: var(--surface);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 22px;
    border-radius: var(--radius-lg);
}

.brand {
    font-family: "Fraunces", serif;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
}

.topbar-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.topbar-links a {
    color: var(--muted);
    text-decoration: none;
}

.topbar-links a:hover,
.topbar-links a:focus-visible,
.project-card a:hover,
.project-card a:focus-visible {
    color: var(--accent-dark);
}

.hero {
    display: grid;
    gap: 22px;
}

.hero-panel {
    position: relative;
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 28px;
    padding: 34px;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.hero-panel::after {
    content: "";
    position: absolute;
    inset: auto auto -45px 52%;
    width: 240px;
    height: 240px;
    border-radius: 34px;
    transform: rotate(16deg);
    background: linear-gradient(160deg, rgba(180, 79, 45, 0.16), rgba(255, 237, 210, 0.5));
    border: 1px solid rgba(180, 79, 45, 0.14);
}

.hero-copy,
.hero-stats {
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin: 0 0 12px;
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-dark);
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.08;
}

h1,
h2 {
    font-family: "Fraunces", serif;
}

h1 {
    max-width: 11ch;
    font-size: clamp(2.8rem, 6vw, 5.2rem);
}

h2 {
    font-size: clamp(1.9rem, 3vw, 3rem);
}

h3 {
    font-size: 1.05rem;
}

.lead,
.overview-grid p,
.project-card p,
.standards-grid p,
.path-list,
.site-footer,
.library-summary,
#search-input {
    color: var(--muted);
}

.lead {
    max-width: 62ch;
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 18px 0 0;
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    text-decoration: none;
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.button:hover,
.button:focus-visible,
.filter-button:hover,
.filter-button:focus-visible,
.card-link:hover,
.card-link:focus-visible {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--accent);
    color: #fff6ef;
}

.button-secondary {
    border-color: rgba(93, 59, 34, 0.16);
    background: rgba(255, 255, 255, 0.4);
}

.hero-stats {
    display: grid;
    gap: 12px;
    align-content: start;
}

.hero-stats article,
.overview-grid article,
.project-card,
.standards-grid article,
.notebook-card {
    padding: 20px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(93, 59, 34, 0.12);
}

.stat-value {
    display: block;
    font-family: "Fraunces", serif;
    font-size: 2.2rem;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--muted);
}

main {
    display: grid;
    gap: 22px;
    margin-top: 22px;
}

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

.section-overview,
.section-projects,
.section-standards {
    display: grid;
    gap: 22px;
}

.overview-grid,
.project-grid,
.standards-grid,
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.section-heading {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 20px;
    align-items: end;
}

.library-controls {
    display: grid;
    gap: 10px;
}

.search-label {
    font-size: 0.9rem;
    color: var(--muted);
}

#search-input {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid rgba(93, 59, 34, 0.14);
    background: rgba(255, 255, 255, 0.76);
    font: inherit;
}

#search-input:focus-visible {
    outline: 2px solid rgba(180, 79, 45, 0.28);
    outline-offset: 2px;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-button {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(93, 59, 34, 0.16);
    background: rgba(255, 255, 255, 0.6);
    font: inherit;
    cursor: pointer;
    transition: transform 180ms ease, color 180ms ease, background-color 180ms ease;
}

.filter-button.is-active {
    background: var(--accent-soft);
    color: var(--accent-dark);
    border-color: rgba(180, 79, 45, 0.22);
}

.library-summary {
    min-height: 24px;
    font-size: 0.95rem;
}

.notebook-card {
    display: grid;
    gap: 14px;
    opacity: 0;
    transform: translateY(18px);
    animation: card-rise 520ms ease forwards;
}

.notebook-card:nth-child(2n) {
    animation-delay: 70ms;
}

.notebook-card:nth-child(3n) {
    animation-delay: 120ms;
}

.card-topline,
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.card-part,
.card-track,
.card-topic {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.82rem;
}

.card-part {
    background: rgba(37, 22, 14, 0.08);
}

.card-track,
.card-topic {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.notebook-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.card-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    display: grid;
    gap: 6px;
}

.card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-link,
.project-card a {
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: none;
}

.path-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 14px;
}

.path-list li {
    position: relative;
    padding: 18px 18px 18px 72px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(93, 59, 34, 0.12);
}

.path-list li::before {
    counter-increment: path;
    content: counter(path);
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff6ef;
    font-weight: 700;
}

.section-path {
    counter-reset: path;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 22px;
    padding: 18px 24px;
    border-radius: var(--radius-lg);
}

@keyframes card-rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {

    .hero-panel,
    .section-heading {
        grid-template-columns: 1fr;
    }

    .overview-grid,
    .project-grid,
    .standards-grid,
    .card-grid {
        grid-template-columns: 1fr;
    }
}

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

    .topbar,
    .section,
    .hero-panel,
    .site-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    h1 {
        font-size: 2.6rem;
    }

    .hero-actions,
    .card-actions,
    .topbar {
        align-items: stretch;
    }

    .card-actions,
    .topbar,
    .hero-actions {
        flex-direction: column;
    }

    .button,
    .card-link {
        width: 100%;
    }
}