/* =========================================================
   ABOUT US PAGE
   Hero → Story (alternating rows) → Numbers → Showreel
   (video + gallery) → Certifications → CTA
   ========================================================= */

/* =========================================================
   HERO
   ========================================================= */
.ab-hero {
  position: relative;
  padding-top: calc(var(--header-h) + 40px);
  padding-bottom: clamp(60px, 9vw, 120px);
  background: #fff;
  border-bottom: 1px solid var(--border);
  clip-path: inset(0);
}

.ab-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.ab-hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(28, 25, 23, .07) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 75% 75% at 25% 50%, #000 30%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at 25% 50%, #000 30%, transparent 95%);
}

.ab-hero__bg-glow {
  position: absolute;
  top: 50%;
  right: -8%;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle,
      rgba(28, 25, 23, .14) 0%,
      rgba(28, 25, 23, .04) 40%,
      rgba(28, 25, 23, 0) 70%);
  filter: blur(40px);
  transform: translateY(-50%);
  animation: ab-glow 9s ease-in-out infinite alternate;
}

@keyframes ab-glow {
  0% {
    opacity: .6;
    transform: translateY(-50%) scale(.9);
  }

  100% {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
  }
}

.ab-hero>.container {
  position: relative;
  z-index: 1;
}

.ab-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(36px, 5vw, 56px);
  font-size: var(--t-xs);
  color: var(--text-muted);
}

.ab-crumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

.ab-crumbs a:hover {
  color: var(--text);
}

.ab-crumbs i {
  font-size: .75rem;
  color: var(--text-light);
}

.ab-crumbs span {
  color: var(--text);
  font-weight: 500;
}

.ab-hero__meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 18px;
}

.ab-hero__meta::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--text-muted);
}

.ab-hero__title {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: 18px;
  max-width: 920px;
}

.ab-hero__title em {
  font-style: normal;
  color: var(--accent);
}

.ab-hero__subtitle {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 720px;
}

/* =========================================================
   SHARED SECTION HEADER
   ========================================================= */
.ab-secthead {
  margin-bottom: clamp(36px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 720px;
}

.ab-secthead--center {
  text-align: center;
  align-items: center;
  margin-left: auto;
  margin-right: auto;
}

.ab-secthead__eyebrow {
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--text-muted);
  font-weight: 500;
}

.ab-secthead__title {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
  line-height: 1.15;
}

.ab-secthead__sub {
  font-size: var(--t-md);
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 620px;
}

/* =========================================================
   STORY — alternating rows: text+image / image+text
   Each row tells one chapter; image is right next to its title
   so there's no awkward whitespace gap.
   ========================================================= */
.ab-story {
  padding: clamp(64px, 9vw, 120px) 0;
  background: var(--bg-soft);
}

.ab-story__rows {
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 6vw, 80px);
}

.ab-story__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

/* Reverse alignment for every other row */
.ab-story__row:nth-child(even) .ab-story__col-text {
  order: 2;
}

.ab-story__row:nth-child(even) .ab-story__col-media {
  order: 1;
}

.ab-story__col-text {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ab-story__chapter {
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--accent);
  font-weight: 500;
}

.ab-story__heading {
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 4px;
}

.ab-story__col-text p {
  font-size: var(--t-md);
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
}

.ab-story__col-text p strong {
  color: var(--text);
  font-weight: 600;
}

/* Plain semantic blockquote — author on the second line.
   No class on the element; styled by parent + adjacent selector. */
.ab-story__col-text blockquote {
  margin: 8px 0 0;
  padding: 18px 22px;
  background: #fff;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  font-size: var(--t-md);
  color: var(--text);
  font-style: italic;
  line-height: 1.55;
}

/* The author line — first <cite> or <footer> inside the blockquote
   gets the muted uppercase treatment automatically. */
.ab-story__col-text blockquote cite,
.ab-story__col-text blockquote footer {
  display: block;
  margin-top: 12px;
  font-style: normal;
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text-muted);
  font-weight: 500;
}

