/* Home hero. The seven concept brands as a fan of cards turning on one pivot below the screen, the way Nítido's
   mark fans three blades from one point. fan-hero.js opens it on load, flicks it one brand at a time, keeps the
   front card in focus and plays its film. Without script, or with reduced motion, it stands open and still:
   each card's --s (its place in the fan) and --a (its distance from the front) are written in the page. */

.fanhero {
  --gap: clamp(12px, 1.7vw, 24px);
  --step: 11.5deg;
  --lean: 4deg;  /* the fan leans right, as the mark's blades do */
  --w: min(25vw, 50svh, 470px);
  --d: calc(var(--w) * 1.1);
  position: relative;
  overflow: clip;
}

.fanhero__stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto 1fr;
  column-gap: var(--gap);
  row-gap: clamp(8px, 2svh, 24px);
  padding: calc(var(--header-h) + clamp(10px, 2.6svh, 36px)) var(--pad) clamp(20px, 4svh, 40px);
}

.fanhero__title {
  grid-column: 1 / -1;
  grid-row: 1;
  position: relative;
  z-index: 3;
  margin: 0;
  font-family: var(--font-display), system-ui, sans-serif;
  font-weight: 700;
  font-size: min(7.4vw, 13svh);
  line-height: 0.92;
  letter-spacing: -0.045em;
}
.fanhero__line { display: block; overflow: hidden; white-space: nowrap; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.fanhero__rise { display: inline-block; }
.fanhero__mark { display: inline-block; width: 0.78em; height: 0.78em; margin-left: 0.04em; vertical-align: 0.02em; color: var(--accent); }

.fanhero__answer {
  grid-column: 1 / span 4;
  grid-row: 2;
  align-self: end;
  position: relative;
  z-index: 3;
  max-width: 42ch;
}
.fanhero__lead { margin: 0 0 12px; font-size: clamp(20px, 1.75vw, 30px); line-height: 1.12; letter-spacing: -0.02em; font-weight: 500; }
.fanhero__body { margin: 0 0 22px; font-size: clamp(14px, 1.02vw, 16px); line-height: 1.5; opacity: 0.78; }

/* The fan: .fan is the pivot, a point below the cards; every card turns on it. */
.fanhero__fan { grid-column: 5 / -1; grid-row: 2; position: relative; min-height: calc(var(--w) * 1.25); }
.fan { position: absolute; left: 50%; top: calc(var(--w) * 1.25 + var(--d)); width: 0; height: 0; margin: 0; padding: 0; list-style: none; }
.fan__blade {
  position: absolute;
  left: calc(var(--w) / -2);
  bottom: var(--d);
  width: var(--w);
  aspect-ratio: 4 / 5;
  transform-origin: 50% calc(100% + var(--d));
  transform: rotate(calc(var(--s) * var(--step) + var(--lean))) scale(calc(1 - var(--a) * 0.03));
  filter: brightness(calc(1 - var(--a) * 0.14));
}
/* The card furthest left would sit behind the words, so the fan shows six at rest. */
.fan__blade--far { opacity: 0; }

.fan__card {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: var(--ink);
  box-shadow: 0 0 0 1px rgba(234, 231, 227, 0.16), 0 34px 70px -28px rgba(0, 0, 0, 0.75);
}
.fan__card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.fan__card img, .fan__card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fan__card video { opacity: 0; transition: opacity 0.35s var(--ease-pull); }
.fan__card video.is-on { opacity: 1; }
.fan__tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  gap: 8px;
  padding: 6px 9px 5px;
  background: var(--night);
  color: var(--night-ink);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: calc(1 - var(--a) * 2);
}
.fan__tag b { color: var(--accent); font-weight: 700; }
.fanhero__pause { border: 1px solid rgba(234, 231, 227, 0.28); cursor: pointer; min-height: 30px; }
.fanhero__pause:hover, .fanhero__pause:focus-visible { border-color: var(--night-ink); }
@media (pointer: coarse) { .fanhero__pause { min-height: 44px; min-width: 64px; } }

.fanhero__foot { position: absolute; z-index: 20; right: 0; bottom: 0; display: flex; gap: 6px; align-items: stretch; }
.fanhero__caption, .fanhero__pause {
  margin: 0;
  padding: 7px 11px 6px;
  background: var(--night);
  color: var(--night-ink);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Phones and narrow windows: headline, then the fan in its own band, then the words. */
@media (max-width: 959px) {
  .fanhero { --w: min(50vw, 300px); --step: 13deg; --lean: 0deg; --d: calc(var(--w) * 1.05); }
  .fanhero__stage { display: block; min-height: 0; padding-top: calc(var(--header-h) + 20px); padding-bottom: 64px; }
  .fanhero__title { font-size: clamp(40px, 11.4vw, 84px); }
  .fanhero__line, .fanhero__rise { display: inline; white-space: normal; overflow: visible; }
  .fanhero__line + .fanhero__line::before { content: " "; }
  .fanhero__fan { height: calc(var(--w) * 1.62); margin: 26px calc(var(--pad) * -1) 18px; overflow: hidden; }
  .fan { top: calc(var(--w) * 1.25 + var(--d) + 6px); }
  .fanhero__foot { right: var(--pad); }
  .fanhero__answer { max-width: 60ch; }
  .fanhero__body { font-size: 16px; }
}
