/* ==========================================================================
   n3-headers.css — "Why us?" section header · Q & A (Arcaneflow, Nocturne)

   <header class="wh">
     <h2 class="wh-sr" id="whyus-title">Why us? Because we’re the whole package.</h2>   (the real heading)
     <div class="wh-qa" aria-hidden="true"> … </div>                                    (the visual)
   </header>

   "Why us?" is asked in a pixel speech bubble; the answer types itself out in big type behind a block
   cursor (n3-headers.js splits it into letters; it re-types each time the header scrolls back into view).
   n3-headers.js sets on .wh-qa:  .wh-armed  (motion on: hold the intro's first frame)
                                  .wh-in     (scrolled into view: play the intro)
                                  .is-typing / .is-dots  (while the answer is on its way)
   Without the script, or when motion is paused / reduced, it shows its finished state.
   Night section only (the tokens are fixed, not read from data-tone).
   ========================================================================== */

.wh {
  --wh-main: clamp(44px, 6vw, 100px);
  --wh-ink: #F4F2FC;
  --wh-grad: linear-gradient(90deg, #A6C9FF 4%, #B99BF2 50%, #F1A0D1 94%);
  position: relative; margin: 0 0 clamp(40px, 5.6vw, 76px);
  container-type: inline-size;
}
.wh-sr {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.wh-qa { position: relative; }
/* the answer line */
.wh-a { position: relative; font: 600 var(--wh-main)/1 "Albert Sans", "Geist", system-ui, sans-serif; letter-spacing: -.055em; color: var(--wh-ink); text-wrap: balance; }
.wh-a em {
  font-style: normal; padding-right: .05em;
  background: var(--wh-grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.wh-l { display: inline; }
@media (max-width: 560px) { .wh-a .wh-l { display: block; } }
/* with container units: the one-line answer always fits its column (it is ≈ 14.1 em wide), and on phones the
   two lines ("Because we’re the" ≈ 7.55 em) fit down to 320 px */
@supports (width: 1cqi) {
  .wh { --wh-main: clamp(44px, min(6vw, 6.6cqi), 100px); }
  @media (max-width: 560px) { .wh { --wh-main: min(44px, 12.9cqi); } }
}

/* the question: a pixel speech bubble */
.wh-chat { display: flex; align-items: flex-end; gap: 14px; margin-bottom: clamp(26px, 3.2vw, 46px); }
.wh-bubble {
  --u: 4px;
  position: relative; isolation: isolate; display: inline-block; padding: .36em .6em .42em; margin-bottom: calc(var(--u) * 4);
  font: 600 clamp(28px, 3.1vw, 50px)/1 "Albert Sans", "Geist", system-ui, sans-serif; letter-spacing: -.045em; color: #15122A;
}
.wh-bubble::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, #FFFFFF, #ECE6FA);
  clip-path: polygon(0 calc(var(--u) * 2), var(--u) calc(var(--u) * 2), var(--u) var(--u), calc(var(--u) * 2) var(--u), calc(var(--u) * 2) 0, calc(100% - var(--u) * 2) 0, calc(100% - var(--u) * 2) var(--u), calc(100% - var(--u)) var(--u), calc(100% - var(--u)) calc(var(--u) * 2), 100% calc(var(--u) * 2), 100% calc(100% - var(--u) * 2), calc(100% - var(--u)) calc(100% - var(--u) * 2), calc(100% - var(--u)) calc(100% - var(--u)), calc(100% - var(--u) * 2) calc(100% - var(--u)), calc(100% - var(--u) * 2) 100%, calc(var(--u) * 2) 100%, calc(var(--u) * 2) calc(100% - var(--u)), var(--u) calc(100% - var(--u)), var(--u) calc(100% - var(--u) * 2), 0 calc(100% - var(--u) * 2));
}
/* the pixel tail, stepping down-left from the bubble */
.wh-tail {
  position: absolute; z-index: -1; left: calc(var(--u) * 3); top: calc(100% - 1px); width: calc(var(--u) * 4); height: calc(var(--u) * 4 + 1px); background: #ECE6FA;
  clip-path: polygon(0 0, 100% 0, 100% 25%, 75% 25%, 75% 50%, 50% 50%, 50% 75%, 25% 75%, 25% 100%, 0 100%);
}

/* the answer: letters not typed yet are only hidden (the layout never moves), the cursor rides after the last one */
.wh-ans { position: relative; }
.wh-c.is-off { visibility: hidden; }
.wh-cur {
  position: absolute; left: 0; top: 0; width: .4em; height: .74em; margin-top: .13em; background: #FF1B6B;
  box-shadow: 0 0 .3em rgba(255, 27, 107, .45); pointer-events: none;
}
/* "typing…" dots, shown only while the answer is on its way */
.wh-dots {
  position: absolute; left: 0; top: calc(var(--wh-main) * .2); display: none; gap: 8px; padding: 16px 18px;
  background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(236, 234, 246, .16);
  clip-path: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px));
}
.wh-dots i { width: 8px; height: 8px; background: #CDBDFF; }
.wh-qa.is-dots .wh-dots { display: flex; }
.wh-qa.is-dots .wh-cur { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  html:not(.af-paused) .wh-qa.wh-in:not(.is-typing) .wh-cur { animation: wh-blink 1.1s steps(1) infinite; }
  html:not(.af-paused) .wh-qa.is-dots .wh-dots i { animation: wh-dot .9s steps(2, jump-none) infinite alternate; }
  html:not(.af-paused) .wh-qa.is-dots .wh-dots i:nth-child(2) { animation-delay: .15s; }
  html:not(.af-paused) .wh-qa.is-dots .wh-dots i:nth-child(3) { animation-delay: .3s; }
  html:not(.af-paused) .wh-qa.wh-armed.wh-in .wh-bubble { animation: wh-pop .42s cubic-bezier(.2, .9, .3, 1.2) both; }
}
.wh-qa.wh-armed:not(.wh-in) .wh-bubble { opacity: 0; }
@keyframes wh-blink { 50% { opacity: 0; } }
@keyframes wh-dot { from { transform: translateY(2px); opacity: .45; } to { transform: translateY(-4px); opacity: 1; } }
@keyframes wh-pop { 0% { opacity: 0; transform: translateY(10px) scale(.92); transform-origin: 0 100%; } 100% { opacity: 1; transform: none; } }