.ab-story__col-media {
  position: relative;
  aspect-ratio: 5 / 4;
  border-radius: var(--r-xl);
  overflow: hidden;
}

.ab-story__col-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease);
}

.ab-story__row:hover .ab-story__col-media img {
  transform: scale(1.03);
}

/* ----- Video mode: when [data-video-id] is present on the media,
   JS adds .has-video which shows the play overlay. Click swaps the
   image for an iframe (.is-playing). ----- */
.ab-story__col-media.has-video {
  cursor: pointer;
}

.ab-story__col-media.has-video::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      rgba(0, 0, 0, 0) 50%,
      rgba(0, 0, 0, .35) 100%);
  pointer-events: none;
  transition: background var(--t-base-d) var(--ease);
}

.ab-story__col-media.has-video:hover::after {
  background: rgba(0, 0, 0, .25);
}

.ab-story__col-media__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .95);
  border-radius: 50%;
  color: var(--text);
  font-size: 1.5rem;
  z-index: 2;
  pointer-events: none;
  transition: transform var(--t-base-d) var(--ease),
    background var(--t-fast) var(--ease);
}

.ab-story__col-media.has-video:hover .ab-story__col-media__play {
  transform: translate(-50%, -50%) scale(1.08);
  background: var(--accent);
  color: #fff;
}

.ab-story__col-media iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 3;
}

/* When playing, hide image + play + gradient overlay so iframe shows */
.ab-story__col-media.is-playing img,
.ab-story__col-media.is-playing .ab-story__col-media__play {
  display: none;
}

.ab-story__col-media.is-playing::after {
  display: none;
}

/* =========================================================
   NUMBERS — stat strip
   ========================================================= */
.ab-stats {
  padding: clamp(56px, 8vw, 96px) 0;
  background: #fff;
}

.ab-stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: #fff;
}

.ab-stat {
  position: relative;
  padding: clamp(28px, 4vw, 44px) clamp(20px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid var(--border);
  transition: background var(--t-base-d) var(--ease);
}

.ab-stat:last-child {
  border-right: none;
}

.ab-stat:hover {
  background: var(--bg-soft);
}

.ab-stat__num {
  font-size: clamp(2rem, 3.6vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.ab-stat__num-suffix {
  font-size: .55em;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0;
}

.ab-stat__label {
  font-size: var(--t-sm);
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 6px;
}

/* =========================================================
   SHOWREEL — auto-scrolling photo strip with manual swipe
   Native horizontal scroll: JS auto-advances scrollLeft each
   frame, user can grab/swipe in either direction. Slides are
   listed twice in HTML so when scrollLeft hits half the track
   width we silently reset to 0 — visually identical position,
   so the seamless loop is invisible.
   ========================================================= */
.ab-reel {
  position: relative;
  padding: clamp(48px, 7vw, 80px) 0;
  background: var(--bg-soft);
  overflow: hidden;
}

.ab-reel__strip {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  /* CRITICAL: override global "scroll-behavior: smooth" on <html>.
     Without this, every JS-driven scrollLeft assignment is animated
     by the browser, which fights our requestAnimationFrame loop and
     produces no visible motion. We need instant scroll updates here. */
  scroll-behavior: auto;
  /* Hide native scrollbar — we drive scrolling ourselves */
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Smooth touch scrolling on iOS */
  -webkit-overflow-scrolling: touch;
  /* Hint to the browser that horizontal touch action belongs to us
     (prevents page scroll during horizontal drag on mobile) */
  touch-action: pan-x;
  cursor: grab;
}

.ab-reel__strip::-webkit-scrollbar {
  display: none;
}

.ab-reel__strip.is-dragging {
  cursor: grabbing;
}

.ab-reel__track {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  width: max-content;
}

.ab-reel__thumb {
  position: relative;
  flex-shrink: 0;
  width: clamp(280px, 28vw, 380px);
  aspect-ratio: 4 / 3;
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-softer);
  transition: transform var(--t-base-d) var(--ease);
  user-select: none;
  -webkit-user-drag: none;
}

.ab-reel__thumb:hover {
  transform: scale(1.02);
}

.ab-reel__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease);
  display: block;
  pointer-events: none;
  /* Prevent the browser from initiating its own image drag */
  -webkit-user-drag: none;
}

