/* ============================================================
   Innovative AI Labs — Premium Header System (header.css)
   Single sticky glass header. Loaded AFTER style.css so it wins.
   Header heights: 76px desktop / 68px mobile (<=1024px).
   ============================================================ */
:root {
  --ial-h: 76px;
  --ial-h-mobile: 68px;
  --ial-ink: #0c1220;
  --ial-ink-soft: #3c4560;
  --ial-line: rgba(12, 18, 32, .09);
  --ial-glass: rgba(255, 255, 255, .88);
}

/* Safety nets: legacy bars must never render even if markup remains */
.topbar,
.breadcrumb-bar {
  display: none !important;
}

/* Anchor targets clear the fixed header */
section[id],
div[id],
footer[id] {
  scroll-margin-top: calc(var(--ial-h) + 14px);
}

/* ================= Header shell ================= */
.ial-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--ial-glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--ial-line);
  transition: background .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.ial-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: .9;
}

.ial-header.scrolled {
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 32px -12px rgba(12, 18, 32, .22);
}

.ial-header-bar {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--ial-h);
  display: flex;
  align-items: center;
  gap: 28px;
  transition: height .25s ease;
}

.ial-header.scrolled .ial-header-bar {
  height: 66px;
}

/* Transparent over the home hero (top of page only) */
.ial-home .ial-header:not(.scrolled):not(.menu-open) {
  background: transparent;
  border-bottom-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.ial-home .ial-header:not(.scrolled):not(.menu-open)::before {
  opacity: 0;
}

.ial-home .hero {
  padding-top: 108px;
}

/* ================= Brand ================= */
.ial-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  border-radius: 10px;
}

.ial-brand-mark {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(12, 18, 32, .1),
    0 4px 14px -4px rgba(12, 18, 32, .3);
  transition: transform .25s ease, box-shadow .25s ease;
}

.ial-brand:hover .ial-brand-mark {
  transform: scale(1.05);
  box-shadow:
    0 0 0 1px rgba(59, 107, 255, .35),
    0 6px 18px -4px rgba(59, 107, 255, .45);
}

.ial-brand-word {
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: 1.22rem;
  letter-spacing: -.01em;
  color: var(--ial-ink);
  white-space: nowrap;
  transition: color .25s ease;
}

.ial-brand-word em {
  font-style: normal;
  color: var(--accent);
}

.ial-home .ial-header:not(.scrolled):not(.menu-open) .ial-brand-word {
  color: #fff;
}

/* ================= Desktop nav ================= */
.ial-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.ial-nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ial-item {
  position: relative;
  display: flex;
  align-items: center;
}

.ial-item-mega {
  position: static;
}

.ial-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 13px;
  font-size: .92rem;
  font-weight: 500;
  color: var(--ial-ink-soft);
  border-radius: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: color .2s ease, background .2s ease;
}

.ial-link::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.ial-link:hover,
.ial-item:focus-within > .ial-link {
  color: var(--ial-ink);
}

.ial-link:hover::after,
.ial-item:focus-within > .ial-link::after {
  transform: scaleX(1);
}

.ial-caret {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 34px;
  margin-left: -4px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--ial-ink-soft);
  cursor: pointer;
  transition: color .2s ease;
}

.ial-caret:hover {
  color: var(--ial-ink);
}

.ial-home .ial-header:not(.scrolled):not(.menu-open) .ial-caret {
  color: rgba(255, 255, 255, .84);
}

.ial-chev {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
  flex-shrink: 0;
}

.ial-item.open > .ial-caret .ial-chev,
.ial-item:hover > .ial-caret .ial-chev {
  transform: rotate(180deg);
}

.ial-home .ial-header:not(.scrolled):not(.menu-open) .ial-link {
  color: rgba(255, 255, 255, .84);
}

.ial-home .ial-header:not(.scrolled):not(.menu-open) .ial-link:hover,
.ial-home .ial-header:not(.scrolled):not(.menu-open) .ial-item:focus-within > .ial-link {
  color: #fff;
}

