/* attashah.dev v6: the first screen, laid out as the title sheet of a drawing set.
   Three drawing conventions carry facts and nothing else: the drawing title (his name over a rule), the title block (what a recruiter
   needs in three seconds) and the datum line (real years under the overview elevation of the four places).
   Variant A (default): he stands large in front of the sheet. Variant B (?hero=b): he walks the strip from 2009 to today.
   js/hero.js sets --ar (the strip's width over its height) and each place's position on the strip; the layout is all here. */
.hero{
  --ar:6;                               /* overview strip, width / height, until hero.js has read the real drawing */
  --foot:clamp(44px,7svh,58px);         /* from the datum line down to the edge: room for the years and the place names */
  --strip-w:100vw;                      /* the width the strip is seen through: the whole screen, except on a phone on its side */
  --strip-h:calc(var(--strip-w) / var(--ar));
  --fig-h:clamp(320px,76svh,880px);     /* height of the figure's sprite cell; he fills about 96% of it */
  --fig-x:62.5vw;                       /* where he stands: in front of the bank towers, clear of the CN Tower on his left */
  --col:calc(var(--fig-x) - var(--gutter) - .15 * var(--fig-h)); /* the title column ends before his back */
  position:relative;min-height:100svh;overflow:hidden;overflow:clip;isolation:isolate;
  display:grid;grid-template-columns:minmax(0,var(--col)) minmax(0,1fr);grid-template-rows:auto auto auto auto 1fr;
  padding:clamp(24px,5.2svh,64px) var(--gutter) calc(var(--foot) + var(--strip-h) + 12px);
}
.hero-in,.hero-copy{display:contents} /* the wrappers exist for the desk hero (css/desk.css); in A and B their children lay out in the hero grid as before */
:where(.hero-in>:not(.hd-stage),.hero-copy>*){position:relative;z-index:2;grid-column:1} /* :where, so these keep the specificity .hero>* had (none) and the class rules below still win */
.hd-stage{display:none}

/* ---- the drawing title */
.hero-name{font:400 min(10.1rem,calc(var(--col) * .166))/.92 var(--title,var(--display));letter-spacing:-.012em;white-space:nowrap;margin:0 0 .16em -.04em}
.hero-name::after{content:"";display:block;height:var(--pen-2,1.4px);margin:.15em 0 0 .04em;background:var(--line);opacity:.72}
.hero-role{margin:0;font:600 clamp(1.35rem,2.05vw,2.6rem)/1.15 var(--display);letter-spacing:.005em}
.hero-sum{margin:.7em 0 0;max-width:33em;color:var(--dim);font-size:clamp(1rem,1.25vw,1.5rem);line-height:1.5;text-wrap:pretty}
.hero-acts{display:flex;flex-wrap:wrap;gap:10px;margin:clamp(16px,2.8svh,34px) 0 0}
.hero-acts .btn{min-height:clamp(46px,3vw,58px);padding-inline:clamp(20px,1.5vw,30px);font-size:clamp(.95rem,1.05vw,1.2rem)}

/* ---- the title block: one fact per row, the field name in the annotation face. It starts clear of his shoulder. */
.hero-block{grid-column:2;grid-row:1 / span 5;align-self:start;justify-self:end;font-size:clamp(.92rem,1.02vw,1.2rem);line-height:1.42;width:min(100% - .3 * var(--fig-h),29.4em);margin:.62rem 0 0;
  border-top:var(--pen-3,2px) solid var(--line)}
.hero-block>div{display:grid;grid-template-columns:5.6em minmax(0,1fr);column-gap:12px;align-items:baseline;padding:.54em 0;border-bottom:1px solid var(--rule)}
.hero-block dt{font:500 max(var(--fs-note,.75rem),.8em)/1.4 var(--note,var(--body));letter-spacing:.03em;color:var(--dim)}
.hero-block dd{margin:0;min-width:0}
.hero-block a{color:var(--line);text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--tan) 70%,transparent);text-decoration-thickness:1px;text-underline-offset:4px}
.hero-block a:hover{color:var(--tan)}
.hero-block .hb-certs a{display:grid;gap:5px;text-decoration:none} /* one link for both badges, to the section that shows the certificates */
.hero-block .hb-certs a>span{display:flex;align-items:center;gap:9px}
.hero-block .hb-certs a:hover{text-decoration:underline;text-decoration-color:var(--tan);text-underline-offset:4px}
.hero-block .hb-exp a{display:inline-block}
.hero-block .hb-certs i{flex:none;display:block;width:2.05em;height:2.05em;background:var(--sheet);isolation:isolate}
.hero-block .hb-certs img{display:block;width:100%;height:100%;object-fit:contain}
.hero-block .hb-certs img.dk{mix-blend-mode:lighten} /* this badge was issued on black: against the sheet colour behind it, the black goes */
.hero-block .hb-two{display:flex;flex-wrap:wrap;gap:2px 20px}

