:root {
    --bg: #f4efe7;
    --bg-soft: #fbfaf7;
    --bg-deep: #ece7dc;
    --surface: rgba(255, 253, 248, 0.9);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --surface-tint: rgba(241, 243, 255, 0.9);
    --surface-ink: #141a3a;
    --ink: #171b32;
    --muted: #62677f;
    --line: rgba(22, 27, 50, 0.08);
    --line-strong: rgba(79, 70, 229, 0.18);
    --accent: #4f46e5;
    --accent-strong: #4338ca;
    --accent-alt: #7c3aed;
    --accent-rgb: 79, 70, 229;
    --accent-alt-rgb: 124, 58, 237;
    --signal: #1d4ed8;
    --shadow-soft: 0 16px 34px -28px rgba(12, 18, 42, 0.18);
    --shadow-card: 0 30px 70px -52px rgba(12, 18, 42, 0.22);
    --shadow-strong: 0 42px 90px -58px rgba(12, 18, 42, 0.34);
    --ring: rgba(var(--accent-rgb), 0.34);
    --radius-xl: 2rem;
    --radius-lg: 1.5rem;
    --radius-md: 1.1rem;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 7rem;
    text-rendering: optimizeLegibility;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    line-height: 1.62;
    background:
        radial-gradient(circle at 12% -6%, rgba(var(--accent-rgb), 0.14), transparent 28%),
        radial-gradient(circle at 86% 8%, rgba(var(--accent-alt-rgb), 0.1), transparent 26%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 38%, #eef1f8 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before,
body::after {
    content: '';
    position: fixed;
    pointer-events: none;
    z-index: 0;
}

body::before {
    inset: 0;
    background-image:
        linear-gradient(rgba(23, 27, 50, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23, 27, 50, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.34), transparent 84%);
}

body::after {
    left: 50%;
    top: 11rem;
    width: min(82rem, 96vw);
    height: 28rem;
    transform: translateX(-50%);
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.96), transparent 70%);
    filter: blur(24px);
}

header,
main,
footer {
    position: relative;
    z-index: 1;
}

::selection {
    background: rgba(var(--accent-rgb), 0.18);
    color: var(--ink);
}

h1,
h2,
h3,
h4 {
    margin: 0;
    font-family: Georgia, Cambria, "Times New Roman", Times, serif;
    color: var(--ink);
    letter-spacing: -0.04em;
    line-height: 0.98;
    text-wrap: balance;
}

p {
    margin: 0;
    color: var(--muted);
    line-height: 1.72;
    text-wrap: pretty;
}

a {
    color: inherit;
    text-decoration: none;
    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

button,
input,
textarea,
select {
    font: inherit;
}

:where(a, button, summary, input, textarea, select):focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 3px;
}

:where(a, button, summary, input, textarea, select):focus:not(:focus-visible) {
    outline: none;
}

img {
    display: block;
    max-width: 100%;
}

.site-nav {
    background: rgba(246, 241, 233, 0.84);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 32px -30px rgba(12, 18, 42, 0.42);
}

.site-nav::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.14), transparent);
}

.site-nav p {
    max-width: 32rem;
    font-size: 0.95rem;
    line-height: 1.55;
    color: rgba(23, 27, 50, 0.56);
}

.site-nav nav[aria-label="Primary"] {
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
    width: fit-content;
    max-width: 100%;
}

.brand-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.95rem;
    min-width: 0;
}

.brand-mark {
    position: relative;
    display: grid;
    place-items: center;
    width: 3.35rem;
    height: 3.35rem;
    flex: none;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid rgba(23, 27, 50, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(249, 246, 240, 0.98));
    box-shadow: var(--shadow-soft);
    padding: 0.25rem;
    isolation: isolate;
}

.brand-mark::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent 48%);
    pointer-events: none;
}

.brand-mark-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 0.78rem;
    max-width: none;
}

.brand-lockup-copy {
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
    min-width: 0;
}