/* ================= Dropdown / mega menu ================= */
.ial-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 10px);
  min-width: 300px;
  background: #fff;
  border: 1px solid var(--ial-line);
  border-radius: 16px;
  box-shadow: 0 28px 60px -16px rgba(12, 18, 32, .28);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  z-index: 5;
}

/* Invisible hover bridge so the panel does not flicker */
.ial-panel::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 0;
  right: 0;
  height: 18px;
}

.ial-item:hover > .ial-panel,
.ial-item:focus-within > .ial-panel,
.ial-item.open > .ial-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.ial-panel-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 11px;
  transition: background .15s ease;
}

.ial-panel-link:hover,
.ial-panel-link:focus-visible {
  background: var(--bg-alt);
}

.ial-panel-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 107, 255, .14), rgba(34, 211, 238, .14));
  color: var(--accent);
}

.ial-panel-ico svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ial-panel-link strong {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ial-ink);
  line-height: 1.35;
}

.ial-panel-link span {
  display: block;
  font-size: .76rem;
  color: var(--ial-ink-soft);
  margin-top: 2px;
  line-height: 1.45;
}

/* Wide mega menu for Services */
.ial-panel-mega {
  width: min(880px, calc(100vw - 48px));
}

.ial-mega-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
}

.ial-mega-col {
  min-width: 0;
}

.ial-mega-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 8px 13px 4px;
}

.ial-mega-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding: 12px 6px 4px;
  border-top: 1px solid var(--ial-line);
}

.ial-mega-foot a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ial-ink);
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.ial-mega-foot a:hover {
  border-color: var(--accent);
  background: #fff;
  transform: translateY(-1px);
}

.ial-mega-foot a svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ================= Header actions ================= */
.ial-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.ial-regions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ial-region {
  display: inline-flex;
  border-radius: 50%;
  transition: transform .18s ease;
}

.ial-region:hover {
  transform: translateY(-2px);
}

.ial-region img {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--ial-line);
}

.ial-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--ial-line);
  color: var(--ial-ink);
  font-size: .83rem;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color .2s ease, background .2s ease;
}

.ial-phone:hover {
  border-color: var(--accent);
  background: rgba(59, 107, 255, .06);
}

.ial-phone svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ial-home .ial-header:not(.scrolled):not(.menu-open) .ial-phone {
  color: #fff;
  border-color: rgba(255, 255, 255, .35);
}

.ial-home .ial-header:not(.scrolled):not(.menu-open) .ial-phone:hover {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .6);
}

.ial-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: .87rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 10px 26px -10px rgba(59, 107, 255, .65);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.ial-cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 16px 32px -10px rgba(59, 107, 255, .75), 0 0 0 4px rgba(59, 107, 255, .12);
}

.ial-cta svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ================= Hamburger ================= */
.ial-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 10px;
  background: none;
  border: 1px solid var(--ial-line);
  border-radius: 11px;
  cursor: pointer;
}

.ial-burger span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--ial-ink);
  transition: transform .25s ease, opacity .2s ease, background .25s ease;
}

.ial-home .ial-header:not(.scrolled):not(.menu-open) .ial-burger {
  border-color: rgba(255, 255, 255, .35);
}

.ial-home .ial-header:not(.scrolled):not(.menu-open) .ial-burger span {
  background: #fff;
}

.ial-header.menu-open .ial-burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.ial-header.menu-open .ial-burger span:nth-child(2) {
  opacity: 0;
}

