/* ============================================================
   Header + Mega menu + Mobile drawer (rebuilt v3)
   Stripe/Linear-style full-width mega panel
   ============================================================ */

/* ─────────  Header bar  ───────── */
.hdr {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 244, 239, 0.88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.hdr-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 36px;
  height: 64px;
}
/* Header needs relative positioning so wide mega can anchor to it */
.hdr-inner { position: relative; }
.hdr-logo img { height: 51px; display: block; }

/* Nav list */
.hdr-nav { flex: 1; display: flex; justify-content: center; }
.hdr-list {
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 2px;
}
.hdr-item { position: relative; }

.hdr-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink-2);
  padding: 9px 14px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-feature-settings: 'ss01', 'cv11';
}
.hdr-link:hover { color: var(--ink); background: rgba(15, 23, 42, 0.05); }
.hdr-trigger { font: inherit; }
.hdr-item.is-active > .hdr-link { color: var(--ink); }
.hdr-item.is-active > .hdr-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--crimson);
  border-radius: 2px;
}
.hdr-link .chev {
  color: var(--ink-4);
  transition: transform 0.2s, color 0.2s;
}
.has-mega.is-open > .hdr-link {
  background: rgba(15, 23, 42, 0.05);
  color: var(--ink);
}
.has-mega.is-open > .hdr-link .chev {
  transform: rotate(180deg);
  color: var(--ink-2);
}

/* ─────────  Mega panel  ───────── */
.mega {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow:
    0 1px 0 rgba(15, 23, 42, 0.04),
    0 24px 60px rgba(15, 23, 42, 0.14),
    0 4px 12px rgba(15, 23, 42, 0.06);
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 110;
  min-width: 520px;
}
/* Wide (Services) — center to viewport so it doesn't skew off the trigger position */
.has-mega-wide .mega {
  position: fixed;
  top: 78px;
  left: 50%;
  right: auto;
  transform: translate(-50%, -6px);
  width: min(1100px, calc(100vw - 48px));
  min-width: 0;
  max-width: none;
}
.has-mega.is-open > .mega {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.has-mega-wide.is-open > .mega {
  transform: translate(-50%, 0);
}

/* Hover bridge so cursor can move from trigger into panel without closing */
.has-mega::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 14px;
}

.mega-shell { padding: 22px; }

.mega-grid { display: grid; gap: 8px 24px; }
.mega-grid-2 { grid-template-columns: 1fr 1fr; min-width: 460px; }
.mega-grid-svc { grid-template-columns: 1fr 1fr 1fr 1.05fr; gap: 8px 20px; }

/* Section heading */
.mega-section {
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
}
.mega-eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  text-transform: uppercase;
  padding: 0 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Items list */
.mega-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.mi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 9px;
  text-align: left;
  transition: background 0.15s;
}
.mi:hover { background: var(--bg-2); }
.mi:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.mi-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.012em;
  line-height: 1.3;
}
.mi-desc {
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: -0.005em;
  line-height: 1.4;
  margin-top: 2px;
}

