:root {
    --page: #fffdf8;
    --paper: #ffffff;
    --ink: #17362f;
    --muted: #5f6f68;
    --teal: #0f4d44;
    --green: #6d8f55;
    --blue: #1f5f82;
    --coral: #e86445;
    --gold: #d39b3d;
    --line: #dfe7df;
    --soft-green: #edf5e7;
    --soft-blue: #eaf3f8;
    --soft-coral: #fff0eb;
    --shadow: 0 18px 45px rgba(28, 56, 47, 0.12);
    --font-scale: 1;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: calc(18px * var(--font-scale));
    line-height: 1.65;
}

body.high-contrast {
    --page: #000000;
    --paper: #101010;
    --ink: #ffffff;
    --muted: #e7e7e7;
    --teal: #7ee4d0;
    --green: #9fe37e;
    --blue: #86d8ff;
    --coral: #ffb099;
    --gold: #ffe071;
    --line: #fff36b;
    --soft-green: #182616;
    --soft-blue: #112430;
    --soft-coral: #301712;
    --shadow: none;
}

body.high-contrast .hero-media {
    opacity: 0.18;
}

body.high-contrast .site-header {
    background: rgba(0, 0, 0, 0.96);
}

body.high-contrast .hero-media,
body.high-contrast .note-card:nth-child(2),
body.high-contrast .note-card:nth-child(3) {
    background-image: none;
    background-color: #050505;
}

body.high-contrast .activity-icon,
body.high-contrast .answer-choice,
body.high-contrast .answer-choice.correct,
body.high-contrast .answer-choice.wrong,
body.high-contrast .cookie-banner {
    background: #101010;
    color: var(--ink);
}

