:root{color-scheme:dark;--cream:#ffebcf;--gold:#f4c783;--edge:clamp(24px,6.3vw,122px);font-family:system-ui,sans-serif;background:#192637;color:#fff5e8}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;min-height:100svh;isolation:isolate}
button,input{font:inherit}
button{color:inherit;cursor:pointer}
button:focus-visible,input:focus-visible{outline:2px solid #ffd997;outline-offset:5px}
button:disabled{opacity:.29;cursor:default}
.world,#view,.shade{position:fixed;inset:0;pointer-events:none}
.world{overflow:hidden;z-index:-4;background:#23344a}
.plate{position:absolute;inset:-3%;background:url(assets/valley.webp) center center/cover no-repeat,linear-gradient(169deg,#23344a 31%,#654e55 53%,#faac66 66%,#28372d 79%);transform:translate3d(var(--scenic-x,0px),var(--scenic-y,0px),0) scale(var(--scenic-scale,1));transition:filter .9s;filter:hue-rotate(var(--hue,0deg)) brightness(var(--light,1))}
.glow{position:absolute;inset:0;background:radial-gradient(ellipse at 43% 55%,#ffb55b44,transparent 26%);opacity:.7;mix-blend-mode:screen;animation:sun 11s ease-in-out infinite alternate}
@keyframes sun{to{opacity:.27}}
#view{z-index:-3}
#view canvas{display:block;width:100%;height:100%}
.shade{z-index:-2;background:linear-gradient(90deg,#0b172890 0%,#131a2852 34%,transparent 59%),linear-gradient(0deg,#0b1019b0,transparent 24%)}
header{position:fixed;inset:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:clamp(19px,3.2vh,37px) var(--edge);z-index:2}
.brand{display:flex;gap:13px;align-items:center;border:0;background:transparent;font-size:clamp(16px,1.28vw,24px);padding:0}
.bars{display:flex;gap:2px;align-items:flex-end;height:27px}
.bars b{width:6px;background:#fff5e8;border-radius:2px 0 0;height:36%}
.bars b:nth-child(2){height:68%}.bars b:nth-child(3){height:100%}
.progress{display:flex;align-items:center;gap:16px;font-variant-numeric:tabular-nums;white-space:nowrap}
#steps{display:flex;gap:6px}
#steps button{width:clamp(11px,1.5vw,30px);height:24px;padding:0;border:0;background:none;position:relative}
#steps button::before{content:'';position:absolute;inset:11px 0 auto;height:2px;background:#fff6db62;border-radius:8px}
#steps button[aria-current]::before{height:4px;inset-block-start:10px;background:#fff3df;box-shadow:0 0 9px #ffdc92a6}
main{min-height:100svh;display:flex;align-items:center;padding:90px var(--edge) 120px}
.content{width:min(49vw,850px);text-shadow:0 2px 25px #101520ad}
h1,h2{font-family:Georgia,'Times New Roman',serif;font-weight:400}
h1{font-style:italic;font-size:clamp(47px,6.05vw,121px);letter-spacing:-.064em;line-height:.93;margin:0;color:var(--cream);text-wrap:balance}
body[data-page="0"] h1{font-size:clamp(55px,7.05vw,142px);text-wrap:initial}
#chapter{color:var(--gold);font-size:13px;letter-spacing:.17em;text-transform:uppercase;margin-bottom:20px}
#chapter:empty{display:none}
#summary{font-size:clamp(17px,1.65vw,31px);line-height:1.27;margin:clamp(18px,3vh,34px) 0 0;max-width:29ch}
body[data-page="0"] #summary{max-width:29ch}
#detail{font-size:clamp(15px,1.13vw,22px);line-height:1.45;margin-top:21px;max-width:43ch}
#detail:empty{display:none}
#detail ul{padding:0;margin:0;list-style:none;display:grid;gap:.5em}
#detail li{border-left:1px solid #efbd76a3;padding-left:13px}
#detail strong{color:var(--cream)}
.pill{margin-top:37px;padding:13px 33px;border:1px solid #ffcd81;border-radius:100px;background:#161c25a2;box-shadow:inset 0 0 10px #eea95e37,0 0 18px #fdb55f45;font-size:clamp(17px,1.4vw,24px);font-weight:600}
.pill span{margin-left:10px}
.pill:hover,footer button:hover{background-color:#8764418c}
.certificate-label{position:fixed;display:none;transform:translate(-50%,-50%);font:italic 600 clamp(13px,2.03vw,42px) Georgia,serif;color:#55351d;letter-spacing:.075em;text-shadow:0 1px 1px #ffdfa0;pointer-events:none;white-space:nowrap}
footer{position:fixed;inset:auto 0 0;display:flex;align-items:center;justify-content:space-between;padding:0 max(20px,3vw) max(20px,4vh);z-index:2;pointer-events:none}
footer button{pointer-events:auto}
.tools,.arrows{display:flex;gap:8px}
.tools button,.arrows button{display:grid;place-items:center;border-radius:50%;width:45px;height:45px;border:1px solid #ffefd257;background:#312b26a8;backdrop-filter:blur(12px);font-size:22px;padding:0}
.arrows button{width:clamp(52px,4.7vw,90px);height:clamp(52px,4.7vw,90px);font-size:clamp(23px,2.4vw,43px)}
.hint{border:0;background:none;display:grid;gap:8px;justify-items:center;position:absolute;left:50%;bottom:2.8vh;transform:translateX(-50%);font-size:14px;text-shadow:0 2px 8px #000}
.hint i{width:20px;height:32px;border:1px solid;border-radius:20px;position:relative}
.hint i:before{content:'';position:absolute;width:1px;height:9px;background:currentColor;left:9px;top:6px}
.hint b{font-size:22px;font-weight:400}
#calculator{margin-top:20px;max-width:480px}
#calculator label{display:flex;justify-content:space-between;gap:10px}
#calculator input{width:100%;accent-color:#edb970;margin:13px 0 18px}
.calculation{display:flex;gap:clamp(15px,3vw,52px);border-top:1px solid #e7b77683;padding-top:13px}
.calculation small{display:block;margin-bottom:4px}
.calculation strong,.calculation output{font:clamp(19px,2.15vw,35px) Georgia,serif;color:var(--cream)}
dialog{color:#fff5e8;background:#1b2431;border:1px solid #bb9465;border-radius:16px;width:min(90vw,630px);padding:30px}
dialog::backdrop{background:#07111cbb;backdrop-filter:blur(8px)}
dialog form{float:right} dialog button{border:0;background:none;font-size:25px}
dialog small{color:var(--gold);letter-spacing:.12em} dialog h2{font-size:32px;margin-bottom:10px} dialog p{line-height:1.6}
#status{position:fixed;left:20px;bottom:85px;font-size:14px}
body[data-motion="off"] .glow{animation:none}
@media(max-width:720px){
  .plate{background-position:60% center}
  .shade{background:linear-gradient(0deg,#0d1520fa 4%,#101725df 30%,#1219275c 61%,#10192835 77%,#0b1523ae)}
  header{padding:19px var(--edge)}
  .progress{gap:7px;font-size:13px}#steps{gap:2px}#steps button{width:8px}
  .bars{height:20px}.brand{gap:7px}
  main{align-items:flex-start;padding:clamp(260px,45svh,450px) var(--edge) 95px}
  .content{width:100%}
  h1{font-size:clamp(43px,10vw,62px);text-wrap:initial}
  body[data-page="0"] h1{font-size:clamp(51px,12vw,75px)}
  #chapter{margin-bottom:10px;font-size:11px}
  #summary{margin-top:14px;font-size:17px;max-width:34ch}
  #detail{margin-top:13px}
  .pill{margin-top:21px;padding:11px 24px}
  footer{padding:14px 20px max(14px,env(safe-area-inset-bottom));background:linear-gradient(0deg,#0c131edb,transparent)}
  .hint{display:none}.tools button{width:44px;height:44px}.arrows button{width:49px;height:49px}
  .certificate-label{font-size:clamp(13px,4vw,23px)}
}
@media(max-width:720px) and (max-height:740px){main{padding-top:34svh}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
@media(min-width:721px){
  body[data-page="0"] .content{position:relative;transform:translateY(-4.5vh)}
  body[data-page="0"] h1::before{content:'';position:absolute;pointer-events:none;left:8%;top:-1%;width:86%;height:47%;border:1.5px solid transparent;border-right-color:#ffe0a2;border-bottom-color:#f4bf7bbf;border-radius:50%;transform:rotate(-16deg);z-index:-1}
  body[data-page="0"] h1::after{content:'✦';position:absolute;left:85%;top:17%;font:clamp(22px,3vw,54px) Georgia,serif;color:#ffdda0}
  body[data-page="0"] h1{isolation:isolate}
  body[data-page="0"] #prev{visibility:hidden}
}
@media(max-width:720px){
  body{touch-action:pan-y}
}
.demo{margin-top:clamp(18px,3vh,35px);max-width:560px}
#demo-label{margin:0 0 10px;color:var(--gold);font-size:clamp(13px,1vw,17px);font-weight:600}
#demo-options{display:flex; flex-wrap:wrap;gap:7px}
#demo-options button{min-height:40px;border:1px solid #ecc28b70;border-radius:40px;background:#101b27ad;padding:7px 15px;font-size:clamp(13px,1vw,17px)}
#demo-options button:hover{border-color:#ffd99a}
#demo-options button[aria-pressed="true"]{color:#23190f;background:#f3c98d;border-color:#fce1b2;text-shadow:none}
.demo-result{margin-top:18px;border-left:1px solid #edc188aa;padding-left:14px}
.demo-result:has(strong:empty){display:none}
.demo-result strong{display:block;color:var(--cream);font:italic clamp(27px,3.1vw,55px)/1 Georgia,serif;letter-spacing:-.035em}
.demo-result p{max-width:44ch;margin:8px 0 0;font-size:clamp(15px,1.1vw,20px);line-height:1.4}
@media(max-width:720px){
  body:not([data-page="0"]):not([data-page="7"]) main{padding-top:37svh}
  .demo{margin-top:15px}
  #demo-label{margin-bottom:6px}
  #demo-options button{min-height:42px;padding:6px 11px}
  .demo-result{margin-top:11px}
}
#scene-labels{position:fixed;inset:0;pointer-events:none}
#scene-labels span{position:absolute;transform:translate(-50%,-50%);padding:3px 10px;color:#ffe6bc;background:#19222de0;border:1px solid #efc08061;border-radius:24px;font-size:clamp(12px,.83vw,16px);line-height:1.2;white-space:nowrap}
#steps button::before{transition:height .24s ease,background-color .3s ease,box-shadow .3s ease;transform-origin:left center}
#steps button[aria-current]::before{animation:chapter-mark .68s cubic-bezier(.12,.69,.17,1) both}
@keyframes chapter-mark{from{transform:scaleX(.25);opacity:.45}to{transform:scaleX(1);opacity:1}}
.pill,footer button:not(.hint),#demo-options button{transition:transform .26s cubic-bezier(.2,.75,.2,1),background-color .22s ease,border-color .22s ease,box-shadow .22s ease}
@media(hover:hover){
  .pill:hover,.arrows button:enabled:hover{transform:translateY(-3px)}
}
button:active:not(:disabled){transform:translateY(1px) scale(.97)}
body[data-motion="off"] #steps button::before,body[data-motion="off"] button{animation:none!important;transition:none!important}
.articles-back{display:grid;place-items:center;width:45px;height:45px;border:1px solid #ffefd257;border-radius:50%;background:#312b26a8;color:inherit;text-decoration:none;pointer-events:auto;font-size:23px}
.articles-back:hover{background:#8764418c}
.articles-back:focus-visible{outline:2px solid #ffd997;outline-offset:4px}
@media(max-width:370px){footer .tools{gap:5px}.articles-back,footer .tools button{width:39px;height:39px}}
