/* Polish (Nov 26): quieter ornaments, cleaner labels, slow motion. Loaded last on the public pages, the pitch and track pages included.
   Undo: remove the polish.css / polish.js lines from each page (copies in backups/before-polish-nov26). */

/* 1. Pages cross-fade into each other (browsers that support it; others just load as before) */
@view-transition{navigation:auto}
::view-transition-old(root),::view-transition-new(root){animation-duration:.4s;animation-timing-function:cubic-bezier(.22,.61,.36,1)}
@media (prefers-reduced-motion:reduce){::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation:none!important}}
html[data-a11y-calm]::view-transition-group(*),html[data-a11y-calm]::view-transition-old(*),html[data-a11y-calm]::view-transition-new(*){animation:none!important}

/* 2. Small gold labels in a clean sans, like a jeweller's tag (only when no Reading help font is chosen) */
html:not([data-a11y-font]) .crest{font:500 11px/1 var(--sans)!important;letter-spacing:.2em!important}
/* A label stays on one line. Its gold lines are 44px where there is room and give way on a narrow phone,
   so a long label neither wraps nor pushes the page wider than the screen. */
.crest{white-space:nowrap}
.crest::before,.crest::after{flex:1 1 0;width:auto;max-width:44px}
@media (max-width:349px){.crest::before,.crest::after{display:none!important}}   /* too narrow for lines: the label stands alone */

/* 3. One ornament per title: the gold lines beside the label stay, the short rule under the title goes */
.learnpage .learn-h1::after{display:none}
.learnpage .learn-h1{margin-bottom:28px!important}

/* 4. The two doors: no gold tab on top, more room inside */
.door::before{display:none}

/* 5. More air between sections on the reading pages */
.learnpage .sec{padding:64px 0!important}
@media (max-width:640px){.learnpage .sec{padding:48px 0!important}}

/* 6. Header: no line at the top of the page; a hairline fades in once you scroll */
.home header{transition:border-color .5s,background-color .5s}
html:not(.scrolled) body.home header{border-bottom-color:transparent!important}

/* 7. Reading help: a quiet round button; its name slides out on hover and keyboard focus */
@media (min-width:601px){
  #a11y-toggle{gap:0;padding:0 12px;border-color:var(--line);transition:box-shadow .3s,gap .4s,padding .4s}
  #a11y-toggle span{display:inline-block;max-width:0;opacity:0;overflow:hidden;white-space:nowrap;transition:max-width .45s cubic-bezier(.22,.61,.36,1),opacity .3s}
  #a11y-toggle:hover,#a11y-toggle:focus-visible{gap:9px;padding:0 18px 0 14px;border-color:var(--gold-line,#b89a5e)}
  #a11y-toggle:hover span,#a11y-toggle:focus-visible span{max-width:140px;opacity:1}
}

/* Motion. All of it turns off with the device's reduce-motion setting or Reading help's calm mode. */
@keyframes drawl{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@media (prefers-reduced-motion:no-preference){
  /* Gold lines draw outward from the label */
  .crest::before{transform-origin:right center;animation:drawl .9s cubic-bezier(.22,.61,.36,1) .35s both}
  .crest::after{transform-origin:left center;animation:drawl .9s cubic-bezier(.22,.61,.36,1) .35s both}
  /* Menu links: the underline grows left to right */
  .home nav.toc a:not(.on){background:linear-gradient(var(--gold-line),var(--gold-line)) 0 100%/0 1px no-repeat;padding-bottom:3px;transition:color .3s,background-size .4s cubic-bezier(.22,.61,.36,1)}
  .home nav.toc a:not(.on):hover{background-size:100% 1px}
  .door:hover .go::after,.door:focus-visible .go::after{transform:translateX(6px)}
}

/* Dec 5: three-step row (For Founders) */
.steps3{display:grid;grid-template-columns:repeat(3,1fr);gap:28px;margin:44px 0 18px;text-align:left}
.steps3 .st{border-top:1px solid var(--oak);padding-top:16px}
.steps3 .n{font:500 34px/1 var(--serif);color:var(--oak)}
.steps3 h3{font:600 22px/1.2 var(--serif);color:var(--accent);margin:10px 0 6px}
.steps3 p{font:18px/1.55 var(--serif);color:var(--fg);margin:0}
.stnote{font:15px/1.5 var(--sans);color:var(--muted);text-align:center;margin:0 0 40px}
.ready{font:18px/1.55 var(--serif);background:var(--sunk);border-radius:4px;padding:16px 20px;margin:0 0 36px}
.ready b{color:var(--accent)}
@media (max-width:600px){.steps3{grid-template-columns:1fr;gap:22px}}