.ial-header.menu-open .ial-burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ================= Mobile panel ================= */
.ial-mobile {
  display: none;
  border-top: 1px solid var(--ial-line);
  background: rgba(255, 255, 255, .98);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  max-height: calc(100vh - var(--ial-h-mobile));
  max-height: calc(100dvh - var(--ial-h-mobile));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ial-header.menu-open .ial-mobile {
  display: block;
}

.ial-mobile-inner {
  padding: 10px 20px 26px;
  max-width: 640px;
  margin: 0 auto;
}

.ial-m-link,
.ial-m-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 15px 6px;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ial-ink);
  background: none;
  border: none;
  border-bottom: 1px solid var(--ial-line);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.ial-m-toggle .ial-chev {
  width: 16px;
  height: 16px;
}

.ial-m-toggle[aria-expanded="true"] .ial-chev {
  transform: rotate(180deg);
}

.ial-m-sub {
  display: none;
  padding: 6px 0 6px 4px;
}

.ial-m-sub.open {
  display: block;
}

.ial-m-group {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 12px 6px 2px;
}

.ial-m-sub a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 6px;
  font-size: .94rem;
  font-weight: 500;
  color: var(--ial-ink-soft);
  border-bottom: 1px solid rgba(12, 18, 32, .05);
}

.ial-m-sub a:last-child {
  border-bottom: none;
}

.ial-m-sub a:active {
  color: var(--accent);
}

.ial-m-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 18px;
  padding: 15px 20px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 12px 26px -10px rgba(59, 107, 255, .6);
}

.ial-m-cta svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ial-m-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.ial-m-contact a {
  font-size: .88rem;
  font-weight: 600;
  color: var(--ial-ink-soft);
}

/* Spacer replacing the removed breadcrumb bar (in-flow offset) */
.ial-page-spacer {
  height: var(--ial-h);
}

/* Focus visibility */
.ial-header a:focus-visible,
.ial-header button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ================= Responsive ================= */
@media (max-width: 1360px) {
  .ial-phone {
    display: none;
  }
}

@media (max-width: 1220px) {
  .ial-regions {
    display: none;
  }

  .ial-header-bar {
    gap: 18px;
  }

  .ial-link {
    padding: 10px 9px;
    font-size: .88rem;
  }
}

@media (max-width: 1024px) {
  :root {
    --ial-h: 68px;
  }

  .ial-header-bar {
    height: var(--ial-h-mobile);
    padding: 0 18px;
    gap: 14px;
  }

  .ial-header.scrolled .ial-header-bar {
    height: var(--ial-h-mobile);
  }

  .ial-nav,
  .ial-header .ial-cta {
    display: none;
  }

  .ial-burger {
    display: inline-flex;
  }

  .ial-actions {
    margin-left: auto;
  }

  .ial-brand-word {
    font-size: 1.05rem;
  }

  .ial-brand-mark {
    width: 38px;
    height: 38px;
  }

  .ial-home .hero {
    padding-top: 118px;
  }
}

@media (max-width: 720px) {
  .ial-home .hero {
    padding-top: 128px;
  }
}

@media (max-width: 400px) {
  .ial-brand-word {
    font-size: .95rem;
  }

  .ial-header-bar {
    padding: 0 14px;
    gap: 10px;
  }
}

/* Hero spacing trims (old values assumed the 118px double header) */
.hero {
  padding-top: 108px;
}

/* Inner-page dark heroes keep their rhythm under the slimmer header */
.blog-hero {
  padding: 128px 0 72px;
}

.post-hero {
  padding: 123px 0 60px;
}

.cs-hero {
  padding: 128px 0 72px;
}

.cs-detail-hero {
  padding: 123px 0 60px;
}

@media (max-width: 1000px) {
  .hero {
    padding-top: 118px;
  }
}

@media (max-width: 720px) {
  .hero {
    padding-top: 128px;
  }
}

@media (max-width: 640px) {
  .blog-hero,
  .post-hero,
  .cs-hero,
  .cs-detail-hero {
    padding-top: 118px;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ial-header,
  .ial-header-bar,
  .ial-link,
  .ial-link::after,
  .ial-panel,
  .ial-cta,
  .ial-brand-mark,
  .ial-burger span {
    transition: none;
  }
}
