/* Homepage only: the opening story, the balance scale, and the homepage's type. Loaded by index.html alone. */
html.story .mast,html.story main>section:not(#exhibit),html.story footer{display:none}
html.story .ex{min-height:100vh;min-height:100dvh;border-bottom:0}
body.in-pro{overflow:hidden}

/* type: handwriting for what people say and think, serif for headlines, plain for controls */
.ex h1,main h2,main h3,.toc h3,.onward a{font-family:var(--serif);font-weight:600;letter-spacing:-.02em}
.ex h1{font-size:clamp(44px,6vw,78px);line-height:1.02}
.ex-line{font-family:var(--serif);font-size:clamp(21px,2.1vw,26px);line-height:1.3}
.ex .go,.ex-try,.ex-ch button{font-family:var(--sans);font-weight:700;font-size:18px}
.ex-ch button{font-size:19px}

#prologue{position:fixed;inset:0;height:100vh;height:100dvh;z-index:100;display:flex;flex-direction:column;cursor:pointer;background-color:#191C28;color:#fff;transition:background-color 1.1s ease,color 1.1s ease;padding:calc(62px + env(safe-area-inset-top)) clamp(18px,5vw,64px) calc(20px + env(safe-area-inset-bottom));overflow:auto}
#prologue[hidden]{display:none}
#prologue[data-bg=day]{background-color:#FFF4CC;color:var(--ink)}
#prologue:before{content:"";position:absolute;inset:0;pointer-events:none;opacity:0;transition:opacity 1.1s ease;background-image:radial-gradient(rgba(25,28,40,.09) 1.3px,transparent 1.4px);background-size:14px 14px}
#prologue[data-bg=day]:before{opacity:1}
#proScene{position:relative;flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);gap:clamp(24px,5vw,72px);align-items:center;max-width:1100px;width:100%;margin:0 auto}
.pro-art{display:flex;justify-content:center;align-items:flex-end;gap:4%;min-width:0}
.ai{flex:1 1 0;min-width:0;max-width:min(360px,62vh)}
.ai .chr{animation:breathe 3.4s ease-in-out infinite;transform-origin:50% 100%}
.ai svg{display:block;width:100%;max-height:62vh}
.ai-phone{flex:0 1 44%;max-width:210px}
.ai-k2{transition:opacity .5s ease,transform .5s ease}
[data-scene=app] .pro-art:not(.kid-on) .ai-k2{opacity:0;transform:translateX(14px)}
[data-phone="0"] .ph1,[data-phone="0"] .ph2,[data-phone="1"] .ph2{opacity:0}
.ph1,.ph2{transition:opacity .12s linear}
#prologue .phone text{font-family:var(--sans);font-weight:700}
#prologue .phone .lbl{font-weight:600;opacity:.75}
#prologue .phone .card{fill:#fff;stroke:none}
#prologue[data-bg=night] .phone text.ans{fill:#191C28}
.ai-parent{flex:0 1 40%;max-width:220px}
#prologue .parent{stroke-width:4.2}
.parent .q{opacity:0;transition:opacity .4s ease}
[data-scene=explain] .parent .q{opacity:1}
#prologue .parent .q{font-family:var(--hand);font-size:52px}
.parent .puzzled{display:none}
[data-scene=explain] .parent .puzzled{display:inline}
[data-scene=explain] .parent .smile{display:none}
.clock .min{transform-origin:100px 100px;animation:spin 2.4s linear infinite}
.clock .hr{transform-origin:100px 100px;animation:spin 28.8s linear infinite}
#prologue[data-bg=night] .doodle{stroke:#AEB9FF}
#prologue[data-bg=night] .doodle text{fill:#F4F1EA}
[data-scene=mithra] .ai-m1{animation:enter .7s cubic-bezier(.2,1.2,.5,1) both}
[data-scene=mithra] .ai-m1 .chr{animation:wave 1s .6s ease-in-out 2}
.pro-words{display:flex;flex-direction:column;gap:14px;min-width:0}
.beat{opacity:0;transform:translateY(8px);transition:opacity .35s ease,transform .35s ease}
.beat.on{opacity:1;transform:none}
.pro-cap{font-family:var(--hand);font-weight:700;font-size:clamp(30px,4vw,52px);line-height:1.1;margin:0}
.pro-think{font-family:var(--hand);font-size:clamp(24px,2.8vw,36px);line-height:1.15;color:#FFD94A;margin:0}
.pro-think.strong{font-size:clamp(30px,3.8vw,50px);font-weight:700}
.pro-math{font-family:var(--hand);font-weight:700;font-size:clamp(40px,6vw,72px);line-height:1;color:#FFD94A;margin:0;clip-path:inset(0 100% 0 0);transition:clip-path .9s ease,opacity .1s}
.pro-math.on{clip-path:inset(0 0 0 0)}
#prologue .bub{color:var(--ink);font-family:var(--hand);font-weight:700;font-size:clamp(23px,2.7vw,34px);line-height:1.16;margin:0;background:#fff}
#prologue .bub p{margin:0}
.pro-opts{display:flex;flex-direction:column;gap:10px;align-items:flex-start}
.pro-opts button{font:700 19px/1.25 var(--sans);text-align:left;background:#fff;color:var(--ink);border:3px solid var(--ink);box-shadow:4px 4px 0 #FFD94A;padding:13px 18px;min-height:52px;cursor:pointer;transition:transform .1s,box-shadow .1s}
.pro-opts button:hover{transform:translateY(-2px)}
.pro-opts button:active{transform:translate(3px,3px);box-shadow:1px 1px 0 #FFD94A}
.pro-opts button[aria-pressed=true]{background:#FFD94A}
.pro-reply{font-family:var(--hand);font-size:clamp(21px,2.3vw,28px);line-height:1.2;color:#FFD94A;margin:0;min-height:3.6em}
.pro-ctl{position:relative;display:flex;justify-content:flex-end;align-items:center;gap:18px;max-width:1100px;width:100%;margin:12px auto 0;min-height:56px}
.pro-next{font:700 19px/1.2 var(--sans);background:var(--mark);color:var(--ink);border:3px solid var(--ink);box-shadow:4px 4px 0 #fff;padding:13px 26px;min-height:52px;cursor:pointer;transition:transform .1s,box-shadow .1s}
.pro-next:hover{transform:translateY(-2px)}
.pro-next:active{transform:translate(3px,3px);box-shadow:1px 1px 0 #fff}
#prologue[data-bg=day] .pro-next{box-shadow:4px 4px 0 var(--ink)}
.pro-next.start{font-size:21px}
.pro-back{font:600 17px/1 var(--sans);background:none;border:0;color:inherit;text-decoration:underline;text-underline-offset:4px;cursor:pointer;min-height:44px;margin-right:auto}
.pro-skip{position:absolute;top:calc(12px + env(safe-area-inset-top));right:14px;z-index:2;font:600 16px/1 var(--sans);background:transparent;color:inherit;border:2px solid currentColor;padding:9px 14px;min-height:40px;cursor:pointer}
#prologue :focus-visible{outline:3px solid #7FC8C2;outline-offset:2px}

@keyframes breathe{50%{transform:translateY(-3px) rotate(-.6deg)}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes enter{from{opacity:0;transform:translateX(60px)}}
@keyframes wave{30%{transform:rotate(-5deg)}70%{transform:rotate(5deg)}}
@media (max-width:760px){
  #proScene{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;align-content:center;gap:18px;text-align:center}
  .ai{max-width:min(230px,34vh)}
  .ai svg{max-height:34vh}
  .ai-phone{max-width:min(140px,30vh)}
  .pro-words{align-items:center;gap:10px}
  .pro-opts{align-items:stretch;width:100%}
  .pro-opts button{text-align:center}
  .pro-reply{min-height:3em}
  .pro-ctl{justify-content:flex-end}
}
@media (max-width:880px){.ex.running .sumline{font-size:24px}}
@media (prefers-reduced-motion:reduce){#prologue,#prologue *,.scale *{animation:none!important;transition:none!important}}

.chr.k3{clip-path:polygon(0 0,100% 0,100% 55%,88% 55%,88% 100%,0 100%)}
.pro-next,.pro-back{white-space:nowrap}
@media (max-width:880px){
  .ex.running .scale{height:112px}.ex.running .beam{top:30px}.ex.running .post{top:32px}
  .ex.running .ex-ch{gap:7px;margin-top:6px}
  .ex.running .ex-ch button{font-size:16.5px;padding:8px 12px;min-height:44px}
  .ex.running .reply{margin-top:8px;grid-template-columns:minmax(0,1fr) 64px}
  .ex.running .think{padding:8px 10px}
  .ex.running .bub{padding:10px 13px;margin-bottom:10px}
  .ex.running #prompt{font-size:22px}
  .pro-next.start{font-size:18px;padding:13px 18px}
}
@media (max-width:880px){.ex.running .scale{margin-top:16px}.ex.running .scale.tip .beam{transform:rotate(5deg)}}
