:root {
    --midnight: #33495f;
    --deep-midnight: #243447;
    --mist: #dce7ec;
    --blue-grey: #9eb4c0;
    --cream: #f7f5ef;
    --warm-white: #fffdf8;
    --text: #35443c;
    --muted: #718078;
    --border: #d5dde0;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--cream);
    color: var(--text);
    font-family: 'Montserrat', sans-serif;
    line-height: 1.75;
}

.workbook-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 64px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 14px 30px;
    background: rgba(247,245,239,.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.back-link {
    color: var(--deep-midnight);
    text-decoration: none;
    font-size: .68rem;
    letter-spacing: .08em;
}

.mini-logo {
    color: var(--deep-midnight);
    text-align: center;
    font-size: .72rem;
    letter-spacing: .25em;
}

.chapter-indicator {
    justify-self: end;
    color: var(--muted);
    font-size: .58rem;
    letter-spacing: .16em;
}

.chapter-nav {
    position: sticky;
    top: 64px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 13px 20px 12px;
    background: rgba(247,245,239,.97);
    border-bottom: 1px solid var(--border);
}

.chapter-nav-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
}

.chapter-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    text-decoration: none;
    transition: .3s ease;
}

.chapter-nav a span {
    color: var(--midnight);
    font-size: .62rem;
    letter-spacing: .12em;
}

.chapter-nav a small {
    font-size: .62rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.chapter-nav a.active {
    color: var(--deep-midnight);
}

.chapter-nav a.active small {
    font-weight: 600;
}

.chapter-nav a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -7px;
    height: 1px;
    background: var(--midnight);
}

.chapter-nav-divider {
    color: var(--blue-grey);
}

.progress-area {
    width: min(520px, 100%);
    margin: 0 auto;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .5rem;
    letter-spacing: .11em;
    text-transform: uppercase;
}

#progress-text {
    color: var(--deep-midnight);
    font-weight: 500;
}

.progress-track {
    height: 3px;
    background: var(--mist);
    border-radius: 20px;
    overflow: hidden;
}

.progress-fill {
    width: 20%;
    height: 100%;
    background: var(--midnight);
    transition: width .6s ease;
}


/* COVER */

.noise-cover {
    position: relative;
    min-height: 720px;
    padding: 80px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
    background:
        radial-gradient(
            circle at 50% 20%,
            rgba(255,255,255,.35),
            transparent 30%
        ),
        linear-gradient(
            160deg,
            #d5e1e7,
            #aebfc9
        );
    color: var(--deep-midnight);
}

.noise-cover::before {
    content: "";
    position: absolute;
    inset: 22px;
    border: 1px solid rgba(36,52,71,.25);
}

.cover-content {
    position: relative;
    z-index: 10;
    max-width: 620px;
}

