/* ---------- THE INTRODUCTION (prototype homepage opening, src/intro-hero.html) ----------
   A wall of the album's faces, pinned cartes in the site's two-colour print (dev/intro-hero/make.py writes it), and on
   it a printed card with the headline, "What's on your mind?" and five sentences. Choosing one lets the wall fall back
   while two faces come forward off it as cartes de visite (pg-intro-hero.js). Wide screens: the card on the left of the
   site's 1320px column and the pair to its right, where the wall was. Narrower: the pair inside the card. Phones: the
   faces fill the screen and the card is a sheet laid over them, a band of faces showing above it. Everything is ih-. */

.ih-hero{position:relative;container:ih/inline-size;overflow:clip;display:flex;align-items:center;
  min-height:max(var(--vh,100svh),640px);padding:calc(var(--nav-h) + 20px) var(--gut) 30px}

/* ---- the wall ---- */
.ih-wall{--c:clamp(70px,6.1vw,150px);position:absolute;inset:0;z-index:0;overflow:hidden;pointer-events:none}
/* the nav sits over the faces: they fade to paper under it, and to paper again where the hero hands on to the page */
.ih-wall::before,.ih-wall::after{content:"";position:absolute;left:0;right:0;z-index:3;pointer-events:none}
.ih-wall::before{top:0;height:calc(var(--nav-h) + 26px);background:linear-gradient(var(--paper) 52%,rgba(245,242,236,0))}
.ih-wall::after{bottom:0;height:56px;background:linear-gradient(rgba(245,242,236,0),var(--paper))}
.ih-board{position:absolute;left:calc(var(--c) * -.62);right:calc(var(--c) * -.62);top:calc(var(--c) * -.5);transition:filter .8s ease}
.ih-drift{display:grid;grid-template-columns:repeat(auto-fill,var(--c));grid-auto-rows:calc(var(--c) * 1.3);gap:calc(var(--c) * .2) calc(var(--c) * .17);
  grid-auto-flow:dense;justify-content:center;animation:ih-drift 52s ease-in-out infinite alternate}
@keyframes ih-drift{from{transform:translate3d(0,0,0)}to{transform:translate3d(calc(var(--c) * -.34),calc(var(--c) * -.62),0)}}
.ih-hero.ih-off .ih-drift{animation-play-state:paused}

.ih-t{position:relative;display:block}
.ih-t.big{grid-column:span 2;grid-row:span 2}
/* .ih-tc carries the pin's tilt and offset (and turns over); .ih-fr is the card's face, .ih-bk its back */
.ih-tc{position:absolute;inset:0;transform:perspective(700px) translate(var(--x),var(--y)) rotate(var(--r)) scale(var(--s)) rotateY(0deg);
  transition:transform 1.05s cubic-bezier(.45,.05,.25,1)}
