/* ==========================================================================
   Split-flap departure board section (#concept-flap, below From Brief to
   Viral). Logic lives in js/concepts.js.
   ========================================================================== */

.flap {
  position: relative;
  z-index: 1;
  padding: 11rem 0 14rem;
  text-align: center;
}
.flap .eyebrow { margin-bottom: 1.4rem; }
.flap__title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 7.6rem;
  line-height: 0.95;
  letter-spacing: -0.4rem;
  text-transform: uppercase;
  color: var(--cream);
  margin-bottom: 5rem;
}

.fb {
  /* every board measurement derives from these; js/concepts.js sets --fb-n
     per header cell from the same COLS constant that builds the rows */
  --fb-ch-w: 1.55rem;
  --fb-ch-h: 2.5rem;
  --fb-ch-fs: 1.8rem;
  --fb-ch-gap: 0.18rem;
  --fb-col-gap: 2.6rem;
  position: relative;
  display: inline-block;
  max-width: calc(100vw - 4.8rem);
  overflow-x: auto;
  padding: 2.6rem 3.2rem 3.4rem;
  background: #131311;
  border: 0.1rem solid rgba(239, 239, 209, 0.14);
  border-radius: 1.6rem;
  box-shadow: 0 3rem 8rem rgba(0, 0, 0, 0.45);
  text-align: left;
}
.fb__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4rem;
  padding-bottom: 1.8rem;
  margin-bottom: 2rem;
  border-bottom: 0.1rem solid rgba(239, 239, 209, 0.14);
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 1.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream);
}
.fb__dep { color: var(--lime); }
.fb__clock { opacity: 0.7; font-variant-numeric: tabular-nums; }

.fb__head {
  display: flex;
  gap: var(--fb-col-gap);
  margin-bottom: 1.2rem;
  font-family: 'Oswald', sans-serif;
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(239, 239, 209, 0.55);
}
.fb__h {
  width: calc(var(--fb-n) * var(--fb-ch-w) + (var(--fb-n) - 1) * var(--fb-ch-gap));
}

.fb__rows { display: flex; flex-direction: column; gap: 1rem; }
.fb__row {
  position: relative;
  display: flex;
  gap: var(--fb-col-gap);
  color: inherit;
  text-decoration: none;
}
.fb__row::before {
  content: '';
  position: absolute;
  inset: -0.4rem -0.7rem;
  border-radius: 0.6rem;
  background: rgba(239, 239, 209, 0.05);
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.fb__row:hover::before { opacity: 1; }
.fb__row--cta { cursor: pointer; }
.fb__row--cta:hover::before { background: rgba(253, 79, 55, 0.12); }
.fb__cell { display: flex; gap: var(--fb-ch-gap); }
.fb__ch {
  position: relative;
  display: block;
  width: var(--fb-ch-w);
  height: var(--fb-ch-h);
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: var(--fb-ch-fs);
  line-height: var(--fb-ch-h);
  text-align: center;
  color: var(--cream);
  background: linear-gradient(#2b2a25, #1e1d19 48%, #14140f 52%, #21201c);
  border-radius: 0.3rem;
}
/* split-flap seam */
.fb__ch::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0.1rem;
  background: rgba(0, 0, 0, 0.55);
}
.fb__cell--5 .fb__ch { color: var(--lime); }
.fb__cell--hot .fb__ch { color: var(--red); }

/* airport-board blink on the CTA row's BOARDING status */
.fb__row--cta .fb__cell--5 { animation: fb-blink 1.2s step-end infinite; }
@keyframes fb-blink {
  0% { opacity: 1; }
  50% { opacity: 0.35; }
  100% { opacity: 1; }
}

/* flap fold about the seam while cycling, mechanical settle on landing */
.fb__ch--flip { animation: fb-flip 0.09s linear infinite; }
@keyframes fb-flip {
  0% { transform: perspective(24rem) rotateX(0deg); }
  49% { transform: perspective(24rem) rotateX(-56deg); filter: brightness(1.45); }
  50% { transform: perspective(24rem) rotateX(52deg); filter: brightness(0.75); }
  100% { transform: perspective(24rem) rotateX(0deg); }
}
.fb__ch--settle { animation: fb-settle 0.16s ease-out; }
@keyframes fb-settle {
  0% { transform: perspective(24rem) rotateX(20deg); filter: brightness(0.9); }
  100% { transform: none; filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fb__row--cta .fb__cell--5,
  .fb__ch--flip,
  .fb__ch--settle { animation: none; }
}

/* static row list for assistive tech (the animated grid is aria-hidden) */
.fb__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  list-style: none;
}

/* ---------- laptop ---------- */

@media (max-width: 1280px) and (min-width: 821px) {
  .fb {
    --fb-ch-w: 1.25rem;
    --fb-ch-h: 2.1rem;
    --fb-ch-fs: 1.45rem;
    --fb-ch-gap: 0.15rem;
    --fb-col-gap: 2rem;
  }
}

/* ---------- mobile ---------- */

@media (max-width: 820px) {
  .flap { padding: 6rem 0 8rem; }
  .flap__title { font-size: 3.4rem; letter-spacing: -0.2rem; margin-bottom: 3rem; }

  .fb {
    --fb-ch-w: 1rem;
    --fb-ch-h: 1.8rem;
    --fb-ch-fs: 1.2rem;
    --fb-ch-gap: 0.12rem;
    --fb-col-gap: 1.4rem;
    max-width: calc(100vw - 3.2rem);
    padding: 1.6rem 1.6rem 2rem;
    border-radius: 1rem;
  }
  .fb__top {
    gap: 1rem;
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    padding-bottom: 1rem;
    margin-bottom: 1.2rem;
  }
  .fb__head { display: none; }
  /* time + result drop; format wraps onto its own line above client + status */
  .fb__cell--1, .fb__cell--4 { display: none; }
  .fb__cell--2 { flex-basis: 100%; }
  .fb__rows { gap: 0.9rem; }
  .fb__row {
    flex-wrap: wrap;
    row-gap: 0.35rem;
    padding-bottom: 0.9rem;
    border-bottom: 0.1rem solid rgba(239, 239, 209, 0.08);
  }
  .fb__rows .fb__row:last-child { border-bottom: 0; padding-bottom: 0; }
}

@media (max-width: 380px) {
  .fb { --fb-ch-w: 0.9rem; --fb-ch-fs: 1.1rem; }
}
