:root {
    --bg: #f3efe8;
    --paper: #fffdf9;
    --paper-strong: #ffffff;
    --ink: #1f2328;
    --muted: #5f6670;
    --accent: #1d6b54;
    --accent-soft: #e4efe9;
    --line: #d7d2c8;
    --line-strong: #5b5f66;
    --warm: #f4efe2;
    --shadow: 0 18px 50px rgba(28, 31, 36, 0.08);
    --grid-line: #c8ccd1;
    --grid-outer: #2f3338;
    --grid-fill: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(29, 107, 84, 0.08), transparent 28%),
        linear-gradient(180deg, #faf7f1 0%, var(--bg) 100%);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.shell {
    width: min(1120px, calc(100vw - 32px));
    margin: 0 auto;
}

.site-header,
.site-footer {
    background: rgba(255, 250, 240, 0.9);
    backdrop-filter: blur(10px);
}

.footer-grid,
.hero-grid,
.word-search-layout,
.generator-form .form-grid,
.pin-panel,
.cta-panel,
.link-groups,
.section-grid {
    display: grid;
    gap: 20px;
}

.site-header .shell {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    color: var(--ink);
}

.brand-logo {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    max-width: 36px;
    max-height: 36px;
    display: block;
    object-fit: contain;
}

.hero,
.hero-simple,
.generator-shell,
.section-grid,
.puzzle-shell,
.cta-panel,
.notice-panel {
    padding: 28px 0;
}

.hero-grid {
    grid-template-columns: 1.3fr 0.7fr;
    align-items: stretch;
}

.hero-panel,
.generator-card,
.puzzle-card,
.answer-card,
.card,
.link-group,
.pin-panel,
.cta-panel,
.notice-panel {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.hero h1,
.hero-simple h1,
.section-heading h2,
.puzzle-card h2,
.answer-card h2,
.site-footer h2 {
    font-family: "Manrope", sans-serif;
    line-height: 1.05;
    margin: 0 0 14px;
}

.hero h1,
.hero-simple h1 {
    font-size: clamp(2.4rem, 6vw, 4.4rem);
}

.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
}

.hero-panel,
.generator-card,
.puzzle-card,
.answer-card,
.pin-panel,
.cta-panel,
.notice-panel,
.link-group,
.card {
    padding: 24px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 13px 22px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.button-secondary {
    background: var(--accent-soft);
    color: var(--accent);
}

.hero-actions,
.cta-actions,
.stat-row,
.form-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.stat-pill {
    display: inline-flex;
    border-radius: 999px;
    padding: 8px 12px;
    background: #f0ead7;
    color: var(--muted);
    font-size: 0.88rem;
}

.generator-form {
    display: grid;
    gap: 16px;
}

.generator-result-shell {
    padding-top: 0;
}

.generator-result-card h2 {
    margin: 0 0 12px;
    font-size: 1.9rem;
}

.result-actions {
    margin-top: 22px;
}

.output-preview-shell {
    padding-top: 0;
}

.output-preview-card {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.output-preview-header h2 {
    margin: 0 0 10px;
    font-family: "Manrope", sans-serif;
    font-size: 1.9rem;
    line-height: 1.08;
}

.output-preview-frame {
    margin-top: 20px;
    padding: 18px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.output-preview-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
}

.generator-form label {
    display: grid;
    gap: 8px;
    font-size: 0.95rem;
}

.generator-form input,
.generator-form select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    background: #fff;
}

.generator-form .form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.intro-copy,
.micro-copy,
.plain-verse {
    color: var(--muted);
    line-height: 1.7;
}

.plain-verse--worksheet {
    margin: 0;
    font-size: 1.24rem;
    line-height: 1.95;
    color: var(--ink);
}

.plain-verse--answer {
    max-width: 36ch;
}

.worksheet-shell {
    padding: 24px 0 32px;
}

.worksheet {
    background: linear-gradient(180deg, var(--paper-strong) 0%, var(--paper) 100%);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: 36px 40px 30px;
}

.worksheet + .worksheet {
    margin-top: 24px;
}

.worksheet-header {
    display: grid;
    gap: 12px;
    padding-bottom: 24px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--line);
}

.worksheet-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    width: fit-content;
    margin-bottom: 2px;
}

.worksheet-brand img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.worksheet-brand-copy {
    display: grid;
    gap: 2px;
}