.ih-fr,.ih-bk{position:absolute;inset:0;display:flex;flex-direction:column;-webkit-backface-visibility:hidden;backface-visibility:hidden}
.ih-fr{padding:6%;background:#ece0ca;border:1.3px solid var(--ink);box-shadow:3px 4px 0 rgba(20,19,17,.82)}
.ih-fr::after{content:"";position:absolute;inset:3.5%;border:1px solid rgba(20,19,17,.32);pointer-events:none}
.ih-tp{position:relative;flex:1 1 auto;min-height:0;overflow:hidden;border:1.2px solid var(--ink);background:var(--coral-2)}
.ih-tp img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 30%;filter:grayscale(1) contrast(1.12) brightness(1.04);mix-blend-mode:multiply}
.ih-tn{position:relative;z-index:1;flex:none;padding-top:5%;font-family:var(--serif);font-style:italic;font-size:calc(var(--c) * .095);line-height:1.15;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}
.ih-tn b{font-family:var(--sans);font-style:normal;font-weight:650;font-size:.78em;letter-spacing:.1em;margin-right:.3em}
.big .ih-tn{font-size:calc(var(--c) * .13)}
/* frames: an arched carte like the album's, an oval mount, a plain photographic print */
.s-arch .ih-tp{border-radius:999px 999px 3px 3px}
.s-oval .ih-fr{border-radius:50%;padding:12% 11%;background:#f1e8d8}
.s-oval .ih-fr::after{border-radius:50%;inset:5%}
.s-oval .ih-tp{border-radius:50%}
.s-oval .ih-tn{display:none}
.s-rect .ih-fr{background:#fbf9f4;padding:5% 5% 6%;border-color:rgba(20,19,17,.55)}
.s-rect .ih-fr::after{display:none}
.s-rect .ih-tp{border:0;border-radius:1px}
/* the print: coral under the ink (p1), ink alone on paper with the coral pass out of register (p2), a pale pass (p3) */
.p2 .ih-tp{background:#f3eee4;box-shadow:var(--mx) var(--my) 0 var(--coral-2)}
.p2 .ih-tp img{mix-blend-mode:normal;filter:grayscale(1) contrast(1.22) brightness(1.06)}
.s-oval.p2 .ih-tp{box-shadow:3px 2px 0 var(--coral-2)}
.p3 .ih-tp{background:var(--coral-l)}
.p3 .ih-tp img{filter:grayscale(1) contrast(1.05) brightness(1.12)}
/* how it's held up */
.pin .ih-fr::before{content:"";position:absolute;z-index:2;top:-6px;left:50%;width:11px;height:11px;margin-left:-5.5px;border-radius:50%;background:var(--coral-2);box-shadow:inset 0 0 0 1.6px var(--ink),1px 2px 0 rgba(20,19,17,.35)}
.tape .ih-fr::before{content:"";position:absolute;z-index:2;top:-7px;left:27%;width:46%;height:14px;background:rgba(238,231,216,.86);border:1px solid rgba(20,19,17,.16);transform:rotate(-4deg)}
.s-oval.tape .ih-fr::before{top:2%}
/* the gap a face leaves when it comes forward */
.ih-t.is-out .ih-tp{background:var(--paper-2)}
.ih-t.is-out .ih-tp img,.ih-t.is-out .ih-tn{opacity:0}
.ih-t.is-out .ih-fr{box-shadow:none;border-style:dashed}
/* now and then a card turns over to ask its question */
.ih-t.turn{z-index:4}
.ih-t.turn .ih-tc{transform-style:preserve-3d}
.ih-t.flip .ih-tc{transform:perspective(700px) translate(var(--x),var(--y)) rotate(var(--r)) scale(var(--s)) rotateY(180deg)}
.ih-bk{transform:rotateY(180deg);justify-content:center;align-items:center;gap:.5em;padding:10% 9%;text-align:center;background:var(--grain-c),var(--coral-l);border:1.3px solid var(--ink);box-shadow:-3px 4px 0 rgba(20,19,17,.82)}
.ih-bk::after{content:"";position:absolute;inset:4%;border:1px solid var(--ink);pointer-events:none}
.ih-bk-k{font-size:max(8px,calc(var(--c) * .07));font-weight:660;letter-spacing:.22em;text-transform:uppercase}
.ih-bk-q{font-family:var(--serif);font-style:italic;font-size:max(11px,calc(var(--c) * .102));line-height:1.18}
.big .ih-bk-q{font-size:calc(var(--c) * .15)}
.ih-bk-n{font-family:var(--display);font-weight:700;font-size:max(9px,calc(var(--c) * .08))}
.s-oval .ih-bk{border-radius:50%;padding:18% 16%}
.s-oval .ih-bk::after{border-radius:50%}

/* a few big cards in front, out at the edges (wide screens only) */
.ih-near{position:absolute;inset:0;z-index:1;transition:opacity .7s ease,transform .9s var(--ease)}
.ih-nr{position:absolute;left:var(--l);top:var(--t);width:calc(var(--c) * 2.3);aspect-ratio:1/1.3;translate:-50% -50%}
.ih-nr .ih-tc{transform:rotate(var(--r))}
.ih-nr .ih-fr{background:#ece0ca;padding:6%;box-shadow:8px 10px 0 rgba(20,19,17,.86)}
.ih-nr .ih-tp{border-radius:999px 999px 4px 4px}
.ih-nr .ih-tn{font-size:calc(var(--c) * .15)}
.ih-nr .ih-fr::before{content:"";position:absolute;z-index:2;top:-8px;left:50%;width:15px;height:15px;margin-left:-7.5px;border-radius:50%;background:var(--coral-2);box-shadow:inset 0 0 0 2px var(--ink),1px 2px 0 rgba(20,19,17,.35)}
.ih-veil{position:absolute;inset:0;z-index:2;background:var(--paper);opacity:0;transition:opacity .8s ease}

/* when a sentence is chosen the wall falls back */
.ih-hero.is-met .ih-veil{opacity:.58}
.ih-hero.is-met .ih-board{filter:blur(2.5px)}
.ih-hero.is-met .ih-near{opacity:0}

/* ---- the card on the wall ---- */
.ih-copy{--pw:clamp(400px,41cqw,590px);--pl:max(0px,calc((100cqw - 1320px) / 2));--sg:clamp(48px,4.4cqw,72px);
  position:relative;z-index:3;isolation:isolate;flex:none;width:var(--pw);margin-left:var(--pl);
  padding:clamp(24px,3vw,40px) clamp(22px,2.8vw,42px) clamp(22px,2.6vw,34px)}
.ih-copy::before{content:"";position:absolute;inset:0;z-index:-1;background:var(--grain),var(--paper);border:2px solid var(--ink);box-shadow:8px 8px 0 var(--coral-2);transform:rotate(-.6deg)}
.ih-copy::after{content:"";position:absolute;top:-9px;left:50%;width:17px;height:17px;margin-left:-8px;border-radius:50%;background:var(--coral-2);box-shadow:inset 0 0 0 2px var(--ink),1px 2px 0 rgba(20,19,17,.35)}
.ih-copy .kicker{margin:0}
.ih-h1{margin:14px 0 clamp(16px,2.4vh,24px);font-size:clamp(2.4rem,min(4.3vw,7.6vh),4.3rem)}
.ih-l1{display:block;white-space:nowrap}

.ih-lede{max-width:34em;margin:0 0 clamp(14px,2.2vh,22px);font-size:clamp(1rem,1.1vw,1.1rem);line-height:1.45;color:var(--ink-2)}
.ih-lede a{color:inherit;text-decoration-thickness:1px;text-underline-offset:3px}
.ih-lede a:hover{color:var(--ink)}
.ih-hero.is-met .ih-lede{display:none}
.ih-ask{display:flex;align-items:center;gap:10px;margin:0 0 12px;font-family:var(--serif);font-style:italic;font-size:clamp(1.18rem,1.55vw,1.42rem);line-height:1.2}
.ih-ask::after{content:"";flex:1 1 auto;height:1px;margin-top:4px;background:linear-gradient(90deg,rgba(20,19,17,.4) 50%,transparent 0) 0 0/7px 1px repeat-x}
.ih-says{list-style:none;margin:0;padding:0;display:grid;gap:clamp(7px,1.1vh,10px)}
.ih-says li:nth-child(odd) .ih-say{rotate:-.35deg}
.ih-says li:nth-child(even) .ih-say{rotate:.3deg}
.ih-say{position:relative;display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:44px;padding:.6em .9em .6em 1.9em;
  background:#fbf9f4;border:1.6px solid var(--ink);border-radius:3px;box-shadow:3px 3px 0 var(--coral-2);color:var(--ink);text-decoration:none;
  font-size:clamp(.97rem,1.05vw,1.06rem);font-weight:460;line-height:1.28;letter-spacing:-.005em;
  transition:translate .14s var(--ease),box-shadow .14s var(--ease),background .25s;-webkit-tap-highlight-color:transparent}
.ih-say::before{content:"\201C";position:absolute;left:.36em;top:50%;margin-top:-.2em;font-family:var(--serif);font-size:1.9em;line-height:1;color:var(--coral-2);font-weight:500}
.ih-say::after{content:"";flex:none;width:18px;height:12px;background:currentColor;opacity:.75;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 12'%3E%3Cpath d='M1 6h15M11 1.5 16 6l-5 4.5' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center/contain;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 12'%3E%3Cpath d='M1 6h15M11 1.5 16 6l-5 4.5' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center/contain;
  transition:transform .3s var(--ease)}
.ih-say:hover{translate:-1px -1px;box-shadow:4px 4px 0 var(--coral-2);background:#fff}
.ih-say:hover::after{transform:translateX(3px);opacity:1}
.ih-say:active,.ih-say.pressed{translate:3px 3px;box-shadow:0 0 0 var(--coral-2)}

/* ---- after a choice: what you said, the pair, and what happens next ---- */
.ih-met{animation:ih-in .55s var(--ease) both}
@keyframes ih-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.ih-said{position:relative;padding:14px 18px 14px;background:#fbf9f4;border:2px solid var(--ink);box-shadow:4px 4px 0 var(--coral-2);rotate:-.8deg;
  font-family:var(--serif);font-style:italic;font-size:clamp(1.12rem,1.45vw,1.3rem);line-height:1.28;outline-offset:5px}
.ih-said-k{display:block;margin-bottom:4px;font-family:var(--sans);font-style:normal;font-weight:650;font-size:.68rem;letter-spacing:.18em;text-transform:uppercase;color:var(--coral-ink)}
.ih-by{display:flex;align-items:center;gap:8px;margin:16px 0 0;font-family:var(--serif);font-style:italic;font-size:1rem;color:var(--ink-2)}
.ih-by svg{flex:none;width:26px;height:26px;fill:none;stroke:var(--ink);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ih-line{margin:clamp(16px,2.4vh,24px) 0 16px;font-family:var(--display);font-weight:700;font-size:clamp(1.2rem,1.65vw,1.5rem);line-height:1.18;text-wrap:pretty}
.ih-acts{display:flex;flex-wrap:wrap;gap:10px}
.ih-acts-pick{margin-top:clamp(14px,2vh,20px)}
.ih-more{display:flex;flex-wrap:wrap;gap:6px 22px;margin:16px 0 0}
.ih-lnk{font-size:.92rem;font-weight:560;color:var(--ink-2);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px;min-height:32px}
.ih-lnk:hover{color:var(--ink)}

/* the stage: one card, in the copy card by default */
.ih-stage{display:grid;grid-template-columns:minmax(0,340px);justify-content:center;margin-top:12px}
.ih-stage:empty{display:none}

/* ---- a carte de visite (in the stage, and in the pairs below the hero without JavaScript) ---- */
.ih-cdv{position:relative;display:flex;flex-direction:column;align-items:center;min-width:0;padding:14px 16px 18px;text-align:center;
  background:var(--grain),#ece0ca;border:1.6px solid var(--ink);box-shadow:5px 6px 0 rgba(20,19,17,.9)}
.ih-cdv::before{content:"";position:absolute;inset:6px;border:1px solid rgba(20,19,17,.45);pointer-events:none}
.ih-cp{position:relative;display:block;width:100%;aspect-ratio:5/5.4;border-radius:999px 999px 6px 6px;border:1.6px solid var(--ink);box-shadow:inset 0 0 0 3px #ece0ca}
.ih-cp img{object-position:50% 28%}
.ih-cn{margin:12px 0 0;font-family:var(--display);font-weight:700;font-size:clamp(1.05rem,1.4vw,1.28rem);line-height:1.05}
.ih-cd{margin-top:3px;font-family:var(--serif);font-style:italic;font-size:.9rem;color:var(--ink-2)}
.ih-ck{margin-top:12px;font-size:.6rem;font-weight:660;letter-spacing:.22em;text-transform:uppercase;color:var(--coral-ink)}
.ih-cq{margin-top:3px;font-family:var(--serif);font-style:italic;font-size:clamp(1rem,1.15vw,1.1rem);line-height:1.24}
.ih-cw{margin-top:3px;font-size:clamp(.84rem,.92vw,.92rem);line-height:1.42;color:var(--ink-2)}
/* in flight: the face first, the words arrive with it */
.ih-cdv.flying>:not(.ih-cp){opacity:0}
.ih-cdv>:not(.ih-cp){transition:opacity .45s ease}
.ih-stage .ih-cdv{will-change:transform}

/* wide screens: the card stands on the wall to the right of the copy, where the faces were */
@media (min-width:1000px) and (min-aspect-ratio:11/10){
  .ih-stage{--cw:min(370px,calc((100cqw - 2 * var(--pl) - var(--pw) - var(--sg) - 48px) * .62));
    position:absolute;top:50%;left:calc(100% + var(--sg));translate:0 -50%;margin:0;width:calc(100cqw - 2 * var(--pl) - var(--pw) - var(--sg));
    grid-template-columns:var(--cw);justify-content:center;align-items:start}
  .ih-stage .ih-cp{aspect-ratio:auto;height:min(calc(var(--cw) * .9),34vh)}
  .ih-by svg{transform:rotate(-55deg)}
  .ih-acts-pick .pill.sm{min-height:46px;padding:.55em 1.25em;font-size:.95rem}   /* full size on wide screens; small on phones so the two sit side by side */
}
@media (min-width:1000px) and (min-aspect-ratio:11/10) and (max-height:760px){
  .ih-stage .ih-cq{font-size:.98rem}.ih-stage .ih-cw{font-size:.83rem;line-height:1.36}
  .ih-stage .ih-ck{margin-top:8px}.ih-stage .ih-cdv{padding:12px 14px 14px}
}

/* short laptop screens: the card tightens so the whole of it fits under the nav */
@media (min-width:1000px) and (min-aspect-ratio:11/10) and (max-height:800px){
  .ih-copy{padding-top:20px;padding-bottom:18px}
  .ih-h1{margin:8px 0 10px}
  .ih-lede{font-size:.96rem;margin-bottom:10px}
  .ih-ask{margin-bottom:8px}
  .ih-says{gap:6px}
  .ih-say{min-height:40px;padding-top:.45em;padding-bottom:.45em}
}

/* tablets and narrow windows: a wider card, the pair inside it */
@media (max-width:999px),(max-aspect-ratio:11/10){
  .ih-copy{--pw:min(620px,100%)}
  .ih-near{display:none}
  .ih-stage .ih-cp{aspect-ratio:auto;height:min(46vw,34vh,260px)}
}

/* phones: the faces fill the screen, and the card is a sheet laid over them with a band of faces showing above */
@media (max-width:640px){
  .ih-hero{display:block;min-height:var(--vh,100svh);padding:calc(var(--nav-h) + clamp(64px,13svh,150px)) 10px 22px}   /* a band of faces above, short enough that the buttons come into view */
  .ih-wall{--c:clamp(76px,22vw,104px)}
  .ih-t:nth-child(n+37){display:none}   /* a phone shows thirty-odd; the rest needn't be drawn */
  .ih-copy{width:auto;margin:0;padding:22px 18px 20px}
  .ih-copy::before{background:var(--grain),rgba(245,242,236,.89);box-shadow:5px 5px 0 var(--coral-2);transform:rotate(-.8deg)}
  .ih-copy .kicker,.ih-h1,.ih-ask{text-shadow:0 0 6px var(--paper),0 0 2px var(--paper)}
  .ih-copy .kicker{letter-spacing:.12em;font-size:.68rem}
  .ih-h1{font-size:clamp(2.1rem,10.4vw,2.6rem);margin:10px 0 16px}
  .ih-ask{font-size:1.16rem;margin-bottom:10px}
  .ih-h1{margin-bottom:10px}
  .ih-lede{font-size:.98rem;line-height:1.4;margin-bottom:14px;text-shadow:0 0 6px var(--paper)}
  .ih-says{gap:8px}
  .ih-say{min-height:46px;padding:.55em .8em .55em 1.75em;font-size:.97rem}
  .ih-said{padding:12px 14px;font-size:1.1rem}
  .ih-line{font-size:1.18rem}
  .ih-acts .pill{flex:1 1 auto}
}
@media (max-width:560px){
  /* the portrait on the left, the words beside it */
  .ih-stage{grid-template-columns:1fr}
  .ih-stage .ih-cdv{display:grid;grid-template-columns:clamp(84px,27vw,112px) minmax(0,1fr);column-gap:14px;align-items:start;justify-items:start;text-align:left;padding:12px 14px 14px 12px}
  .ih-stage .ih-cp{grid-row:1/span 6;height:auto;aspect-ratio:4/5;border-radius:999px 999px 4px 4px}
  .ih-stage .ih-cdv>:not(.ih-cp){grid-column:2}
  .ih-stage .ih-cn{margin-top:2px}
  .ih-stage .ih-ck{margin-top:8px}
}

/* ---- without JavaScript: the pairs, laid out under the hero (the sentences link here) ---- */
html.js .ih-pairs{display:none}
.ih-pair+.ih-pair{margin-top:clamp(48px,6vw,80px)}
.ih-pq{display:inline-block;margin:0 0 22px;padding:14px 20px;background:#fbf9f4;border:2px solid var(--ink);box-shadow:4px 4px 0 var(--coral-2);
  font-family:var(--serif);font-style:italic;font-size:clamp(1.15rem,1.6vw,1.35rem);line-height:1.3}
.ih-cards{display:grid;grid-template-columns:repeat(2,minmax(0,300px));gap:clamp(18px,3vw,36px)}
.ih-pairs-end{margin-top:clamp(48px,6vw,80px)}
@media (max-width:560px){.ih-cards{grid-template-columns:1fr}}

/* reduced motion: a still wall, and changes without travel */
@media (prefers-reduced-motion:reduce){
  .ih-drift{animation:none}
  .ih-tc,.ih-board,.ih-veil,.ih-near{transition:none}
  .ih-met{animation:none}
  .ih-say,.ih-say::after{transition:none}
}
