/* =========================
   MOBILE (<=768px)
========================= */

@media screen and (max-width: 767px),
       screen and (orientation: landscape) and (max-height: 500px) {

  /* -------------------------
     NAVIGATION
  ------------------------- */

  .header-inner{
    height:80px;
    padding:0 20px;
  }
    
  .logo img{
    width:140px;
  }

  :root {
    --brand-text-primary: rgba(255,244,230,0.92);
    --brand-text-secondary: rgba(255,244,230,0.7);
    --brand-accent: #ffffff;
  }

/* =========================
   NAV TOGGLE (KEEP CLEAN)
========================= */

.nav-toggle{ 
  display:flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  top:-10px;
  border-radius:50%;
  font-size:18px;

  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);

  position:relative;
  z-index:1200;

  transition: all 0.25s ease;
}

.nav-toggle:hover{
  background: rgba(255,255,255,0.12);
}

.nav-toggle:active{
  transform: scale(0.92);
}

body.nav-open {
  overflow-x: hidden;
}

/* =========================
   NAV CONTAINER (FLAT + LEFT FLOW)
========================= */

.main-nav{
  position:fixed;
  inset:0;
  height:100vh;
  height:100svh; /* fallback-safe */ 

  gap:10px;
  
  display:flex;
  flex-direction:column;
  align-items:flex-start;

  padding:100px 24px 40px;

  background:#0a0a0a;

  transform: translateX(-100%);
  opacity:0;
  pointer-events:none;

  transition:
    transform 0.45s cubic-bezier(.22,1,.36,1),
    opacity 0.3s ease;

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  z-index:1100;
}

.main-nav.active{
  transform: translateX(0);
  opacity:1;
  pointer-events:auto;
}


/* =========================
   NAV ITEMS (LEFT ALIGNED FLOW)
========================= */

.main-nav > a,
.main-nav > .nav-dropdown{
  width:100%;
}

/* real clickable items */
.main-nav a,
.nav-trigger{
  display:block;
  width:100%;

  padding: 10px 8px;

  font-size:1.05rem;
  letter-spacing:0.06em;

  text-align:left;

  color: rgba(255,244,230,0.9);
  text-decoration:none;

  border-bottom: 1px solid rgba(255,255,255,0.05);

  opacity:0;
  transform: translateY(12px);

  transition:
    opacity 0.35s ease,
    transform 0.35s cubic-bezier(.22,1,.36,1),
    color 0.2s ease;
}

/* animate in */
.main-nav.active a,
.main-nav.active .nav-trigger{
  opacity:1;
  transform: translateY(0);
}


/* =========================
   HOVER / INTERACTION (SUBTLE)
========================= */

.main-nav a:hover,
.nav-trigger:hover{
  color: #000;
  transform: translateX(2px);
}


/* =========================
   DROPDOWN — NO SHIFT SYSTEM
========================= */

/* parent = anchor */
.nav-dropdown{
  position: relative;
  width: 100%;
}

/* trigger stays stable */
.nav-trigger{
  display:block;
  width:100%;
  text-align:left;
  cursor:pointer;
  position: relative;
  z-index: 2;
}