body.high-contrast .activity-icon,
body.high-contrast .answer-choice,
body.high-contrast .btn,
body.high-contrast .nav-cta {
    border: 1px solid var(--line);
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

.page-shell {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.skip-link {
    position: absolute;
    top: -60px;
    left: 16px;
    z-index: 20;
    background: var(--teal);
    color: white;
    padding: 10px 14px;
    border-radius: 6px;
}

.skip-link:focus {
    top: 12px;
}

.accessibility-bar {
    background: var(--ink);
    color: white;
    font-size: calc(0.9rem * var(--font-scale));
}

.accessibility-inner,
.accessibility-actions,
.nav-wrap,
.hero-actions,
.spark-actions {
    display: flex;
    align-items: center;
}

.accessibility-inner {
    justify-content: flex-end;
    gap: 16px;
    padding: 8px 0;
}

.accessibility-actions {
    gap: 8px;
}

.utility-btn {
    min-height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    color: white;
    border-radius: 6px;
    padding: 6px 10px;
    font: inherit;
    cursor: pointer;
}

.font-size-display {
    min-width: 54px;
    text-align: center;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 253, 248, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.nav-wrap {
    min-height: 82px;
    justify-content: space-between;
    gap: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: var(--soft-green);
    color: var(--teal);
    font-family: Georgia, serif;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(109, 143, 85, 0.22);
}

.brand strong {
    display: block;
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    line-height: 1.1;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    color: var(--muted);
    font-weight: 650;
}

.main-nav a,
.site-footer a {
    text-decoration: none;
}

.main-nav a:hover,
.activity-card a:hover,
.site-footer a:hover {
    color: var(--coral);
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    background: var(--paper);
}

.hero {
    position: relative;
    min-height: 650px;
    display: grid;
    align-items: stretch;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero-media {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 253, 248, 0.98) 0%, rgba(255, 253, 248, 0.88) 35%, rgba(255, 253, 248, 0.22) 68%),
        url("assets/cognspark-hero.jpg") center right / cover no-repeat;
}

.hero-inner {
    position: relative;
    display: grid;
    align-items: center;
    padding: 86px 0 104px;
}

.hero-copy {
    max-width: 610px;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.08;
    letter-spacing: 0;
}

h1,
h2 {
    font-family: Georgia, "Times New Roman", serif;
}

h1 {
    font-size: clamp(3rem, 6vw, 5.7rem);
    max-width: 720px;
}

h2 {
    font-size: clamp(2.2rem, 4vw, 3.8rem);
}

h3 {
    font-size: 1.55rem;
}

p {
    margin: 0;
}

.hero-copy p {
    max-width: 560px;
    margin-top: 28px;
    color: #263f39;
    font-size: 1.35rem;
}

.hero-actions {
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    padding: 14px 22px;
    border: 1px solid transparent;
    border-radius: 8px;
    text-decoration: none;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

.btn-primary {
    background: var(--coral);
    color: white;
    box-shadow: 0 10px 24px rgba(232, 100, 69, 0.24);
}

.btn-primary:hover {
    background: #d95132;
}

.btn-secondary {
    background: var(--paper);
    color: var(--teal);
    border-color: var(--line);
}

.section-band {
    background: #f7faf3;
}

.daily-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
    gap: 54px;
    align-items: center;
    padding: 86px 0;
}

.section-intro {
    display: grid;
    gap: 18px;
}

.section-intro p:not(.quiet-label) {
    color: var(--muted);
    font-size: 1.15rem;
}

.centered {
    max-width: 760px;
    margin: 0 auto 38px;
    text-align: center;
}

.quiet-label {
    color: var(--coral);
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.spark-panel,
.activity-card,
.note-card,
.final-panel {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.spark-panel {
    padding: 32px;
}

.spark-topline {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    color: var(--muted);
    font-size: 0.95rem;
}

.spark-type {
    color: var(--teal);
    font-weight: 800;
}

.spark-question {
    margin-top: 14px;
    color: var(--muted);
}

.answer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.answer-choice {
    min-height: 62px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbf6;
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.answer-choice:hover,
.answer-choice.selected {
    border-color: var(--green);
    background: var(--soft-green);
}

.answer-choice.correct {
    border-color: var(--green);
    background: #dcefd2;
}

.answer-choice.wrong {
    border-color: var(--coral);
    background: var(--soft-coral);
}

.spark-actions {
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
}

.text-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    color: var(--blue);
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

.hint-text,
.spark-feedback {
    margin-top: 18px;
    color: var(--muted);
    font-weight: 650;
}

.activities {
    padding: 88px 0;
}

.activity-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.activity-card {
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 300px;
    padding: 30px;
    overflow: hidden;
}

.activity-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 5px;
}

.activity-card.memory::after {
    background: var(--green);
}

.activity-card.words::after {
    background: var(--blue);
}

.activity-card.thinking::after {
    background: var(--coral);
}

.activity-card.trivia::after {
    background: var(--gold);
}

.activity-icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-bottom: 28px;
    border-radius: 8px;
    font-size: 1.7rem;
}

.memory .activity-icon {
    background: var(--soft-green);
    color: var(--green);
}

.words .activity-icon {
    background: var(--soft-blue);
    color: var(--blue);
}

.thinking .activity-icon {
    background: var(--soft-coral);
    color: var(--coral);
}

.trivia .activity-icon {
    background: #fff7e6;
    color: var(--gold);
}

.activity-card p {
    margin-top: 16px;
    color: var(--muted);
}

.activity-card a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
    margin-top: auto;
    padding-top: 28px;
    color: var(--teal);
    font-weight: 800;
    text-decoration: none;
}

.split-section {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
    gap: 48px;
    align-items: center;
    padding: 86px 0;
}

.split-section p {
    margin: 22px 0 28px;
    color: var(--muted);
    font-size: 1.15rem;
}

.note-stack {
    display: grid;
    gap: 16px;
}

.note-card {
    padding: 24px;
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
}

.note-card:nth-child(2) {
    margin-left: 34px;
    background: #f7fbff;
}

.note-card:nth-child(3) {
    margin-left: 68px;
    background: #fff7f2;
}

.trust-section {
    padding: 82px 0;
}

.trust-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(360px, 1.2fr);
    gap: 48px;
}

.trust-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.trust-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.trust-list i {
    color: var(--coral);
    margin-top: 5px;
}

.final-cta {
    padding: 0 0 88px;
}

.final-panel {
    padding: 48px;
    text-align: center;
}

.final-panel p {
    max-width: 620px;
    margin: 16px auto 0;
    color: var(--muted);
}

.final-panel .hero-actions {
    justify-content: center;
}

.site-footer {
    background: #12342e;
    color: white;
    padding: 54px 0 28px;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 40px;
}

.footer-brand .brand-mark {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.footer-brand strong {
    color: white;
}

.site-footer p {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.78);
}

.site-footer nav {
    display: grid;
    gap: 12px;
    align-content: start;
    justify-items: end;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.88rem;
}

.footer-bottom p {
    max-width: 620px;
}

.cookie-banner {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    max-width: 760px;
    margin: 0 auto;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.cookie-banner[hidden] {
    display: none;
}

@media (max-width: 900px) {
    .nav-wrap {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px 0;
    }

    .main-nav {
        width: 100%;
        flex-wrap: wrap;
        gap: 14px 22px;
    }

    .hero {
        min-height: auto;
    }

    .hero-media {
        position: relative;
        min-height: 360px;
        background:
            linear-gradient(0deg, rgba(255, 253, 248, 0.12), rgba(255, 253, 248, 0.12)),
            url("assets/cognspark-hero.jpg") center / cover no-repeat;
        order: 2;
    }

    .hero-inner {
        padding: 54px 0;
    }

    .daily-layout,
    .activity-grid,
    .split-section,
    .trust-grid,
    .trust-list,
    .footer-grid,
    .footer-bottom {
        grid-template-columns: 1fr;
    }

    .note-card:nth-child(2),
    .note-card:nth-child(3) {
        margin-left: 0;
    }

    .site-footer nav {
        justify-items: start;
    }
}

@media (max-width: 560px) {
    body {
        overflow-x: hidden;
    }

    .page-shell {
        width: min(100% - 28px, 1120px);
    }

    .accessibility-inner,
    .cookie-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .accessibility-inner {
        align-items: flex-start;
    }

    .accessibility-actions {
        flex-wrap: wrap;
    }

    .nav-wrap {
        gap: 18px;
    }

    .main-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 14px;
        font-size: 0.98rem;
    }

    .main-nav a {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .nav-cta,
    .hero-actions .btn,
    .spark-actions .btn,
    .final-panel .btn {
        width: 100%;
    }

    .hero-copy,
    .hero-copy p {
        max-width: 100%;
    }

    .hero-inner {
        display: block;
    }

    .hero-copy p,
    .spark-question,
    .section-intro p,
    .cookie-banner p {
        overflow-wrap: break-word;
    }

    .hero-copy,
    .hero-copy p,
    .cookie-banner p {
        width: calc(100vw - 28px);
        max-width: calc(100vw - 28px);
    }

    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 2.1rem;
    }

    .answer-grid {
        grid-template-columns: 1fr;
    }

    .spark-panel,
    .activity-card,
    .final-panel {
        padding: 24px;
    }

    .cookie-banner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px 12px;
        left: 14px;
        right: 14px;
        width: calc(100vw - 28px);
        max-width: calc(100vw - 28px);
        padding: 14px;
    }

    .cookie-banner p,
    .cookie-banner a,
    .cookie-banner button {
        max-width: 100%;
    }

    .cookie-banner a {
        grid-column: 1;
        font-size: 0.95rem;
    }

    .cookie-banner button {
        grid-column: 2;
        grid-row: 1 / span 2;
        min-height: 48px;
        padding: 10px 16px;
    }
}
