@font-face {
    font-family: "Fraunces";
    font-style: normal;
    font-weight: 600 700;
    font-display: swap;
    src: url("./fonts/fraunces-latin-ext.woff2") format("woff2");
    unicode-range:
        U+0100-02BA,
        U+02BD-02C5,
        U+02C7-02CC,
        U+02CE-02D7,
        U+02DD-02FF,
        U+0304,
        U+0308,
        U+0329,
        U+1D00-1DBF,
        U+1E00-1E9F,
        U+1EF2-1EFF,
        U+2020,
        U+20A0-20AB,
        U+20AD-20C0,
        U+2113,
        U+2C60-2C7F,
        U+A720-A7FF;
}

@font-face {
    font-family: "Fraunces";
    font-style: normal;
    font-weight: 600 700;
    font-display: swap;
    src: url("./fonts/fraunces-latin.woff2") format("woff2");
    unicode-range:
        U+0000-00FF,
        U+0131,
        U+0152-0153,
        U+02BB-02BC,
        U+02C6,
        U+02DA,
        U+02DC,
        U+0304,
        U+0308,
        U+0329,
        U+2000-206F,
        U+20AC,
        U+2122,
        U+2191,
        U+2193,
        U+2212,
        U+2215,
        U+FEFF,
        U+FFFD;
}

@font-face {
    font-family: "Space Grotesk";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("./fonts/space-grotesk-latin-ext.woff2") format("woff2");
    unicode-range:
        U+0100-02BA,
        U+02BD-02C5,
        U+02C7-02CC,
        U+02CE-02D7,
        U+02DD-02FF,
        U+0304,
        U+0308,
        U+0329,
        U+1D00-1DBF,
        U+1E00-1E9F,
        U+1EF2-1EFF,
        U+2020,
        U+20A0-20AB,
        U+20AD-20C0,
        U+2113,
        U+2C60-2C7F,
        U+A720-A7FF;
}

@font-face {
    font-family: "Space Grotesk";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("./fonts/space-grotesk-latin.woff2") format("woff2");
    unicode-range:
        U+0000-00FF,
        U+0131,
        U+0152-0153,
        U+02BB-02BC,
        U+02C6,
        U+02DA,
        U+02DC,
        U+0304,
        U+0308,
        U+0329,
        U+2000-206F,
        U+20AC,
        U+2122,
        U+2191,
        U+2193,
        U+2212,
        U+2215,
        U+FEFF,
        U+FFFD;
}

:root {
    --color-ink: #1f2233;
    --color-cream: #f9f2de;
    --color-sun: #ffb454;
    --color-coral: #f46f5f;
    --color-teal: #1b8a89;
    --color-night: #24304f;
    --color-paper: rgba(255, 255, 255, 0.78);
    --shadow-card: 0 24px 60px rgba(31, 34, 51, 0.16);
    --radius-card: 28px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    color: var(--color-ink);
    font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
    overflow-x: clip;
    background:
        radial-gradient(circle at top left, rgba(255, 180, 84, 0.3), transparent 32%),
        radial-gradient(circle at top right, rgba(27, 138, 137, 0.22), transparent 30%),
        linear-gradient(180deg, #fff7e8 0%, #f9ecd4 58%, #f6f0e2 100%);
}

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

.hero {
    position: relative;
    overflow: hidden;
    padding: 4rem 1.5rem 3rem;
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    opacity: 0.75;
}

.hero::before {
    inset: auto auto -3rem -3rem;
    width: 14rem;
    height: 14rem;
    background: rgba(244, 111, 95, 0.16);
}

.hero::after {
    inset: -4rem -4rem auto auto;
    width: 18rem;
    height: 18rem;
    background: rgba(27, 138, 137, 0.16);
}

.hero__frame {
    max-width: 80rem;
    margin: 0 auto;
}

.hero__toolbar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1rem;
}

.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    max-width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 0.85rem 1rem;
    background: rgba(36, 48, 79, 0.88);
    color: #fff9f1;
    box-shadow: 0 18px 36px rgba(31, 34, 51, 0.18);
    cursor: pointer;
}