.brand-lockup-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--ink);
}

.brand-lockup-note {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(23, 27, 50, 0.46);
}

.site-nav .brand-lockup-note {
    display: none;
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    padding: 0.52rem 0.92rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: rgba(23, 27, 50, 0.68);
}

.nav-link:hover {
    color: var(--ink);
    border-color: rgba(23, 27, 50, 0.08);
    background: rgba(255, 255, 255, 0.76);
}

.nav-link[aria-current="page"] {
    color: var(--accent-strong);
    border-color: rgba(var(--accent-rgb), 0.16);
    background: rgba(var(--accent-rgb), 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.btn-primary,
.btn-secondary,
.btn-tertiary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    padding: 0.9rem 1.35rem;
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.1;
    isolation: isolate;
    overflow: hidden;
}

.btn-compact {
    padding: 0.7rem 1.02rem;
    font-size: 0.84rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-strong), var(--accent-alt));
    color: white;
    box-shadow: 0 18px 36px -24px rgba(var(--accent-rgb), 0.48);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 40px -24px rgba(var(--accent-rgb), 0.56);
}

.btn-secondary {
    border-color: rgba(23, 27, 50, 0.08);
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink);
    box-shadow: var(--shadow-soft);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-rgb), 0.18);
    color: var(--accent-strong);
}

.btn-tertiary {
    border-color: rgba(var(--accent-rgb), 0.12);
    background: rgba(var(--accent-rgb), 0.09);
    color: var(--accent-strong);
}

.btn-tertiary:hover {
    background: rgba(var(--accent-rgb), 0.12);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.72rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.eyebrow::before {
    content: '';
    width: 2.6rem;
    height: 1px;
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.16), rgba(var(--accent-rgb), 0.56));
}

.page-hero,
.paper-card,
.tone-card,
.diagram-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
}

.page-hero::before,
.paper-card::before,
.tone-card::before,
.diagram-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.92), transparent);
}

.page-hero {
    background:
        radial-gradient(circle at top right, rgba(var(--accent-alt-rgb), 0.1), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 246, 240, 0.92));
    padding: clamp(1.7rem, 3vw, 2.6rem);
}

.page-hero-narrow {
    max-width: 60rem;
    margin-inline: auto;
}

.page-hero-narrow > :where(h1, h2) {
    max-width: 44rem;
}

.page-hero-narrow > p:not(.eyebrow) {
    max-width: 50rem;
}

.paper-card {
    background: rgba(255, 255, 255, 0.9);
}

.tone-card {
    background: linear-gradient(180deg, rgba(242, 244, 255, 0.94), rgba(255, 255, 255, 0.92));
    border-color: rgba(var(--accent-rgb), 0.12);
}

.diagram-card {
    background:
        radial-gradient(circle at top right, rgba(var(--accent-alt-rgb), 0.1), transparent 36%),
        linear-gradient(180deg, rgba(240, 244, 255, 0.96), rgba(255, 255, 255, 0.92));
    border-color: rgba(var(--accent-rgb), 0.12);
}

a.paper-card:hover,
a.tone-card:hover,
a.diagram-card:hover {
    transform: translateY(-3px);
    border-color: rgba(var(--accent-rgb), 0.18);
    box-shadow: 0 36px 80px -56px rgba(12, 18, 42, 0.26);
}

.section-rule {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(23, 27, 50, 0.08), rgba(var(--accent-rgb), 0.18), rgba(23, 27, 50, 0.08), transparent);
}

.note-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent-strong);
    padding: 0.42rem 0.8rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.number-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 9999px;
    border: 1px solid rgba(var(--accent-rgb), 0.14);
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.12), rgba(var(--accent-rgb), 0.05));
    color: var(--accent-strong);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.accent-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-strong);
    font-weight: 700;
}

.accent-link::after {
    content: '->';
    transition: transform 0.18s ease;
}

.muted-list li + li {
    margin-top: 0.65rem;
}

