/* =========================================================================
   responsive.css — Mobile-first breakpoints: 480px, 768px, 1024px, 1440px.
   ========================================================================= */

/* ---------------------------------------------------------------------
   < 768px — skip scroll-triggered reveal animations, show content
   immediately instead of waiting on IntersectionObserver timing
   --------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  [data-reveal],
  [data-reveal="fade"],
  [data-reveal="slide-left"],
  [data-reveal="slide-right"],
  [data-reveal="scale"] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .timeline__item {
    opacity: 1;
    clip-path: none;
    transition: none;
  }

  .timeline__marker {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------------------------------------------------------------------
   < 1024px — portrait bleeds behind the headline instead of stacking
   --------------------------------------------------------------------- */
@media (max-width: 1023.98px) {
  .hero__grid {
    position: relative;
    display: block;
    isolation: isolate;
  }

  .hero__grid > *:first-child {
    position: relative;
    z-index: 1;
    max-width: 68%;
  }

  .hero__portrait-wrap {
    position: absolute;
    top: 0;
    z-index: 0;
    justify-content: flex-end;
  }

  .hero__portrait {
    opacity: 0.55;
  }

  .hero__actions {
    flex-wrap: nowrap;
  }

  .hero__actions .btn {
    flex: 1 1 auto;
    padding-inline: var(--space-sm);
    white-space: nowrap;
  }
}

@media (max-width: 767.98px) {
  .hero__portrait-wrap {
    right: -25%;
  }

  .hero__portrait {
    width: 45%;
  }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
  .hero__portrait-wrap {
    right: -10%;
  }

  .hero__portrait {
    width: 50%;
  }
}

/* ---------------------------------------------------------------------
   >= 480px — large phones
   --------------------------------------------------------------------- */
@media (min-width: 480px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------------------------------------------------------------------
   >= 768px — tablets
   --------------------------------------------------------------------- */
@media (min-width: 768px) {
  .hero {
    padding-top: calc(var(--nav-height) + var(--space-2xl));
    padding-bottom: var(--space-2xl);
    min-height: min(92vh, 780px);
  }

  .expertise-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-links {
    grid-template-columns: repeat(3, 1fr);
  }

  .leadership-grid .card {
    flex: 1 1 calc(50% - var(--space-md) / 2);
  }

  .about-teaser {
    grid-template-columns: 1fr 1fr;
  }

  .about-teaser > *:first-child {
    text-align: right;
    justify-self: end;
  }

  .about-teaser > *:first-child .eyebrow {
    flex-direction: row-reverse;
  }

  .about-teaser > *:first-child p {
    text-align: right;
  }

  .about-teaser > *:last-child {
    text-align: left;
    justify-self: stretch;
  }


  .stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------------------------------------------------------------------
   >= 1024px — desktop
   --------------------------------------------------------------------- */
@media (min-width: 1024px) {
  .nav__toggle {
    display: none;
  }

  .nav__links {
    display: flex;
  }

  .btn.nav__cta {
    display: inline-flex;
  }

  .mobile-menu {
    display: none;
  }

  .hero__grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero__grid > *:first-child {
    text-align: right;
    justify-self: end;
  }

  .hero__grid > *:first-child .hero__title,
  .hero__grid > *:first-child .hero__lead {
    margin-left: auto;
  }

  .hero__grid > *:first-child .hero__actions {
    justify-content: flex-end;
  }

  .hero__portrait-wrap {
    justify-content: flex-start;
  }

  .expertise-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .leadership-grid .card {
    flex: 1 1 calc(33.333% - var(--space-md) * 2 / 3);
  }

  .tech-group__list {
    gap: 0.75rem;
  }

  /* Centered line, alternating cards */
  .timeline {
    position: relative;
    padding-left: 0;
    border-left: none;
    margin-left: 0;
  }

  .timeline::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-border);
    transform: translateX(-1px);
  }

  .timeline__item {
    padding-bottom: var(--space-lg);
    margin-bottom: calc(-1 * var(--space-lg));
  }

  .timeline__marker {
    left: 50%;
    top: 0;
    width: 56px;
    height: 56px;
    --timeline-marker-position: translateX(-50%);
    transform: var(--timeline-marker-position);
  }

  .timeline__card {
    max-width: 47%;
  }

  .timeline__item:nth-child(odd) .timeline__card {
    margin-right: auto;
    padding-right: calc(var(--space-lg) + 8px);
    position: relative;
  }

  .timeline__item:nth-child(even) .timeline__card {
    margin-left: auto;
    padding-left: calc(var(--space-lg) + 8px);
    position: relative;
  }

  .timeline__item:nth-child(odd) .timeline__card {
    text-align: right;
  }

  .timeline__item:nth-child(odd) .timeline__card > .timeline__company,
  .timeline__item:nth-child(odd) .timeline__card > .timeline__year,
  .timeline__item:nth-child(odd) .timeline__card > .timeline__role {
    width: fit-content;
    margin-left: auto;
  }

  .timeline__item:nth-child(odd) .timeline__card > p {
    margin-left: auto;
  }

  .timeline__card::after {
    content: "";
    position: absolute;
    top: 24px;
    width: 28px;
    height: 2px;
    background: var(--color-border);
    transition: background var(--duration-base) var(--ease-standard);
  }

  .timeline__item:nth-child(odd) .timeline__card::after {
    right: 0;
  }

  .timeline__item:nth-child(even) .timeline__card::after {
    left: 0;
  }

  .timeline__item:hover .timeline__card::after,
  .timeline__item:focus-within .timeline__card::after {
    background: var(--color-primary);
  }
}

/* ---------------------------------------------------------------------
   < 1024px — hide desktop-only nav, show hamburger
   --------------------------------------------------------------------- */
@media (max-width: 1023.98px) {
  .nav__links {
    display: none;
  }

  .btn.nav__cta {
    display: none;
  }

  .nav__toggle {
    display: flex;
  }
}

/* ---------------------------------------------------------------------
   >= 1440px — large desktop
   --------------------------------------------------------------------- */
@media (min-width: 1440px) {
  .hero__title,
  .page-hero h1 {
    font-size: clamp(3.5rem, 5.5vw, 5rem);
  }

  .expertise-grid {
    gap: var(--space-lg);
  }
}

/* ---------------------------------------------------------------------
   >= 1920px — ultra-wide desktop
   --------------------------------------------------------------------- */
@media (min-width: 1920px) {
  .hero__portrait {
    width: min(480px, 32vw);
  }
}

/* ---------------------------------------------------------------------
   Reduced-width tweaks for very small phones
   --------------------------------------------------------------------- */
@media (max-width: 359.98px) {
  .hero__title {
    font-size: 2.1rem;
  }

  .btn {
    width: 100%;
  }

  .btn-row {
    flex-direction: column;
  }
}
