/* ================================================================
   TARABA BizComm — Home (the 5-minute showroom tour)
   css/pages/home.css | Loaded by index.html only, after
   base.css, layout.css, showroom.css, showroom-motion.css, modal.css.

   Rebuilt for the showroom restructure (Phase 7). Everything shared
   lives in css/showroom*.css; this file only lays out Home's 8 rooms.
   The pre-rebuild version is kept in _archive/pre-showroom/home.css.
================================================================ */

/* The fixed 70px nav sits over the hero, and anchor jumps
   ("Start the tour") must land below it. */
html {
  scroll-padding-top: 70px;
}
.hero-room {
  padding-top: calc(70px + var(--s-8));
}

/* Hero right side: the client's guide + logo animation (transparent,
   straight on the dark room). A wider right column than before (6/5
   instead of 7/5) keeps the guide and logo readable while the
   headline still breaks over three lines. */
.hero-room .wrap {
  grid-template-columns: 6fr 5fr;
}

/* Hero card wall (client request, 2026-10-31): the nine room-04 cards
   behind the headline, set a little up and down (not one straight line).
   Slot 7 on the right is the lit card; one softened card waits to its
   right and the other seven sit to its left. Every 1.2s each card moves
   one slot to the right, so the next card steps into the lit slot
   (js/pages/index.js sets --slot; the card leaving the right edge comes
   back in at the far left). */
.hero-wall {
  --cw: clamp(190px, 14.5vw, 290px);
  --pitch: calc(var(--cw) * 1.08);
  /* centre of the lit slot: well to the right, with room for one card after it */
  --hx: min(calc(50% + 3 * var(--pitch)), calc(100% - 1.6 * var(--pitch)));
  --zig: calc(var(--cw) * 0.16);
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.hero-wall__card {
  --slot: 0;
  --y: 0px;
  --sc: 1;
  position: absolute;
  top: 50%;
  left: calc(var(--hx) + (var(--slot) - 7) * var(--pitch) - var(--cw) / 2);
  width: var(--cw);
  aspect-ratio: 9 / 16;
  border-radius: var(--r-lg);
  overflow: hidden;
  transform: translateY(calc(-50% + var(--y))) scale(var(--sc));
  filter: brightness(0.5) saturate(0.8) blur(2px);
  transition:
    left 700ms var(--ease-out),
    transform 700ms var(--ease-out),
    filter 600ms var(--ease-out),
    box-shadow 600ms ease-out,
    opacity 400ms ease-out;
}
.hero-wall__card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-wall__card.is-lit {
  z-index: 1;
  filter: none;
  box-shadow:
    0 0 0 3px var(--orange),
    0 24px 50px rgba(0, 0, 0, 0.5);
}
/* the card wrapping from the right edge to the far left doesn't slide across */
.hero-wall__card.is-jump {
  transition: none;
  opacity: 0;
}
.hero-wall::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      rgba(1, 56, 106, 0.9) 0%,
      rgba(1, 56, 106, 0.72) 38%,
      rgba(1, 56, 106, 0.2) 62%,
      rgba(1, 56, 106, 0.1) 100%
    ),
    linear-gradient(0deg, rgba(1, 56, 106, 0.7), transparent 25%),
    linear-gradient(180deg, rgba(1, 56, 106, 0.6), transparent 20%);
}
.js-motion .hero-wall {
  animation: wall-in 900ms var(--ease-out) 200ms both;
}
@keyframes wall-in {
  from {
    opacity: 0;
  }
}
@media (max-width: 1023px) {
  .hero-wall::after {
    background: rgba(1, 56, 106, 0.66);
  }
}
@media (max-width: 639px) {
  .hero-wall {
    --cw: 140px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-wall__card {
    transition: none;
  }
}

/* Centred rooms (02 Gap, 07 Principle) */
.room-center {
  text-align: center;
}
.room-center h2 {
  margin-left: auto;
  margin-right: auto;
}
.gap-exhibit figcaption {
  margin: var(--s-5) auto 0;
  max-width: 40ch;
}
.gap-exhibit figcaption strong {
  color: var(--navy);
}

/* ── Room 03 — What we do ───────────────────── */
.room-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--s-6);
}
.exhibits {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 8 cards: 4 + 4 */
  gap: var(--s-4);
  margin-top: var(--s-7);
}

