/* Self-hosted fonts (SIL OFL). Latin plus Welsh accents. No third-party requests. */
@font-face{font-family:"Archivo";src:url("fonts/archivo-var-latin.woff2") format("woff2");font-weight:100 900;font-stretch:62% 125%;font-style:normal;font-display:swap}
@font-face{font-family:"Atkinson Hyperlegible Next";src:url("fonts/atkinson-hyperlegible-next-400-latin.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Atkinson Hyperlegible Next";src:url("fonts/atkinson-hyperlegible-next-700-latin.woff2") format("woff2");font-weight:700;font-style:normal;font-display:swap}
/* Layout: one column. On the stage the tick box and the four letters never leave their places; every size is measured from the logo tile (--T). */
:root{
  --ink:#150F20; --paper:#FFF7EB; --flare:#FF6846; --ember:#AD2A10; --sun:#FFC933; --tide:#0A5A70; --slate:#5C5568;
  --slate-tint:#B7B0C3; /* proposed: Slate fails on Ink, so dark mode needs a lighter grey. Not in the palette table yet. */
  --bg:var(--paper); --fg:var(--ink); --muted:var(--slate); --accent:var(--ember); --line:var(--ink);
  --btn-line:var(--ink); --focus:var(--ink); --chip-line:var(--ink);
  --display:"Archivo","Segoe UI",Roboto,"Helvetica Neue",Arial,system-ui,sans-serif;
  --body:"Atkinson Hyperlegible Next","Atkinson Hyperlegible",Verdana,"Segoe UI",Roboto,system-ui,sans-serif;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:var(--ink); --fg:var(--paper); --muted:var(--slate-tint); --accent:var(--flare); --line:var(--slate-tint);
  --btn-line:var(--flare); --focus:var(--sun); --chip-line:var(--sun); color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:var(--ink); --fg:var(--paper); --muted:var(--slate-tint); --accent:var(--flare); --line:var(--slate-tint);
  --btn-line:var(--flare); --focus:var(--sun); --chip-line:var(--sun); color-scheme:dark}

*{box-sizing:border-box}
body{background:var(--bg);color:var(--fg);font:400 1rem/1.5 var(--body);padding-block:1.5rem 4rem;
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
.page{max-width:55rem;margin:0 auto;display:flex;flex-direction:column;gap:2.75rem}
.page>*{min-width:0}
h1,h2{font-family:var(--display);font-weight:800;text-wrap:balance;margin:0}
h1{font-size:clamp(1.9rem,6vw,2.75rem);line-height:1.08}
h2{font-size:1.5rem;line-height:1.15}
h3{font:700 1.0625rem/1.3 var(--body);margin:0}
p,ol,ul{margin:0}
.top{display:flex;flex-direction:column;gap:.75rem;align-items:flex-start}
.chip{font:700 .9375rem/1 var(--body);background:var(--sun);color:var(--ink);border:2px solid var(--chip-line);border-radius:999px;padding:.4rem .75rem}
.prose{max-width:40rem;display:flex;flex-direction:column;gap:.9rem}
.prose ul,.prose ol{padding-left:1.25rem;display:flex;flex-direction:column;gap:.6rem}
.sec{display:flex;flex-direction:column;gap:1.25rem}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
:focus-visible{outline:3px solid var(--focus);outline-offset:3px}

/* ---------- the stage ---------- */
.hero{display:flex;flex-direction:column;gap:.9rem}
.stage{container-type:inline-size;border:2px solid var(--line);border-radius:16px;background:var(--bg);overflow:hidden;user-select:none;-webkit-user-select:none}
.field{--T:min(17vw,140px);padding:16px;display:grid;
  --F:calc(var(--T)*.589);      /* font size at which live Archivo 900/105 matches the outlined wordmark */
  --P:calc(var(--F)*1.16);      /* line pitch while the lines play; the wordmark's own pitch is --F */
  --g:calc(var(--T)*.2);        /* gap between tile and wordmark, as on the concept sheet */
  --small:clamp(1rem,calc(var(--F)*.3),1.25rem);
  --hh:calc(var(--small)*2.3)}  /* room for the form's caption above the letters */
@supports (width:1cqw){.field{--T:min(19.5cqw,140px);padding:max(16px,5cqw)}}
.field>*{grid-area:1/1;min-width:0}

/* end card: this is the resting HTML, with or without scripts */
.final{display:flex;flex-direction:column;justify-content:center}
.lockup{display:flex;gap:var(--g);height:var(--T)}
.mark{position:relative;flex:none;width:var(--T);height:var(--T);color:var(--ink)}
.tile{position:absolute;inset:0;border-radius:23%;background:var(--flare)}
.mark svg{position:absolute;inset:0;width:100%;height:100%;display:block}
.bx,.ct{transform-box:fill-box;transform-origin:center}
.bx{transform:rotate(-12deg)}
.wm{flex:none;height:var(--T);width:auto;color:var(--fg);display:block;overflow:visible}
.after{margin-top:var(--g);display:flex;flex-direction:column;gap:.3rem}
.tag{font:800 clamp(1.125rem,calc(var(--F)*.36),1.75rem)/1.2 var(--display);text-wrap:balance}
.desc{font-size:var(--small);line-height:1.4;text-wrap:balance}

/* the form's wording, then the lines: four pinned letters with words growing out of them */
.seq{position:relative;pointer-events:none;padding-top:var(--hh);padding-left:calc(var(--T) + var(--g) - var(--F)*.074)}
.cap0{position:absolute;top:0;left:calc(var(--T) + var(--g));font:400 var(--small)/1.2 var(--body);color:var(--muted);white-space:nowrap;visibility:hidden}
.cap0 b{font-weight:700;letter-spacing:.03em}
.row{position:relative;height:var(--P)}
.row:last-child{height:var(--F)}
.ln{position:absolute;left:0;top:0;display:flex;align-items:baseline;white-space:nowrap}
.strut{width:0;height:calc(var(--F)*.686)}  /* puts every line on the wordmark's baseline, whatever the font */
.ini,.tails{line-height:0;font-family:var(--display);font-size:var(--F)}
.ini{display:block;font-weight:900;font-stretch:105%;color:var(--accent)}
.tails{display:grid;align-items:baseline;color:var(--fg)}
.tails>*{grid-area:1/1;white-space:nowrap}
.gloss{font:400 var(--small)/0 var(--body);color:var(--muted);padding-left:.55em}

/* while the sequence plays */
.stage[data-state="seq"] .final{justify-content:flex-start;padding-top:var(--hh)}
.stage[data-state="seq"] .mark{color:var(--fg)}
.stage[data-state="seq"] .tile{opacity:0;transform:scale(.94)}
.stage[data-state="seq"] .gl{opacity:0}
.stage[data-state="seq"] .after{opacity:0;transform:translateY(.4em)}
.stage[data-state="seq"] .cap0{visibility:visible}

/* ---------- controls ---------- */
.controls{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center}
.btn,.seg label>span{font:700 1rem/1 var(--body);min-height:44px;padding:.55rem 1rem;border-radius:10px;border:2px solid var(--btn-line);
  background:var(--flare);color:var(--ink);display:inline-flex;align-items:center;gap:.5rem;cursor:pointer}
.btn svg{width:.9em;height:.9em;flex:none}
.btn svg[hidden]{display:none}
.btn.quiet,.seg label>span{background:transparent;color:var(--fg);border-color:var(--fg)}
.btn.quiet[aria-pressed="true"],.seg input:checked+span{background:var(--fg);color:var(--bg)}
.btn.quiet[aria-pressed="true"]::before,.seg input:checked+span::before{content:"\2713"}
.beat{color:var(--muted);font-variant-numeric:tabular-nums;margin-left:auto}
.seg{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center}
.controls[hidden],.seg[hidden]{display:none}
.seg>span{font-weight:700}
.seg label{position:relative;display:inline-flex}
.seg input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.seg input:focus-visible+span{outline:3px solid var(--focus);outline-offset:3px}
.seg small{font-weight:400;font-size:1rem}

/* ---------- notes ---------- */
.lines,.beats{list-style:none;padding:0;display:flex;flex-direction:column}
.lines li,.beats li{border-top:1px solid var(--muted);padding-block:.9rem;display:grid;gap:.3rem 1.25rem}
.lines li{max-width:40rem}
.ln2{font:800 1.3rem/1.2 var(--display)}
.ln2 b{color:var(--accent);font-weight:inherit}
.setname{font-weight:700;color:var(--muted)}
.beats li{grid-template-columns:5.25rem minmax(0,1fr);max-width:44rem}
.beats .t{font-variant-numeric:tabular-nums;font-weight:700}
.beats .t small{display:block;font-weight:400;font-size:1rem;color:var(--muted)}
.quote{border:2px solid var(--line);border-radius:12px;padding:1rem 1.1rem;max-width:40rem}

/* ---------- preview page, under the hero ---------- */
.skip{position:absolute;left:16px;top:-4rem;background:var(--bg);color:var(--fg);border:2px solid var(--fg);border-radius:10px;padding:.6rem 1rem;font-weight:700;z-index:2}
.skip:focus{top:8px}
.intro{display:flex;flex-direction:column;gap:.6rem;max-width:40rem}
.intro .lead{font-size:1.125rem}
.find{display:flex;flex-direction:column;gap:.5rem;max-width:40rem}
.find label{font-weight:700}
.find .row2{display:flex;flex-wrap:wrap;gap:.6rem}
.find input{flex:1 1 14rem;min-width:0;min-height:44px;font:400 1rem/1.2 var(--body);padding:.55rem .8rem;border:2px dashed var(--muted);border-radius:10px;background:transparent;color:var(--muted)}
.find input::placeholder{color:var(--muted);opacity:1}
.find button{background:transparent;color:var(--muted);border:2px dashed var(--muted);cursor:not-allowed}
.find .hint{color:var(--muted);font-weight:700}
.cards{list-style:none;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr));gap:1rem}
.card{border:2px solid var(--line);border-radius:16px;padding:1.1rem 1.2rem;display:flex;flex-direction:column;gap:.4rem}
.card h2{font-size:1.25rem}
.foot{border-top:1px solid var(--muted);padding-top:1rem;display:flex;flex-direction:column;gap:.25rem;color:var(--muted)}
.foot strong{color:var(--fg)}
