:root {
    color-scheme: dark;
    --ink: #fff3e1;
    --soft: #e6d4df;
    --peach: #ffc09b;
    --line: #ead0dd40;
    --serif: Georgia, "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: #18111f;
    color: var(--ink);
    font: 16px/1.5 var(--sans);
}
[hidden] {
    display: none !important;
}
button,
input,
a {
    font: inherit;
}
button,
a {
    touch-action: manipulation;
}
button {
    cursor: pointer;
    color: inherit;
}
a {
    color: inherit;
    text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex="-1"]:focus-visible {
    outline: 2px solid #ffe3a3;
    outline-offset: 5px;
}
.skip {
    position: absolute;
    z-index: 9;
    left: 1rem;
    top: -6rem;
    background: #25192c;
    padding: 0.8rem;
}
.skip:focus {
    top: 0.5rem;
}
.world {
    position: relative;
    isolation: isolate;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.scenery,
.veil {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}
.veil {
    z-index: -1;
    background:
        linear-gradient(90deg, #180f27b8, transparent 69%),
        linear-gradient(0deg, #150f20d4, transparent 25%);
}
.frame {
    width: min(90%, 1480px);
    margin-inline: auto;
}
header {
    padding-block: 23px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    gap: 12px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font: clamp(19px, 2vw, 27px)/1 var(--serif);
}
.emblem {
    width: 39px;
    height: 39px;
}
.link {
    display: inline-flex;
    align-items: center;
    gap: 0.8em;
    padding: 9px 17px;
    border: 1px solid var(--line);
    border-radius: 30px;
    font-size: 13px;
    background: #24182d65;
}
.link:hover {
    background: #3e2944;
}
main {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 0.98fr) minmax(0, 1.02fr);
    align-items: center;
    position: relative;
    padding-block: clamp(8px, 1.7svh, 20px);
    column-gap: 1%;
    row-gap: 8px;
}
.copy {
    position: relative;
    z-index: 1;
}
.eyebrow,
.small {
    font: 600 10px/1.5 var(--sans);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--peach);
}
.eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
}
.eyebrow:before {
    content: "";
    width: 32px;
    height: 1px;
    background: currentColor;
}
h1,
h2,
p {
    margin: 0;
}
h1,
h2 {
    font: 400 clamp(54px, 5.8vw, 98px)/0.99 var(--serif);
    letter-spacing: -0.055em;
    text-wrap: balance;
}
h1 em {
    display: block;
    color: var(--peach);
    font-weight: 400;
}
.intro {
    font-size: clamp(15px, 1.16vw, 18px);
    color: var(--soft);
    max-width: 38ch;
    margin: 12px 0 14px;
    line-height: 1.55;
}
.tabs {
    display: inline-flex;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #1e142cd4;
}
.tabs button {
    background: none;
    border: 0;
    border-radius: 20px;
    padding: 8px clamp(12px, 1.4vw, 22px);
    font-size: clamp(15px, 1.2vw, 18px);
    color: var(--soft);
    min-height: 46px;
}
.tabs button[aria-pressed="true"] {
    background: #594151;
    color: #fff3df;
}
.fields {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-top: 15px;
}
.field {
    display: grid;
    gap: 5px;
    color: var(--soft);
    font-size: 12px;
}
.field input {
    display: block;
    min-width: 0;
    width: 160px;
    height: 46px;
    padding: 0 11px;
    color: var(--ink);
    background: #23182dde;
    border: 1px solid #ac85968c;
    border-radius: 7px;
    letter-spacing: 0.03em;
    font-size: 16px;
}
.field input[aria-invalid="true"] {
    border-color: #ff9c9c;
}
.go {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    min-height: 46px;
    border: 1px solid #ffd2ac;
    border-radius: 7px;
    padding: 10px 18px;
    background: #ffc39f;
    color: #321b2a;
    font-weight: 650;
    font-size: 14px;
}
.go:hover {
    background: #ffdbb9;
}
.error {
    color: #ffddd0;
    font-size: 14px;
    max-width: 48ch;
    background: #381f36;
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 10px;
}
.error:empty {
    display: none;
}
.art {
    position: relative;
    aspect-ratio: 1.15;
    width: min(100%, 720px, 56svh);
    justify-self: center;
    min-width: 0;
}
.plate {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.art-label {
    position: absolute;
    bottom: 3%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    color: #fff1dd;
    background: #281b328c;
    border: 1px solid #ddb7ca55;
    border-radius: 30px;
    padding: 8px 16px;
    font: italic 16px var(--serif);
}
.art-label:hover,
.quiet:hover {
    background: #57364a;
}
.spark {
    color: var(--peach);
}
.note {
    position: absolute;
    bottom: 14%;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 88%;
    background: #291c34f5;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 12px 16px;
    font: 15px/1.5 var(--serif);
    box-shadow: 0 8px 30px #150d21a0;
}
.result h2 {
    font-size: clamp(46px, 5.3vw, 85px);
    margin: 5px 0 14px;
}
.arc-number {
    display: block;
    font: italic 22px var(--serif);
    color: var(--peach);
}
.reading {
    max-width: 45ch;
    color: var(--soft);
    margin: 10px 0;
}
.reflection {
    font: italic clamp(18px, 1.5vw, 23px)/1.35 var(--serif);
    max-width: 38ch;
    color: #ffe0c9;
}
.contributions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 16px 0;
    font-size: 13px;
}
.contributions span {
    border-left: 2px solid #ffb48c;
    padding-left: 8px;
}
.contributions span + span {
    border-color: #d3baff;
    border-left-style: dashed;
}
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 18px;
}
.quiet {
    min-height: 40px;
    border: 1px solid var(--line);
    background: #281c32bb;
    border-radius: 7px;
    padding: 6px 12px;
    font-size: 13px;
}
.text-btn {
    border: 0;
    background: none;
    text-decoration: underline;
    text-underline-offset: 4px;
    color: var(--soft);
    padding: 8px;
    font-size: 13px;
}
.quiet:disabled {
    opacity: 0.42;
    cursor: default;
}
nav {
    position: relative;
    padding: 6px 0 12px;
}
.constellation-nav { order: 1; }
.route-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 4px;
}
.route-head:after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}
.route-head .small {
    color: #e7cbd1;
}
.route {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}
.stop {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    padding: 8px clamp(6px, 1.1vw, 20px);
    min-width: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #eedde3;
}
.stop:hover {
    background: #62435255;
}
.stop[aria-current="step"] {
    background: linear-gradient(105deg, #6b454fc9, #4a31456e);
    border-color: #d899864f;
    color: #ffe1c7;
}
.stop canvas {
    width: 40px;
    height: 36px;
    flex: none;
}
.stop b {
    display: block;
    font: 400 clamp(17px, 1.5vw, 25px)/1.1 var(--serif);
}
.stop small {
    display: block;
    font-size: 9px;
    letter-spacing: 0.15em;
    margin-bottom: 4px;
    color: #e0bcc6;
}
.sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
}
.article-link {
    color: var(--soft);
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.route-head .article-link {
    order: 1;
}
.program-hint,
.program-check {
    margin-top: 14px;
    color: var(--soft);
    font-size: 14px;
}
.program-check h3 {
    margin: 0 0 6px;
    color: var(--ink);
    font: 24px/1.2 var(--serif);
}
.program-check ul {
    padding-left: 20px;
    margin: 6px 0;
}
@media (max-width: 820px) {
    .frame {
        width: 92%;
    }
    main {
        grid-template-columns: 1.06fr 0.94fr;
    }
    .stop {
        gap: 5px;
        padding: 9px 5px;
    }
    .stop canvas {
        width: 30px;
    }
    .art {
        aspect-ratio: 0.98;
    }
    .fields {
        gap: 8px;
    }
}
@media (max-width: 660px) {
    header {
        padding-block: 14px;
    }
    .emblem {
        width: 31px;
        height: 31px;
    }
    .brand {
        gap: 6px;
    }
    .link {
        font-size: 12px;
        padding: 7px 10px;
        gap: 6px;
    }
    .veil {
        background: linear-gradient(
            0deg,
            #1b1325 4%,
            #201329cc 35%,
            transparent 77%
        );
    }
    main {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 0 0 18px;
        gap: 0;
    }
    .art {
        order: -1;
        width: min(100%, 450px);
        height: clamp(195px, 36svh, 340px);
        aspect-ratio: auto;
        align-self: center;
    }
    .art-label {
        bottom: 0;
        padding: 6px 13px;
        font-size: 14px;
    }
    .note {
        bottom: 16%;
    }
    .copy {
        margin: 20px 0 0;
    }
    .eyebrow {
        font-size: 9px;
        margin-bottom: 10px;
    }
    h1 {
        font-size: clamp(46px, 10.8vw, 67px);
    }
    .intro {
        font-size: 15px;
        margin: 12px 0 15px;
        max-width: 42ch;
    }
    .fields {
        margin-top: 10px;
    }
    .field input {
        width: 150px;
    }
    .go {
        gap: 10px;
    }
    .route-head {
        margin-bottom: 6px;
    }
    .stop {
        flex-direction: column;
        align-items: center;
        gap: 1px;
        padding: 7px 1px;
    }
    .stop b {
        font: 12px/1.4 var(--sans);
    }
    .stop small {
        display: none;
    }
    .stop canvas {
        width: 32px;
        height: 28px;
    }
    nav {
        padding: 8px 0 17px;
    }
    .result h2 {
        font-size: 45px;
    }
    .contributions {
        margin: 10px 0;
    }
    .result .eyebrow {
        margin-bottom: 5px;
    }
}
@media (max-width: 360px) {
    .field,
    .field input {
        width: 100%;
    }
    .fields .go {
        width: 100%;
    }
    .stop b {
        font-size: 10px;
    }
    .route {
        gap: 1px;
    }
}
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        animation: none !important;
        transition: none !important;
    }
}

