:root {
  color-scheme: light;
  --paper: #f7f3e9; --ink: #183a34; --muted: #53665c; --line: #c8c8b6;
  --pine: #143c36; --deep: #102f2d; --honey: #e9c671;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", Arial, sans-serif;
}

/* A guided courtyard gives one explanation and one next action at a time. */
.court-progress {display:flex;gap:12px;list-style:none;padding:0;margin:0 0 23px;color:#6b7569;font-size:11px;line-height:1.3;}
.court-progress li {display:flex;flex:1;flex-direction:column;gap:5px;}
.court-progress li span {display:grid;place-items:center;width:25px;height:25px;border:1px solid #9aa494;border-radius:50%;font:600 12px var(--sans);}
.court-progress .is-reached span {background:#dbe5d7;border-color:#55795f;color:#163e32;}
.court-progress [aria-current=step] {color:#183a34;font-weight:650;}
.court-progress [aria-current=step] span {background:#1d4a3c;color:#fff8e8;}
.court-topics {display:grid;gap:9px;margin:20px 0 10px;}
.court-topic {min-height:48px;padding:12px 15px;text-align:left;color:#163d32;background:#eef0e4;border:1px solid #9aa993;border-radius:5px;}
.court-topic:hover {background:#e0e9d8;border-color:#32684e;}
.court-instruction {border-left:2px solid #b29049;padding-left:14px;line-height:1.55;}
.panel .court-position {font-size:14px;color:#56705d;margin:0 0 15px;}
.court-current-card {display:flex;gap:16px;align-items:center;width:100%;padding:12px;border:1px solid #c2c7ae;border-radius:6px;background:#eeeadd;color:#254537;text-align:left;}
.court-current-card img {width:78px;height:auto;border-radius:4px;}
.court-current-card span {font:21px/1.3 var(--serif);}
.court-current-card small {display:block;margin-top:9px;font:13px/1.4 var(--sans);text-decoration:underline;text-underline-offset:3px;}
.court-meaning .mira-story {margin-top:21px;}
.court-meaning .mira-story p {font:18px/1.6 var(--sans);}
.court-response-choices {display:flex;flex-wrap:wrap;gap:8px;margin-top:17px;}
.projected:disabled {cursor:default;}
body[data-room=dvor] .panel {scroll-margin-top:18px;}
@media(min-width:691px) {
  body[data-room=dvor] .art-column {position:sticky;top:24px;}
}
@media(max-width:690px) {
  body[data-room=dvor] .room-grid {grid-template-columns:1fr;}
  body[data-room=dvor] .room-grid>.panel {grid-row:1;}
  body[data-room=dvor] .room-grid>.art-column {grid-row:2;}
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; color: var(--ink); background: var(--paper); font: 16px/1.52 var(--sans); }
button, textarea, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid #268b82; outline-offset: 4px; }
.sr,.skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 10; top: 9px; left: 9px; padding: 8px 15px; background: white; color: var(--deep); }
.shell { width: min(1180px, calc(100% - clamp(36px, 8vw, 116px))); margin-inline: auto; }
.topbar { border-bottom: 1px solid #173d352c; }
.bar-inner { min-height: 66px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 24px/1 var(--serif); text-decoration: none; }
.brand img { border-radius: 8px; }
nav { display: flex; gap: clamp(12px, 3vw, 28px); align-items: center; }
nav a, nav button, .text-action { display: inline-flex; align-items: center; min-height: 44px; border: 0; padding: 6px 0; background: none; color: var(--ink); font-size: 14px; text-underline-offset: 4px; }
nav a, nav button { text-decoration: none; }
nav a:hover, nav button:hover, .text-action:hover { text-decoration: underline; }
h1,h2,h3,p,blockquote,figure { margin: 0; }
h1,h2,h3 { text-wrap: balance; }
.page-head { padding: clamp(28px, 4.5vw, 56px) 0 clamp(22px, 2.7vw, 36px); }
.page-head h1 { font: 400 clamp(36px, 5.0vw, 72px)/1.04 var(--serif); letter-spacing: -.047em; }
.page-head p { margin-top: 13px; max-width: 60ch; color: var(--muted); font-size: clamp(15px, 1.15vw, 18px); }
.doors { display: grid; gap: 19px; margin-bottom: 50px; }
.door { display: grid; grid-template-columns: minmax(0, 1.03fr) minmax(0, 1fr); text-decoration: none; overflow: hidden; border: 1px solid #20453a32; border-radius: 6px; }
.door:focus-visible { outline-offset: 3px; }
.door.table { color: #fbf4e3; background: linear-gradient(111deg,#0b302f,#1b453d); border-color: #153b36; }
.door.courtyard { background: linear-gradient(112deg,#ede8d6,#f4f0de); }
.door-copy { display: flex; flex-flow: column; align-items: flex-start; justify-content: center; min-width: 0; padding: clamp(25px, 4.4vw, 67px); }
.overline { color: #466258; font-size: 11px; font-weight: 650; letter-spacing: .14em; line-height: 1.4; text-transform: uppercase; }
.table .overline { color: #e1c88c; }
.door h2 { margin-top: 17px; font: 400 clamp(33px, 4.1vw, 62px)/1.05 var(--serif); letter-spacing: -.045em; }
.door-copy p { max-width: 32ch; margin: 15px 0 24px; font-size: clamp(15px,1.2vw,18px); color: #435b4e; }
.table .door-copy p { color: #e1e7d8; }
.door-art { display: flex; align-items: center; width: 100%; height: 100%; background: #142c27; }
.door-art img { display: block; width: 100%; height: auto; }
.door.courtyard .door-art { background: #e9e4d4; }
.enter { display: inline-flex; align-items: center; gap: 15px; font-size: 15px; font-weight: 600; padding: 10px 0; border-bottom: 1px solid currentColor; }
.table .enter { color: #f3d99b; }
.arrow { display: inline-block; font-family: var(--sans); transition: transform .15s; }
.door:hover .arrow { transform: translateX(5px); }
.room-heading { padding: clamp(23px,3.2vw,42px) 0 clamp(18px,2.3vw,29px); }
.room-heading .overline { display: block; }
.room-heading h1 { margin-top: 5px; font: 400 clamp(35px,4.2vw,61px)/1.07 var(--serif); letter-spacing: -.042em; }
.room-grid { display: grid; grid-template-columns: minmax(0,1.42fr) minmax(300px,1fr); gap: clamp(23px,3.4vw,50px); align-items: start; margin-bottom: 40px; }
.art-column { min-width: 0; }
.frame { position: relative; overflow: hidden; isolation: isolate; width: 100%; background: #112f2c; border-radius: 5px; }
.frame-base { display: block; width: 100%; height: 100%; object-fit: contain; }
.plane { position: absolute; inset: 0 auto auto 0; pointer-events: none; transform-origin: 0 0; }
.projected { display: block; position: absolute; top: 0; left: 0; width: 200px; height: 300px; padding: 0; border: 0; border-radius: 7px; transform-origin: 0 0; background: transparent; }
button.projected { pointer-events: auto; }
.projected:focus-visible { outline: 5px solid #efa847; outline-offset: 0; }
.caption { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 0; color: var(--muted); font-size: 13px; }
.caption button { margin-left: auto; color: var(--ink); font-size: 13px; }
.panel { min-width: 0; border-top: 1px solid #a59b76; padding: 20px 0 0; }
.panel h2, .dialog-copy h2 { font: 400 clamp(25px,2.45vw,38px)/1.13 var(--serif); letter-spacing: -.025em; margin-bottom: 13px; }
.panel h2:focus, .room-heading h1:focus, .page-head h1:focus { outline: none; }
.panel p, .dialog-copy p { margin-top: 11px; }
.soft { color: var(--muted); font-size: 15px; }
.sample-quote, .guest-quote { padding: 12px 17px; margin: 16px 0; border-left: 2px solid #b49658; color: #264039; background: #eae6d94f; font: 20px/1.38 var(--serif); overflow-wrap: anywhere; white-space: pre-line; }
.panel .actions { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; margin-top: 18px; }
.primary { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 46px; border: 1px solid #17483e; border-radius: 5px; padding: 10px 19px; text-decoration: none; background: var(--pine); color: #fbf7eb; font: 600 15px/1.35 var(--sans); }
.primary:hover { background: #20554c; }
.secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 15px; font: 500 14px/1.3 var(--sans); border: 1px solid #9da899; border-radius: 5px; background: transparent; color: var(--ink); text-decoration: none; }
.secondary:hover { background: #e8e8d9; }
.text-action { text-decoration: underline; text-decoration-color: #86958b; }
.form-field { display: grid; gap: 7px; margin: 14px 0 0; }
.form-field label { color: var(--ink); font-weight: 600; font-size: 15px; }
textarea { display: block; width: 100%; min-height: 82px; resize: vertical; padding: 11px 13px; color: var(--ink); background: #fffdf6; border: 1px solid #9ca99d; border-radius: 5px; line-height: 1.4; }
textarea::placeholder { color: #6a756c; opacity: 1; }
textarea[aria-invalid=true] { border-color: #a34636; }
.error { color: #943526; font-size: 14px; }
.rollup { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 7px; }
.rollup summary { cursor: pointer; padding: 11px 0; min-height: 44px; font-weight: 600; color: var(--ink); }
.rollup[open] summary { padding-bottom: 3px; }
.speaker { display: flex; align-items: center; gap: 8px; font: 600 14px/1.3 var(--sans); color: #36534a; }
.speaker img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; clip-path: circle(39% at 50% 48.6%); margin-left:-3px; }
.mira-story { margin: 10px 0 16px; }
.mira-story p { font: 18px/1.55 var(--serif); overflow-wrap: anywhere; }
.card-list { display: grid; gap: 0; margin: 14px 0; border-block: 1px solid var(--line); }
.card-line { display: flex; align-items: center; min-height: 44px; width: 100%; padding: 7px 2px; border: none; color: var(--ink); background: transparent; text-align: left; }
.card-line + .card-line { border-top: 1px solid #c8c8b66e; }
.card-line small { margin-left: auto; padding-left: 8px; color: var(--muted); }
.card-line:hover { text-decoration: underline; }
.saved-thought { display: grid; gap: 10px; margin: 19px 0; }
.saved-thought dt { font: 600 13px var(--sans); color: var(--muted); }
.saved-thought dd { margin: -6px 0 8px; overflow-wrap: anywhere; white-space: pre-line; font: 20px/1.4 var(--serif); }
.finish-row { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap: 6px 18px; padding: 7px 0 22px; border-top:1px solid var(--line); }
.finish-row a, .finish-row button { font-size: 14px; }
.dialog-copy { padding: clamp(22px,4vw,40px); }
dialog { width: min(560px,calc(100% - 28px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #b8b69c; border-radius: 8px; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: #071c1bd4; }
.dialog-top { display:flex; justify-content:flex-end; padding: 5px 13px 0; }
.dialog-top button { min-height: 40px; padding: 5px 9px; border: 0; background: transparent; color: var(--ink); }
.dialog-top + .dialog-copy { padding-top: 0; }
dialog.art-dialog { width: min(1100px,calc(100% - 24px)); }
.zoom-room { width: min(100%,calc((100dvh - 115px)*1.405)); margin: 0 auto 14px; }
.zoom-room .frame { border-radius: 0; }
.card-detail { padding: 0 18px 20px; text-align: center; }
.card-detail h2 { font: 27px var(--serif); margin: 0; }
.card-detail p { margin: 5px 0 12px; }
.card-detail img { display: block; max-width: 100%; width: auto; height: auto; max-height: min(64dvh,720px); margin: 0 auto; border-radius: 5px; }
.check { display: flex; align-items: flex-start; gap: 9px; margin: 17px 0 6px; cursor: pointer; }
.check input { accent-color: var(--pine); width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; }
.dialog-copy .actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }
@media (min-width: 1150px) { .room-grid { grid-template-columns:minmax(0,1.45fr) minmax(340px,1fr); } }
@media (max-width: 840px) {
  .shell { width: calc(100% - 42px); }
  .door-copy { padding: 25px; }
  .room-grid { grid-template-columns: minmax(0,1.04fr) minmax(284px,1fr); gap: 23px; }
  .panel { padding-top: 14px; }
}
@media (max-width: 690px) {
  .shell { width: calc(100% - 32px); }
  .bar-inner { min-height: 55px; }
  .brand { font-size: 22px; }
  .brand img { width: 27px; height: 27px; }
  nav { gap: 14px; }
  .page-head { padding: 26px 0 22px; }
  .door { grid-template-columns: 1fr; }
  .door-art { grid-row: 1; }
  .door-copy { padding: 20px 22px 17px; }
  .door h2 { margin-top: 6px; }
  .door-copy p { margin: 9px 0 8px; }
  .doors { gap: 14px; margin-bottom: 24px; }
  .room-grid { grid-template-columns: 1fr; gap: 8px; }
  .room-heading { padding: 19px 0 14px; }
  .room-heading h1 { font-size: clamp(34px,8vw,44px); }
  .caption { padding: 0; }
  .panel h2 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation: none!important; transition:none!important; scroll-behavior:auto!important; } }

/* The third row has one illustrated door per element, in canonical order. */
.elements-section { border-top: 1px solid var(--line); padding: clamp(24px,3.7vw,46px) 0 38px; }
body[data-room=stihii] .elements-section { border:0; }
.doors:has(+ .elements-section) { margin-bottom: 26px; }
.element-intro h1,.element-intro h2 { font: 400 clamp(34px,4.8vw,64px)/1.1 var(--serif); letter-spacing:-.045em; }
.element-intro p { max-width:68ch; margin:10px 0 17px; color:var(--muted); }
.element-gate { display:flex; align-items:center; flex-wrap:wrap; gap:9px 38px; margin: 0 0 24px; }
.birth-form label { display:block; font-weight:600; font-size:14px; margin-bottom:5px; }
.birth-row { display:flex; align-items:stretch; gap:8px; flex-wrap:wrap; }
.birth-row input { min-width:0; width:157px; max-width:100%; min-height:45px; border:1px solid #9ca99d; border-radius:5px; padding:8px 12px; background:#fffdf6; color:var(--ink); font-variant-numeric:tabular-nums; }
.birth-row input[aria-invalid=true] { border-color:#a34636; }
.birth-message p { margin:7px 0 0; }
.birth-result { font-size:15px; overflow-wrap:anywhere; }
.birth-result p { margin:4px 0; }
.sign-choice fieldset { padding:12px 0 0; border:0; margin:9px 0 0; }
.sign-choice legend { font-size:15px; padding:0; }
.sign-choice .actions { display:flex;flex-wrap:wrap;gap:8px; margin:0; }
.element-doors { position:relative; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:clamp(10px,1.45vw,18px); }
.element-door { display:block; text-decoration:none; border:1px solid #a9a58b70; border-radius:6px; overflow:hidden; min-width:0; }
.element-door.fire { background:#34281e; color:#fff2dc; }
.element-door.earth { background:#e6e9d8; color:#2b402e; }
.element-door.air { background:#e4edf0; color:#273f4c; }
.element-door.water { background:#123c3d; color:#f2f2df; }
.element-card-copy { padding:clamp(12px,1.38vw,20px); }
.element-title { display:flex; align-items:center; justify-content:space-between; }
.element-title h3 { font:400 clamp(27px,2.85vw,40px)/1.05 var(--serif);letter-spacing:-.035em; }
.door-arrow { position:relative;width:18px;height:18px;flex-shrink:0;transition:transform .15s; }
.door-arrow::before,.door-arrow::after { content:'';position:absolute;right:2px;top:2px; }
.door-arrow::before { width:17px;height:1.5px;background:currentColor;transform-origin:right center;transform:rotate(-45deg); }
.door-arrow::after { width:10px;height:10px;border-top:1.5px solid;border-right:1.5px solid; }
.element-door:hover .door-arrow { transform:translate(2px,-2px); }
.element-signs { margin-top:6px; font-size:14px; }
.element-place { font:italic 16px/1.4 var(--serif);margin-top:12px; }
.element-paging { display:none; }
.panel .birth-form,.panel .birth-result { margin:15px 0; }
.panel .birth-row { gap:7px; }
.panel .birth-row input { flex:1 1 130px; max-width:180px; }
.panel .birth-tools { margin:16px 0; border-block:1px solid var(--line); padding:2px 0; }
.panel .birth-tools summary { min-height:44px; padding:9px 1px; cursor:pointer; color:var(--muted); font-size:14px; }
.panel .birth-tools .birth-form { margin:3px 0 13px; }
body[data-room=ogon] { --pine:#754326; --ink:#3c3025; --muted:#64574c; --paper:#f8f0e3; }
body[data-room=zemlya] { --pine:#465936; --ink:#2c3e2b; --muted:#586552; --paper:#f4f2e5; }
body[data-room=vozduh] { --pine:#35566b; --ink:#293e4a; --muted:#506371; --paper:#f1f3f1; }
body[data-room=voda] { --pine:#1d5151; --ink:#173d3f; --muted:#506664; --paper:#edf2ed; }
body:is([data-room=ogon],[data-room=zemlya],[data-room=vozduh],[data-room=voda]) .primary { border-color:var(--pine); }
body[data-room=ogon] .primary:hover { background:#69391f; }
body[data-room=zemlya] .primary:hover { background:#394a2c; }
body[data-room=vozduh] .primary:hover { background:#28495b; }
body[data-room=voda] .primary:hover { background:#163e41; }
.birth-image { margin:18px 0; border-left:2px solid #b49552;padding:0 0 0 16px; }
.birth-image h3 {font:25px/1.2 var(--serif);margin:5px 0;}
.birth-image .card-detail-link { display:flex;align-items:center;gap:11px;text-align:left;border:0;background:none;padding:2px 0;color:var(--ink); }
.birth-image .card-detail-link img { width:39px;height:auto;border-radius:3px; }
.sample-panel { padding:0 clamp(16px,3vw,35px) 22px; }
.sample-panel h2 { font:400 30px/1.2 var(--serif);margin:0 0 12px; }
.sample-panel .sample-layout { display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);align-items:start;gap:22px; }
.sample-panel .sample-layout .rollup { margin-top:15px; }
.sample-panel .guest-quote { font-size:18px; }
@media(max-width:690px) {
  .element-doors { display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;padding-bottom:5px; }
  .element-door { flex:0 0 85%;scroll-snap-align:start; }
  .element-paging { display:flex;justify-content:space-between; }
  .element-gate { margin-bottom:16px;gap:7px; }
  .sample-panel .sample-layout { grid-template-columns:1fr;gap:12px; }
}

.start-row { display:flex;align-items:center;flex-wrap:wrap;gap:8px 15px;margin-top:19px; }
.start-row .soft { font-size:14px; }
.book-door-row { margin:2px 0 46px; }
.door.library { background:#e7e8df;color:#2a413b;border-color:#a8afa2; }
.door.library .door-art { background:#303d35; }
.library-image { display:block;width:100%;height:auto;border-radius:5px; }
body[data-room=kniga] { --pine:#304d47;--ink:#283e38;--muted:#55655b;--paper:#f5f1e7; }
.book-grid.chapter-ready { grid-template-columns:minmax(0,.85fr) minmax(0,1fr);gap:clamp(24px,4vw,60px); }
.book-panel { border-color:#a49268; }
.book-panel .chapter-origin { margin:0 0 12px;color:var(--muted);font-size:14px; }
.chapter { min-width:0;padding-bottom:4px;color:var(--ink); }
.chapter h2 { margin-bottom:18px; }
.chapter p { margin:12px 0;font:clamp(18px,1.5vw,21px)/1.56 var(--serif);overflow-wrap:anywhere; }
.book-panel .form-field { margin-top:22px; }
.book-panel .rollup { margin-top:14px; }
.book-panel .check { color:var(--muted);font-size:14px; }
.chapter-end { margin-top:24px;border-top:1px solid var(--line);padding-top:18px; }
.chapter-end h2 { font-size:24px; }
.example-chapter .chapter { margin-top:20px; }
.extra-court { margin:20px 0; }
.extra-court h3 { font:24px/1.2 var(--serif); }
.extra-court-pair { display:grid;grid-template-columns:repeat(2,minmax(0,110px));gap:16px;margin:12px 0; }
.extra-court-card { background:transparent;color:var(--ink);border:none;padding:0;text-align:left; }
.extra-court-card img { display:block;width:100%;aspect-ratio:2/3;object-fit:contain;border-radius:5px; }
.extra-court-card span { display:block; }
.extra-card-title { font-weight:600; }
.gate-book { margin-top:20px; }
@media(max-width:690px){
  .book-grid.chapter-ready { grid-template-columns:minmax(0,1fr);gap:24px; }
  .chapter-ready .book-panel { grid-row:1; }
  .book-door-row { margin-bottom:28px; }
}

/* A reader's discovery, kept separate from the guest's own chapter. */
.creation-marginalia {max-width:740px;margin:34px auto 22px;padding:0 20px;border-top:1px solid #c8b17c70;border-bottom:1px solid #c8b17c50;background:#102420d9;color:#e8dcc1;}
.creation-marginalia summary {min-height:72px;padding:15px 0;cursor:pointer;font:18px/1.5 Georgia,serif;}
.creation-marginalia summary::marker {color:#c8b17c;font-size:13px;}
.creation-caption {display:block;margin:0 0 5px 18px;font:10px/1.4 system-ui,sans-serif;letter-spacing:.15em;text-transform:uppercase;color:#cdbb96;}
.creation-title {font:18px/1.5 Georgia,serif;}
.creation-marginalia summary:focus-visible {outline:2px solid #f1c77d;outline-offset:5px;}
.creation-lines {padding:0 0 12px;font:15px/1.75 Georgia,serif;}
.creation-lines p {margin:0 0 13px;}
@media(max-width:600px){.creation-marginalia {margin-top:24px;padding:0 16px;}}