.ab-reel__thumb:hover img {
  transform: scale(1.05);
}

.ab-reel__thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 23, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--t-base-d) var(--ease);
}

.ab-reel__thumb:hover .ab-reel__thumb-overlay {
  opacity: 1;
}

.ab-reel__thumb-overlay i {
  color: #fff;
  font-size: 1.5rem;
}

/* Edge fades — left + right gradient softens loop boundary */
.ab-reel::before,
.ab-reel::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(48px, 6vw, 100px);
  pointer-events: none;
  z-index: 2;
}

.ab-reel::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg-soft) 0%, transparent 100%);
}

.ab-reel::after {
  right: 0;
  background: linear-gradient(-90deg, var(--bg-soft) 0%, transparent 100%);
}

/* =========================================================
   CERTIFICATIONS — clickable cert cards open lightbox
   ========================================================= */
.ab-certs {
  padding: clamp(64px, 9vw, 120px) 0;
  background: #fff;
}

/* Dynamic column count via :has() — adapts to actual cert count.
   1 cert → 1 col (centered, max-width capped)
   2 certs → 2 cols, 3 → 3, 4+ → 4 cols (extras wrap to next row).
   :has() is widely supported in modern browsers (Chromium 105+,
   Safari 15.4+, Firefox 121+). Default is 4 cols for fallback. */
.ab-certs__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

/* Single cert — center it, cap width so it doesn't stretch */
.ab-certs__grid:has(> :only-child) {
  grid-template-columns: minmax(0, 220px);
  justify-content: center;
}

/* Exactly 2 certs */
.ab-certs__grid:has(> :nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 480px;
}

/* Exactly 3 certs */
.ab-certs__grid:has(> :nth-child(3):last-child) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 720px;
}

/* 4 or more certs — same 4-col grid, extras wrap (default already covers this) */
.ab-certs__grid:has(> :nth-child(4):last-child) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ab-cert {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-md, 12px);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease),
    transform var(--t-base-d) var(--ease),
    box-shadow var(--t-base-d) var(--ease);
}

.ab-cert:hover {
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.ab-cert__ico {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 25, 23, .1);
  color: var(--accent);
  border-radius: 10px;
  font-size: 1.4rem;
  transition: background var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease);
}

.ab-cert:hover .ab-cert__ico {
  background: var(--accent);
  color: #fff;
}

.ab-cert__title {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -.005em;
}

.ab-cert__sub {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-muted);
  font-weight: 500;
}

/* =========================================================
   LIGHTBOX — used by certs (and reusable elsewhere)
   ========================================================= */
.ab-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(28, 25, 23, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  transition: opacity var(--t-base-d) var(--ease);
}

.ab-lightbox.is-open {
  display: flex;
  opacity: 1;
}

.ab-lightbox__inner {
  position: relative;
  max-width: 1100px;
  max-height: 90vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.ab-lightbox__img {
  max-width: 100%;
  max-height: 75vh;
  width: auto;
  height: auto;
  border-radius: var(--r-md, 12px);
  background: #fff;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .4);
  display: block;
}

.ab-lightbox__caption {
  color: rgba(255, 255, 255, .85);
  font-size: var(--t-sm);
  text-align: center;
  max-width: 600px;
  line-height: 1.5;
}

.ab-lightbox__close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}

.ab-lightbox__close:hover {
  background: rgba(255, 255, 255, .25);
}

.ab-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 5;
  transition: background var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}

.ab-lightbox__nav:hover {
  background: rgba(255, 255, 255, .3);
  transform: translateY(-50%) scale(1.05);
}

/* Viewport-edge positioning so the arrows are always visible
   (not clipped by the inner container) */
.ab-lightbox__nav--prev {
  left: 24px;
}