/* Featured promo card (Services mega) */
.mega-promo {
  background:
    radial-gradient(420px 240px at 100% 100%, rgba(200, 16, 46, 0.22), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, #112341 100%);
  color: #fff;
  border-radius: 12px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.mp-eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5fdbd2;
}
.mp-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.25;
  color: #fff;
  margin: 0;
}
.mp-desc {
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
}
.mp-cta {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--crimson);
  padding: 9px 14px;
  border-radius: 8px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, transform 0.15s;
}
.mp-cta:hover { background: #a90c24; transform: translateY(-1px); }
.mp-arr { transition: transform 0.2s; display: inline-block; }
.mp-cta:hover .mp-arr { transform: translateX(3px); }

/* ─────────  Header actions  ───────── */
.hdr-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.hdr-talk {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 8px 14px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.hdr-talk:hover { color: var(--ink); background: rgba(15, 23, 42, 0.05); }

.hdr-cta {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: #fff;
  background: var(--crimson);
  padding: 9px 16px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.05);
}
.hdr-cta:hover {
  background: #a90c24;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(200, 16, 46, 0.28);
}
.hdr-arr { transition: transform 0.2s; display: inline-block; }
.hdr-cta:hover .hdr-arr { transform: translateX(3px); }

.hdr-burger {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 8px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 0;
  cursor: pointer;
  margin-left: auto;
}
.hdr-burger span {
  display: block;
  width: 18px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

/* ─────────  Mobile drawer  ───────── */
.mob {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  visibility: hidden;
}
.mob.is-open { pointer-events: auto; visibility: visible; }
.mob-overlay {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.mob.is-open .mob-overlay { opacity: 1; }

.mob-panel {
  position: absolute;
  top: 0; right: 0;
  width: min(380px, 92vw);
  height: 100%;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: -16px 0 40px rgba(15, 23, 42, 0.18);
}
.mob.is-open .mob-panel { transform: translateX(0); }

.mob-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.mob-logo img { height: 28px; display: block; }
.mob-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.mob-close:hover { background: var(--line); }

.mob-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}
.mob-link, .mob-grp > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  list-style: none;
  letter-spacing: -0.012em;
}
.mob-grp > summary::-webkit-details-marker { display: none; }
.mob-link:hover, .mob-grp > summary:hover { color: var(--crimson); }
.mob-chev { color: var(--ink-4); font-weight: 400; transition: transform 0.2s; font-size: 18px; }
.mob-grp[open] > summary .mob-chev { transform: rotate(90deg); color: var(--crimson); }

.mob-sub {
  display: flex;
  flex-direction: column;
  padding: 8px 0 12px;
}
.mob-sub a {
  display: block;
  padding: 10px 8px 10px 20px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.mob-sub a:hover { color: var(--ink); background: var(--bg-2); }
.mob-sub-h {
  display: block;
  padding: 12px 8px 6px 20px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
}

.mob-foot {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mob-foot .btn { width: 100%; justify-content: center; }

/* ─────────  Responsive  ───────── */
@media (max-width: 1180px) {
  .hdr-inner { gap: 20px; padding: 0 24px; }
  .hdr-talk { display: none; }
}
@media (max-width: 1024px) {
  .hdr-nav { display: none; }
  .hdr-burger { display: inline-flex; }
  .hdr-cta { display: none; }
  .hdr-actions { margin-left: auto; }
}
@media (min-width: 1025px) {
  .mob { display: none; }
}

/* ---------- Global responsive (containers, type, hero) ---------- */
@media (max-width: 900px) {
  .container { padding: 0 22px; }
  section { padding: 56px 0 !important; }
  .hero { padding: 56px 0 64px !important; }
  .hero-grid { grid-template-columns: 1fr !important; gap: 36px !important; }
  .hero h1 { font-size: clamp(34px, 8vw, 44px) !important; }
  .hero .lead { font-size: 17px !important; }
  .hero-meta { grid-template-columns: 1fr 1fr 1fr !important; gap: 18px !important; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { justify-content: center; }
  .hero-vis { display: none !important; }
}
@media (max-width: 640px) {
  h1 { font-size: clamp(30px, 9vw, 40px) !important; line-height: 1.05 !important; }
  h2 { font-size: clamp(24px, 7vw, 32px) !important; }
  .container { padding: 0 18px; }
  .hero-meta { grid-template-columns: 1fr !important; gap: 14px !important; }
  .hero-meta > div { display: flex; align-items: baseline; gap: 12px; }
  .hero-meta .hm-num { font-size: 30px !important; }
}

/* ---------- Section grids fallback responsive ---------- */
@media (max-width: 1080px) {
  .services-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .case-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .footer-top { grid-template-columns: 1.4fr 1fr 1fr 1fr !important; gap: 32px !important; }
}
@media (max-width: 820px) {
  .services-grid { grid-template-columns: 1fr !important; }
  .case-grid { grid-template-columns: 1fr !important; }
  .footer-top { grid-template-columns: 1fr 1fr !important; gap: 36px !important; }
  .ft-brand { grid-column: 1 / -1; }
  .methodology-grid { grid-template-columns: 1fr !important; }
  .testimonial-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr !important; }
}
