:root { color-scheme: light; --paper: #f3e8cf; --paper-light: #fff8e8; --ink: #392d22; --muted: #6c5942; --line: #ac906559; --blue: #2a5d78; --ochre: #b78437; }
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse at 65% 24%, #fffaf0 0, transparent 66%), repeating-linear-gradient(0deg, #74512504 0, #74512504 1px, transparent 1px, transparent 4px), var(--paper); font-family: Georgia, 'Times New Roman', serif; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; padding: 0.7rem 1.05rem; color: var(--ink); background: transparent; border: 1px solid #a38762; border-radius: 3px; cursor: pointer; }
button:hover { background: #a57c2010; }
button:disabled { opacity: 0.5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
a { color: var(--blue); text-underline-offset: 0.2em; }
[hidden] { display: none !important; }
.notebook-header { min-height: 98px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem clamp(1rem, 3vw, 3.5rem); border-bottom: 1px solid var(--line); }
.wordmark { color: var(--ink); font-size: clamp(1.1rem, 1.6vw, 1.6rem); text-decoration: none; }
.wordmark span { display: block; font: 0.75rem/1.8 system-ui, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.header-actions { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; font: 0.875rem/1.5 system-ui, sans-serif; }
#save-state { color: var(--muted); }
.chapter-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem; padding: 0.6rem 1rem; border-bottom: 1px solid var(--line); }
.chapter-nav button { border: 0; border-bottom: 2px solid transparent; padding: 0.5rem 0.9rem; color: var(--muted); font-size: 0.9rem; }
.chapter-nav button[aria-current='step'] { border-bottom-color: var(--blue); color: var(--blue); }
#story { overflow: hidden; min-height: calc(100dvh - 205px); }
.story-page { display: grid; grid-template-columns: minmax(0, 1.13fr) minmax(0, 0.87fr); max-width: 1640px; margin: 0 auto; min-height: calc(100dvh - 225px); }
.illustration-column { padding: 1.5rem 0 2rem clamp(1rem, 3vw, 3rem); display: flex; flex-direction: column; justify-content: center; min-width: 0; position: relative; }
.folio { margin: 0 1.5rem; display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font: italic 0.95rem/1.5 Georgia, serif; }
.stage { position: relative; width: 100%; aspect-ratio: 1.28; overflow: hidden; }
.stage img { position: absolute; object-fit: contain; pointer-events: none; mix-blend-mode: multiply; }
.stage .case { width: 86%; height: 82%; left: 7%; top: 8%; z-index: 3; }
.stage .plane { width: 72%; height: 53%; left: 10%; top: 0; opacity: 0; z-index: 2; }
.stage .island-art { width: 100%; height: 100%; inset: 0; opacity: 0; }
.stage .plane-front, .stage .plane-back { width: 52%; height: 36%; left: 20%; top: 31%; opacity: 0; z-index: 2; }
.stage .plane-front { clip-path: inset(0 0 0 48%); }
.stage .plane-back { clip-path: inset(0 52% 0 0); }
.stage .companion-case { width: 25%; height: 25%; top: 59%; opacity: 0; z-index: 2; }
.stage .companion-one { left: 11%; transform: rotate(-8deg); }
.stage .companion-two { left: 67%; transform: rotate(9deg); }
.luggage-tag { position: absolute; left: 37%; top: 73%; max-width: 43%; z-index: 5; padding: 0.55rem 0.8rem; background: #faf1dc; border: 1px solid #957345; box-shadow: 2px 3px 0 #60452118; transform: rotate(-5deg); font-style: italic; overflow-wrap: anywhere; font-size: 0.95rem; }
.luggage-tag::before { content: ''; position: absolute; width: 1px; height: 28px; background: #927953; top: -28px; left: 12px; transform: rotate(14deg); }
.stage[data-scene='island'] .island-art { opacity: 0.9; }
.stage[data-scene='island'] .plane-front { opacity: 0.8; transform: translate(10%, 3%) rotate(7deg); }
.stage[data-scene='island'] .plane-back { opacity: 0.8; transform: translate(-7%, -2%) rotate(-5deg); }
.stage[data-scene='island'] .case { width: 34%; height: 35%; top: 55%; left: 35%; }
.stage[data-scene='island'] .luggage-tag { top: 85%; left: 40%; max-width: 45%; font-size: 0.85rem; }
.stage[data-scene='island'] .companion-case { opacity: 0.7; }
.heart { position: absolute; left: 51%; top: 64%; z-index: 6; color: #9d524b; font: 2rem/1 Georgia, serif; opacity: 0; pointer-events: none; }
.sketch-caption { margin: 0 1.5rem 1rem; text-align: center; font-style: italic; color: var(--muted); line-height: 1.6; }
.animation-controls { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; margin: 0 1rem; }
.animation-controls button { font: 0.85rem/1.4 system-ui, sans-serif; border-color: var(--line); }
.animation-status { min-height: 1.5em; text-align: center; color: var(--muted); font-size: 0.875rem; margin: 0.5rem 1rem; }
.question-column { padding: clamp(1.4rem, 3.5vw, 4rem); border-left: 1px solid var(--line); align-self: center; min-width: 0; }
.eyebrow { color: var(--muted); font: 0.75rem/1.7 system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.14em; margin: 0 0 0.9rem; }
h1 { font-size: clamp(2rem, 3.4vw, 3.7rem); font-weight: 400; line-height: 1.12; margin: 0 0 1.3rem; letter-spacing: -0.035em; }
.setup { font-size: clamp(1.1rem, 1.35vw, 1.35rem); line-height: 1.65; margin: 0 0 1.2rem; }
.concept { padding: 0.3rem 0 0.3rem 0.9rem; border-left: 2px solid var(--ochre); font-size: 0.95rem; line-height: 1.65; color: var(--muted); }
.answer-field { display: grid; gap: 0.5rem; margin: 1.4rem 0; line-height: 1.5; }
.answer-field small { color: var(--muted); font: 0.875rem/1.5 system-ui, sans-serif; }
.answer-field textarea, .custom-value input { width: 100%; min-width: 0; resize: vertical; border: 0; border-bottom: 1px solid #9b805c; border-radius: 0; background: #fffaf049; color: var(--ink); padding: 0.8rem; font: 1rem/1.65 Georgia, serif; }
.continue { background: var(--blue); border-color: var(--blue); color: #fff9ed; padding: 0.85rem 1.4rem; }
.continue:hover { background: #214b62; }
.question-actions { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; margin-top: 1.4rem; }
.question-actions a { font-size: 0.9rem; }
.source-note { font: 0.78rem/1.6 system-ui, sans-serif; color: var(--muted); margin-top: 1.5rem; }
.context { border-bottom: 1px solid var(--line); margin: 1.1rem 0; padding-bottom: 0.6rem; }
.context summary { cursor: pointer; color: var(--blue); }
.context p { white-space: pre-wrap; line-height: 1.6; }
.notebook-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; padding: 1rem clamp(1rem, 3vw, 3rem); border-top: 1px solid var(--line); font: 0.8rem/1.6 system-ui, sans-serif; color: var(--muted); }
.notebook-footer label { display: flex; gap: 0.5rem; align-items: center; }
.notebook-footer input { width: 18px; height: 18px; accent-color: var(--blue); }
.save-warning { padding: 1rem; border: 2px solid #a85139; background: #fff3d8; line-height: 1.6; }
.value-stage { position: absolute; inset: 10% 8%; padding: 1.5rem; display: flex; flex-direction: column; justify-content: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.value-stage h2 { font-weight: 400; font-style: italic; text-align: center; font-size: clamp(1.5rem, 2.5vw, 2.5rem); margin: 0 0 1.3rem; }
.value-words { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 0.7rem; }
.value-word { display: block; padding: 0.6rem; font-size: 1.1rem; font-style: italic; border-bottom: 1px solid #a98a56; color: var(--blue); }
.value-word:nth-child(3n) { transform: rotate(-4deg); }.value-word:nth-child(3n + 1) { transform: rotate(3deg); }
.value-words.final .value-word { font-size: clamp(1.6rem, 3vw, 2.9rem); }
.value-margin { margin-top: 2rem; text-align: center; color: var(--muted); font-style: italic; line-height: 1.7; }
.values-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin: 1rem 0; }
.value-option { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.7rem; border: 1px solid var(--line); cursor: pointer; }
.value-option input { width: 19px; height: 19px; flex: 0 0 19px; margin-top: 0.1rem; accent-color: var(--blue); }
.value-option small { display: block; color: var(--muted); font: 0.8rem/1.5 system-ui, sans-serif; margin-top: 0.3rem; }
.value-option:has(input:checked) { border-color: var(--blue); background: #2a5d7810; }
.rounds { display: flex; flex-wrap: wrap; gap: 0.7rem; padding: 0; list-style: none; color: var(--muted); }
.rounds li { padding-bottom: 0.3rem; border-bottom: 2px solid var(--line); }.rounds .active { color: var(--blue); border-color: var(--blue); }.rounds .kept { border-color: var(--ochre); }
.custom-values { font-size: 0.9rem; line-height: 1.6; }.custom-values summary { cursor: pointer; }.custom-value { display: grid; gap: 0.3rem; margin: 0.6rem 0; }
.choice-status { color: var(--blue); line-height: 1.5; }
dialog { width: min(850px, 94vw); max-height: 88dvh; border: 1px solid #9b805c; background: var(--paper-light); color: var(--ink); padding: clamp(1rem, 3vw, 2rem); }
dialog::backdrop { background: #231c17a6; }.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }.dialog-heading h2 { font-weight: 400; }
.record-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }.record-entry { border-top: 1px solid var(--line); padding: 1rem 0; }.record-entry h3 { font-size: 1rem; }.record-entry p { white-space: pre-wrap; line-height: 1.7; }
@media (min-width: 1700px) { .stage { max-height: 690px; } }
@media (max-width: 900px) { .story-page { grid-template-columns: 1fr; }.illustration-column { padding: 1rem; }.stage { max-width: 620px; margin: auto; aspect-ratio: 1.7; }.question-column { border-left: 0; border-top: 1px solid var(--line); padding: 1.5rem; }.notebook-header { flex-wrap: wrap; }.header-actions { gap: 0.6rem; }.chapter-nav { justify-content: flex-start; } }
@media (max-width: 480px) { .header-actions #save-state { flex-basis: 100%; }.stage { aspect-ratio: 1.3; }.values-options { grid-template-columns: 1fr; }.value-stage { padding: 0.6rem; inset: 5%; }.value-word { font-size: 1rem; padding: 0.3rem; }.value-margin { margin-top: 0.7rem; }.luggage-tag { font-size: 0.8rem; }.chapter-nav button { font-size: 0.8rem; padding: 0.4rem 0.6rem; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
