/* CASE page, "How it was built" (p-built.js). Lives inside main.cs and takes the brand's own variables set by p-case.js
   (--bg --ink --sub --alt --altInk --ac --acInk --fd --fb --dw --dcase --dstretch --ds --line --altLine --pad --max).
   The sketches are drawn in the brand's ink on a sheet of its ground; the notes are in the accent (or the em colour
   when the accent is too faint on that ground). No zooms, no device frames, no numbers. */

/* ── 1. from the first sketch to the finished site ── */
.c-hb{background:var(--alt);color:var(--altInk);padding:clamp(6rem,16vh,11rem) var(--pad)}
.c-hb .c-k{color:inherit;opacity:.62}
.c-hb>.c-sh,.c-kit>.c-sh{margin-bottom:1.6rem}
.hb-lede{max-width:var(--max);margin:0 auto;font-size:clamp(1.05rem,1.25vw,1.25rem);line-height:1.5}
.hb-lede span{display:block;max-width:40rem;opacity:.75}
.hb-list{max-width:var(--max);margin:clamp(3.4rem,9vh,6rem) auto 0;display:grid;gap:clamp(4.5rem,11vh,8rem)}
.hb-scr{width:100%;max-width:min(100%,calc((100svh - 10rem) * 1.6));margin:0 auto}
/* desktop: each sheet holds still for a while so the scroll that follows can wipe the finished page in */
@media (min-width:901px) and (prefers-reduced-motion:no-preference){
  .hb-list{gap:clamp(1.5rem,4vh,3rem)}
  .hb-track::after{content:'';display:block;height:48vh}
  .hb-stick{position:sticky;top:5.5rem}
}
.hb-t{font-family:var(--fd);font-weight:var(--dw);text-transform:var(--dcase);font-stretch:var(--dstretch);letter-spacing:var(--dt);font-variation-settings:var(--dvar);line-height:1;font-size:calc(clamp(1.35rem,2vw,2rem) * var(--ds));margin:0 0 1.1rem}
.hb-fw{--p:0;position:relative;container-type:inline-size}
.hb-frame{position:relative;aspect-ratio:1440/900;border-radius:6px;overflow:hidden;background:var(--hb-paper);box-shadow:0 0 0 1px var(--altLine),0 50px 90px -50px rgba(0,0,0,.55);touch-action:pan-y;user-select:none;-webkit-user-select:none;outline:none}
.hb-frame:focus-visible{box-shadow:0 0 0 2px var(--ac),0 50px 90px -50px rgba(0,0,0,.55)}
.hb-sk{position:absolute;inset:0;width:100%;height:100%;display:block;overflow:hidden}
.hb-sk path{fill:none;stroke:var(--hb-ink);stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1;opacity:.8}
.hb-sk .p0{stroke-width:calc(.7px * var(--k,1));opacity:.3}
.hb-sk .p1{stroke-width:calc(1.05px * var(--k,1))}
.hb-sk .p2{stroke-width:calc(1.6px * var(--k,1))}
.hb-sk text.gh{fill:none;stroke:var(--hb-ink);stroke-width:calc(var(--sw,1) * 1px * var(--k,1));stroke-linejoin:round;opacity:0}
.drawn .hb-sk path{animation:hb-draw .8s cubic-bezier(.3,.6,.2,1) var(--d,0s) forwards}
.drawn .hb-sk text.gh{animation:hb-fade 1.1s ease var(--d,0s) forwards}
@keyframes hb-draw{to{stroke-dashoffset:0}}
@keyframes hb-fade{to{opacity:.85}}
.hb-sk.still path{stroke-dashoffset:0;animation:none}
.hb-sk.still text.gh{opacity:.85;animation:none}
.hb-real{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:top;clip-path:inset(0 calc(100% - var(--p) * 100%) 0 0);pointer-events:none}
.hb-edge{position:absolute;top:0;bottom:0;left:calc(var(--p) * 100%);width:2px;margin-left:-1px;background:var(--hb-ink);opacity:calc(min(var(--p) * 25, 1) * min((1 - var(--p)) * 25, 1));pointer-events:none}
.hb-edge b{position:absolute;top:50%;left:50%;width:clamp(2.4rem,4cqw,3.2rem);height:clamp(2.4rem,4cqw,3.2rem);transform:translate(-50%,-50%);border-radius:50%;background:var(--hb-paper);color:var(--hb-ink);border:1.5px solid var(--hb-ink);display:grid;place-items:center}
.hb-edge svg{width:45%;height:45%}
/* the handwritten notes: on the sketch, hidden where the finished page has wiped in */
.hb-notes{position:absolute;inset:0;margin:0;padding:0;list-style:none;pointer-events:none;clip-path:inset(0 0 0 calc(var(--p) * 100%))}
.hb-note{position:absolute;left:var(--x);top:var(--y);max-width:min(34cqw,calc(100% - var(--x) - 1.5%));transform:translateY(-70%) rotate(var(--r,-2deg));transform-origin:0 50%;font:600 clamp(15px,2.15cqw,31px)/1.02 'Caveat','Mynerve',cursive;color:var(--hb-note);text-wrap:balance;opacity:0;transition:opacity .9s ease calc(1.5s + var(--i) * .4s)}
.hb-note:lang(el){font-family:'Mynerve','Caveat',cursive;font-weight:400;font-size:clamp(13px,1.7cqw,25px);line-height:1.15}
.drawn .hb-note{opacity:1}
.hb-hint{max-width:var(--max);margin:2.6rem auto 0;color:inherit!important;opacity:.62}
@container (max-width:600px){
  .hb-notes{position:static;clip-path:none;margin-top:.9rem;display:flex;flex-direction:column;gap:.35rem}
  .hb-note{position:static;max-width:none;transform:none;font-size:21px;line-height:1.1;color:var(--hb-note-alt,currentColor)}
  .hb-note:lang(el){font-size:17px}
}