/* dropdown OUT of layout */
.dropdown-menu{
  position: absolute;   /* KEY */
  left: 0;
  top: 100%;

  width: calc(100% - 12px);   /* prevents edge stretch */
  padding-left: 6px;         /* better breathing */
  margin-top: 8px;

  transform: translateX(6px); /* subtle separation */

  display: none;

  /* remove panel */
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

/* open */
.nav-dropdown.dropdown-open .dropdown-menu{
  display: block;
}


/* =========================
   ITEMS
========================= */

.dropdown-menu a{
  display:block;
  width:100%;

  font-size:0.9rem;
  padding: 10px 8px;

  color: rgba(255,244,230,0.75);
  text-decoration:none;

  background: transparent !important;

  opacity:0;
  transform: translateY(6px);

  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    color 0.2s ease;
}

/* hover (fix invisible text issue) */
.dropdown-menu a:hover{
  color:#000;
  background: transparent !important;
}

/* animate */
.nav-dropdown.dropdown-open .dropdown-menu a{
  opacity:1;
  transform: translateY(0);
}

/* =========================
   ACTIVE LINK (CLEAN LINE STYLE)
========================= */

.main-nav a.active{
  color:#fff;
  position:relative;
}

.main-nav a.active::before{
  content:"";
  position:absolute;
  left:-12px;
  top:50%;
  transform:translateY(-50%);

  width:4px;
  height:18px;

  background:#fff;
  border-radius:2px;
}

/* FORCE BLACK HOVER (GLOBAL) */
.main-nav a:hover,
.nav-trigger:hover,
.dropdown-menu a:hover {
  color: #000 !important;
}

/* SAFE HOVER (EXCLUDES ACTIVE) */
.main-nav a:hover:not(.active){
  color: #000 !important;
}

.main-nav a.active,
.main-nav a.active:hover {
  color: #fff !important;
}

.main-nav a.active:hover {
  opacity: 0.8;
}

/* =========================
   BACKDROP (SOFT)
========================= */

.nav-backdrop{
  position:fixed;
  inset:0;

  background: rgba(0,0,0,0.5);

  opacity:0;
  pointer-events:none;

  transition: opacity 0.3s ease;
}

body.nav-open .nav-backdrop{
  opacity:1;
  pointer-events:auto;
}


/* =========================
   CLEAN HEADER (UNCHANGED INTENT)
========================= */

body.scrolled .header-inner{
  background:transparent !important;
  box-shadow:none !important;
  border:none !important;
}

  /* -------------------------
     TYPOGRAPHY
  ------------------------- */

  h1{
    font-size:clamp(1.2rem,4vw,1.4rem);
    line-height:1.4;
  }

  h2{
    font-size:clamp(1rem,3vw,1.2rem);
  }

  p{
    font-size:0.9rem;
    line-height:1.5;
  }

  /* -------------------------
     LAYOUT
  ------------------------- */

  .align-start{
    justify-content:flex-start;
  }
  
  .align-end{
    justify-content:flex-end;
  }

  .align-start .page-container,
  .align-end .page-container,
  .align-start .page-container-wide,
  .align-end .page-container-wide{
    align-items:center;
    text-align:left;
    flex-direction:column;
    margin-inline: auto;
  }

  .about-main-content h1,
  .careers-main-content h1,
  .suppliers-main-content h1{
  
    margin-top:var(--space-md);
  }

  .research-domains-grid {
    grid-template-columns: 1fr;
  }

  .research-domains-grid{
    width:100%;
  }

/* =========================
   HERO BASE
========================= */

.home-hero,
.home-hero-secondary,
.home-hero-tertiary {
  position: relative;

  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;

  padding-top: calc(80px + env(safe-area-inset-top));

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
}

/* =========================
   HERO VIDEO TEXT OVERRIDE
========================= */

/* Section alignment */
.home-hero.align-start {
  justify-content: flex-start;
}

.home-hero.valign-bottom {
  align-items: flex-end;
}

/* Ensure overlay follows section alignment */
.home-hero .home-hero-overlay {
  justify-content: flex-start;
  align-items: flex-end;
}

/* Add bottom breathing space */
.home-hero.valign-bottom .home-hero-overlay {
  padding-bottom: clamp(2rem, 6vw, 4rem);
}

/* =========================
   VIDEO HERO
========================= */

.home-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.home-hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

/* VIDEO GRADIENT */

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;

  background: linear-gradient(
    to top,
    rgba(0,0,0,0.85),
    rgba(0,0,0,0.3),
    transparent
  );

  z-index: 1;
  pointer-events: none;
}

/* =========================
   CONTENT LAYER
========================= */

.page-container {
  position: relative;
  z-index: 2;
}

.home-hero-overlay {
  width: 100%;
  display: flex;
  align-items: center;
}