.worksheet-brand-copy strong {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1;
}

.worksheet-brand-copy span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.worksheet-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.worksheet-title {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.worksheet-reference {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 700;
}

.worksheet-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.96rem;
}

.worksheet-instruction-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 18px;
    border-radius: 18px;
    background: #fcfaf6;
    border: 1px solid var(--line);
}

.worksheet-instruction {
    margin: 0;
    color: var(--ink);
    font-size: 0.96rem;
    font-weight: 700;
}

.worksheet-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.worksheet-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 12px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 800;
}

.worksheet-content {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(280px, 0.95fr);
    gap: 34px;
    align-items: start;
}

.worksheet-content--stack {
    grid-template-columns: 1fr;
}

.puzzle-stage {
    display: grid;
    gap: 22px;
}

.puzzle-frame,
.word-bank,
.puzzle-side-card,
.crypto-key,
.fallen-columns,
.fallen-answer-panel {
    background: var(--paper-strong);
    border: 1px solid var(--line);
    border-radius: 24px;
}

.puzzle-frame {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.puzzle-frame--color {
    background: transparent;
}

.word-bank,
.puzzle-side-card,
.crypto-key,
.fallen-answer-panel {
    padding: 18px 0 0 26px;
}

.word-bank h3,
.puzzle-side-card h3,
.crypto-key h3,
.fallen-answer-panel h3 {
    margin: 0 0 12px;
    font-family: "Manrope", sans-serif;
    font-size: 1.28rem;
    font-weight: 800;
    line-height: 1.2;
}

.worksheet-section-label {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.2;
}

.worksheet-section-note {
    margin: 0 0 16px;
}

.word-bank-intro,
.side-copy {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.55;
}

.word-bank-intro {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.word-bank-intro-mark {
    flex: 0 0 auto;
    color: var(--accent);
    font-weight: 800;
}

.word-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    columns: 2;
    column-gap: 22px;
}

.word-checklist li {
    break-inside: avoid;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
}

.word-check {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--grid-outer);
    border-radius: 4px;
    background: #fff;
}

.worksheet-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.key-grid {
    display: grid;
    gap: 10px;
    line-height: 1.45;
}

.card-grid,
.link-groups,
.pin-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-grid {
    display: grid;
    gap: 20px;
}

.tool-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tool-card {
    display: grid;
    align-content: start;
    gap: 10px;
}

.tool-card .button {
    width: 100%;
}

.book-hub-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.book-group-card h3,
.verse-card h3,
.related-resources-card h3 {
    margin: 0 0 12px;
    font-family: "Manrope", sans-serif;
    font-size: 1.25rem;
}

.book-link-list,
.resource-link-list,
.verse-puzzle-links {
    margin: 0;
    padding-left: 18px;
}

.book-link-list {
    columns: 2;
    column-gap: 22px;
}

.book-link-list.compact {
    columns: 2;
}

.book-link-list li,
.resource-link-list li,
.verse-puzzle-links li {
    break-inside: avoid;
    margin-bottom: 8px;
    line-height: 1.45;
}

.book-verse-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.verse-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.rich-copy-card p,
.faq-card p,
.related-resources-card p {
    margin: 0 0 14px;
    line-height: 1.7;
}

.rich-copy-card p:last-child,
.faq-card p:last-child {
    margin-bottom: 0;
}

.meta-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

.verse-text {
    margin: 0 0 14px;
    padding: 14px 16px;
    background: rgba(29, 107, 84, 0.06);
    border-left: 4px solid var(--accent);
    border-radius: 14px;
    font-weight: 600;
    line-height: 1.65;
}

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

.faq-card h3 {
    margin: 0 0 12px;
    font-size: 1.2rem;
}

.word-search-layout {
    grid-template-columns: minmax(0, 1.8fr) minmax(290px, 0.95fr);
    align-items: start;
}

.grid-wrap {
    display: flex;
    justify-content: flex-start;
    padding: 4px 0 0;
    overflow: visible;
}

.puzzle-grid {
    border-collapse: collapse;
    margin: 0;
    border: 0;
    background: var(--grid-fill);
}

.puzzle-grid td {
    width: 42px;
    height: 42px;
    border: 1px solid var(--grid-line);
    text-align: center;
    vertical-align: middle;
    font-weight: 700;
    font-family: "IBM Plex Mono", monospace;
    font-size: 1.15rem;
    letter-spacing: 0.05em;
    background: #fff;
}