/* ── Room 05 — "What we do": the icons draw themselves ──────────
   Client, 2026-11-14: the yellow dot arrives first, then the rest of
   the icon is drawn around it.

   The icons come from the shared sprite through <use>, and CSS cannot
   select inside that shadow tree — but custom properties inherit into
   it, which is how the dot already takes its colour. So the sprite's
   shapes read --i-draw and --i-dot, and the card sets them from here.
   They are registered so the browser interpolates them; where
   @property is unsupported the icon simply shows fully drawn, which is
   also the state without JS or with reduced motion. */
@property --i-draw {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@property --i-dot {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}
/* before the card arrives: dot hidden, strokes undrawn */
.js-motion .exhibits .exhibit[data-reveal]:not(.is-in) .exhibit__icon .icon {
  --i-draw: 1;
  --i-dot: 0;
}
/* Once the card is in view the icon keeps redrawing itself (client,
   2026-11-14: the first pass was too quick to catch and ran only once).
   One turn takes 8s — the dot lands, the line takes 2.5s to draw, it
   holds a good while, then the whole icon blanks out and starts again
   from the dot (client, 2026-11-17: no reverse/unwind — it should
   disappear, not erase backwards). The blank is a hard cut: two
   keyframes a hundredth of a percent apart with no stop in between, so
   the browser has nothing to interpolate and the icon vanishes in one
   frame instead of animating to it. */
@keyframes exhibit-icon-draw {
  0% {
    --i-dot: 0;
    --i-draw: 1;
  }
  7% {
    --i-dot: 1;
    --i-draw: 1;
  }
  38% {
    --i-dot: 1;
    --i-draw: 0;
  }
  80% {
    --i-dot: 1;
    --i-draw: 0;
  }
  80.01% {
    --i-dot: 0;
    --i-draw: 1;
  }
  100% {
    --i-dot: 0;
    --i-draw: 1;
  }
}
.js-motion .exhibits .exhibit[data-reveal].is-in .exhibit__icon .icon {
  animation: exhibit-icon-draw 8s var(--ease-out) infinite;
  animation-delay: calc(var(--i, 0) * 260ms);
}

/* ── Room 04 — Industries ───────────────────── */
/* Square cards (client, 2026-10-31): the artwork cut square out of each
   tall card, with the name and line as page text underneath. Hover or
   focus turns a card over. Eight cards since Manufacturing and
   Automation became one (client, 2026-11-13) and ten again once Food
   Processing and Pets/Veterinary joined (2026-11-14), so the grid is a
   plain 5 × 2 (2 × 5 on a phone). */
#industries .industries {
  /* Below 1024px five across squeezes the longer names onto three lines
     and the row loses its rhythm, so tablets and phones get two. */
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-4);
  max-width: 820px;
  margin: var(--s-6) auto 0;
}
@media (min-width: 1024px) {
  #industries .industries {
    grid-template-columns: repeat(5, 1fr);
    max-width: none;
  }
}
#industries .industry {
  overflow: visible;
  border-radius: var(--r-lg);
  box-shadow: none;
}
.industry__in {
  display: block;
  height: 100%;
  perspective: 1000px;
}
.industry__card {
  position: relative;
  display: block;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 600ms var(--ease-out);
}
.industry:hover .industry__card,
.industry:focus-visible .industry__card {
  transform: rotateY(180deg);
}
.industry__face {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--navy-mid);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.7);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
#industries .industry img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
}
.industry__text {
  padding: var(--s-3) var(--s-4);
}
.industry__name {
  font-family: var(--f-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  /* the card heading in Marigold as well (client, 2026-11-14) */
  color: var(--orange);
}
/* The card's front name is an <h3> (real heading, 2026-11-04). It stays
   inline like the <span> it replaced, so the line box keeps coming from
   the parent's strut and the card height does not change. */
.industry__text h3.industry__name {
  display: inline;
}
.industry__line {
  font-size: var(--fs-small);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
}
/* the back: what we make for this sector, and the way to the work */
.industry__face--back {
  position: absolute;
  inset: 0;
  justify-content: center;
  gap: var(--s-3);
  padding: var(--s-6) var(--s-5);
  /* Marigold instead of white when the card is turned over (client,
     2026-11-14) — the one flat #EAA221, not a gradient. */
  background: var(--orange);
  border-color: transparent;
  transform: rotateY(180deg);
}
.industry__face--back .industry__name {
  font-size: 20px;
  color: var(--navy);
}
.industry__face--back .industry__line {
  color: var(--navy);
}
.industry__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--s-2);
  font-family: var(--f-display);
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--navy);
}
.industry__more .icon {
  width: 16px;
  height: 16px;
}
/* Card i flips in, one after another */
.js-motion [data-motion="industries"] .industry__in {
  transition:
    transform 500ms var(--ease-out),
    opacity 300ms ease-out;
  transition-delay: calc(180ms + var(--i, 0) * 200ms);
  transform-origin: 50% 50%;
}
.js-motion [data-motion="industries"]:not(.is-in) .industry__in {
  opacity: 0;
  transform: perspective(1000px) rotateY(-90deg);
}
@media (max-width: 639px) {
  /* phones: a static 2-column grid so all nine cards show on the page
     (client, 2026-11-04) instead of a single row the visitor had to
     swipe sideways through. */
  #industries .industries {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-flow: row;
    gap: var(--s-3);
    overflow-x: visible;
    scroll-snap-type: none;
    margin-right: 0;
    padding: 0;
  }
  #industries .industry {
    scroll-snap-align: none;
  }
  .industry__name {
    font-size: 15px;
  }
  .industry__face--back {
    padding: var(--s-4) var(--s-3);
  }
  .industry__face--back .industry__name {
    font-size: 17px;
  }
  .industry__line {
    font-size: 13px;
  }
}

