/* ============================================
   ZYVERY GLOBAL — Architectural Header
   Full-width cell grid · no glass / no pills
   ============================================ */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transform: translateY(-100%);
  animation: headerDrop 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

@keyframes headerDrop {
  to { transform: translateY(0); }
}

/* Top progress beam */
.header-beam {
  height: var(--header-beam-height);
  background: #1a1a1a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.header-beam-progress {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red-dark), var(--red), #ff4d6a);
  box-shadow: 0 0 18px var(--red-glow);
  transition: width 0.12s linear;
}

.header-shell {
  position: relative;
  background: var(--black);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.header-cursor {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(227, 24, 55, 0.14) 0%, transparent 68%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 0;
}

.header-shell:hover .header-cursor {
  opacity: 1;
}

.header-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 300px) 1fr minmax(130px, 160px);
  height: var(--header-bar-height);
  max-width: 100%;
}

/* ---- Logo zone ---- */
.h-logo {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: background 0.35s ease;
}

.h-logo:hover {
  background: rgba(227, 24, 55, 0.06);
}

.h-logo-stripe {
  width: 5px;
  flex-shrink: 0;
  background: var(--red);
  transform-origin: top;
  animation: stripeGrow 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

.h-logo-img {
  display: block;
  width: auto;
  height: 82px;
  max-width: 260px;
  object-fit: contain;
  object-position: left center;
  padding: 8px 20px 8px 14px;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), filter 0.35s ease;
}

.h-logo:hover .h-logo-img {
  transform: scale(1.03);
  filter: drop-shadow(0 0 10px var(--red-glow));
}

@keyframes stripeGrow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

/* ---- Nav cells ---- */
.h-nav {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.h-nav-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  height: 100%;
}

.h-nav-row li {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.h-nav-row li:last-child {
  border-right: none;
}

.h-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  width: 100%;
  height: 100%;
  padding: 10px 12px 12px;
  cursor: pointer;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-100%);
  animation: cellDrop 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.h-nav-row li:nth-child(1) .h-cell { animation-delay: 0.25s; }
.h-nav-row li:nth-child(2) .h-cell { animation-delay: 0.32s; }
.h-nav-row li:nth-child(3) .h-cell { animation-delay: 0.39s; }
.h-nav-row li:nth-child(4) .h-cell { animation-delay: 0.46s; }
.h-nav-row li:nth-child(5) .h-cell { animation-delay: 0.53s; }
.h-nav-row li:nth-child(6) .h-cell { animation-delay: 0.60s; }

@keyframes cellDrop {
  to { opacity: 1; transform: translateY(0); }
}

.h-cell-fill {
  position: absolute;
  inset: 0;
  background: var(--red);
  transform: scaleY(0);
  transform-origin: bottom center;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
}

.h-cell-ghost {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -58%);
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 800;
  line-height: 1;
  color: var(--white);
  opacity: 0.035;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.h-cell-num {
  position: relative;
  z-index: 1;
  font-family: var(--font-heading);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gray-500);
  transition: color 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.h-cell-name {
  position: relative;
  z-index: 1;
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-300);
  margin-top: 4px;
  transition: color 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.h-cell:hover .h-cell-fill,
.h-cell.active .h-cell-fill,
.h-cell[aria-current="page"] .h-cell-fill {
  transform: scaleY(1);
}

.h-cell:hover .h-cell-ghost,
.h-cell.active .h-cell-ghost,
.h-cell[aria-current="page"] .h-cell-ghost {
  opacity: 0.12;
  transform: translate(-50%, -62%) scale(1.06);
}

.h-cell:hover .h-cell-num,
.h-cell:hover .h-cell-name,
.h-cell.active .h-cell-num,
.h-cell.active .h-cell-name,
.h-cell[aria-current="page"] .h-cell-num,
.h-cell[aria-current="page"] .h-cell-name {
  color: var(--white);
}

.h-cell:hover .h-cell-num,
.h-cell.active .h-cell-num,
.h-cell[aria-current="page"] .h-cell-num {
  transform: translateY(-2px);
}

.h-cell:hover .h-cell-name,
.h-cell.active .h-cell-name,
.h-cell[aria-current="page"] .h-cell-name {
  transform: translateY(-2px);
}

.h-cell.active .h-cell-fill,
.h-cell[aria-current="page"] .h-cell-fill {
  transform: scaleY(1);
}

/* ---- Contact wedge ---- */
.h-cta {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: var(--red);
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%);
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  animation: ctaReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.7s forwards;
}

@keyframes ctaReveal {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.h-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.65s ease;
}

.h-cta:hover::before {
  transform: translateX(120%);
}

.h-cta-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 20px 0 28px;
  gap: 12px;
}

.h-cta-label {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white);
}

.h-cta-arrow {
  font-size: 1.25rem;
  line-height: 1;
  color: var(--white);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.h-cta:hover .h-cta-arrow {
  transform: translate(3px, -3px) rotate(-8deg);
}

/* ---- Mobile burger ---- */
.h-burger {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  background: var(--black-soft);
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--white);
  cursor: pointer;
}