.answer-grid .is-highlight {
    background: var(--accent-soft);
}

.link-group ul,
.feature-list,
.key-grid {
    margin: 0;
    padding-left: 18px;
}

.color-grid,
.colour-grid {
    font-family: "Archivo Black", sans-serif;
}

.color-grid td,
.colour-grid td {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    padding: 4px;
    background: #ffffff;
    font-family: "Archivo Black", sans-serif;
    border-color: #d4d4d4;
}

.color-grid.has-outline td,
.colour-grid.has-outline td {
    -webkit-text-stroke: 1.4px #171717;
    color: transparent;
    text-shadow: none;
}

.color-grid.has-light-fill td,
.colour-grid.has-light-fill td {
    background: #ffffff;
}

.coloring-layout .grid-wrap,
.colouring-layout .grid-wrap {
    padding: 6px 0 0;
    background: transparent;
    border-radius: 0;
}

.coloring-layout .word-bank,
.colouring-layout .word-bank {
    background: transparent;
}

.coloring-layout .word-bank h3,
.colouring-layout .word-bank h3 {
    color: var(--ink);
}

.word-bank {
    min-width: 0;
    background: transparent;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
}

.download-shell {
    padding-top: 20px;
}

.print-header-download p {
    display: none;
}

.download-footer-line {
    margin: 18px 0 0;
    text-align: center;
    font-size: 0.88rem;
    color: var(--muted);
}

.cryptogram-block,
.fallen-answer {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 10px;
}

.crypto-token {
    display: inline-grid;
    justify-items: center;
    min-width: 48px;
    padding: 0 4px 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.crypto-encoded {
    font-size: 1.58rem;
    line-height: 1;
    font-family: "IBM Plex Mono", monospace;
    font-weight: 700;
}

.crypto-plain {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    min-height: 26px;
    border-top: 0;
    border-bottom: 2px solid var(--line);
    margin-top: 8px;
    padding: 0 2px 4px;
    font-size: 0.96rem;
    font-family: "IBM Plex Mono", monospace;
}

.crypto-space {
    padding: 16px 4px 0;
    min-width: 14px;
}

.cryptogram-layout {
    grid-template-columns: minmax(0, 1.8fr) minmax(290px, 0.95fr);
}

.crypto-key {
    min-width: 0;
    background: transparent;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    padding: 18px 0 0 26px;
}

.key-grid {
    list-style: none;
    padding: 0;
}

.key-grid li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 0.98rem;
    line-height: 1.45;
}

.key-grid li strong {
    min-width: 1.6em;
    font-family: "IBM Plex Mono", monospace;
    font-weight: 700;
}

.fallen-stage {
    display: grid;
    gap: 30px;
}

.fallen-section-note {
    margin-bottom: 20px;
}

.fallen-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 24px 28px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.fallen-column {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.fallen-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.fallen-column h3 {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    text-align: left;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.fallen-column li {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 34px;
    padding: 0 8px 8px;
    border: 0;
    border-bottom: 1px solid var(--grid-line);
    border-radius: 0;
    background: transparent;
    font-weight: 700;
    font-family: "IBM Plex Mono", monospace;
}

.fallen-answer-panel {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    padding: 24px 0 0;
}

.fallen-answer {
    gap: 10px 8px;
}

.fallen-cell {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 34px;
    height: 42px;
    border: 1px solid var(--grid-line);
    border-radius: 3px;
    background: #fff;
    font-weight: 700;
    font-family: "IBM Plex Mono", monospace;
}

.fallen-answer {
    gap: 10px 8px;
}

.fallen-cell.is-revealed {
    color: var(--accent);
    border-color: var(--accent);
    background: #fff;
}

.fallen-cell.punctuation {
    border-color: transparent;
    background: transparent;
    width: auto;
}

.pin-panel,
.cta-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
}

.hero-output .hero-actions {
    margin-top: 22px;
}

.hero-output .button {
    min-width: 160px;
}

.hero-generator .shell,
.hero-output .shell {
    align-items: start;
}

.site-footer {
    margin-top: 32px;
    border-top: 1px solid var(--line);
}

.footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 28px 0 32px;
}

.footer-grid--site h2 {
    margin: 0 0 12px;
    font-family: "Manrope", sans-serif;
    font-size: 1.1rem;
}