details {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-soft);
    padding: 0 1.2rem;
}

details + details {
    margin-top: 0.95rem;
}

summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    list-style: none;
    padding: 1.05rem 0;
    font-weight: 700;
    color: var(--ink);
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '+';
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent-strong);
    flex: none;
}

details[open] summary::after {
    content: '-';
}

details[open] {
    border-color: rgba(var(--accent-rgb), 0.16);
    box-shadow: 0 24px 50px -42px rgba(12, 18, 42, 0.26);
}

.field-input {
    display: block;
    width: 100%;
    border-radius: 1rem;
    border: 1px solid rgba(23, 27, 50, 0.12);
    background: white;
    padding: 0.95rem 1rem;
    color: var(--ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.field-input::placeholder {
    color: rgba(98, 103, 127, 0.7);
}

.field-input:focus {
    outline: none;
    border-color: rgba(var(--accent-rgb), 0.3);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.08);
    transform: translateY(-1px);
}

.field-textarea {
    min-height: 11rem;
    resize: vertical;
}

.texture-panel {
    background-image:
        linear-gradient(rgba(23, 27, 50, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23, 27, 50, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.74);
}

.footer-link:hover {
    color: white;
    transform: translateX(2px);
}

footer.bg-indigo-950 {
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(var(--accent-alt-rgb), 0.16), transparent 28%),
        linear-gradient(180deg, #13193a 0%, #1a2147 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

footer.bg-indigo-950::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.08;
    pointer-events: none;
}

footer.bg-indigo-950 > div {
    position: relative;
    z-index: 1;
}

.footer-logo-link .brand-lockup-title {
    color: white;
}

.footer-logo-link .brand-lockup-note {
    color: rgba(255, 255, 255, 0.56);
}

.footer-logo-link .brand-mark {
    box-shadow: 0 18px 34px -26px rgba(3, 7, 18, 0.58);
}

/* Homepage */

.hero-shell {
    position: relative;
    display: grid;
    gap: 1.6rem;
    align-items: start;
    isolation: isolate;
    border-radius: 2.25rem;
    border: 1px solid rgba(23, 27, 50, 0.08);
    background:
        radial-gradient(circle at top right, rgba(var(--accent-alt-rgb), 0.12), transparent 30%),
        radial-gradient(circle at left center, rgba(var(--accent-rgb), 0.08), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 244, 236, 0.94));
    box-shadow: var(--shadow-strong);
    padding: clamp(1.3rem, 3vw, 2.2rem);
}

.hero-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), transparent 22%);
    pointer-events: none;
}

.home-hero-copy {
    display: grid;
    gap: 1.1rem;
    align-content: start;
    min-width: 0;
}

.hero-deck {
    max-width: 42rem;
    font-size: 1.1rem;
    line-height: 1.78;
}

.hero-deck-secondary {
    max-width: 38rem;
    font-size: 1rem;
    line-height: 1.72;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    padding-top: 0.4rem;
}

.hero-status-grid {
    display: grid;
    gap: 0.9rem;
    padding-top: 0.7rem;
    align-items: stretch;
}

.hero-status {
    position: relative;
    display: grid;
    align-content: start;
    overflow: hidden;
    border-radius: 1.25rem;
    border: 1px solid rgba(23, 27, 50, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(250, 248, 243, 0.78));
    padding: 1rem 1.05rem 1rem 1.2rem;
    box-shadow: var(--shadow-soft);
}

.hero-status::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.82), rgba(var(--accent-alt-rgb), 0.64));
}

.hero-status::after {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.92), transparent);
}

.hero-status-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(23, 27, 50, 0.48);
}

.hero-status p {
    margin-top: 0.4rem;
    font-size: 0.94rem;
    line-height: 1.6;
}