.h-burger-tag {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
}

.h-burger-icon {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 26px;
}

.h-burger-icon span {
  display: block;
  height: 2px;
  background: var(--white);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), width 0.3s ease;
}

.h-burger-icon span:last-child {
  width: 60%;
  align-self: flex-end;
}

.h-burger:hover .h-burger-icon span:last-child {
  width: 100%;
}

.h-burger.active .h-burger-icon span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.h-burger.active .h-burger-icon span:last-child {
  width: 100%;
  transform: translateY(-4px) rotate(-45deg);
}

/* ---- Scrolled compact state ---- */
.header.scrolled {
  --header-bar-height: 72px;
}

.header.scrolled .h-cell-ghost {
  opacity: 0;
  pointer-events: none;
}

.header.scrolled .h-cell-name {
  font-size: 0.58rem;
}

.header.scrolled .h-logo-img {
  height: 64px;
  max-width: 220px;
  padding: 6px 16px 6px 12px;
}

/* ---- Mobile fullscreen nav ---- */
.h-mobile {
  position: fixed;
  inset: 0;
  z-index: 1001;
  pointer-events: none;
  visibility: hidden;
}

.h-mobile.open {
  pointer-events: auto;
  visibility: visible;
}

.h-mobile-screen {
  position: absolute;
  inset: 0;
  background: var(--black);
  display: flex;
  flex-direction: column;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  transform: translateY(100%);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.h-mobile.open .h-mobile-screen {
  transform: translateY(0);
}

.h-mobile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.h-mobile-kicker {
  font-family: var(--font-heading);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.h-mobile-close {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.h-mobile-close:hover {
  border-color: var(--red);
  color: var(--red);
}

.h-mobile-close-x {
  font-size: 1.2rem;
  line-height: 1;
}

.h-mobile-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding: 20px 0;
}

.h-mobile-list li {
  overflow: hidden;
}

.h-mobile-link {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transform: translateX(40px);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.5s ease,
              padding-left 0.35s ease,
              color 0.3s ease;
}

.h-mobile.open .h-mobile-link {
  transform: translateX(0);
  opacity: 1;
}

.h-mobile.open .h-mobile-list li:nth-child(1) .h-mobile-link { transition-delay: 0.08s; }
.h-mobile.open .h-mobile-list li:nth-child(2) .h-mobile-link { transition-delay: 0.14s; }
.h-mobile.open .h-mobile-list li:nth-child(3) .h-mobile-link { transition-delay: 0.20s; }
.h-mobile.open .h-mobile-list li:nth-child(4) .h-mobile-link { transition-delay: 0.26s; }
.h-mobile.open .h-mobile-list li:nth-child(5) .h-mobile-link { transition-delay: 0.32s; }
.h-mobile.open .h-mobile-list li:nth-child(6) .h-mobile-link { transition-delay: 0.38s; }

.h-mobile-num {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--red);
  letter-spacing: 0.06em;
}

.h-mobile-name {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1;
}

.h-mobile-go {
  font-size: 1.5rem;
  color: var(--gray-700);
  transform: translate(-8px, 8px) rotate(0deg);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, color 0.3s ease;
}

.h-mobile-link:hover {
  padding-left: 12px;
}

.h-mobile-link:hover .h-mobile-go,
.h-mobile-link[aria-current="page"] .h-mobile-go {
  opacity: 1;
  transform: translate(0, 0);
  color: var(--red);
}

.h-mobile-link[aria-current="page"] .h-mobile-name {
  color: var(--red);
}

.h-mobile-cta {
  display: block;
  width: 100%;
  padding: 20px;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--red);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s ease 0.4s, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.4s, background 0.3s ease;
}

.h-mobile.open .h-mobile-cta {
  opacity: 1;
  transform: translateY(0);
}

.h-mobile-cta:hover {
  background: var(--red-dark);
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .h-cell-name {
    font-size: 0.58rem;
    letter-spacing: 0.08em;
  }

  .h-cell {
    padding: 8px 8px 10px;
  }
}

@media (max-width: 960px) {
  .header-grid {
    grid-template-columns: 1fr auto auto;
  }

  .h-nav,
  .h-cta {
    display: none;
  }

  .h-logo {
    border-right: none;
    padding-left: max(20px, env(safe-area-inset-left));
  }

  .h-burger {
    display: flex;
    min-width: 100px;
    height: 100%;
    padding-right: max(20px, env(safe-area-inset-right));
    padding-left: 16px;
  }
}

@media (max-width: 520px) {
  .h-logo-img {
    height: 68px;
    max-width: 200px;
    padding: 6px 14px 6px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header,
  .h-logo-stripe,
  .h-cell,
  .h-cta,
  .h-mobile-screen,
  .h-mobile-link {
    animation: none;
    transition: none;
    transform: none;
    opacity: 1;
  }
}
