/* PeatLogic 0.5 — local geometric identity, progressive enhancement, guided steps. */
:root {
  --background: #f6f4eb; --surface: #fffef9; --text: #1f3830;
  --primary: #153e33; --secondary: #3d6554; --water: #246174;
  --peat: #76523b; --gold: #d5b575; --success: #245c3d;
  --warning: #76531d; --danger: #91372c; --border: #ced3c5;
  --dayak-pattern: url('./motif.svg');
  --paper: var(--background); --ink: var(--text); --forest: var(--primary);
  --soft: var(--secondary); --line: var(--border); --muted: #526258;
  --ornament: var(--dayak-pattern);
}
.journey-ui { background: var(--background); }
.journey-ui a:hover { color: var(--water); }
.journey-ui .button:hover { color: #fff; }
.journey-ui .button.secondary:hover,.journey-ui .button.gold:hover { color: var(--primary); }
.journey-ui .eyebrow { color: var(--secondary); }
.journey-ui .journey-header { border-bottom: 3px solid var(--primary); }
.journey-header:after { content:""; position:absolute; height:6px; bottom:-9px; inset-inline:0; background:var(--dayak-pattern) repeat-x center/96px 16px; }
.journey-header .brand { letter-spacing: -.04em; }
.journey-ui .primary-nav > a[aria-current] { background:#e7ecdf; color:#173d31; border:0; box-shadow:inset 0 -3px #9f7839; padding-inline:10px; }
.journey-ui .main-content,.journey-ui .public-main { min-width:0; width:100%; }
.journey-ui .reader-tools { width:100%; padding-top:17px; }
.journey-ui .reader-tools .quiet { font-size:.8rem; }
.journey-ui .app-footer { width:100%; }
.journey-ui .card { background:var(--surface); }
.journey-ui .button { font-size:.95rem; min-height:46px; }
.journey-ui .small-link { font-size:.85rem; display:inline-flex; align-items:center; min-height:44px; }
.journey-ui .notice { font-size:.92rem; }
.journey-ui .tag { font-size:.75rem; }
.journey-ui .quiet:disabled,.journey-ui .button:disabled { cursor:not-allowed; }
.journey-ui :focus-visible { outline:3px solid #2b748b; outline-offset:4px; }
.journey-ui .brand-symbol { color:#fff; }
.journey-ui .brand-symbol .icon { color:inherit; }
.level-heading { padding:0 0 26px; margin:0 0 26px; position:relative; }
.level-heading:after,.ornament-divider { content:""; display:block; height:16px; background:var(--dayak-pattern) repeat-x left center/96px 16px; margin-top:24px; max-width:384px; }
.level-heading h1 { font-size:clamp(1.9rem,3.5vw,3rem); max-width:850px; }
.level-heading .eyebrow { margin-bottom:10px; }
.learning-hero { border-radius:4px; min-height:350px; }
.learning-hero:after { height:16px; background:var(--dayak-pattern) repeat-x center/96px 16px; z-index:3; }
.journey-ui .learning-hero .eyebrow { color:var(--gold); }
.learning-hero-copy { padding:36px 40px 42px; }
.learning-hero h1 { font-size:clamp(2rem,3.4vw,3rem); }
.learning-hero .current-learning { font-size:.9rem; margin-bottom:16px; color:#f4efde; }
.learning-hero .current-learning strong { display:block; }
.learning-hero .identity-strip { font-size:.8rem; }
.learning-hero-art:after { content:""; position:absolute; top:0; right:24px; width:32px; height:100%; background:var(--dayak-pattern) repeat-y center/192px 32px; opacity:.55; }
.progress-ribbon { margin-bottom:24px; }
.progress-ribbon p { font-size:.86rem; }
.journey-map { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:1fr 1fr; column-gap:48px; }
.milestone { display:grid; grid-template-columns:40px minmax(0,1fr) auto; gap:18px; align-items:center; padding:22px 0; border-bottom:1px solid var(--border); min-width:0; position:relative; }
.milestone-mark { width:36px; height:36px; display:grid; place-items:center; background:#e6e9dd; border:1px solid #bbc6b3; color:#536150; font-size:.78rem; }
.milestone.done .milestone-mark { background:var(--primary); color:white; border-color:var(--primary); }
.milestone.current .milestone-mark { background:var(--gold); color:var(--primary); border-color:#ac8742; box-shadow:0 0 0 4px #ece6d3; }
.milestone strong { font-size:1.05rem; }
.milestone p { margin-top:4px; font-size:.9rem; }
.milestone small { display:block; margin-top:5px; color:#56654e; font-size:.75rem; }
.milestone.current small { color:#624c22; font-weight:600; }
.milestone.locked { color:#637061; }
.milestone.locked>.icon { color:#6e7b6a; width:18px; }
.milestone:last-child { grid-column:1/-1; }
.help-strip { display:flex; align-items:center; gap:20px; border-block:1px solid var(--border); padding:22px 0; margin-top:35px; }
.help-strip p { margin:0; flex:1; font-size:.92rem; }
.learn-resume { display:flex; justify-content:space-between; align-items:center; gap:24px; padding:24px 0; }
.learn-resume h2 { font-size:1.4rem; }
.learn-resume .eyebrow { margin-bottom:8px; }
.guide-instructions { list-style:none; counter-reset:guide; padding:0; margin:30px 0; }
.guide-instructions li { counter-increment:guide; padding:24px 0 24px 64px; border-bottom:1px solid var(--border); position:relative; }
.guide-instructions li:before { content:counter(guide,decimal-leading-zero); position:absolute; left:0; top:24px; color:#816430; font-size:1.3rem; font-family:Georgia,serif; }
.guide-instructions h2 { font-size:1.25rem; }
.guide-reminder { border-left:4px solid #927340; }
.menu-guide dl { display:grid; grid-template-columns:120px 1fr; gap:12px 20px; }
.menu-guide dt { font-weight:600; }
.menu-guide dd { margin:0; color:var(--muted); }
.guide-page:before,.policy-page:before { content:""; display:block; height:20px; background:var(--dayak-pattern) repeat-x center/120px 20px; margin-bottom:28px; }
.journey-ui .auth-story { border-left:20px solid var(--gold); border-image:var(--dayak-pattern) 16 repeat; position:relative; }
.auth-story:after { content:""; position:absolute; inset-inline:24px; bottom:25px; height:32px; background:var(--dayak-pattern) repeat-x; }
.journey-ui .auth-form h1:after { content:""; display:block; width:144px; height:12px; background:var(--dayak-pattern) repeat-x left/72px 12px; margin:16px 0; }
/* Opening: final copy and start action exist in the server HTML, without JS. */
.opening-page .workspace { min-height:0; }
.opening-page .reader-tools { position:static; background:#133b31; padding:12px 5%; max-width:none; color:#fff; }
.opening-page .reader-tools>div { margin-left:auto; }
.opening-page .reader-tools .quiet { color:#faf6e8; }
.cinematic { min-height:calc(100svh - 148px); height:auto; max-height:none; padding:32px 7% 26px; display:flex; flex-direction:column; isolation:isolate; }
.cinema-landscape { z-index:0; pointer-events:none; }
.cinematic:before { z-index:1; pointer-events:none; background:linear-gradient(90deg,#082a24f5 0%,#123c34b8 48%,#153b3240 100%); }
.cinematic:after { content:""; position:absolute; top:0; bottom:0; right:3%; width:32px; background:var(--dayak-pattern) repeat-y center/192px 32px; opacity:.5; z-index:1; pointer-events:none; }
.cinema-top,.cinema-bottom { position:relative; inset:auto; z-index:2; }
.cinema-top { font-size:.68rem; align-items:flex-start; max-width:none; }
.cinema-top>a { font-size:.85rem; }
.cinema-stories { position:relative; inset:auto; transform:none; z-index:2; padding:30px 0 15px; max-width:650px; flex:1; display:flex; align-items:center; min-height:330px; }
.cinema-stories h1 { font-size:clamp(1.6rem,3vw,2.8rem); letter-spacing:.06em; display:flex; align-items:center; gap:18px; margin:18px 0; }
.opening-symbol { width:48px; height:48px; display:grid; place-items:center; border:1px solid var(--gold); color:var(--gold); }
.opening-symbol>.icon { width:32px; height:32px; }
.cinema-stories h2,.cinema-stories .opening-tagline { font-family:Georgia,serif; font-weight:400; font-size:clamp(2rem,4vw,3.7rem); line-height:1.16; color:#fff6e3; letter-spacing:-.035em; margin:16px 0; max-width:660px; }
.cinema-stories p { font-size:1rem; }
.journey-ui .cinema-stories .eyebrow { color:var(--gold); }
.cinema-actions { position:relative; z-index:2; padding-bottom:26px; }
.cinema-actions p { font-size:.85rem; color:#e1e9dd; margin-top:12px; }
.cinema-actions a:not(.button) { color:#f1d79f; text-decoration:underline; }
.cinema-bottom { padding-top:20px; border-top:1px solid #b1c1a740; font-size:.68rem; flex-wrap:wrap; }
.cinema-bottom .quiet { min-height:44px; }
.cinema-fire { opacity:0; transition:opacity 1.8s; }
.cinematic[data-stage="1"] .water-scene { opacity:.15; }
.cinematic[data-stage="1"] .land-scene,.cinematic[data-stage="2"] .land-scene { fill:#634e39; }
.cinematic[data-stage="2"] .cinema-fire { opacity:.8; }
.cinematic[data-stage="2"] .cinema-smoke { opacity:.55; }
.cinema-stories article { animation:none; }
/* Single main stage. Micro-readings, exploratory diagrams and activities stay separate. */
.guided-page .main-content { padding-bottom:150px; }
.guided-page .app-footer { padding-bottom:130px; }
.step-progress ol { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; list-style:none; padding:0; margin:0 0 32px; }
.step-progress li { min-width:0; border-bottom:3px solid #cbd1c2; }
.step-progress li>a,.step-progress li>div { display:flex; flex-wrap:wrap; gap:6px 12px; align-items:center; min-height:74px; padding:10px; }
.step-progress strong { flex:1; font-size:.9rem; }
.step-progress small { font-size:.7rem; width:100%; padding-left:36px; color:#606e5c; }
.step-progress li span { background:#e4e8dd; width:25px; height:25px; display:grid; place-items:center; font-size:.75rem; flex-shrink:0; }
.step-progress .selected { border-color:#9a743a; background:#eee9d7; }
.step-progress .selected span { color:white; background:var(--primary); }
.step-progress .complete { border-color:var(--primary); }
.step-progress .complete span { background:var(--primary); color:white; }
.learning-stage { max-width:850px; margin-inline:auto; }
.micro-meta { display:flex; align-items:start; gap:20px; justify-content:space-between; font-size:.82rem; padding-bottom:14px; border-bottom:1px solid var(--border); }
.micro-meta>span { padding-top:10px; }
.micro-meta details { max-width:65%; }
.micro-meta li { padding:6px 0; }
.micro-meta a { text-decoration:underline; }
.micro-reading { position:relative; padding:25px 0; }
.micro-index { display:block; font-family:Georgia,serif; font-size:2rem; color:#8b7444; margin-bottom:16px; }
.micro-reading h2 { font-size:clamp(1.7rem,3.5vw,2.4rem); max-width:730px; }
.micro-reading>p { font-size:1.1em; line-height:1.8; max-width:740px; margin-top:22px; }
.learning-stage .form-stack { gap:24px; }
.learning-stage .explorer { max-width:650px; width:100%; margin-inline:auto; }
.ecosystem-links { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.ecosystem-links details { border-top:2px solid var(--water); padding-top:8px; }
.ecosystem-links p { font-size:.9rem; }
.causal-nodes details:not(:last-child):after { content:"↓"; display:block; text-align:center; color:var(--water); }
.solution-comparison { display:grid; grid-template-columns:1fr 1fr; gap:20px 32px; }
.solution-comparison article { border-top:3px solid #ad9156; padding-top:22px; }
.solution-comparison h3 { font-size:1.3rem; }
.solution-comparison dt { color:var(--primary); font-weight:600; margin-top:16px; font-size:.85rem; }
.solution-comparison dd { margin:6px 0 0; color:var(--muted); font-size:.92rem; }
.guided-activity { border-top:1px solid var(--border); padding-top:28px; }
.guided-activity .eyebrow { margin-bottom:18px; }
.next-hint { font-size:.88rem; background:#e8eddf; padding:12px; }
.quiz-step { padding:30px 0; }
.quiz-step p { max-width:630px; }
.quiz-step .button { margin-top:24px; }
.inline-glossary { margin:30px 0 20px; padding-top:20px; border-top:1px solid var(--border); font-size:.85rem; }
.inline-glossary>div { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.term-button { display:inline-flex; min-height:44px; align-items:center; padding:6px 12px; border:1px solid #aebfac; border-radius:3px; color:var(--water); background:#fdfef9; text-decoration:underline; text-underline-offset:4px; }
.journey-ui dialog p { font-size:1rem; line-height:1.8; }
.bottom-actions { position:fixed; z-index:45; bottom:16px; left:50%; transform:translateX(-50%); width:calc(100% - 64px); max-width:1176px; display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:24px; border:1px solid #becab8; border-top:4px solid #997d40; padding:14px 18px; background:#fffdf3; box-shadow:0 4px 18px #17352b24; }
.bottom-actions>.button:first-child { justify-self:start; }
.bottom-actions>.button:last-child { justify-self:end; }
.bottom-actions>div { text-align:center; }
.bottom-actions strong,.bottom-actions small { display:block; }
.bottom-actions small { font-size:.64rem; letter-spacing:.12em; }
.bottom-actions strong { font-size:.85rem; }
.guided-page .music-feedback:not(:empty),.guided-page .network-notice { bottom:120px; }
.journey-ui .certificate-border { background:#fffdf4; border:2px solid #a88945; }
.certificate-border:before,.certificate-border:after { content:""; display:block; height:16px; background:var(--dayak-pattern) repeat-x center/96px 16px; }
.certificate-border:before { margin-bottom:24px; }
.certificate-border:after { margin-top:18px; }
.certificate-sheet .brand-symbol { background:var(--primary); }
/* A slow transition never masks the current content. */
.journey-ui .transition-screen { position:fixed; top:auto; bottom:0; left:0; right:0; padding:12px 20px; height:auto; background:#153e33; color:white; z-index:150; border-top:3px solid var(--gold); box-shadow:none; }
.journey-ui .transition-screen .skeleton-head,.journey-ui .transition-screen .skeleton-row,.journey-ui .transition-screen .skeleton-body { display:none; }
.journey-ui .transition-screen p { color:white; margin:0; text-align:center; font-size:.9rem; }
@media(max-width:900px) {
  .journey-map { column-gap:25px; }
  .learning-hero-copy { padding:30px 25px 40px; }
  .step-progress strong { font-size:.8rem; }
  .step-progress li>a,.step-progress li>div { align-items:start; }
  .bottom-actions { width:calc(100% - 40px); gap:12px; }
}
@media(max-width:600px) {
  .journey-ui .reader-tools>div { flex-wrap:wrap; gap:5px 14px; }
  .journey-ui .reader-tools .quiet { font-size:.76rem; }
  .journey-ui .main-content { padding-inline:18px; }
  .journey-ui .primary-nav>a { min-height:48px; }
  .journey-map { grid-template-columns:1fr; }
  .milestone { padding:19px 0; gap:12px; grid-template-columns:36px minmax(0,1fr) auto; }
  .milestone p { font-size:.88rem; }
  .milestone .small-link { font-size:.8rem; }
  .help-strip { flex-wrap:wrap; align-items:flex-start; }
  .help-strip>a { margin-left:42px; }
  .learn-resume { display:block; padding:0 0 24px; }
  .learn-resume .button { margin-top:20px; width:100%; }
  .learning-hero h1 { font-size:2rem; }
  .learning-hero .identity-strip { font-size:.75rem; }
  .learning-hero .button { width:100%; }
  .level-heading { margin-bottom:12px; padding-bottom:12px; }
  .level-heading:after { margin-top:18px; }
  .level-heading p { font-size:.94rem; }
  .step-progress ol { gap:5px; margin-bottom:24px; }
  .step-progress li>a,.step-progress li>div { display:block; padding:8px 4px; min-height:100px; }
  .step-progress li span { margin-bottom:9px; }
  .step-progress strong { display:block; font-size:.73rem; line-height:1.4; }
  .step-progress small { padding:0; font-size:.64rem; }
  .ecosystem-links,.solution-comparison { grid-template-columns:1fr; }
  .micro-meta details { max-width:70%; }
  .micro-reading>p { font-size:1rem; }
  .bottom-actions { bottom:0; left:0; transform:none; width:100%; grid-template-columns:auto 1fr; gap:8px; padding:10px 14px max(12px,env(safe-area-inset-bottom)); }
  .bottom-actions>div { grid-column:1/-1; grid-row:1; display:flex; justify-content:space-between; align-items:center; }
  .bottom-actions>div small { font-size:.63rem; }
  .bottom-actions>div strong { font-size:.8rem; }
  .bottom-actions>.button { padding:10px 12px; font-size:.8rem; }
  .bottom-actions>.button:last-child { width:100%; justify-self:stretch; }
  .guided-page .main-content { padding-bottom:125px; }
  .guided-page .app-footer { padding-bottom:125px; }
  .journey-ui .auth-wrap { margin:0; padding:0; }
  .journey-ui .auth-form { padding:24px 18px; }
  .journey-ui .auth-story { display:none; }
  .menu-guide dl { grid-template-columns:1fr; gap:8px; }
  .menu-guide dd { margin-bottom:10px; }
  .guide-instructions li { padding-left:46px; }
  .opening-page .reader-tools { padding:12px 6%; }
  .cinematic { padding:24px 7% 20px; min-height:calc(100svh - 140px); }
  .cinema-top { flex-direction:row; font-size:.55rem; gap:14px; }
  .cinema-top>a { font-size:.78rem; white-space:nowrap; }
  .cinema-stories { min-height:320px; padding:28px 0 14px; }
  .cinema-stories h1 { font-size:1.55rem; gap:12px; }
  .cinema-stories h2,.cinema-stories .opening-tagline { font-size:2.25rem; line-height:1.15; }
  .cinema-stories p { font-size:.94rem; }
  .cinema-actions .button { width:100%; }
  .cinema-actions { padding-bottom:20px; }
  .cinema-bottom { font-size:.58rem; gap:8px; padding-top:15px; }
  .cinematic:after { width:16px; right:2%; background-size:96px 16px; opacity:.4; }
  .journey-ui dialog { width:calc(100% - 28px); max-height:85dvh; overflow-y:auto; }
  .reference-card { grid-template-columns:minmax(0,1fr) 44px; }
  .journey-ui .bookmark-button { min-width:44px; min-height:44px; }
  .question legend { flex-wrap:wrap; }
  .question legend>span:last-child { flex:1; min-width:200px; }
  .form-stack,.form-stack label { min-width:0; }
  .journey-ui .two-grid { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:360px) {
  .journey-header { gap:6px; padding-inline:12px; }
  .journey-header .brand { font-size:18px; }
  .bottom-actions>.button:first-child span { display:none; }
  .step-progress strong { font-size:.68rem; }
  .cinema-top { flex-wrap:wrap; }
}
@media(prefers-reduced-motion:reduce) { .cinema-fire { transition:none; } }
@media print { .bottom-actions { display:none; } .certificate-border:before,.certificate-border:after { print-color-adjust:exact; } .guided-page .main-content { padding-bottom:0; } }

html:has(body.large-text) { font-size:112.5%; }
.guided-page input,.guided-page textarea,.guided-page summary { scroll-margin-block:120px 170px; }
.low-data .cinema-fire { transition:none; }
.journey-ui .transition-screen .skeleton-head { display:block; width:130px; height:5px; margin:0 auto 8px; background:#739787; border-radius:2px; }