.hero-map {
    position: relative;
    align-self: start;
    display: grid;
    gap: 1rem;
    min-width: 0;
    overflow: hidden;
    border-radius: 1.8rem;
    border: 1px solid rgba(var(--accent-rgb), 0.12);
    background:
        radial-gradient(circle at bottom right, rgba(var(--accent-alt-rgb), 0.12), transparent 32%),
        radial-gradient(circle at top left, rgba(var(--accent-rgb), 0.08), transparent 24%),
        linear-gradient(180deg, rgba(238, 242, 255, 0.96), rgba(255, 255, 255, 0.94));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.72),
        var(--shadow-card);
    padding: 1.35rem;
}

.hero-map::after {
    content: '';
    position: absolute;
    right: -2rem;
    bottom: -2rem;
    width: 10rem;
    height: 10rem;
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.16), transparent 72%);
    filter: blur(14px);
}

.map-caption-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    align-items: stretch;
}

.map-caption {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.15rem;
    border-radius: 9999px;
    border: 1px solid rgba(23, 27, 50, 0.08);
    background: rgba(255, 255, 255, 0.78);
    padding: 0.4rem 0.78rem;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(23, 27, 50, 0.62);
    text-align: center;
}

.map-board {
    display: grid;
    gap: 1.15rem;
}

.map-lane {
    position: relative;
    border-radius: 1.35rem;
    border: 1px solid rgba(23, 27, 50, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(249, 247, 242, 0.88));
    padding: 1.05rem 1rem 1.1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.map-lane-title {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(23, 27, 50, 0.48);
}

.map-node-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 0.95rem;
    align-items: stretch;
}

.map-node {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.7rem;
    border-radius: 9999px;
    border: 1px solid rgba(23, 27, 50, 0.08);
    background: white;
    padding: 0.54rem 0.85rem;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    color: var(--ink);
    box-shadow: 0 12px 24px -22px rgba(12, 18, 42, 0.34);
}

.map-node-stack > .map-node:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    width: min(100%, 11rem);
    justify-self: center;
}

.map-node-accent {
    border-color: rgba(var(--accent-rgb), 0.14);
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent-strong);
}

.map-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    min-height: 2.4rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.map-arrow::before,
.map-arrow::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.34));
}

.map-split {
    display: grid;
    gap: 0.95rem;
}

.map-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.95rem;
    margin-top: 0.15rem;
    align-items: stretch;
}

.map-footer-card {
    display: grid;
    align-content: start;
    min-height: 9.4rem;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.3rem;
    background: linear-gradient(135deg, rgba(25, 31, 77, 0.96), rgba(43, 35, 109, 0.96));
    color: white;
    padding: 1.05rem 1.05rem 1.15rem;
    box-shadow: 0 22px 42px -34px rgba(12, 18, 42, 0.42);
}

.map-footer-card strong {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.64);
}

.map-footer-card p {
    margin-top: 0.4rem;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.92rem;
    line-height: 1.6;
}

.chapter-shell {
    position: relative;
    display: grid;
    gap: 1.25rem;
    align-items: start;
    isolation: isolate;
    border-radius: 2rem;
    border: 1px solid rgba(23, 27, 50, 0.08);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow-card);
    padding: clamp(1.35rem, 3vw, 2.25rem);
}

.chapter-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.52), transparent 22%);
    pointer-events: none;
}

.chapter-shell-tinted {
    background:
        radial-gradient(circle at top right, rgba(var(--accent-alt-rgb), 0.08), transparent 34%),
        linear-gradient(180deg, rgba(242, 244, 255, 0.92), rgba(255, 255, 255, 0.92));
}