/* ---- the overview elevation: the four places as one strip, the datum line with a tick for every year and a longer one where he moved,
   and a link per place. grid-area auto: an absolute child then spans the whole padding box, edge to edge. */
.hero-strip{position:absolute;z-index:1;left:0;right:0;bottom:var(--foot);height:var(--strip-h);grid-area:auto}
.hs-cam{--lead:0;--yr:0;position:absolute;left:0;bottom:0;height:100%;width:calc(var(--strip-h) * var(--ar));will-change:transform}
.hs-art{position:absolute;inset:0;color:var(--trace);opacity:.5} /* quiet behind him; in B, where the strip is the picture, it is drawn stronger */
.hs-art svg{position:absolute;inset:0;width:100%;height:100%;display:block;overflow:visible}
.hs-art .hs-wash [pathLength]{display:none} /* the outline is inked by the copy above the washes */
.hs-art .hs-ink :is(path,rect,circle,ellipse,line,polyline,polygon,use,text,image):not([pathLength]){display:none}
.hs-cam::after{content:"";position:absolute;left:0;right:0;top:100%;height:1px;background:color-mix(in srgb,var(--dim) 60%,transparent)} /* the datum */
.hs-cam.yrs::before{content:"";position:absolute;left:calc(var(--lead) * 100%);right:0;top:100%;height:5px; /* one tick a year, from 2009 */
  background:linear-gradient(90deg,color-mix(in srgb,var(--dim) 55%,transparent) 1px,transparent 1px) 0 0/calc(var(--yr) / (1 - var(--lead)) * 100%) 100% repeat-x}
