/* home-band.css: the black band on the home page.
   It sits straight under the hero snapshot: "We built MESAscale around the levers…" with the
   scroll-linked sphere, then a glow that turns the black into the white logo wall. A second glow
   (light to black) leads into Verified Client Results, which the thesis with its signature closes out.
   Markup is injected by scripts/home-band.py; behaviour is in home-band.js.
   Structure after the Darkroom home page; glow, sphere and signature are our own. */

:root {
  --hb-bg: #0f1011;                     /* the site's obsidian, so the band meets the sections after it with no seam */
  --hb-top: #fff;                       /* the manifesto it grows out of */
  --hb-serif: 'Zodiak', 'DM Serif Display', Georgia, serif;
  /* the thesis body: chosen to sit as close as a free face can to the book serif on darkroomagency.com
     (per-letter proportions, stroke weight and x-height measured against it; Zodiak was 27% heavier and wider) */
  --hb-thesis-serif: 'Cambo', 'PT Serif', Georgia, serif;
  --hb-sans: 'Inter', system-ui, sans-serif;
  --hb-ember: #F05A28;
}

/* ───────────── the bridge: light → ember glow → black ───────────── */
.hb-bridge { position: relative; height: clamp(300px, 56vh, 540px); margin-top: -1px; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, var(--hb-top) 0%, var(--hb-top) 30%, var(--hb-bg) 100%); }
.hb-glow { position: absolute; inset: 0; will-change: transform, opacity;
  background:
    linear-gradient(180deg, var(--hb-top) 0%, var(--hb-top) 6%, rgba(244, 244, 244, 0) 46%),
    radial-gradient(ellipse 84% 94% at 50% 0%,
      var(--hb-top) 0%, var(--hb-top) 24%, #ffe6d9 36%, #ffb48f 49%, #ff8147 59%, #f05a28 66%, #b23c17 73%, #5a1d0c 81%, #1d0f0a 90%, var(--hb-bg) 97%);
  transform: translate3d(0, calc((1 - var(--hb-p, 1)) * 9%), 0) scale(calc(1.14 - var(--hb-p, 1) * .14), calc(.86 + var(--hb-p, 1) * .14));
  transform-origin: 50% 0;
  opacity: calc(.2 + var(--hb-p, 1) * .8); }
.hb-bridge::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .5; mix-blend-mode: soft-light;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 86%); mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 86%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E"); }

/* the way out: the same dome turned over, so the black rises out of the white logo wall */
.hb-bridge--out { --hb-top: #fff; height: clamp(260px, 46vh, 460px); margin-bottom: -1px; transform: scaleY(-1);
  background: linear-gradient(180deg, var(--hb-top) 0%, var(--hb-top) 30%, var(--hb-bg) 64%, var(--hb-bg) 100%); }