.eyebrow {
    margin: 0 0 16px;
    color: var(--midnight);
    font-size: .62rem;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.noise-cover h1 {
    margin: 0;
    color: var(--deep-midnight);
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(4.2rem, 9vw, 7rem);
    font-weight: 500;
    line-height: .82;
}

.cover-divider {
    width: 60px;
    height: 1px;
    margin: 28px auto 22px;
    background: var(--deep-midnight);
}

.cover-subtitle {
    max-width: 430px;
    margin: 0 auto;
    color: var(--deep-midnight);
    font-size: .82rem;
    line-height: 1.85;
}

.cover-introduction {
    max-width: 450px;
    margin: 20px auto 28px;
    color: rgba(36,52,71,.78);
    font-size: .7rem;
    line-height: 1.8;
}

.primary-button {
    display: inline-block;
    padding: 13px 28px;
    border: 1px solid var(--midnight);
    border-radius: 30px;
    background: var(--midnight);
    color: var(--warm-white);
    text-decoration: none;
    font-size: .66rem;
    letter-spacing: .11em;
    text-transform: uppercase;
    transition: .3s ease;
}

.primary-button:hover {
    background: var(--deep-midnight);
    border-color: var(--deep-midnight);
    transform: translateY(-2px);
}

.cover-moon {
    position: absolute;
    top: 90px;
    left: 50%;
    width: 285px;
    height: 285px;
    border: 1px solid rgba(36,52,71,.2);
    border-radius: 50%;
    transform: translateX(-50%);
}

.cover-moon::after {
    content: "";
    position: absolute;
    width: 245px;
    height: 245px;
    top: 20px;
    left: 20px;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 50%;
}

.cover-botanical {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.stem {
    position: absolute;
    bottom: 40px;
    width: 1px;
    background: var(--deep-midnight);
    opacity: .48;
    transform-origin: bottom;
}

.stem-one {
    left: 17%;
    height: 360px;
    transform: rotate(-14deg);
}

.stem-two {
    right: 19%;
    height: 410px;
    transform: rotate(14deg);
}

.stem-three {
    left: 50%;
    height: 220px;
    transform: translateX(-50%) rotate(2deg);
}

.leaf {
    position: absolute;
    width: 55px;
    height: 27px;
    border: 1px solid var(--deep-midnight);
    border-radius: 100% 0 100% 0;
    opacity: .55;
}

.leaf-one {
    left: 10%;
    bottom: 250px;
    transform: rotate(-25deg);
}

.leaf-two {
    left: 18%;
    bottom: 340px;
    transform: rotate(155deg);
}

.leaf-three {
    left: 14%;
    bottom: 145px;
    transform: rotate(-38deg);
}

.leaf-four {
    right: 11%;
    bottom: 280px;
    transform: rotate(205deg);
}

.leaf-five {
    right: 18%;
    bottom: 370px;
    transform: rotate(28deg);
}

.leaf-six {
    right: 14%;
    bottom: 145px;
    transform: rotate(205deg);
}

.flower {
    position: absolute;
    color: var(--deep-midnight);
    font-size: 1.5rem;
    opacity: .62;
}

.flower-one {
    left: 23%;
    bottom: 365px;
}

.flower-two {
    right: 23%;
    bottom: 410px;
}


/* GENERAL */

.workbook-section,
.chapter-section {
    width: min(900px, calc(100% - 40px));
    margin: 0 auto;
    padding: 95px 0;
}

.welcome-section {
    max-width: 760px;
    text-align: center;
}

.workbook-section h2,
.chapter-section h2 {
    margin: 0 0 22px;
    color: var(--deep-midnight);
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.7rem, 6vw, 4.6rem);
    font-weight: 500;
    line-height: 1;
}

.welcome-section > p:not(.eyebrow),
.chapter-introduction {
    max-width: 700px;
    margin: 0 auto 20px;
    color: var(--muted);
}

.gentle-note {
    max-width: 680px;
    margin: 40px auto;
    padding: 26px 30px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.botanical-symbol {
    display: block;
    margin-bottom: 8px;
    color: var(--midnight);
    font-size: 1.5rem;
}

.gentle-note p {
    margin: 0;
    color: var(--deep-midnight);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.35rem;
}

.chapter-section {
    border-top: 1px solid var(--border);
}

.chapter-heading {
    margin-bottom: 55px;
    text-align: center;
}

.chapter-heading h2 {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.reflection-box,
.exercise-box,
.prompt-box,
.noise-card,
.final-reflection,
.grounding-box,
.body-check {
    margin: 28px 0;
    padding: 35px;
    background: var(--warm-white);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.reflection-box h3,
.exercise-box h3,
.prompt-box h3,
.noise-card h3,
.final-reflection h3,
.grounding-box h3,
.body-check h3 {
    margin: 0 0 12px;
    color: var(--deep-midnight);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.9rem;
    font-weight: 500;
}

.reflection-box p,
.exercise-box p,
.prompt-box p,
.noise-card p,
.final-reflection p {
    color: var(--muted);
}

label {
    display: block;
    margin: 22px 0 8px;
    color: var(--text);
    font-size: .72rem;
}

textarea {
    width: 100%;
    min-height: 125px;
    padding: 15px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    resize: vertical;
    background: #fffefa;
    color: var(--text);
    font: 400 .8rem/1.7 'Montserrat', sans-serif;
    transition: .25s ease;
}

textarea:focus {
    border-color: var(--midnight);
    box-shadow: 0 0 0 3px rgba(51,73,95,.08);
}

textarea::placeholder {
    color: #a1aaa5;
}

.large-writing-space {
    min-height: 220px;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 12px;
    margin-top: 22px;
}

.check-grid label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fffefa;
    font-size: .68rem;
}

input[type="checkbox"] {
    accent-color: var(--midnight);
    margin-top: 3px;
}

.noise-map,
.sorting-grid,
.thought-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 20px;
    margin: 28px 0;
}

.noise-card,
.sorting-card {
    margin: 0;
}

.noise-card {
    background: #e8eef1;
}

.noise-card > span,
.card-kicker,
.filter-card > span,
.grounding-kicker,
.plan-kicker {
    color: var(--midnight);
    font-size: .55rem;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.sorting-card {
    padding: 32px;
    border-radius: 18px;
    background: #e6edf0;
    border: 1px solid #cedbe0;
}

.sorting-card h3 {
    margin: 5px 0 15px;
    color: var(--deep-midnight);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 500;
}

.thought-filter {
    grid-template-columns: repeat(3, 1fr);
}

.filter-card {
    padding: 28px;
    background: var(--mist);
    border: 1px solid #cbd8de;
    border-radius: 16px;
}

.filter-card h3 {
    margin: 12px 0 8px;
    color: var(--deep-midnight);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.55rem;
    font-weight: 500;
}

.filter-card p {
    margin: 0;
    color: var(--muted);
    font-size: .72rem;
}

.prompt-quote {
    margin: 20px 0;
    color: var(--deep-midnight) !important;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.65rem;
}

.grounding-box {
    background: var(--deep-midnight);
    border-color: var(--deep-midnight);
    color: var(--warm-white);
    text-align: center;
}

.grounding-box h3 {
    color: var(--warm-white);
    font-size: 2.7rem;
}

.grounding-box .grounding-kicker {
    color: #cbdce5;
}

.grounding-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 28px;
}

.grounding-list div {
    padding: 18px 10px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 12px;
}

.grounding-list strong {
    display: block;
    color: #dce8ee;
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 500;
}

.grounding-list span {
    display: block;
    font-size: .62rem;
}

.body-check {
    background: #edf2f3;
}

.calm-plan {
    margin: 28px 0;
    padding: 38px;
    background: var(--mist);
    border: 1px solid #cad8de;
    border-radius: 20px;
}

.calm-plan h3 {
    margin: 6px 0 25px;
    color: var(--deep-midnight);
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    font-weight: 500;
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.plan-grid > div {
    padding: 24px;
    background: rgba(255,253,248,.65);
    border: 1px solid rgba(51,73,95,.14);
    border-radius: 14px;
}

.plan-grid span {
    color: var(--midnight);
    font-size: .6rem;
    letter-spacing: .12em;
}

.plan-grid h4 {
    margin: 8px 0;
    color: var(--deep-midnight);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.45rem;
    font-weight: 500;
}

.plan-grid textarea {
    min-height: 105px;
}

.final-closing {
    max-width: 700px;
    margin: 65px auto;
    text-align: center;
}

.final-closing h3 {
    margin: 8px 0 12px;
    color: var(--deep-midnight);
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    font-weight: 500;
}

.final-closing p {
    color: var(--muted);
}

.workbook-complete {
    margin-top: 70px;
    padding: 70px 35px;
    background: #d9e4e8;
    border-radius: 24px;
    text-align: center;
}

.workbook-complete h2 {
    max-width: 650px;
    margin: 0 auto 20px;
}

.workbook-complete > p:not(.eyebrow) {
    max-width: 620px;
    margin: 0 auto;
    color: var(--muted);
}

.completion-mark {
    margin: 28px 0 5px;
    color: var(--midnight);
    font-size: 2rem;
}

.print-button {
    display: inline-block;
    margin-top: 22px;
    padding: 13px 28px;
    border: 1px solid var(--deep-midnight);
    border-radius: 30px;
    background: transparent;
    color: var(--deep-midnight);
    font: 500 .66rem 'Montserrat', sans-serif;
    letter-spacing: .11em;
    text-transform: uppercase;
    cursor: pointer;
    transition: .3s ease;
}

.print-button:hover {
    background: var(--deep-midnight);
    color: var(--cream);
}

.chapter-closing {
    margin: 55px auto 20px;
    text-align: center;
}

.chapter-closing span {
    color: var(--midnight);
    font-size: 1.5rem;
}

.chapter-closing p {
    margin: 5px auto 0;
    color: var(--deep-midnight);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
}

.chapter-navigation {
    margin-top: 32px;
    text-align: center;
}

footer {
    padding: 35px 20px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: .6rem;
    letter-spacing: .08em;
    text-align: center;
}


/* SAVE */

.save-status {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 9999;
    padding: 12px 20px;
    border-radius: 30px;
    background: var(--deep-midnight);
    color: var(--cream);
    font-size: .68rem;
    letter-spacing: .08em;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: .3s ease;
}

.save-status.show {
    opacity: 1;
    transform: translateY(0);
}


/* MOBILE */

@media (max-width: 700px) {

    .workbook-header {
        grid-template-columns: 1fr auto;
        gap: 12px;
    }

    .chapter-indicator {
        display: none;
    }

    .chapter-nav {
        top: 64px;
        padding: 12px 16px 10px;
    }

    .chapter-nav-inner {
        justify-content: flex-start;
        overflow-x: auto;
        gap: 11px;
        white-space: nowrap;
        padding-bottom: 5px;
        scrollbar-width: none;
    }

    .chapter-nav-inner::-webkit-scrollbar {
        display: none;
    }

    .chapter-nav a {
        flex-shrink: 0;
    }

    .chapter-nav a small {
        font-size: .56rem;
    }

    .noise-cover {
        min-height: 650px;
        padding: 55px 20px;
    }

    .noise-cover::before {
        inset: 12px;
    }

    .cover-moon {
        width: 220px;
        height: 220px;
        top: 80px;
    }

    .cover-moon::after {
        width: 188px;
        height: 188px;
    }

    .workbook-section,
    .chapter-section {
        width: min(100% - 30px, 900px);
        padding: 70px 0;
    }

    .workbook-section h2,
    .chapter-section h2 {
        font-size: 2.8rem;
    }

    .reflection-box,
    .exercise-box,
    .prompt-box,
    .noise-card,
    .final-reflection,
    .grounding-box,
    .body-check,
    .calm-plan {
        padding: 24px 20px;
    }

    .check-grid,
    .noise-map,
    .sorting-grid,
    .thought-filter,
    .plan-grid,
    .grounding-list {
        grid-template-columns: 1fr;
    }

    .grounding-list div {
        display: grid;
        grid-template-columns: 45px 1fr;
        align-items: center;
        text-align: left;
    }

    .grounding-list strong {
        grid-row: span 1;
    }

    .save-status {
        left: 18px;
        right: 18px;
        bottom: 18px;
        text-align: center;
    }
}


/* REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before {
        transition: none !important;
    }

}


/* PRINT */

@media print {

    .workbook-header,
    .chapter-nav,
    .primary-button,
    .print-button,
    .save-status {
        display: none !important;
    }

    body {
        background: white;
        color: #222;
    }

    .noise-cover {
        min-height: 100vh;
        page-break-after: always;
        break-after: page;
    }

    .welcome-section,
    .chapter-section {
        page-break-before: always;
        break-before: page;
        page-break-after: always;
        break-after: page;
    }

    .reflection-box,
    .exercise-box,
    .prompt-box,
    .noise-card,
    .sorting-grid,
    .thought-filter,
    .grounding-box,
    .body-check,
    .calm-plan,
    .final-reflection,
    .workbook-complete {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    textarea {
        background: white;
        border-color: #aaa;
        color: #222;
        resize: none;
    }

    h1,
    h2,
    h3,
    h4,
    p,
    label {
        color: #222 !important;
    }

    @page {
        size: A4;
        margin: 18mm;
    }

}