.chapter-shell-dark {
    background:
        radial-gradient(circle at top right, rgba(var(--accent-alt-rgb), 0.2), transparent 30%),
        linear-gradient(135deg, #151b40 0%, #1c2451 100%);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 44px 92px -60px rgba(12, 18, 42, 0.48);
}

.chapter-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 9999px;
    border: 1px solid rgba(var(--accent-rgb), 0.16);
    background: rgba(var(--accent-rgb), 0.06);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.chapter-shell-dark .chapter-number {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.chapter-body {
    display: grid;
    gap: 1.2rem;
    min-width: 0;
}

.chapter-deck {
    max-width: 48rem;
    font-size: 1.06rem;
    line-height: 1.8;
}

.chapter-shell-dark h2,
.chapter-shell-dark h3 {
    color: white;
}

.chapter-shell-dark p {
    color: rgba(255, 255, 255, 0.74);
}

.chapter-shell-dark .eyebrow {
    color: rgba(255, 255, 255, 0.84);
}

.chapter-shell-dark .eyebrow::before {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.54));
}

.insight-grid,
.step-grid,
.practice-list,
.scenario-stack,
.resource-rail {
    display: grid;
    gap: 1rem;
}

.balanced-grid {
    align-items: stretch;
}

.balanced-grid > * {
    height: 100%;
}

.balanced-grid > :where(.paper-card, .tone-card, .diagram-card, .insight-panel, .practice-panel, .step-card, .boundary-card) {
    display: grid;
    align-content: start;
}

.insight-grid > *,
.step-grid > *,
.practice-list > *,
.scenario-stack > *,
.resource-rail > *,
.map-footer > * {
    height: 100%;
    min-width: 0;
}

.insight-panel,
.practice-panel,
.scenario-card,
.resource-card,
.boundary-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: 1.45rem;
    border: 1px solid rgba(23, 27, 50, 0.08);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-soft);
    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        background-color 0.22s ease;
}

.insight-panel,
.practice-panel,
.boundary-card {
    padding: 1.3rem;
}

.insight-panel::before,
.practice-panel::before,
.scenario-card::before,
.resource-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.82), rgba(var(--accent-alt-rgb), 0.64));
}

.insight-kicker,
.resource-kicker,
.scenario-card-meta {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.insight-kicker,
.resource-kicker {
    color: rgba(var(--accent-rgb), 0.88);
}

.scenario-card-meta {
    color: rgba(23, 27, 50, 0.48);
}

.insight-panel p,
.practice-panel p,
.scenario-card p,
.resource-card p,
.boundary-card p {
    line-height: 1.72;
}

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

.step-card {
    position: relative;
    overflow: hidden;
    border-radius: 1.45rem;
    border: 1px solid rgba(var(--accent-rgb), 0.12);
    background: rgba(255, 255, 255, 0.86);
    padding: 1.35rem;
    box-shadow: var(--shadow-soft);
    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease;
}

.practice-layout {
    display: grid;
    gap: 1rem;
}

.practice-board {
    position: relative;
    overflow: hidden;
    border-radius: 1.7rem;
    border: 1px solid rgba(var(--accent-rgb), 0.14);
    background:
        radial-gradient(circle at top right, rgba(var(--accent-alt-rgb), 0.1), transparent 34%),
        linear-gradient(180deg, rgba(239, 243, 255, 0.96), rgba(255, 255, 255, 0.94));
    padding: 1.45rem;
    box-shadow: var(--shadow-card);
}

.practice-board-grid {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.25rem;
}

.practice-board-row {
    display: grid;
    gap: 0.35rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(23, 27, 50, 0.08);
}

.practice-board-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.practice-board-row span {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(23, 27, 50, 0.48);
}

.scenario-card,
.resource-card {
    display: grid;
    gap: 0.75rem;
    align-content: start;
    padding: 1.25rem 3.7rem 1.25rem 1.5rem;
}

.scenario-card::after,
.resource-card::after {
    content: '->';
    position: absolute;
    top: 1.1rem;
    right: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent-strong);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.scenario-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: auto;
    color: var(--accent-strong);
    font-weight: 700;
}

.scenario-card-link::after {
    content: '->';
    transition: transform 0.18s ease;
}

.scenario-card:hover .scenario-card-link::after,
.accent-link:hover::after {
    transform: translateX(3px);
}

.boundary-layout {
    display: grid;
    gap: 1rem;
}

