@font-face{font-family:"Willowmere Kai SC";src:url("type/academy-kai-sc.woff2") format("woff2");font-weight:500;font-display:swap}
@font-face{font-family:"Willowmere Kai TC";src:url("type/academy-kai-tc.woff2") format("woff2");font-weight:500;font-display:swap}
@font-face{font-family:"Willowmere Serif SC";src:url("type/academy-serif-sc.woff2") format("woff2");font-weight:500;font-display:swap}
@font-face{font-family:"Willowmere Serif TC";src:url("type/academy-serif-tc.woff2") format("woff2");font-weight:500;font-display:swap}
html:lang(zh-Hans){
  --jp:"Willowmere Serif SC","Songti SC","Noto Serif CJK SC","SimSun",serif;
  --heading-zh:"Willowmere Kai SC","Kaiti SC","KaiTi",var(--jp);
}
html:lang(zh-Hant){
  --jp:"Willowmere Serif TC","Songti TC","Noto Serif CJK TC","PMingLiU",serif;
  --heading-zh:"Willowmere Kai TC","Kaiti TC","DFKai-SB",var(--jp);
}
html:lang(en){--jp:Georgia,"Times New Roman",serif}
.locale-picker{display:inline-flex;align-items:center;line-height:1.1;white-space:nowrap;color:inherit}
.locale-picker select{cursor:pointer;color:inherit;border:0;border-bottom:1px solid currentColor;border-radius:0;background:transparent;font:600 clamp(12px,.98vw,17px)/1.2 var(--jp,Georgia,serif);padding:6px 0;min-height:32px;max-width:8.5em}
.locale-picker select option{background:#f4ead4;color:#392e23;font-family:system-ui,sans-serif}
.locale-picker select:focus-visible{outline:2px solid currentColor;outline-offset:3px}
.gate-language{position:absolute;right:max(3.5vw,16px);top:max(2.6vh,12px);z-index:2;background:var(--grain),#f4ead8e8;padding:0 .55em;box-shadow:1px 1px 0 #a4967d}
.campus-actions{display:flex;align-items:center;gap:clamp(6px,1.3vw,24px)}
.school-name b,.map-header h2 b,.book-tab strong{font:inherit}
html:lang(en) .letter-label{letter-spacing:0}
html:lang(en) .landmark span,html:lang(en) .landmark small{letter-spacing:0}
@media(max-width:680px) and (orientation:portrait){
  .campus-actions{flex-direction:column-reverse;gap:0}
  .campus-actions #backTitle{min-height:26px;font-size:12px}
  .gate-language{top:9px;right:10px}
  .locale-picker select{font-size:12px;min-height:29px}
  .mast,.lesson>header{gap:6px}
  .mast nav,.lesson>header nav{gap:5px}
  html:lang(en) .landmark span{font-size:clamp(11px,3.2vw,16px)}
  html:lang(en) .map-header h2{letter-spacing:0}
  html:lang(en) .map-header h2 span{display:block;margin:.15em 0 0;padding:0;border:0}
}


html:is(:lang(zh-Hans),:lang(zh-Hant),:lang(en)){font-family:var(--jp)}

/* Keep translated marginal notes upright. Their Latin originals use Fell Italic. */
html:lang(zh) :is(.en[data-i18n],i[data-i18n],.letter-script,.field-note i,
  .folioNo span,.lesson-cue-heading [lang=en],#notes>i,.locale-picker select option){
  font-family:var(--jp);
  font-style:normal;
}
html:lang(zh) #spellReading:lang(zh){font-family:var(--jp)}
html:lang(zh) :is(.school-name,.school,.brand,.map-header h2,.letter-label,
  .landmark span,.stamp-page h3,#letter h1,#bookTitle,#ending h2,#guide h2,
  .flight-title h1,#flightDiploma h2,#flightNotes h2,#notes h2){
  font-family:var(--heading-zh);
  font-weight:500;
}
html:lang(zh) .instructions p,html:lang(zh) .lesson-cue p{line-height:1.55}
html:lang(zh) :is(#guide,#flightNotes,#notes) :is(p,dd){line-height:1.75}
/* Even a small angle blurs the fine horizontal strokes of small Song text. */
html:lang(zh) #letter{transform:translateY(-50%)}
@media(min-width:681px) and (min-height:621px){
  html:lang(zh) #letter :is(.invitation,blockquote){font-size:clamp(13px,1vw,19px);line-height:1.7}
}
@media(max-width:640px) and (orientation:portrait){
  html:lang(zh) #letter{transform:none}
}
@media(max-width:680px) and (orientation:portrait){
  html:lang(zh) #letter .invitation,html:lang(zh) #letter blockquote{font-size:12px;line-height:1.55}
  html:lang(zh) :is(.flower-language,.sense-line,.lesson-device output){font-size:10px}
  html:lang(zh) :is(.flight-book .mast nav button,.mast nav button,.flight-book .mast nav a){font-size:12px}
}
@media(max-width:680px) and (orientation:portrait){
  #book,.flight-book{grid-template-columns:minmax(0,1fr)}
  body:not(.clean) #book,.flight-page:not(.plate-only) .flight-book{grid-template-rows:auto minmax(0,1fr) auto}
  .mast{display:grid;grid-template-columns:minmax(0,1fr);gap:0;padding:3px 3px 4px}
  .mast .brand{width:fit-content;max-width:calc(100% - 82px);letter-spacing:.025em}
  .mast .running{display:none}
  .mast nav,.flight-book .mast nav{justify-content:flex-end;gap:clamp(8px,3vw,18px)}
  .mast nav .locale-picker{position:absolute;right:3px;top:2px}
  #book footer,.flight-book footer{min-width:0}
  .instructions,.lesson-cue{min-width:0}
}