/* ── Room 06 — Our Principal ────────────────── */
/* Execute: the same sentence as before, with a small icon before each
   output (client, 2026-10-31) */
.step__out .icon {
  width: 1.15em;
  height: 1.15em;
  margin-right: 0.25em;
  vertical-align: -0.2em;
  color: var(--brand-navy);
}
/* End state: every step lit orange (the arrow completed the path) */
#principal .step__badge {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--navy);
  --icon-dot: var(--white);
}
/* Badges pop in as before; each turns orange when the arrow lands on
   its step (js/pages/index.js adds .is-lit) */
.js-motion #principal [data-motion="steps"] .step__badge {
  transition:
    opacity 250ms var(--ease-out),
    transform 350ms cubic-bezier(0.3, 1.4, 0.5, 1),
    background-color 220ms ease-out,
    border-color 220ms ease-out,
    color 220ms ease-out;
  transition-delay:
    calc(var(--i, 1) * 280ms - 120ms),
    calc(var(--i, 1) * 280ms - 120ms),
    0s,
    0s,
    0s;
}
.js-motion #principal [data-motion="steps"] .step:not(.is-lit) .step__badge {
  background: var(--white);
  border-color: var(--border-h);
  color: var(--brand-navy);
}
.js-motion #principal .step.is-lit .step__badge {
  animation: step-lit 420ms ease-out;
}
@keyframes step-lit {
  40% {
    transform: scale(1.14);
    box-shadow: 0 0 0 8px rgba(234, 162, 33, 0.18);
  }
}
/* The logo's arrow + the dotted path it draws (js/pages/index.js) */
.steps__arrow {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: 40px;
  height: 32px;
  margin: -16px 0 0 -20px; /* transform places its centre */
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 4px 6px rgba(1, 56, 106, 0.25));
}
.steps__arrow svg {
  display: block;
}
.steps__trail {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}
.steps__trail-dots {
  fill: none;
  stroke: #eaa221;
  stroke-opacity: 0.6;
  stroke-width: 2;
  stroke-dasharray: 2 8;
  stroke-linecap: round;
}
.steps__trail-reveal {
  fill: none;
  stroke: #fff;
  stroke-width: 14;
}
/* the arrow draws its own path, so the static line steps aside */
.has-flight .steps__line {
  display: none;
}
.kpi {
  margin-top: var(--s-8);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
  font-size: var(--fs-lead);
  color: var(--text-soft);
  /* client, 2026-11-02: one line wherever it fits (was max 60ch) */
  max-width: none;
}
.kpi strong {
  color: var(--navy);
  /* client, 2026-11-13: capitals and properly bold */
  font-weight: 800;
  text-transform: uppercase;
}