/* The night map opens into a light reading room below the journey. */
.site-links, .site-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 24px;
}
.site-links { padding: 0; font-size: 14px; }
.site-links a:hover, .site-links a:focus-visible { text-decoration: underline; }
.form-note { margin-top: 12px; color: var(--soft); font-size: 13px; }
.form-note a, .atlas a:not(.go) { text-decoration: underline; text-underline-offset: .2em; }
.map-section, .editorial { padding-block: clamp(36px, 6vw, 80px); }
.atlas h2 { font-size: clamp(35px, 4.6vw, 64px); }
.atlas h3 { font: 400 clamp(22px, 2vw, 30px)/1.15 var(--serif); margin: 0 0 12px; }
.map-section { border-top: 1px solid var(--line); }
.map-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; gap: 5%; }
.star-map {
    position: relative;
    width: min(100%, 670px);
    aspect-ratio: 1;
    background: radial-gradient(circle, #3a2941, transparent 70%);
}
.map-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-lines path { fill: none; stroke: #a28d9e; stroke-width: .28; }
.map-lines .rim { stroke-dasharray: .7 .5; }
#selected-line { stroke: #ffd09e; stroke-width: .75; }
#age-marks text { fill: #dabfae; text-anchor: middle; dominant-baseline: central; font-size: 1.45px; }
#age-marks .decade { font-weight: 650; font-size: 2.4px; fill: #fff2dd; }
.map-point {
    position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
    display: grid; place-items: center; width: clamp(24px, 4vw, 40px); aspect-ratio: 1; padding: 0;
    border: 1px solid #c7a88c; border-radius: 50%; background: #2c2034; color: #fff0d9;
    font: 600 clamp(12px, 1.35vw, 17px)/1 var(--sans);
}
.map-point[aria-pressed="true"] { outline: 2px solid #ffe4ad; outline-offset: 1px; background: #ebbd8c; color: #24192c; }
.map-notes { max-width: 48ch; padding: 20px; border-left: 1px solid var(--line); }
.map-notes label { display: block; color: var(--soft); font-size: 14px; }
.map-notes select { width: 100%; min-height: 44px; margin: 6px 0 20px; padding: 6px; font: inherit; color: var(--ink); background: #302238; }
.map-notes p { margin-bottom: 16px; }
.atlas summary { cursor: pointer; font-weight: 600; padding-block: 14px; }
#age-scale { border-top: 1px solid var(--line); }
#age-scale p { max-width: 70ch; margin: 8px 0; }
#age-values { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 250px),1fr)); gap: 16px; list-style: none; padding: 0; }
#age-values strong { display: block; color: var(--peach); }
.paper { color-scheme: light; color: #292335; background: #faf6ee; }
.paper .eyebrow { color: #805637; }
.editorial + .editorial { border-top: 1px solid #d5c8b7; }
.reading-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); margin-block: 28px; }
.editorial p { max-width: 67ch; }
.editorial p + a { display: inline-block; margin-top: 12px; }
.offer { display: grid; grid-template-columns: 1.1fr .9fr; gap: 7%; }
.offer h2, .faq h2 { margin-bottom: 20px; }
.offer .go { color: white; background: #312539; border: 0; margin-right: 12px; }
.offer a { margin-block: 12px; }
.contents { padding-left: 28px; margin: 0; }
.contents li, .faq details { padding-block: 10px; border-bottom: 1px solid #d5c8b7; }
.faq details p { padding-bottom: 15px; }
.site-footer { justify-content: space-between; padding-block: 32px; }
@media (max-width: 700px) {
    header.frame { flex-wrap: wrap; }
    .site-links { gap: 8px 16px; }
    .art { order: 0; }
    .map-layout, .offer { grid-template-columns: 1fr; gap: 16px; }
    .map-notes { padding: 0 0 16px; border-left: 0; }
    #age-marks .subdivision { display: none; }
    #age-marks .decade { font-size: 3px; }
}
.edit-map { float: right; margin-left: 10px; }
.map-report-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 16px; }

.world { overflow-anchor: none; }
.art-label small { display: block; margin-top: 2px; font: 12px/1.4 var(--sans); color: var(--peach); }
.star-info { display: grid; place-items: center; width: 1.15em; height: 1.15em; border: 1px solid var(--line); border-radius: 50%; font: italic 14px Georgia, serif; }
#star-location { display: inline-block; margin-top: 6px; color: var(--peach); text-decoration: underline; }
.result-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px; margin-top: 14px; }
.chapter-report-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.chapter-buy { padding: 9px 14px; border: 1px solid #ddac85; border-radius: 7px; color: var(--peach); font-size: 14px; font-weight: 600; }
.chapter-buy:hover { background: #543448; }
.map-intro { max-width: 55ch; margin-top: 16px; color: var(--soft); }
.matrix-lines { margin: 24px 0; }
.matrix-lines dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px 24px; }
.matrix-lines dl div { border-top: 1px solid var(--line); padding: 12px 0; }
.matrix-lines dt { color: var(--soft); font-size: 14px; }
.matrix-lines dd { margin: 4px 0 0; font: 26px var(--serif); color: var(--peach); }
@media (max-width: 660px) {
    header .site-links { font-size: 12px; }
    .art { order: -1; height: clamp(175px, 25svh, 235px); }
    .matrix-lines dl { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .result-links .text-btn { padding-inline: 0; }
}

.library-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; margin-bottom: clamp(20px, 3vw, 36px); }
.atlas .library a { text-decoration: none; }
.library-all, .library-read { font-weight: 600; font-size: 14px; }
.library-all { padding: 9px 16px; border: 1px solid #bba797; border-radius: 24px; }
.library-all:hover { background: #f1e6d7; }
.library-shelf { display: grid; grid-template-columns: minmax(0,1.35fr) repeat(2,minmax(0,1fr)); gap: clamp(12px,1.5vw,22px); }
.library-feature, .library-topic { position: relative; overflow: hidden; border-radius: 15px; }
.library-feature {
    grid-row: span 2; display: flex; flex-direction: column; justify-content: space-between;
    padding: clamp(22px,2.4vw,38px); color: #fff2dc;
    background: linear-gradient(0deg,#261a2b 5%,#261a2bde 45%,#27182c7d), url('/images/karta-arkanov/night.webp') center/cover;
}
.library-feature img { width: 100%; height: clamp(140px,14vw,210px); object-fit: contain; }
.library-feature h3 { color: #ffdfb8; font-size: clamp(30px,3.3vw,50px); margin: 14px 0 8px; }
.library-feature p, .library-topic p { font-size: 15px; line-height: 1.5; max-width: 38ch; }
.library-read { display: inline-flex; gap: 12px; align-items: center; margin-top: 18px; color: #ffd2a9; }
.library-topic { padding: clamp(18px,2vw,32px); background: #f5ecdf; border: 1px solid #dacbb9; }
.library-topic:nth-of-type(3), .library-topic:nth-of-type(4) { background: #f1e9e7; border-color: #dacbc9; }
.library-topic h3 { margin: 12px 0 6px; font-size: clamp(23px,2vw,32px); }
.library-topic p { color: #574952; }
.library-glyph { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #cbb7a5; border-radius: 50%; font: 26px/1 Georgia,serif; color: #734c48; }
.library-arrow { position: absolute; right: 18px; top: 16px; color: #79594f; font-size: 20px; }
.library a:focus-visible { outline: 3px solid #88552f; outline-offset: 3px; }
.library-topic:hover, .library-topic:focus-visible { border-color: #9d7b65; }
@media (prefers-reduced-motion: no-preference) {
    .library-feature img, .library-arrow { transition: transform .25s ease; }
    .library-feature:hover img { transform: scale(1.035); }
    .library-topic:hover .library-arrow { transform: translate(2px,-2px); }
}
@media (max-width: 880px) {
    .library-shelf { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .library-feature { grid-column: 1/-1; grid-row: auto; flex-direction: row-reverse; align-items: center; gap: 20px; }
    .library-feature img { width: 38%; }
}
@media (max-width: 540px) {
    .library-shelf { grid-template-columns: 1fr; }
    .library-feature { flex-direction: column; align-items: stretch; gap: 0; }
    .library-feature img { width: 100%; height: 140px; }
    .library-topic { padding: 18px 38px 18px 70px; }
    .library-topic h3 { margin-top: 0; }
    .library-glyph { position: absolute; left: 16px; top: 19px; }
}

.offer .contents { display: grid; gap: 6px; list-style: none; counter-reset: contents; padding: 0; }
.offer .contents li { padding: 0; border: 0; counter-increment: contents; }
.offer .contents a {
    display: flex; align-items: center; gap: .9rem; min-height: 44px; padding: .55rem .85rem;
    border: 1px solid #d6c4b7; border-radius: .65rem; background: #fffaf3; color: #443145; text-decoration: none;
}
.offer .contents a::before { content: counter(contents,decimal-leading-zero); color: #896248; font-family: Georgia,serif; }
.offer .contents a::after { content: "↗"; margin-left: auto; }
.offer .contents a:hover { background: #f1e6da; }
.offer { row-gap: 16px; }
.offer .report-actions > a { margin: 0; }

.world .chapter-report-links:not([hidden]) { margin-top: 4px; gap: 5px; }
@media (min-width: 661px) and (max-height: 800px) {
    #journey h1 { font-size: clamp(46px,8.5svh,68px); }
    .result h2 { font-size: clamp(42px,8svh,62px); margin: 4px 0 8px; }
    #journey .eyebrow { margin-bottom: 7px; }
    .actions, .result-links { margin-top: 6px; }
    .contributions { margin: 6px 0; }
    .intro { max-width: 50ch; }
}
@media (min-width: 881px) and (max-height: 680px) {
    .world .ka-header .ka-header-inner { padding-block: 8px; }
    #journey { padding-block: 5px; row-gap: 4px; }
    #journey .intro { margin-block: 8px; }
    .world > nav.frame { padding-block: 4px 8px; }
    .world .stop { padding-block: 5px; }
    .world .fields { gap: 8px; }
    .world .field input { width: 145px; }
}

@media (max-width: 660px), (pointer: coarse) and (orientation: landscape) and (max-height: 520px) {
    .world { overflow: clip; }
    .world .constellation-nav {
        order: 0;
        position: sticky;
        top: 0;
        z-index: 3;
        box-sizing: border-box;
        width: 100%;
        padding: 6px 4% 8px;
        background: #251a2e;
        border-bottom: 1px solid #5d4359;
    }
    .constellation-nav .stop { min-height: 44px; }
    #journey :is(input, button, a, [tabindex]) { scroll-margin-top: 6rem; }
}