/* the load moment: the outline is drawn from left to right and the washes follow the pen */
.hs-art.draw .hs-ink [pathLength]{stroke-dasharray:1;stroke-dashoffset:1;animation:hs-ink var(--draw,1.7s) cubic-bezier(.4,.1,.35,1) forwards}
.hs-art.draw .hs-wash{-webkit-mask:linear-gradient(90deg,#000 calc(100% - 14vw),transparent) 0 0/0% 100% no-repeat;mask:linear-gradient(90deg,#000 calc(100% - 14vw),transparent) 0 0/0% 100% no-repeat;
  animation:hs-wash var(--draw,1.7s) cubic-bezier(.4,.1,.35,1) .16s forwards}
.hs-art.wait{visibility:hidden}
@keyframes hs-ink{to{stroke-dashoffset:0}}
@keyframes hs-wash{to{-webkit-mask-size:calc(100% + 16vw) 100%;mask-size:calc(100% + 16vw) 100%}}

/* each place: --x is where it starts and --w how wide it is, as shares of the strip (hero.js sets them from the drawing) */
.hs-map{position:absolute;inset:0 0 calc(-1 * var(--foot)) 0}
.hs-map a{position:absolute;top:0;bottom:0;left:calc(var(--x) * 100%);width:calc(var(--w) * 100%);padding:calc(var(--strip-h) + 10px) 0 0 9px;
  color:var(--dim);text-decoration:none;font:500 clamp(var(--fs-note,.75rem),.8vw,1rem)/1.25 var(--note,var(--body));letter-spacing:.03em;-webkit-tap-highlight-color:transparent}
.hs-map a+a::after{content:"";position:absolute;left:0;top:var(--strip-h);width:1px;height:10px;background:color-mix(in srgb,var(--line) 62%,transparent)} /* the longer tick where the place begins */
.hs-map .lb{display:block;width:fit-content;white-space:nowrap;transform:translateX(var(--lbx,0px));transition:opacity .25s} /* --lbx: B keeps the name of the place he is in on screen while the view follows him */
.hs-map a.cut .lb,.hs-now.cut{opacity:0} /* a name that would be cut off by the edge of the window is not shown at all */
.hs-map .yr{color:var(--trace);font-variant-numeric:tabular-nums;margin-right:.55em}
.hs-map b{font-weight:500;color:var(--line)}
/* the place under the pointer (or the one he is walking through) is lit: the same drawing in the line colour, cut to that place */
.hs-map a::before{content:"";position:absolute;left:0;right:0;top:0;height:var(--strip-h);background:var(--line);opacity:0;transition:opacity .25s;
  -webkit-mask:var(--art,none) calc(var(--x) / (1 - var(--w)) * 100%) 0/calc(100% / var(--w)) 100% no-repeat;mask:var(--art,none) calc(var(--x) / (1 - var(--w)) * 100%) 0/calc(100% / var(--w)) 100% no-repeat}
.hs-map a:hover::before,.hs-map a:focus-visible::before,.hs-map a.on::before{opacity:.86}
.hs-map a:hover b,.hs-map a.on b{color:var(--tan)}
.hs-map a:focus-visible{outline-offset:-3px}
.hs-now{position:absolute;right:10px;top:calc(var(--strip-h) + 10px);font:500 clamp(var(--fs-note,.75rem),.8vw,1rem)/1.25 var(--note,var(--body));letter-spacing:.03em;color:var(--trace);pointer-events:none;transition:opacity .25s}

/* ---- the figure (hero.js builds it). His soles sit on the datum; a soft shadow lies under them. */
.hero-fig{--sole:.013;position:absolute;left:var(--fig-x);bottom:calc(var(--fig-h) * var(--sole) * -1);height:var(--fig-h);aspect-ratio:600/1040;margin-left:calc(var(--fig-h) * -.2885);
  pointer-events:none;opacity:0;transition:opacity .4s ease-out}
.hero-fig.in{opacity:1}
.hero-fig i{position:absolute;display:block}
.hf-man{inset:0;background-repeat:no-repeat;transform-origin:50% 100%}
.hf-shadow{left:18%;right:18%;bottom:calc(var(--sole) * 100% - 1.7%);height:3.4%;background:radial-gradient(closest-side,rgb(0 0 0 / .62),transparent)}
/* a little light on the sheet behind him, so the navy shirt keeps its edge against the navy sheet */
.hero[data-variant=a] .hero-fig::before{content:"";position:absolute;left:-22%;right:-22%;top:2%;bottom:30%;background:radial-gradient(closest-side,color-mix(in srgb,var(--sheet-3) 90%,var(--trace)),transparent);opacity:.6}

/* ---- variant B: the whole walk in miniature. A strip taller than it fits is wider than its window: the view then follows him. */
.hero[data-variant=b]{--fig-h:clamp(84px,6.7vw,136px);--col:calc(57vw - var(--gutter));--b-min:min(32svh,280px);--strip-h:max(calc(var(--strip-w) / var(--ar)),var(--b-min))}
.hero[data-variant=b] .hero-fig{left:0;margin-left:0;transition:none;will-change:transform,opacity}
.hero[data-variant=b] .hs-art{opacity:.74}
.hero[data-variant=b] .hero-block{width:min(100% - 40px,29.4em)}

/* ---- narrow screens: one column. The strip sits under the summary with him standing on it, then the actions and the title block.
   The place names take two rows there, turn about, because two of the places are narrower than their names. The first screen is as
   tall as what is on it and no taller: on a tall tablet the next section follows at once instead of a dead band. */
@media (max-width:999px){
  .hero{--foot:56px;--fig-h:min(44.5svh,calc(384px + (100vw - 390px) * .1));--fig-x:79vw;min-height:0;display:flex;flex-direction:column;reading-flow:flex-visual;padding:16px var(--gutter) 22px}
  .hero-name{font-size:min(5.5rem,17.4vw);white-space:normal;margin-bottom:.12em}
  .hero-name span{display:block}
  .hero-name::after{width:57%}
  .hero-role{max-width:58%;font-size:1.36rem}
  .hero-sum{max-width:57%;font-size:.97rem;line-height:1.46;margin-top:.55em}
  .hero-strip{position:relative;order:1;flex:none;inset:auto;margin:8px calc(var(--gutter) * -1) var(--foot)}
  .hero-acts{order:2;margin-top:12px}
  .hero-acts .btn{flex:1 1 auto;justify-content:center;padding-inline:14px}
  .hero-block{order:3;width:auto;justify-self:auto;align-self:stretch;margin-top:10px;font-size:.9rem}
  .hero-block>div{padding:.34rem 0;grid-template-columns:4.9rem minmax(0,1fr)}
  .hero-block .hb-certs i{width:30px;height:30px}
  .hs-map a{padding-left:6px}
  .hs-map a:nth-of-type(even) .lb{white-space:normal;margin-top:1.4em}
  .hs-map a:nth-of-type(even)::after{height:27px}
  .hs-now{right:8px}
  .hero[data-variant=b]{--fig-h:84px;--b-min:min(20svh,170px)}
  .hero[data-variant=b] .hero-name{font-size:min(5.5rem,15.2vw)}
  .hero[data-variant=b] .hero-name span{display:inline}
  .hero[data-variant=b] .hero-name::after{width:auto}
  .hero[data-variant=b] .hero-role,.hero[data-variant=b] .hero-sum{max-width:none}
  .hero[data-variant=b] .hero-block{width:auto}
  .hero[data-variant=b] .hs-map a:nth-of-type(even) .lb{white-space:nowrap;margin-top:0} /* the strip is wide there: one row is enough */
  .hero[data-variant=b] .hs-map a:nth-of-type(even)::after{height:10px}
}
/* the narrowest phones: the two actions still share one row */
@media (max-width:380px){.hero-acts{gap:8px}.hero-acts .btn{padding-inline:8px;font-size:.89rem}}
/* a tablet held upright: the lettering, the walker and his strip are larger */
@media (min-width:600px) and (max-width:999px) and (min-height:521px){.hero-role{font-size:1.7rem}.hero-sum{font-size:1.1rem}.hero-block{font-size:1rem}.hero[data-variant=b]{--fig-h:clamp(96px,13vw,128px);--b-min:min(26svh,300px)}}
/* THE ONE CHANGE OF ORDER, deliberate: on a short narrow screen (a phone with its toolbars showing, or any phone under 800 px of height)
   the Contact row is shown first in the title block, so that how to reach him is still on the first screen. On every other screen the
   block reads in its written order, Contact last. reading-flow keeps the tab order with what is seen, where the browser supports it. */
@media (max-width:999px) and (max-height:800px){.hero-block{display:flex;flex-direction:column;reading-flow:flex-visual}.hero-block>div:last-child{order:-1}}

/* ---- a phone on its side (short and wide): the name, the role, the summary and both actions on the left, him on the strip on the right,
   all above the fold; the title block follows below it in two columns. In B the right side is the strip, with the view following him. */
@media (max-height:520px) and (min-width:560px) and (max-width:999px){
  .hero{--strip-w:42vw;--foot:52px;--fig-h:min(100svh - 90px,340px);--fig-x:calc(var(--strip-w) * .66);
    display:grid;grid-template-columns:minmax(0,1fr) var(--strip-w);grid-template-rows:auto auto auto auto 1fr auto;column-gap:clamp(16px,3vw,32px);padding:12px var(--gutter) 18px}
  .hero-name{font-size:min(4rem,6.8vw);margin-bottom:.1em}
  .hero-name span{display:inline}
  .hero-name::after{width:auto}
  .hero-role{max-width:none;font-size:1.28rem}
  .hero-sum{max-width:none;font-size:.92rem;line-height:1.42;margin-top:.4em}
  .hero-acts{order:0;margin-top:12px}
  .hero-acts .btn{flex:0 1 auto;padding-inline:16px}
  .hero-strip{grid-column:2;grid-row:1 / span 5;order:0;align-self:end;width:var(--strip-w);margin:max(0px,calc(var(--fig-h) * .97 - var(--strip-h))) 0 var(--foot);overflow-x:clip;overflow-y:visible}
  .hero-block{grid-column:1 / -1;grid-row:6;order:0;display:grid;grid-template-columns:1fr 1fr;column-gap:clamp(20px,4vw,48px);margin-top:14px}
  .hero-block>div:last-child{order:0}
  .hero[data-variant=b]{--fig-h:84px;--b-min:min(42svh,180px)}
  .hero[data-variant=b] .hero-name{font-size:min(4rem,6.8vw)}
}

/* ---- touch: every link in the title block is a target at least 44 px tall, without the rows growing more than they must */
@media (pointer:coarse){
  .hero-block .hb-two a{display:inline-flex;align-items:center;min-height:44px}
  .hero-block>div:has(.hb-two){padding-block:0}
  .hero-block .hb-exp a{padding-block:12px;margin-block:-12px}
  .hero-block>div:has(.hb-exp){padding-bottom:12px}
}
/* a narrow laptop or a tablet on its side: the block has less room beside him, so it is set a little smaller */
@media (min-width:1000px) and (max-width:1180px){.hero-block{font-size:.86rem}.hero-block>div{grid-template-columns:4.5em minmax(0,1fr);column-gap:8px}}
/* a short laptop window: the title block closes up, so the whole sheet with its datum stays on one screen */
@media (max-height:720px) and (min-width:1000px){.hero{padding-top:clamp(20px,4svh,34px)}.hero-block>div{padding:.4em 0}.hero-block .hb-certs a{gap:3px}}
/* a very short wide window: the facts stay, the summary goes */
@media (max-height:520px) and (min-width:1000px){.hero-sum{display:none}.hero-block>div{padding:.3rem 0}}
