/* ===================== INDUSTRIES (sectors) ===================== */
.sectors {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 96px) 24px clamp(40px, 6vw, 80px);
}

/* blueprint grid on the section SURFACE (behind the cards) —
   revealed as a soft spotlight that follows the cursor */
.sectors::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(43, 108, 176, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 108, 176, 0.22) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(220px 220px at var(--sec-mx, -999px) var(--sec-my, -999px),
                        #000 0%, rgba(0, 0, 0, 0.45) 42%, transparent 70%);
          mask-image: radial-gradient(220px 220px at var(--sec-mx, -999px) var(--sec-my, -999px),
                        #000 0%, rgba(0, 0, 0, 0.45) 42%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.sectors.is-grid::before { opacity: 1; }

/* ---------- Heading ---------- */
.sec-head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto clamp(34px, 5vw, 56px);
}
.sec-kicker {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 14px;
}
.sec-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: clamp(1.7rem, 3.4vw, 2.8rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.sec-title .grad {
  background: linear-gradient(95deg, var(--accent), #6aa6ec 55%, #8f6cf0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.sec-sub {
  margin-top: 16px;
  font-size: clamp(0.98rem, 1.4vw, 1.12rem);
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Grid (all cards in one section on PC) ---------- */
.sec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 1.6vw, 22px);
}

/* ---------- Card: white-framed photo, serif overlay, clickable ---------- */
.sec-card {
  position: relative;
  display: block;
  text-decoration: none;
  aspect-ratio: 1 / 1;
  border-radius: 26px;
  overflow: hidden;
  background: #fff;
  border: 7px solid #fff;
  /* layered shadow below the card for a touch of depth */
  box-shadow: 0 6px 14px rgba(20, 40, 80, 0.10),
              0 20px 40px rgba(20, 40, 80, 0.18);
  will-change: transform;
}
/* slightly slower, buttery hover */
.sectors a.sec-card {
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.5s ease,
              filter 0.5s ease;
}
.sectors a.sec-card:hover {
  transform: translateY(-10px) scale(1.012);
  box-shadow: 0 10px 20px rgba(20, 40, 80, 0.14),
              0 38px 70px rgba(20, 40, 80, 0.32);
}

/* background photo */
.sec-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.sec-card:hover .sec-bg { transform: scale(1.07); }

/* dark gradient so the bottom text is readable */
.sec-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(8, 18, 30, 0) 30%,
    rgba(8, 18, 30, 0.42) 58%,
    rgba(6, 14, 26, 0.84) 100%);
  transition: background 0.32s ease;
  pointer-events: none;
}
/* deepen the veil slightly on hover so the popup + text pop */
.sec-card:hover .sec-veil {
  background: linear-gradient(180deg,
    rgba(8, 18, 30, 0.18) 0%,
    rgba(8, 18, 30, 0.32) 45%,
    rgba(6, 14, 26, 0.86) 100%);
}

/* URL link popup removed — no longer shown */
.sec-pop { display: none; }

/* bottom overlay text */
.sec-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 22px clamp(16px, 1.6vw, 20px) clamp(16px, 1.8vw, 20px);
}
.sec-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: clamp(1.4rem, 2vw, 1.85rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}
.sec-name em {
  font-style: normal;
  font-weight: 700;
}
.sec-desc {
  margin-top: 8px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* small pill button (like the reference brand tag) */
.sec-pill {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #1a2230;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease, background 0.3s ease;
}
.sec-card:hover .sec-pill {
  transform: translateY(-2px);
  background: #fff;
}

/* ---------- Desktop hover: pop the info up, dim the rest ---------- */
@media (hover: hover) and (min-width: 761px) {
  /* keep the name pinned to the bottom; collapse the info + button so they
     reserve no space until hover, then expand smoothly above the name */
  .sec-desc {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(10px);
    transition: max-height 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                margin-top 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.5s ease,
                transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .sec-pill {
    max-height: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(10px);
    transition: max-height 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                margin-top 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                padding 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.5s ease,
                transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.3s ease;
  }
  .sec-card:hover .sec-desc {
    max-height: 6em;
    margin-top: 8px;
    opacity: 1;
    transform: translateY(0);
  }
  .sec-card:hover .sec-pill {
    max-height: 3em;
    margin-top: 14px;
    padding-top: 8px;
    padding-bottom: 8px;
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.08s;
  }
}

/* ---------- Mobile nav (hidden on desktop) ---------- */
.sec-mnav { display: none; }

/* ---------- Reveal ---------- */
.sectors .reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.sectors .reveal.in-view { opacity: 1; transform: translateY(0); }
/* stagger cards a touch as they enter */
.sec-card:nth-child(4n+2).in-view { transition-delay: 0.05s; }
.sec-card:nth-child(4n+3).in-view { transition-delay: 0.10s; }
.sec-card:nth-child(4n+4).in-view { transition-delay: 0.15s; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1080px) {
  .sec-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Phone: horizontal swipe carousel */
@media (max-width: 760px) {
  .sectors { padding: 56px 0 40px; }
  .sec-head { padding: 0 20px; }

  .sec-rail {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    /* side padding = half the leftover space so the FIRST and LAST cards
       can scroll all the way to the centre */
    padding: 6px calc((100% - min(78%, 320px)) / 2) 8px;
  }
  .sec-rail::-webkit-scrollbar { display: none; }

  .sec-grid {
    display: flex;
    gap: 14px;
  }
  /* NOTE: high specificity (.sectors a.sec-card) is required to beat the
     desktop base rule, whose 0.32s transform transition would otherwise
     make the coverflow lag behind the finger on mobile. */
  .sectors a.sec-card {
    scroll-snap-align: center;
    flex: 0 0 min(78%, 320px);
    transform-origin: center center;
    /* coverflow scale/opacity are driven per-frame by JS — NO transform/opacity
       transition so the cards track the finger 1:1. box-shadow can still ease. */
    transition: box-shadow 0.3s ease;
    will-change: transform, opacity;
  }
  /* JS drives the coverflow scale/opacity; don't let hover fight it */
  .sectors a.sec-card:hover { transform: none; }

  /* dots + swipe hint (stacked, centered) */
  .sec-mnav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 0 20px;
  }
  .sec-dots { display: flex; gap: 7px; }
  .sec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(43, 108, 176, 0.25);
    padding: 0;
    cursor: pointer;
    transition: width 0.3s ease, background 0.3s ease;
  }
  .sec-dot.active {
    width: 22px;
    border-radius: 5px;
    background: var(--accent);
  }
  .sec-swipe {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    color: var(--muted);
  }
}

/* ===================== DARK THEME ===================== */
[data-theme="dark"] .sec-card {
  background: #11182a;
  border-color: #11182a;
  box-shadow: var(--d-shadow);
}
[data-theme="dark"] .sec-pill {
  background: rgba(244, 247, 252, 0.95);
  color: #11182a;
}
[data-theme="dark"] .sec-dot { background: rgba(159, 194, 255, 0.28); }
[data-theme="dark"] .sec-dot.active { background: var(--accent); }