.results-section { padding-bottom: 70px; }
/* the cover-colour ambience behind the carousel dissolves at both ends instead of ending on an edge */
.results-section .cf-amb { -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 24%, #000 76%, transparent 100%); mask-image: linear-gradient(180deg, transparent 0%, #000 24%, #000 76%, transparent 100%); }

/* ───────────── thesis ───────────── */
.hb-thesis { position: relative; background: var(--hb-bg); padding: clamp(80px, 9vw, 132px) 0 clamp(72px, 8vw, 116px); }
.hb-th-inner { width: min(1220px, calc(100% - 2 * var(--sc-gutter, 32px))); margin: 0 auto; display: grid; grid-template-columns: 195px minmax(0, 1fr); align-items: start; }
.hb-sig { width: 96px; height: auto; margin-top: -14px; overflow: visible; }
.hb-sig path { stroke: #fff; stroke-width: 3.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.hb-th-main { min-width: 0; grid-column: 2; }
.hb-th-h { margin: 0; font-family: var(--hb-sans); font-size: 34px; line-height: 44px; font-weight: 400; letter-spacing: -.005em; color: #fff; text-wrap: balance; }
.hb-th-body { max-width: 790px; margin: 52px 0 0 54px; }
.hb-th-body p { margin: 0 0 24px; font-family: var(--hb-thesis-serif); font-weight: 400; font-size: 20px; line-height: 30px; letter-spacing: 0; color: #a1a1a1; text-wrap: pretty;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
/* the last paragraph is the white one (the sign-off follows it, so it is no longer :last-child) */
.hb-th-body > p:nth-of-type(4) { margin-bottom: 0; color: #fff; }

/* the sign-off: the founder's signature and printed name close the thesis, the way a letter ends */
.hb-so { display: flex; align-items: flex-end; gap: 18px; margin-top: 38px; }
.hb-so .hb-sig { width: 92px; margin: 0; flex: none; }
.hb-so-t { padding-bottom: 6px; }
.hb-so-n { display: block; font-family: var(--hb-thesis-serif); font-size: 18px; line-height: 24px; color: #fff; }
.hb-so-r { display: block; margin-top: 2px; font-family: var(--hb-sans); font-size: 13.5px; line-height: 20px; color: #8d8d8d; }

/* the signature writes itself when the sign-off scrolls into view (it sits at the foot of a long block); the lines come up one after another when the section does */
.hb-armed .hb-sig path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.hb-armed.is-signed .hb-sig path { animation: hb-write 1.7s cubic-bezier(.5, 0, .3, 1) forwards; }
.hb-armed.is-signed .hb-sig path:nth-child(2) { animation-delay: .55s; animation-duration: 1.2s; }
.hb-armed.is-signed .hb-sig path:nth-child(3) { animation-delay: 1s; animation-duration: 1.5s; }
.hb-armed.is-signed .hb-sig path:nth-child(4) { animation-delay: 1.5s; animation-duration: 1.3s; }
@keyframes hb-write { to { stroke-dashoffset: 0; } }
.hb-armed .hb-so-t { opacity: 0; }
.hb-armed.is-signed .hb-so-t { opacity: 1; transition: opacity .9s ease 1.6s; }
.hb-armed .hb-th-h, .hb-armed .hb-th-body p { opacity: 0; transform: translate3d(0, 14px, 0); }
.hb-armed.is-in .hb-th-h, .hb-armed.is-in .hb-th-body p { opacity: 1; transform: none; transition: opacity .9s ease, transform 1s cubic-bezier(.22, 1, .36, 1); }
.hb-armed.is-in .hb-th-h { transition-delay: .15s; }
.hb-armed.is-in .hb-th-body p:nth-child(1) { transition-delay: .35s; }
.hb-armed.is-in .hb-th-body p:nth-child(2) { transition-delay: .5s; }
.hb-armed.is-in .hb-th-body p:nth-child(3) { transition-delay: .65s; }
.hb-armed.is-in .hb-th-body p:nth-child(4) { transition-delay: .8s; }

/* ───────────── levers ───────────── */
.hb-levers { position: relative; background: var(--hb-bg); padding: clamp(96px, 10vw, 150px) 0 clamp(90px, 11vw, 160px); }
.hb-lv-h { width: min(560px, calc(100% - 2 * var(--sc-gutter, 32px))); margin: 0 auto; text-align: center; font-family: var(--hb-serif); font-weight: 400; font-size: 28px; line-height: 37.8px; letter-spacing: -.02em; color: #fff; text-wrap: balance; }
.hb-lv-grid { position: relative; width: min(927px, calc(100% - 2 * var(--sc-gutter, 32px))); margin: clamp(110px, 14vw, 205px) auto 0; display: grid; grid-template-columns: 400px 330px; justify-content: space-between; align-items: stretch; }
.hb-lv-list { list-style: none; margin: 0; padding: 0; }
.hb-lv-item { padding-bottom: clamp(120px, 21vh, 210px); opacity: .26; transition: opacity .6s ease; }
.hb-lv-item:last-child { padding-bottom: 0; }
.hb-levers[data-a="1"] .hb-lv-item[data-i="1"], .hb-levers[data-a="2"] .hb-lv-item[data-i="2"],
.hb-levers[data-a="3"] .hb-lv-item[data-i="3"], .hb-levers[data-a="4"] .hb-lv-item[data-i="4"] { opacity: 1; }
.hb-num { display: grid; place-items: center; width: 20px; height: 20px; margin: 0 0 18px; border: 1px solid #fff; border-radius: 50%; font-family: var(--hb-sans); font-size: 11px; line-height: 1; font-weight: 500; color: #fff; }
.hb-lv-item h3 { margin: 0 0 14px; font-family: var(--hb-serif); font-weight: 400; font-size: 24px; line-height: 32px; letter-spacing: -.01em; color: #fff; }
.hb-lv-item p { margin: 0; max-width: 400px; font-family: var(--hb-sans); font-size: 16px; line-height: 24px; letter-spacing: .02em; font-weight: 400; color: #fff; }
.hb-lv-fig { display: none; }

/* the sphere: sticky on desktop */
.hb-lv-stick { position: sticky; top: calc(50vh - 190px); align-self: start; width: 330px; height: 330px; margin-top: -4px; }
.hb-g { position: relative; width: 100%; height: 100%; }
.hb-globe { display: block; width: 100%; height: 100%; overflow: visible; }
.hb-globe circle { fill: none; stroke: rgba(255, 255, 255, .62); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hb-globe .hb-g-out { stroke: rgba(255, 255, 255, .78); }
.hb-globe .hb-g-r1, .hb-globe .hb-g-r2, .hb-globe .hb-g-r3, .hb-globe .hb-g-in { transform-origin: 200px 200px; transition: transform 1.25s cubic-bezier(.65, 0, .2, 1); }
.hb-idle { transform-origin: 200px 200px; animation: hb-breathe 9s ease-in-out infinite alternate; }
.hb-g-r2 .hb-idle { animation-duration: 12s; animation-delay: -4s; }
.hb-g-r3 .hb-idle { animation-duration: 15s; animation-delay: -7s; }
@keyframes hb-breathe { from { transform: scale(1, .955); } to { transform: scale(1, 1.045); } }

/* four poses of the same three rings */
.hb-globe[data-s="1"] .hb-g-r1 { transform: rotate(-8deg) scaleY(.27); }
.hb-globe[data-s="1"] .hb-g-r2 { transform: rotate(64deg) scaleY(.52); }
.hb-globe[data-s="1"] .hb-g-r3 { transform: rotate(0deg) scaleX(.56); }
.hb-globe[data-s="1"] .hb-g-in { transform: translate(34px, -34px) scale(.7); }
.hb-globe[data-s="2"] .hb-g-r1 { transform: rotate(32deg) scaleY(.36); }
.hb-globe[data-s="2"] .hb-g-r2 { transform: rotate(-42deg) scaleY(.64); }
.hb-globe[data-s="2"] .hb-g-r3 { transform: rotate(26deg) scaleX(.3); }
.hb-globe[data-s="2"] .hb-g-in { transform: translate(-20px, 24px) scale(.62); }
.hb-globe[data-s="3"] .hb-g-r1 { transform: rotate(-34deg) scaleY(.2); }
.hb-globe[data-s="3"] .hb-g-r2 { transform: rotate(84deg) scaleY(.72); }
.hb-globe[data-s="3"] .hb-g-r3 { transform: rotate(-18deg) scaleX(.78); }
.hb-globe[data-s="3"] .hb-g-in { transform: translate(28px, 30px) scale(.5); }
.hb-globe[data-s="4"] .hb-g-r1 { transform: rotate(8deg) scaleY(.44); }
.hb-globe[data-s="4"] .hb-g-r2 { transform: rotate(122deg) scaleY(.34); }
.hb-globe[data-s="4"] .hb-g-r3 { transform: rotate(2deg) scaleX(.16); }
.hb-globe[data-s="4"] .hb-g-in { transform: translate(-30px, -26px) scale(.82); }

/* the pin: numbered node on the ring and a label, like a callout */
.hb-pin { position: absolute; left: calc(var(--px, 62) * 1%); top: calc(var(--py, 30) * 1%); display: flex; align-items: center; transform: translate(-11px, -50%); transition: left 1.25s cubic-bezier(.65, 0, .2, 1), top 1.25s cubic-bezier(.65, 0, .2, 1); white-space: nowrap; }
.hb-g[data-s="1"] { --px: 60; --py: 30; }
.hb-g[data-s="2"] { --px: 42; --py: 68; }
.hb-g[data-s="3"] { --px: 46; --py: 46; }
.hb-g[data-s="4"] { --px: 56; --py: 40; }
.hb-node { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--hb-bg); border: 1px solid #fff; font-family: var(--hb-sans); font-size: 11.5px; line-height: 1; font-weight: 500; color: #fff; box-shadow: 0 0 0 4px rgba(240, 90, 40, .18), 0 0 18px rgba(240, 90, 40, .45); }
.hb-pin i { flex: none; width: 9px; height: 1px; background: rgba(255, 255, 255, .7); }
.hb-pill { padding: 3px 8px 4px; border: 1px solid #fff; border-radius: 6px; background: var(--hb-bg); font-family: var(--hb-sans); font-size: 14px; line-height: 17px; font-weight: 500; color: #fff; transition: opacity .3s ease; }
.hb-pin.is-swap .hb-pill, .hb-pin.is-swap .hb-node b { opacity: 0; }
.hb-node b { font-weight: 500; transition: opacity .3s ease; }

/* ───────────── phones and tablets: static graphic after each item ───────────── */
@media (max-width: 899px) {
  .hb-th-inner { grid-template-columns: minmax(0, 1fr); row-gap: 26px; }
  .hb-th-main { grid-column: 1; }
  .hb-sig { width: 68px; margin: 0; }
  .hb-so { margin-top: 30px; gap: 14px; }
  .hb-so .hb-sig { width: 76px; }
  .hb-th-h { font-size: 28px; line-height: 37px; }
  .hb-th-body { margin: 30px 0 0 0; }
  .hb-th-body p { font-size: 18px; line-height: 28px; margin-bottom: 20px; }
  .hb-levers { padding-top: 64px; }
  .hb-lv-h { font-size: 24px; line-height: 32px; }
  .hb-lv-grid { display: block; width: min(560px, calc(100% - 2 * var(--sc-gutter, 18px))); margin-top: 56px; }
  .hb-lv-stick { display: none; }
  .hb-lv-item, .hb-lv-item:last-child { opacity: 1; padding: 0 0 clamp(54px, 12vw, 80px); }
  .hb-lv-item:last-child { padding-bottom: 0; }
  .hb-lv-item p { max-width: none; font-size: 15px; line-height: 23px; }
  .hb-lv-fig { display: block; position: relative; width: min(330px, 86%); aspect-ratio: 1; margin: 34px auto 0; }
  .hb-lv-fig .hb-pin { transition: none; }
  .hb-lv-fig .hb-globe .hb-g-r1, .hb-lv-fig .hb-globe .hb-g-r2, .hb-lv-fig .hb-globe .hb-g-r3, .hb-lv-fig .hb-globe .hb-g-in { transition: none; }
  .hb-lv-fig .hb-g[data-s="1"] { --px: 58; --py: 30; } .hb-lv-fig .hb-g[data-s="2"] { --px: 30; --py: 68; }
  .hb-lv-fig .hb-g[data-s="3"] { --px: 36; --py: 46; } .hb-lv-fig .hb-g[data-s="4"] { --px: 48; --py: 40; }
  .hb-pill { font-size: 13px; }
}
@media (max-width: 560px) {
  .hb-bridge { height: clamp(240px, 38vh, 340px); }
  .hb-lv-fig { width: min(300px, 92%); }
  .hb-pin { transform: translate(-11px, -50%) scale(.92); transform-origin: 11px 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .hb-glow { transform: none; opacity: 1; }
  .hb-armed .hb-sig path { stroke-dashoffset: 0; animation: none !important; }
  .hb-armed .hb-so-t { opacity: 1; transition: none; }
  .hb-armed .hb-th-h, .hb-armed .hb-th-body p { opacity: 1; transform: none; transition: none; }
  .hb-idle { animation: none; }
  .hb-globe .hb-g-r1, .hb-globe .hb-g-r2, .hb-globe .hb-g-r3, .hb-globe .hb-g-in, .hb-pin, .hb-lv-item { transition: none; }
}