.boundary-list {
    margin: 1.4rem 0 0;
    padding-left: 1.2rem;
    color: rgba(255, 255, 255, 0.74);
}

.boundary-list li + li {
    margin-top: 0.7rem;
}

.boundary-card {
    background: rgba(255, 255, 255, 0.96);
}

.chapter-shell-dark .boundary-card h3,
.chapter-shell-dark .boundary-card h4 {
    color: var(--ink);
}

.chapter-shell-dark .boundary-card p {
    color: var(--muted);
}

.chapter-shell-dark .boundary-card .insight-kicker {
    color: rgba(var(--accent-rgb), 0.88);
}

.boundary-mini-list {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.2rem;
}

.boundary-mini-item + .boundary-mini-item {
    padding-top: 0.9rem;
    border-top: 1px solid rgba(23, 27, 50, 0.08);
}

.resource-rail {
    margin-top: 0.4rem;
}

.resource-card p {
    max-width: 38rem;
}

@media (hover: hover) {
    .hero-status:hover,
    .map-lane:hover,
    .insight-panel:hover,
    .practice-panel:hover,
    .step-card:hover,
    .scenario-card:hover,
    .resource-card:hover,
    .paper-card:hover,
    .tone-card:hover,
    .diagram-card:hover {
        transform: translateY(-3px);
        border-color: rgba(var(--accent-rgb), 0.18);
        box-shadow: 0 34px 80px -58px rgba(12, 18, 42, 0.26);
    }
}

@media (min-width: 640px) {
    .hero-status-grid,
    .insight-grid,
    .resource-rail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (min-width: 960px) {
    .hero-shell {
        grid-template-columns: minmax(0, 1.08fr) minmax(20rem, 0.92fr);
    }

    .map-split,
    .practice-layout,
    .boundary-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chapter-shell {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 1.7rem;
    }

    .insight-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 420px) {
    .map-caption-row,
    .map-footer {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1280px) {
    .hero-status-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .site-nav p {
        max-width: none;
        font-size: 0.84rem;
        line-height: 1.45;
    }

    .brand-mark {
        width: 3rem;
        height: 3rem;
    }

    .brand-logo-link {
        gap: 0.8rem;
    }

    .site-nav nav[aria-label="Primary"] {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .site-nav nav[aria-label="Primary"]::-webkit-scrollbar {
        display: none;
    }

    .site-nav nav[aria-label="Primary"] .nav-link {
        flex: 0 0 auto;
        min-height: 2.15rem;
        padding: 0.45rem 0.72rem;
        font-size: 0.84rem;
    }

    .hero-shell,
    .page-hero,
    .paper-card,
    .tone-card,
    .diagram-card,
    .chapter-shell {
        border-radius: 1.55rem;
    }

    .hero-shell,
    .chapter-shell,
    .page-hero {
        padding: 1.2rem;
    }

    .hero-map,
    .practice-board {
        padding: 1.15rem;
    }

    .hero-actions > :where(.btn-primary, .btn-secondary, .btn-tertiary) {
        width: 100%;
    }

    .scenario-card,
    .resource-card {
        padding-right: 1.25rem;
        padding-left: 1.25rem;
    }

    .scenario-card::after,
    .resource-card::after {
        top: auto;
        right: 1rem;
        bottom: 1rem;
    }

    .boundary-list {
        padding-left: 1rem;
    }
}

@media (max-width: 540px) {
    .map-caption-row,
    .map-node-stack,
    .map-footer {
        grid-template-columns: 1fr;
    }

    .map-node-stack > .map-node:last-child:nth-child(odd) {
        width: 100%;
    }

    .map-arrow {
        gap: 0.55rem;
        min-height: auto;
        letter-spacing: 0.12em;
        text-align: center;
    }

    .map-arrow::before,
    .map-arrow::after {
        min-width: 1.5rem;
    }

    .hero-deck,
    .chapter-deck {
        font-size: 1rem;
        line-height: 1.72;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