.ab-lightbox__nav--next {
  right: 24px;
}

.ab-lightbox__counter {
  position: absolute;
  top: -38px;
  left: 0;
  font-size: var(--t-xs);
  color: rgba(255, 255, 255, .7);
  letter-spacing: .04em;
}

/* =========================================================
   CTA — single button, leads to products
   ========================================================= */
.ab-cta {
  padding: clamp(64px, 9vw, 120px) 0;
  background: var(--bg-soft);
}

.ab-cta__inner {
  position: relative;
  padding: clamp(36px, 6vw, 64px);
  background: linear-gradient(135deg, #1c1917 0%, #292524 100%);
  border-radius: var(--r-xl);
  overflow: hidden;
  color: #fff;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

.ab-cta__inner::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle,
      rgba(28, 25, 23, .25) 0%,
      rgba(28, 25, 23, 0) 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.ab-cta__text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ab-cta__eyebrow {
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: .18em;
  color: rgba(255, 255, 255, .6);
  font-weight: 500;
}

.ab-cta__title {
  font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: #fff;
}

.ab-cta__sub {
  font-size: var(--t-md);
  color: rgba(255, 255, 255, .75);
  line-height: 1.55;
  max-width: 480px;
}

.ab-cta__actions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
}

.ab-cta__actions .btn--primary {
  background: #fff;
  color: var(--text);
  border-color: #fff;
}

.ab-cta__actions .btn--primary:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
  .ab-stats__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ab-stat:nth-child(2) {
    border-right: none;
  }

  .ab-stat:nth-child(1),
  .ab-stat:nth-child(2) {
    border-bottom: 1px solid var(--border);
  }

  .ab-stat:nth-child(3) {
    border-right: 1px solid var(--border);
  }

  /* On tablets, cap grid at 3 columns; :has() overrides handle 1/2 cases */
  .ab-certs__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ab-certs__grid:has(> :nth-child(4):last-child),
  .ab-certs__grid:has(> :nth-child(n+5)) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 720px;
  }
}

@media (max-width: 992px) {
  .ab-story__row {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* Always image-first on mobile, regardless of order overrides */
  .ab-story__row:nth-child(even) .ab-story__col-text,
  .ab-story__col-text {
    order: 2;
  }

  .ab-story__row:nth-child(even) .ab-story__col-media,
  .ab-story__col-media {
    order: 1;
  }

  .ab-cta__inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .ab-cta__actions {
    justify-content: flex-start;
  }

  .ab-lightbox__nav {
    width: 40px;
    height: 40px;
  }

  .ab-lightbox__nav--prev {
    left: 12px;
  }

  .ab-lightbox__nav--next {
    right: 12px;
  }
}

@media (max-width: 768px) {
  .ab-hero {
    padding-top: calc(var(--header-h) + 24px);
  }

  .ab-story__col-media {
    aspect-ratio: 4 / 3;
  }

  .ab-story__col-media__play {
    width: 52px;
    height: 52px;
    font-size: 1.2rem;
  }

  .ab-lightbox {
    padding: 16px;
  }

  .ab-lightbox__close {
    top: -38px;
    right: 0;
  }
}

@media (max-width: 576px) {
  .ab-stats__grid {
    grid-template-columns: 1fr;
  }

  .ab-stat {
    border-right: none !important;
    border-bottom: 1px solid var(--border);
  }

  .ab-stat:last-child {
    border-bottom: none;
  }

  /* On phones, cap at 2 columns regardless of count;
     1-cert :has() rule still applies for centering. */
  .ab-certs__grid,
  .ab-certs__grid:has(> :nth-child(2):last-child),
  .ab-certs__grid:has(> :nth-child(3):last-child),
  .ab-certs__grid:has(> :nth-child(4):last-child),
  .ab-certs__grid:has(> :nth-child(n+5)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 480px;
  }

  .ab-cta__actions {
    width: 100%;
  }

  .ab-cta__actions .btn {
    flex: 1;
    justify-content: center;
  }
}