/* ── 2. the brand kit ── */
.c-kit{padding:clamp(6rem,16vh,11rem) var(--pad)}
.kt-grid{max-width:var(--max);margin:clamp(3.4rem,9vh,6rem) auto 0;display:grid;gap:1rem}
.kt-row{display:grid;gap:1rem;min-width:0}
.kt-row.kt-two,.kt-row.kt-top{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.kt-col{display:grid;gap:1rem;grid-template-rows:1fr 1fr;min-width:0}
.kt-t{margin:0;border-radius:6px;overflow:hidden;background:var(--tb,transparent);color:var(--ti,inherit);padding:clamp(1.2rem,2vw,1.8rem);display:flex;flex-direction:column;justify-content:space-between;gap:1.4rem;min-height:clamp(13rem,27vh,17rem);min-width:0}
.kt-t.line{background:transparent;color:var(--ink);box-shadow:inset 0 0 0 1px var(--line)}
.kt-t.edge{box-shadow:inset 0 0 0 1px var(--line)}
/* a tile alone on its row lays out sideways */
.kt-one.wide>.kt-share,.kt-one.wide>.kt-type{flex-direction:row;align-items:center;justify-content:space-between}
.kt-one.wide>.kt-share .kt-in{flex:0 1 32rem}
.kt-one.wide>.kt-t figcaption{max-width:22rem}
.kt-t figcaption{font:500 .92rem/1.4 var(--fb);opacity:.72;display:flex;flex-wrap:wrap;gap:.3rem 1.4rem;margin:0}
.kt-t figcaption b{font-weight:600}
.kt-in{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;min-height:0;min-width:0}
.kt-top>.kt-logo.a{min-height:clamp(22rem,50vh,32rem)}
.kt-li{display:block;width:auto;height:auto;max-width:min(62%,26rem);max-height:8.5rem;object-fit:contain}
.kt-logo.b .kt-li{max-width:min(48%,18rem);max-height:7rem}
.kt-lm{height:clamp(3rem,6vw,5.5rem)}
.kt-logo.b .kt-lm{height:clamp(2.4rem,4.6vw,4.2rem)}
.kt-lt{font-family:var(--fd);font-stretch:var(--dstretch);font-weight:var(--dw);text-transform:uppercase;letter-spacing:.02em;line-height:1;font-size:clamp(1.8rem,3.6vw,3.4rem);text-align:center}
.kt-logo.b .kt-lt{font-size:clamp(1.4rem,2.6vw,2.4rem)}
.kt-ics{display:flex;align-items:flex-end;gap:1.1rem}
.kt-ics img{display:block;border-radius:22%;box-shadow:0 12px 26px -14px rgba(0,0,0,.6)}
.kt-ics img:nth-child(1){width:clamp(4.6rem,6vw,6rem)}.kt-ics img:nth-child(2){width:3.4rem}.kt-ics img:nth-child(3){width:1.75rem;border-radius:6px}
.kt-pal{min-height:0}
.kt-sw{display:grid;grid-template-columns:repeat(auto-fit,minmax(5.2rem,1fr));gap:.7rem;width:100%}
.kt-sw div{display:grid;gap:.4rem;font:400 .85rem/1.3 var(--fb);min-width:0}
.kt-sw i{display:block;aspect-ratio:1/1.1;border-radius:4px;box-shadow:inset 0 0 0 1px var(--line)}
.kt-sw b{font-weight:600}
.kt-sw span{opacity:.6;font-variant-numeric:tabular-nums}
.kt-type .kt-in{align-items:flex-start;justify-content:flex-end;gap:0}
.kt-big{margin:0;font-size:calc(clamp(1.9rem,3.4vw,3.4rem) * var(--ds));line-height:1.04;text-wrap:balance;max-width:min(100%,26rem);overflow-wrap:break-word}
.kt-big i{font-style:italic;color:var(--emc)}
.kt-small{margin:.9rem 0 0;font-size:1rem;line-height:1.45;opacity:.8;max-width:38ch}
.kt-band{padding:0}
.kt-band .kt-in{justify-content:center;padding-top:clamp(1.2rem,2vw,1.8rem)}
.kt-band figcaption{padding:0 clamp(1.2rem,2vw,1.8rem) clamp(1.2rem,2vw,1.8rem)}
.kt-run{width:100%;overflow:hidden;background:var(--ac);color:var(--acInk);padding:.75rem 0}
.kt-run>div{display:flex;width:max-content;animation:kt-run 28s linear infinite}
.kt-run span{display:inline-flex;align-items:center;white-space:nowrap;font-family:var(--fd);font-weight:var(--dw);font-stretch:var(--dstretch);text-transform:uppercase;line-height:1;font-size:calc(clamp(1.5rem,2.4vw,2.3rem) * var(--ds))}
.kt-run span i{font-style:normal;font-size:.5em;margin:0 .8em}
.kt-run.still>div{animation:none}
@keyframes kt-run{to{transform:translateX(-50%)}}
.kt-shots{display:grid;grid-template-columns:repeat(var(--n,4),minmax(0,1fr));gap:.6rem;width:100%}
.kt-photos.n1{--n:1}.kt-photos.n2{--n:2}.kt-photos.n3{--n:3}.kt-photos.n4{--n:4}.kt-photos.n5{--n:5}.kt-photos.n6{--n:6}
.kt-shots img{display:block;width:100%;aspect-ratio:4/5;object-fit:cover;border-radius:4px;background:var(--bg)}
.kt-photos.n1 .kt-shots img,.kt-photos.n2 .kt-shots img,.kt-photos.n3 .kt-shots img{aspect-ratio:4/3}
.kt-share .kt-in{align-items:flex-start}
.kt-card{width:min(100%,30rem);background:#fff;color:#111;border-radius:10px;overflow:hidden;box-shadow:0 0 0 1px rgba(0,0,0,.06),0 18px 40px -22px rgba(0,0,0,.5);font-family:system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;text-align:left}
.kt-card img{display:block;width:100%;aspect-ratio:1200/630;object-fit:cover}
.kt-card div{padding:.7rem .95rem .85rem}
.kt-card b{display:block;font-size:.88rem;line-height:1.3;font-weight:600}
.kt-card small{display:block;margin-top:.2rem;font-size:.76rem;color:#667}
.kt-card.sq{display:grid;grid-template-columns:6.5rem minmax(0,1fr);align-items:center}
.kt-card.sq img{aspect-ratio:1;height:100%}

/* brand touches, as on the rest of the page */
.b-de .hb-frame,.b-de .kt-t,.b-ka .kt-t,.b-fz .kt-t,.b-ka .hb-frame{border-radius:0}
.b-wg .kt-run{transform:rotate(-1.5deg) scale(1.04);margin:.6rem 0}

@media (max-width:900px){
  .kt-row.kt-two,.kt-row.kt-top{grid-template-columns:1fr}
  .kt-one.wide>.kt-share,.kt-one.wide>.kt-type{flex-direction:column;align-items:stretch}
  .kt-col{grid-template-rows:auto}
  .kt-top>.kt-logo.a{min-height:16rem}
  .kt-t{min-height:12rem}
  .kt-sw{grid-template-columns:repeat(3,minmax(0,1fr))}
  .kt-shots{grid-template-columns:repeat(2,minmax(0,1fr))}
  .kt-photos.n1 .kt-shots{grid-template-columns:1fr}
  .kt-photos.n3 .kt-shots img:nth-child(3),.kt-photos.n5 .kt-shots img:nth-child(5){grid-column:1/-1}
  .hb-scr{max-width:100%}
  .hb-list{gap:3.6rem}
}
@media (prefers-reduced-motion:reduce){
  .hb-note{transition:none}
  .kt-run>div{animation:none}
}