/* ── Room 06 — Proof ────────────────────────── */
.proof {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--s-8);
  align-items: center;
}
.proof .stats {
  margin-top: var(--s-7);
  display: grid;
  grid-template-columns: repeat(2, auto);
  justify-content: start;
  gap: var(--s-6) var(--s-8);
}
.quote {
  padding: var(--s-6);
  border-left: 3px solid var(--orange);
  background: var(--white);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  box-shadow: var(--shadow-sm);
}
.quote p {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--navy);
}
.quote cite {
  display: block;
  margin-top: var(--s-4);
  font-size: var(--fs-small);
  font-style: normal;
  color: var(--text-soft);
}
.quotes__nav {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-5);
}
.quotes__nav .btn-link {
  margin-left: auto;
}
.proof__logos {
  margin-top: var(--s-8);
}
/* Client logos in their own colours, a size up from the shared strip */
.proof__logos .logo-strip img {
  /* client, 2026-11-13: the logos were reading too small on the page */
  height: 96px;
  padding: 10px 18px;
  filter: none;
  opacity: 1;
}
/* less empty space under the logos, before Let's talk */
#proof {
  padding-bottom: calc(var(--room-y) / 2);
}
@media (max-width: 639px) {
  .proof__logos .logo-strip img {
    height: 72px;
  }
}

/* ── Room 02 — Fundamental Principle ───────────
   A white room right after the dark hero, so the two read as separate
   rooms. Helvetica and no animation at all, both on the client's ask
   (2026-11-03): the three capitals simply sit in slate and CHARACTER in
   orange; the strikes, the typing and the 4.5s replay are gone. */
#principle .statement__intro {
  max-width: 62ch;
  margin: 0 auto var(--s-5);
  text-align: center;
  font-size: var(--fs-lead);
  color: var(--text-soft);
}
#principle .statement {
  /* the line break in the markup does the splitting, so the line may
     use the whole wrap; 47px is the largest that still fits the long
     line on one row at 1280 and up */
  max-width: none;
  font-size: clamp(22px, 3.4vw, 47px);
  color: var(--navy);
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}
#principle .statement em {
  color: var(--slate);
}
#principle .statement strong {
  color: var(--orange-ink-lg);
  /* One thickness across the whole line (client, 2026-11-13): the
     weight TRICKS / TOOLS / TECHNIQUES already had, which is the
     statement's own 700. CHARACTER used to be heavier because <strong>
     picks up the browser's "bolder" and lands on 900 — that extra
     width is also what pushed the line past two rows. Colours stay. */
  font-weight: 700;
}
#principle .statement em::after {
  display: none;
}

/* ── Room 08 — CTA ──────────────────────────── */
#talk {
  background: var(--navy-deep);
}

/* ─────────────────────────────────────────────
       RESPONSIVE
    ───────────────────────────────────────────── */
@media (max-width: 1023px) {
  .exhibits {
    grid-template-columns: repeat(2, 1fr);
  }
  .proof {
    grid-template-columns: 1fr;
    gap: var(--s-7);
  }
  .hero-room .wrap {
    grid-template-columns: 1fr;
  }
  /* still flush with the right edge (the guide enters from off screen) */
  .hero-show {
    max-width: 600px;
    justify-self: end;
    width: 100%;
  }
}
@media (max-width: 639px) {
  .hero-room {
    padding-top: calc(70px + var(--s-6));
    min-height: 0;
  }
  .room-head {
    grid-template-columns: 1fr;
    gap: var(--s-4);
  }
  .exhibits {
    grid-template-columns: 1fr;
    gap: var(--s-3);
  }
  .exhibit {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: var(--s-4);
    column-gap: var(--s-4);
  }
  .exhibit__icon {
    width: 52px;
    height: 52px;
  }
  .exhibit h3 {
    flex: 1;
  }
  .exhibit p {
    flex-basis: 100%;
  }
  .proof .stats {
    gap: var(--s-5) var(--s-6);
  }
  .quotes__nav {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .industry__card {
    transition: none;
  }
  .industry:hover .industry__card,
  .industry:focus-visible .industry__card {
    transform: none;
  }
}