.home-hero-overlay > div {
  max-width: 700px;
  width: 100%;
}

/* =========================
   TYPOGRAPHY
========================= */

.home-hero-overlay h1 {
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  line-height: 1.3;
}

.home-hero-overlay p {
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  line-height: 1.6;
}

/* =========================
   ALIGNMENT
========================= */

.align-start .home-hero-overlay {
  justify-content: flex-start;
  text-align: left;
}

.align-end .home-hero-overlay {
  justify-content: flex-end;
  text-align: left;
}

  /* -------------------------
     SPACING
  ------------------------- */

  .section{
    padding:3rem 0;
  }

  .section-lg{
    padding:4rem 0;
  }

  .section-xl{
    padding:5rem 0;
  }

  /* -------------------------
     CONTAINERS
  ------------------------- */
  .hero-split-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-top: calc(80px + env(safe-area-inset-top));
  }
  
  .hero-split-left h1 {
    font-size: clamp(2.2rem, 7.5vw, 3.8rem);
    max-width: 100%;
    word-break: break-word;
  }
  
  .hero-split-right {
    align-items: flex-start;
  }
  
  :root {
    --page-padding: clamp(1rem, 4vw, 2rem);
  }
  
  .page-container,
  .page-container-wide,
  .home-hero,
  .home-hero-secondary,
  .home-hero-tertiary {
    padding-inline: var(--page-padding);
  }

/* ==========================
   MOBILE TIMELINE (CARDS)
========================== */

  .timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;

    max-width: 100%;
    padding: 0;
  }

  .timeline-step {
    position: relative;
    display: block; /* override desktop flex */
  }

  /* REMOVE CONNECTOR LINES */

  .timeline-step::after {
    display: none !important;
  }

  /* CARD */

  .timeline-card {
    padding: 1.25rem;
    border-radius: 12px;

    min-height: auto; /* remove fixed height */

    cursor: pointer;
  }

  /* HEADER ROW (TITLE + ARROW) */

  .timeline-card h3 {
    font-size: 0.95rem;
    line-height: 1.4;

    margin: 0;
    padding-right: 1.5rem;
  }

  /* STEP NUMBER */

  .step-number {
    font-size: 0.65rem;
    letter-spacing: 1px;
    margin-bottom: 0.4rem;
  }

  /* COLLAPSIBLE CONTENT */

  .timeline-card p {
    max-height: 0;
    overflow: hidden;
    opacity: 0;

    transition: 
      max-height 0.4s ease,
      opacity 0.3s ease;

    margin-top: 0;
  }

  /* OPEN STATE */

  .timeline-step.open .timeline-card p {
    max-height: 200px;
    opacity: 1;
    margin-top: 0.6rem;
  }

  /* ARROW INDICATOR */

  .timeline-card::after {
    content: "⌃";
    position: absolute;
    right: 1rem;
    top: 1.2rem;

    font-size: 25px;
    color: var(--color-text-primary);

    transform: rotate(180deg);
    transition: transform 0.25s ease;
  }

  .timeline-step.open .timeline-card::after {
    transform: rotate(0deg);
  }

  /* -------------------------
     FOOTER
  ------------------------- */

  #site-footer{
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;

    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;

  
    padding: 1.8rem clamp(1rem, 4vw, 2rem);
  }


  .footer-inner{
    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 1rem;
    text-align: center;
  }

  /* reorder visually (no HTML change needed) */
  .footer-left{ order: 1; }
  .footer-center{ order: 2; }
  .footer-right{ order: 3; }

  /* links wrap properly */
  .footer-center{
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  /* prevent edge hugging */
  .footer-center a{
    white-space: nowrap;
  }

  .social-icon{
    font-size:16px;
  }

}


@media (max-width: 1023px){
  .timeline-step::after{
    display:none !important;
  }
}

body{
  overflow-x: hidden;
}

html {
  scrollbar-gutter: stable;
}