.sidebar-toggle__bars {
    display: inline-grid;
    gap: 0.22rem;
}

.sidebar-toggle__bars span {
    display: block;
    width: 1.2rem;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.sidebar-toggle__label {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero__inner {
    position: relative;
    display: grid;
    gap: 1.5rem;
    align-items: center;
    padding: 2.5rem;
    border-radius: 2rem;
    background: linear-gradient(135deg, rgba(36, 48, 79, 0.94), rgba(27, 138, 137, 0.9));
    color: #fff9f1;
    box-shadow: var(--shadow-card);
}

.hero__inner > * {
    min-width: 0;
}

.hero__copy {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.hero__eyebrow {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.hero__title {
    margin: 0;
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(2.8rem, 6vw, 5.4rem);
    line-height: 0.95;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

.hero__summary {
    max-width: 45rem;
    margin: 1.5rem 0 0;
    font-size: 1.08rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.hero__figure {
    position: relative;
    margin: 0;
}

.hero__figure::after {
    content: "";
    position: absolute;
    inset: auto 1rem -1rem auto;
    width: 7rem;
    height: 7rem;
    border-radius: 1.8rem;
    background: rgba(255, 180, 84, 0.22);
    filter: blur(1px);
}

.hero__image {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: auto;
    max-width: 28rem;
    margin-left: auto;
    border: 5px solid rgba(255, 255, 255, 0.22);
    border-radius: 1.8rem;
    box-shadow: 0 28px 60px rgba(16, 21, 37, 0.35);
    aspect-ratio: 2 / 1;
}

.layout {
    display: grid;
    gap: 1.5rem;
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

.layout > *,
.content > *,
.child-grid__cards > * {
    min-width: 0;
}

.sidebar,
.story-card,
.child-card {
    box-shadow: var(--shadow-card);
}

.sidebar {
    align-self: start;
    border: 1px solid rgba(31, 34, 51, 0.08);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    background: var(--color-paper);
    backdrop-filter: blur(14px);
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.sidebar__header {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sidebar__title {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.15rem;
    overflow-wrap: anywhere;
}

.sidebar__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(36, 48, 79, 0.1);
    color: var(--color-night);
    flex-shrink: 0;
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
}

.sidebar__block + .sidebar__block {
    margin-top: 1.5rem;
}

.sidebar__intro {
    margin: 0 0 0.9rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.sidebar h2,
.section-heading h2,
.child-card h3 {
    margin: 0 0 0.75rem;
    font-family: "Fraunces", Georgia, serif;
}

.tree {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.tree .tree {
    list-style: none;
}

.tree__item {
    list-style: none;
}

.tree__item + .tree__item {
    margin-top: 0.45rem;
}

.tree__item.is-active > .tree__branch > .tree__summary > .tree__link,
.tree__item.is-active > .tree__link {
    color: var(--color-coral);
}

.tree__item.is-ancestor > .tree__branch > .tree__summary > .tree__link,
.tree__item.is-ancestor > .tree__link {
    color: var(--color-teal);
}

.tree__label {
    display: inline-block;
}

.tree__label.is-draft {
    color: rgba(31, 34, 51, 0.68);
    font-style: italic;
}

.tree__branch {
    border-left: 2px solid rgba(31, 34, 51, 0.08);
    padding-left: 0.55rem;
}

.tree__summary {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    cursor: pointer;
    list-style: none;
}

.tree__summary::-webkit-details-marker {
    display: none;
}

.tree__chevron {
    width: 0.7rem;
    height: 0.7rem;
    flex: 0 0 0.7rem;
    border-right: 2px solid rgba(31, 34, 51, 0.48);
    border-bottom: 2px solid rgba(31, 34, 51, 0.48);
    transform: rotate(-45deg);
    transition: transform 0.18s ease;
}

.tree__branch[open] > .tree__summary > .tree__chevron {
    transform: rotate(45deg);
}

.tree__link {
    display: inline-block;
    text-decoration: none;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.tree__link:hover,
.tree__link:focus-visible {
    text-decoration: underline;
}

.tree__link--leaf {
    padding-left: 1.35rem;
}

.tree__branch > .tree {
    margin-top: 0.45rem;
}

.sidebar a,
.content a {
    color: var(--color-night);
}

.sidebar-overlay {
    display: none;
}

.content {
    display: grid;
    gap: 1.5rem;
}

.story-card {
    border-radius: var(--radius-card);
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.82);
}

.story-card__content {
    padding: clamp(0.5rem, 1vw, 1rem);
    overflow-wrap: anywhere;
}

.prose {
    font-size: 1.02rem;
    line-height: 1.85;
}

.prose > * {
    overflow-wrap: anywhere;
}

.prose h2,
.prose h3,
.prose h4 {
    font-family: "Fraunces", Georgia, serif;
    line-height: 1.15;
    color: var(--color-night);
}

.prose a {
    text-decoration-thickness: 0.12rem;
    text-decoration-color: rgba(244, 111, 95, 0.4);
}

.child-grid {
    display: grid;
    gap: 1rem;
}

.section-heading p {
    margin: 0;
    max-width: 42rem;
}

.child-grid__cards {
    display: grid;
    gap: 1rem;
}

.child-card {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 1.6rem;
    padding: 1.4rem;
    color: inherit;
    text-decoration: none;
    background:
        linear-gradient(135deg, rgba(255, 180, 84, 0.18), rgba(255, 255, 255, 0.96)),
        #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.child-card:hover,
.child-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 30px 68px rgba(31, 34, 51, 0.2);
}

.child-card__order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    min-height: 2.4rem;
    padding: 0 0.55rem;
    margin-bottom: 0.8rem;
    border-radius: 0.9rem;
    background: var(--color-night);
    color: #fff;
    font-weight: 700;
}

.child-card h3,
.child-card p {
    margin: 0;
    overflow-wrap: anywhere;
}

.child-card h3 {
    line-height: 1.15;
}

.child-card p {
    color: rgba(31, 34, 51, 0.82);
    line-height: 1.7;
}

@media (min-width: 960px) {
    .hero__toolbar {
        display: none;
    }

    .hero__inner {
        grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 28rem);
    }

    .layout {
        grid-template-columns: minmax(17rem, 22rem) minmax(0, 1fr);
        align-items: start;
    }

    .sidebar {
        position: sticky;
        top: 1.25rem;
        max-height: calc(100vh - 2.5rem);
        overflow-y: auto;
    }

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

@media (max-width: 959px) {
    body.has-sidebar-open {
        overflow: hidden;
    }

    .hero {
        padding-top: 2rem;
    }

    .hero__toolbar {
        position: relative;
        z-index: 12;
    }

    .hero__inner {
        padding: 2rem;
    }

    .hero__image {
        max-width: 100%;
        margin: 0 auto;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 19;
        border: 0;
        padding: 0;
        background: rgba(18, 24, 40, 0.42);
    }

    .sidebar-overlay.is-open {
        display: block;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 20;
        width: min(22rem, calc(100vw - 2.5rem));
        height: 100vh;
        border-radius: 0 1.8rem 1.8rem 0;
        overflow-y: auto;
        transform: translateX(-108%);
        opacity: 0;
        visibility: hidden;
        transition:
            transform 0.24s ease,
            opacity 0.24s ease,
            visibility 0.24s ease;
        background: rgba(255, 248, 237, 0.98);
    }

    .sidebar.is-open {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }

    .sidebar__header {
        display: flex;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 2rem 1rem 2.5rem;
    }

    .hero__inner,
    .sidebar,
    .story-card {
        padding: 1.15rem;
        border-radius: 1.4rem;
    }

    .hero__title {
        font-size: clamp(2.15rem, 11vw, 3.6rem);
        line-height: 1;
    }

    .hero__summary {
        margin-top: 1rem;
    }

    .layout {
        padding: 0 1rem 2.5rem;
    }

    .child-card {
        padding: 1.15rem;
    }

    .tree__link--leaf {
        padding-left: 1rem;
    }
}