.footer-grid--site p {
    margin: 0 0 10px;
    font-size: 0.94rem;
}

@media (max-width: 900px) {
    .hero-grid,
    .worksheet-content,
    .word-search-layout,
    .cryptogram-layout,
    .card-grid,
    .book-support-grid,
    .tool-card-grid,
    .book-hub-grid,
    .book-verse-grid,
    .link-groups,
    .pin-panel,
    .cta-panel,
    .footer-grid,
    .generator-form .form-grid,
    .site-header .shell {
        grid-template-columns: 1fr;
    }

    .brand {
        align-items: flex-start;
    }

    .worksheet {
        padding: 24px 20px 22px;
    }

    .worksheet-title {
        font-size: 1.9rem;
    }

    .word-checklist {
        columns: 1;
    }

    .book-link-list,
    .book-link-list.compact {
        columns: 1;
    }

    .word-bank {
        padding: 20px 0 0;
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .crypto-key {
        padding: 20px 0 0;
        border-left: 0;
        border-top: 1px solid var(--line);
    }
}

@media print {
    @page {
        margin: 0.45in;
        size: letter portrait;
    }

    body {
        background: #fff;
        color: #111;
    }

    body:not(.is-download-page) .site-header,
    body:not(.is-download-page) .site-footer,
    body:not(.is-download-page) .hero,
    body:not(.is-download-page) .hero-simple,
    body:not(.is-download-page) .generator-shell,
    body:not(.is-download-page) .section-grid,
    body:not(.is-download-page) .cta-panel,
    body:not(.is-download-page) .pin-panel {
        display: none !important;
    }

    .shell {
        width: 100%;
        margin: 0;
    }

    .worksheet-shell {
        padding: 0;
    }

    .worksheet {
        box-shadow: none;
        border: 0;
        border-radius: 0;
        padding: 0;
        background: #fff;
    }

    .worksheet + .worksheet {
        margin-top: 0;
    }

    .worksheet-header {
        margin-bottom: 24px;
        padding-bottom: 16px;
    }

    .worksheet-kicker {
        background: transparent;
        border: 1px solid #111;
        color: #111;
        padding: 4px 10px;
    }

    .worksheet-title {
        font-size: 1.9rem;
    }

    .worksheet-note {
        display: none;
    }

    .worksheet-instruction-bar {
        background: #fff;
        border: 1px solid #111;
        padding: 12px 14px;
    }

    .worksheet-content,
    .word-search-layout,
    .cryptogram-layout {
        grid-template-columns: minmax(0, 1.75fr) minmax(220px, 0.95fr);
        gap: 24px;
    }

    .worksheet-content--stack {
        grid-template-columns: 1fr;
    }

    .puzzle-frame,
    .word-bank,
    .crypto-key,
    .fallen-columns,
    .fallen-answer-panel {
        border-radius: 0;
        box-shadow: none;
        background: #fff;
    }

    .puzzle-frame {
        padding: 0;
        border: 0;
    }

    .puzzle-grid td {
        width: 34px;
        height: 34px;
        font-size: 0.98rem;
    }

    .color-grid td,
    .colour-grid td {
        width: 34px;
        height: 34px;
        font-size: 1rem;
        letter-spacing: 0.08em;
        background: #fff;
    }

    .word-bank {
        padding: 10px 0 0 18px;
        border: 0;
        border-left: 1px solid #bbb;
    }

    .crypto-key {
        padding: 10px 0 0 18px;
        border: 0;
        border-left: 1px solid #bbb;
        background: transparent;
    }

    .crypto-token {
        min-width: 38px;
        padding: 0 2px 6px;
    }

    .crypto-encoded {
        font-size: 1.2rem;
    }

    .crypto-plain {
        min-height: 20px;
        font-size: 0.82rem;
        border-bottom: 1.5px solid #aaa;
    }

    .fallen-columns,
    .fallen-answer-panel {
        background: #fff;
        border: 0;
        padding: 0;
    }

    .fallen-answer-panel {
        padding-top: 18px;
        border-top: 1px solid #bbb;
    }

    .fallen-column li,
    .fallen-cell {
        border-radius: 0;
    }

    .word-checklist {
        columns: 1;
    }

    .answer-card,
    .worksheet--answer {
        page-break-before: always;
    }
}
