/* =========================================================
   Skyline IFE: shared stylesheet
   1. Tokens  2. Base  3. Utilities  4. Components
   5. Header/footer  6. Homepage sections  7. Motion
   ========================================================= */

/* ---------- 1. Tokens (from the designer's styleguide) ---------- */
:root {
  color-scheme: light;

  /* Brand */
  --orange: #FF5515;          /* New Orange 2026: the only accent orange */
  --orange-dark: #E2440A;
  --navy: #202D60;            /* Skyline blue primary */
  --navy-deep: #18224A;
  --green: #68BB45;

  /* Neutrals */
  --ink: #232323;
  --ink-soft: #4A4A4A;
  --muted: #909090;
  --border: #E2E2E2;
  --surface: #FFFFFF;
  --surface-alt: #F1F3F5;

  /* Type */
  --font-body: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Space Grotesk", "Manrope", Arial, sans-serif;

  --fs-hero: clamp(2.25rem, 1.2rem + 3.6vw, 4rem);
  --fs-h2: clamp(1.75rem, 1.3rem + 1.5vw, 2.625rem);
  --fs-h3: clamp(1.125rem, 1rem + .4vw, 1.375rem);
  --fs-body: 1rem;
  --fs-small: 1rem;
  --fs-caption: .75rem;

  /* Layout */
  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 3rem + 4vw, 7rem);
  --radius: 20px;
  --radius-pill: 999px;
  --header-h: 88px;
  --header-h-compact: 68px;

  /* Motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-soft: cubic-bezier(.2, .7, .2, 1);
  --dur: .9s;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-padding-top: calc(var(--header-h-compact) + env(safe-area-inset-top, 0px)); -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
/* No ligatures (Manrope joins some letter pairs by default). !important because the `font` shorthand used on some elements would otherwise switch them back on. */
*, *::before, *::after { font-variant-ligatures: none !important; font-feature-settings: "liga" 0, "clig" 0, "calt" 0; }
address { font-style: normal; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 4px; }

/* ---------- 3. Utilities ---------- */
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 200; background: var(--navy); color: #fff; padding: .75rem 1rem; border-radius: 8px; }
.skip-link:focus { top: calc(1rem + env(safe-area-inset-top, 0px)); }

.h2 { font-size: var(--fs-h2); font-weight: 400; line-height: 1.25; color: var(--navy); letter-spacing: -.01em; }

/* ---------- 4. Components ---------- */

/* Buttons: pill with a soft light sweep on hover */
.btn {
  --btn-bg: var(--orange);
  --btn-fg: #fff;
  position: relative;
  isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px;
  padding: .8rem 1.6rem;
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 600 var(--fs-small)/1 var(--font-body);
  overflow: hidden;
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out), background-color .3s;
}
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.28) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform .8s var(--ease-out);
}
.btn:hover { background: var(--orange-dark); transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(255, 85, 21, .7); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: translateY(0); }
.btn--sm { min-height: 38px; padding: .65rem 1.25rem; font-size: .8125rem; }
.btn--outline { --btn-bg: transparent; border: 1.5px solid rgba(255,255,255,.85); }
.btn--outline:hover { background: #fff; color: var(--navy); box-shadow: 0 10px 24px -12px rgba(0,0,0,.45); }

/* Image with an offset colour block behind it (designer's signature framing) */
.offset-media { position: relative; isolation: isolate; }
.offset-media img { position: relative; width: 100%; border-radius: var(--radius); object-fit: cover; }
.offset-media__block {
  position: absolute; z-index: -1; border-radius: var(--radius);
  transition: transform 1.2s var(--ease-out) .15s;
}
.offset-media--navy .offset-media__block { background: var(--navy); inset: -6% 30% 16% -6%; }
.offset-media--green .offset-media__block { background: var(--green); inset: -5% -5% 25% 15%; }
.offset-media--wide .offset-media__block { inset: -7% 6% 30% 10%; }

/* ---------- 5. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  transition: transform .5s var(--ease-out), box-shadow .4s, background-color .4s;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 101; background: #fff; }
/* Once scrolled, only the background changes: a light frost and soft shadow. Size stays fixed. */
.site-header.is-scrolled {
  background: rgba(255,255,255,.88);
  -webkit-backdrop-filter: blur(10px); /* a lighter blur is much cheaper to redraw while scrolling */
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px -18px rgba(32, 45, 96, .35);
}
.site-header.is-hidden { transform: translateY(-100%); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; height: var(--header-h-compact); }
.site-header__logo img { width: 116px; }

.main-nav { display: flex; align-items: center; gap: 1.5rem; }
.main-nav__list { display: flex; gap: 1.75rem; }
.main-nav__list a, .main-nav__external { position: relative; font-weight: 600; font-size: .875rem; color: var(--navy); padding-block: .5rem; }
.main-nav__list a { transition: color .3s ease; }
.main-nav__list a:hover, .main-nav__list a[aria-current="page"] { color: var(--orange); }
.main-nav__external { display: inline-flex; align-items: center; gap: .9rem; color: var(--green); padding-left: 1.5rem; border-left: 1px solid var(--navy); }
.main-nav__external { transition: color .3s ease; }
.main-nav__external:hover { color: var(--orange); }
/* Icon drawn with a mask so it always matches the link colour */
.icon-inflight {
  display: inline-block; width: 22px; height: 24px; flex: none;
  background-color: currentColor;
  -webkit-mask: url(../img/icon-inflight.svg) center / contain no-repeat;
  mask: url(../img/icon-inflight.svg) center / contain no-repeat;
  transition: transform .45s var(--ease-out);
}
.main-nav__external:hover .icon-inflight { transform: translateY(-2px) rotate(-6deg); }

.menu-toggle { display: none; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; padding: 10px; }
.menu-toggle__bars { position: relative; display: block; width: 24px; height: 18px; }
.menu-toggle__bars span { position: absolute; left: 0; width: 100%; height: 2.5px; border-radius: 2px; background: var(--navy); transition: transform .45s var(--ease-out), opacity .3s; }
.menu-toggle__bars span:nth-child(1) { top: 0; }
.menu-toggle__bars span:nth-child(2) { top: 8px; }
.menu-toggle__bars span:nth-child(3) { top: 16px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 90;
  padding: calc(var(--header-h-compact) + env(safe-area-inset-top, 0px) + 2rem) var(--gutter) 2rem;
  background: var(--navy); color: #fff;
  clip-path: circle(0 at calc(100% - 42px) 40px);
  transition: clip-path .8s var(--ease-out);
}
.mobile-menu.is-open { clip-path: circle(150% at calc(100% - 42px) 40px); }
.mobile-menu li { overflow: hidden; }
.mobile-menu li a { display: block; font-size: clamp(1.75rem, 7vw, 2.5rem); font-weight: 500; padding: .35rem 0; transform: translateY(110%); transition: transform .7s var(--ease-out); }
.mobile-menu.is-open li a { transform: none; }
.mobile-menu.is-open li:nth-child(2) a { transition-delay: .05s; } .mobile-menu.is-open li:nth-child(3) a { transition-delay: .1s; }
.mobile-menu.is-open li:nth-child(4) a { transition-delay: .15s; } .mobile-menu.is-open li:nth-child(5) a { transition-delay: .2s; }
.mobile-menu.is-open li:nth-child(6) a { transition-delay: .25s; }
.mobile-menu li a { transition: transform .7s var(--ease-out), color .3s ease; }
.mobile-menu li a:hover, .mobile-menu li a[aria-current="page"] { color: var(--orange); }
.mobile-menu__external { display: inline-flex; gap: .75rem; align-items: center; margin-top: 2rem; color: var(--green); font-weight: 600; }
.mobile-menu__external:hover { color: var(--orange); }

/* ---------- 6. Homepage sections ---------- */

/* Hero */
.hero { position: relative; min-height: clamp(420px, 68vh, 720px); display: grid; place-items: center; overflow: hidden; color: #fff; text-align: center; background: var(--navy-deep); }
.hero__media { position: absolute; inset: -8% 0 0; will-change: transform; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; transform: scale(1.12); animation: hero-zoom 2.8s var(--ease-out) forwards; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,14,35,.25) 0%, rgba(10,14,35,.45) 55%, rgba(10,14,35,.6) 100%); }
.hero__content { position: relative; z-index: 1; padding-block: 4rem; }
.hero__title { font-size: var(--fs-hero); font-weight: 500; line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; text-shadow: 0 2px 30px rgba(0,0,0,.25); }
.hero__lede { max-width: 46rem; margin: 1.5rem auto 0; font-size: clamp(.95rem, .9rem + .2vw, 1.0625rem); font-weight: 500; line-height: 1.6; opacity: .95; }
.hero__title, .hero__lede { opacity: 0; transform: translateY(28px); animation: rise 1.2s var(--ease-out) forwards; }
.hero__title { animation-delay: .25s; }
.hero__lede { animation-delay: .5s; }

/* Journey (welcome / services / why) shares one light background and the flight path */
.journey { position: relative; background: var(--surface-alt); padding-block: var(--section-y); }
/* Layering: band backgrounds (static) < route line (z 1) < cards, images and text (z 2) */
.journey__route { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
.journey__route-line { fill: none; stroke: var(--navy); stroke-opacity: .55; stroke-width: 1.5; stroke-dasharray: 6 6; }
.journey__route-mask { fill: none; stroke: #fff; stroke-width: 8; stroke-linecap: round; }
.journey__plane { opacity: 0; transition: opacity .4s; }
.journey .offset-media, .journey .service-card, .journey .feature-row, .journey .section-head,
.journey .welcome__text, .journey .why__text, .journey .split__text, .journey .timeline { position: relative; z-index: 2; }
.journey--white { background: var(--surface); }
.journey--flush { padding-bottom: 0; }
.band { padding-block: var(--section-y); }
.band--white { background: var(--surface); margin-top: var(--section-y); }

/* Welcome */
.welcome { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; max-width: 1100px; }
.welcome__media { margin-top: 1rem; }
.welcome__text { padding-top: .25rem; }
.welcome__text .h2 { margin-bottom: 1.25rem; }
.welcome__text p { font-size: var(--fs-small); color: var(--ink-soft); max-width: 38rem; }
.welcome__text p + p { margin-top: 1rem; }
.welcome__text .btn { margin-top: 1.75rem; }

/* Section heading */
.section-head { text-align: center; max-width: 40rem; margin: 0 auto clamp(2.5rem, 4vw, 3.5rem); }
.section-head p { margin-top: 1rem; font-weight: 500; color: var(--ink); }

/* Services */
.services { padding-top: clamp(4rem, 8vw, 6.5rem); }
.services__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 5vw, 6.5rem) clamp(1.5rem, 6vw, 6.5rem); max-width: 1060px; margin-inline: auto; }
.service-card {
  display: flex; flex-direction: column; /* cards in a row share a height, so buttons can sit on one baseline */
  position: relative;
  background: var(--surface); border-radius: 12px; padding: 1.25rem 1.25rem 1.75rem;
}
/* Hover shadow sits ready on a pseudo-element and only fades in: animating opacity is
   cheap for every browser, whereas animating the shadow itself repaints the card each frame. */
.service-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 24px 50px -28px rgba(32, 45, 96, .45);
  opacity: 0; transition: opacity .6s var(--ease-out);
}
.service-card:hover::after { opacity: 1; }
.service-card__media, .news-card__media {
  /* own compositing layer, so the rounded clip stays crisp while the image scales */
  isolation: isolate; transform: translateZ(0);
}
.service-card__media img, .news-card__media img {
  transform: translateZ(0) scale(1); backface-visibility: hidden; will-change: transform;
  transition: transform .8s cubic-bezier(.33, 1, .68, 1); /* same gentle curve in and out */
}
.service-card__media { border-radius: 14px; overflow: hidden; aspect-ratio: 531 / 280; background: var(--surface-alt); }
.service-card__media img { width: 100%; height: 100%; object-fit: cover; }
.service-card:hover .service-card__media img { transform: translateZ(0) scale(1.04); }
.service-card__title { margin-top: 1.25rem; font-size: var(--fs-h3); font-weight: 500; color: var(--ink); }
.service-card p { margin-top: .6rem; font-size: var(--fs-small); color: var(--ink-soft); }
.service-card p { margin-bottom: 1.25rem; }
.service-card p:last-child { margin-bottom: 0; }
.service-card .btn { margin-top: auto; align-self: flex-start; } /* pushed to the bottom of the card */

/* Why choose */
.why { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: clamp(2rem, 5vw, 4rem); align-items: center; max-width: 1100px; padding-top: clamp(5rem, 9vw, 7rem); }
.why__features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 2.5rem; margin-top: 2.5rem; max-width: 34rem; }
.why__features li { display: grid; grid-template-columns: 32px 1fr; gap: .9rem; align-items: start; }
.why__features img { width: 26px; height: auto; margin-top: .15rem; }
.why__features h3 { font-size: 1.125rem; font-weight: 500; color: var(--ink); line-height: 1.4; }
.why__features p { margin-top: .4rem; font-size: .8125rem; color: var(--ink-soft); }
.why__media { margin-right: 5%; margin-top: 2rem; }
.why__badge {
  position: absolute; left: -2.5rem; top: 2rem; z-index: 2;
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem 1.1rem .5rem .9rem; border-radius: var(--radius-pill);
  background: var(--surface); box-shadow: 0 14px 30px -16px rgba(32,45,96,.35);
}
.why__badge-num { font: 700 2.75rem/1 var(--font-display); color: var(--orange); letter-spacing: -.02em; }
.why__badge-label { font-size: .75rem; line-height: 1.3; color: var(--ink); }

/* Stats */
.stats { background: var(--navy); color: #fff; padding-block: clamp(3rem, 5vw, 4.5rem); }
.stats__list { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem 1.5rem; max-width: 1100px; }
.stats__list li { display: flex; flex-direction: column; gap: .35rem; min-width: 8rem; }
.stats__num { font: 700 clamp(2.5rem, 2rem + 2vw, 3.75rem)/1 var(--font-display); color: var(--green); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stats__label { font-size: .9375rem; font-weight: 500; }

/* Movie library */
.library { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: clamp(2rem, 4vw, 3.5rem); max-width: 1180px; padding-block: calc(var(--section-y) + 1rem) var(--section-y); }
.library__panel { position: absolute; z-index: -1; left: calc(var(--gutter) + 4%); right: var(--gutter); top: calc(var(--section-y) + 3rem); bottom: calc(var(--section-y) - 2.25rem); background: var(--navy); border-radius: var(--radius); }
.library { isolation: isolate; }
.library__media { margin-left: -2%; }
.library__media img { aspect-ratio: 720 / 420; }
.library__text { color: #fff; padding: 4rem clamp(1.5rem, 4vw, 3rem) 3rem 0; }
.library__text .h2 { color: #fff; margin-bottom: 1rem; }
.library__text p { font-size: var(--fs-small); opacity: .9; max-width: 26rem; }
.library__text p + p { margin-top: .5rem; }
.library__text .btn { margin-top: 1.75rem; }

/* News */
.news { background: var(--surface-alt); padding-block: var(--section-y); }
.news .container { max-width: calc(1100px + var(--gutter) * 2); }
.news__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.news__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 4rem); }
.news__more { display: none; }
.news-card__media { display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 555 / 318; }
.news-card__media img { width: 100%; height: 100%; object-fit: cover; }
.news-card:hover .news-card__media img { transform: translateZ(0) scale(1.04); }
/* Firefox: it redraws a zooming image unevenly, so instead of zooming, the image
   brightens softly (a light overlay fading in) alongside the card shadow. */
@supports (-moz-appearance: none) {
  .service-card__media, .news-card__media { position: relative; isolation: auto; transform: none; }
  .service-card__media img, .news-card__media img { transform: none !important; will-change: auto; backface-visibility: visible; transition: none; }
  .service-card__media::after, .news-card__media::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: rgba(255, 255, 255, .14); opacity: 0; transition: opacity .5s ease;
  }
  .service-card:hover .service-card__media::after, .news-card:hover .news-card__media::after { opacity: 1; }
}
.news-card__cat { display: flex; align-items: center; gap: .5rem; margin-top: 1.25rem; font-size: .6875rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.news-card__title { margin-top: .75rem; font-size: 1.125rem; font-weight: 500; line-height: 1.45; color: var(--ink); }
.news-card__title a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .6s var(--ease-out); }
.news-card:hover .news-card__title a { background-size: 100% 1px; }
.news-card__meta { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1.25rem; padding-bottom: .9rem; border-bottom: 1px solid var(--border); font-size: .75rem; color: var(--muted); }
.news-card__meta span { display: inline-flex; align-items: center; gap: .4rem; }
.link-more { margin-left: auto; font-weight: 700; color: var(--orange); transition: color .3s; }
.news-card:hover .link-more { color: var(--orange-dark); }

/* CTA */
.cta { position: relative; overflow: hidden; display: grid; place-items: center; min-height: clamp(340px, 40vw, 520px); text-align: center; color: #fff; background: var(--navy-deep); }
.cta__media { position: absolute; inset: -15% 0; will-change: transform; }
.cta__media img { width: 100%; height: 100%; object-fit: cover; }
.cta::after { content: ""; position: absolute; inset: 0; background: rgba(24, 34, 74, .55); }
.cta__content { position: relative; z-index: 1; padding-block: 4rem; }
.cta__title { max-width: 34rem; margin: 0 auto 2rem; font-size: var(--fs-h2); font-weight: 400; line-height: 1.3; text-wrap: balance; }

/* Footer */
.site-footer { background: var(--surface); padding-top: clamp(3rem, 5vw, 4.5rem); font-size: .8125rem; color: var(--ink); }
.site-footer__top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 3rem; }
.site-footer__brand img { width: 150px; margin-bottom: 1.25rem; }
.site-footer__brand p { margin-top: .75rem; }
.social { display: flex; gap: .6rem; margin-top: 1.25rem; }
.social__link { width: 32px; height: 32px; border-radius: 50%; background: url(../img/social.svg) no-repeat; background-size: 74px 32px; transition: transform .45s var(--ease-out); }
.social__link--x { background-position: 0 0; }
.social__link--in { background-position: -42px 0; }
.social__link:hover { transform: translateY(-3px); }
.site-footer__nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
.site-footer__nav h2 { font-size: 1rem; font-weight: 500; color: var(--navy); margin-bottom: 1rem; }
.site-footer__nav li + li { margin-top: .6rem; }
.site-footer__nav a { color: var(--ink-soft); transition: color .3s; }
.site-footer__nav a:hover { color: var(--orange); }
.site-footer__nav a.is-green { color: var(--green); }
.site-footer__nav a.is-green:hover { color: var(--orange); }
.footer-inflight { display: inline-flex; align-items: center; gap: .5rem; }
.footer-inflight .icon-inflight { width: 15px; height: 16px; }
.footer-inflight:hover .icon-inflight { transform: translateY(-1px) rotate(-6deg); }
.site-footer__rule { position: relative; display: grid; place-items: center; margin-top: 3rem; }
.site-footer__rule::before { content: ""; position: absolute; left: var(--gutter); right: var(--gutter); top: 50%; height: 1px; background: var(--border); }
.site-footer__rule img { position: relative; padding-inline: .75rem; background: var(--surface); box-sizing: content-box; }
.site-footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .75rem; padding-block: 1.5rem; font-size: .75rem; color: var(--ink-soft); }
.site-footer__bottom span { margin-inline: .75rem; }
.site-footer__bottom a:hover { color: var(--orange); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .main-nav { display: none; }
  .menu-toggle { display: block; position: relative; z-index: 101; }
  .why__badge { left: -1rem; }
}
@media (max-width: 900px) {
  .journey__route { display: none; }
  .welcome, .why, .library { grid-template-columns: 1fr; }
  .welcome__media, .why__media { max-width: 460px; }
  .why__media { margin: 2.5rem 5% 0 0; }
  .why__badge { left: 1rem; top: 1rem; }
  .library__panel { left: var(--gutter); right: var(--gutter); top: calc(var(--section-y) + 1rem + 7vw); bottom: var(--section-y); }
  .library__media { margin: 0 0 0 .75rem; }
  .library__text { padding: .5rem 1.75rem 2.25rem; }
  .site-footer__top { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --header-h: 72px; --header-h-compact: 64px; }
  .site-header__logo img { width: 100px; }
  .services__grid, .news__grid, .why__features { grid-template-columns: 1fr; }
  .stats__list { display: grid; grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 1.75rem; }
  .stats__list li { align-items: center; }
  /* Full-width buttons, as in the mobile design */
  .welcome__text .btn, .service-card .btn, .library__text .btn, .news__more, .cta .btn { display: flex; width: 100%; }
  .news__head .btn { display: none; }
  .news__more { margin-top: 2rem; }
  .news-card__meta .link-more { flex-basis: 100%; margin-left: 0; }
  /* Service cards run almost edge to edge, with taller images */
  .services__grid { margin-inline: -.75rem; gap: 1.5rem; }
  .service-card { border-radius: 16px; padding: 1rem 1rem 1.5rem; }
  .service-card__media { aspect-ratio: 4 / 3; }
  .cta__content { width: 100%; }
  .hero { min-height: 340px; }
  .hero__content { padding-block: 3rem; }
  .site-footer__nav { grid-template-columns: 1fr 1fr; }
  .news .container { max-width: calc(1100px + var(--gutter) * 2); }
.news__head { flex-wrap: wrap; }
  .library__text { padding-inline: 1.5rem; }
}


/* =========================================================
   8. Inner pages
   ========================================================= */

/* Page hero: shorter than the homepage hero, same treatment */
.page-hero { position: relative; display: grid; place-items: center; min-height: clamp(300px, 26vw, 520px); overflow: hidden; color: #fff; text-align: center; background: var(--navy-deep); }
.page-hero__media { position: absolute; inset: -10% 0; will-change: transform; }
.page-hero__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); animation: hero-zoom 2.4s var(--ease-out) forwards; }
.page-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,14,35,.3), rgba(10,14,35,.5)); }
.page-hero__content { position: relative; z-index: 1; padding-block: 3.5rem; }
.page-hero__title { font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem); font-weight: 600; line-height: 1.1; letter-spacing: -.02em; }
.page-hero__lede { max-width: 48rem; margin: 1.25rem auto 0; font-weight: 600; font-size: clamp(.95rem, .9rem + .2vw, 1.0625rem); line-height: 1.55; }
.page-hero__sub { margin-top: 1.25rem; font-size: clamp(1.25rem, 1rem + 1vw, 2rem); font-weight: 400; }
.page-hero__title, .page-hero__lede, .page-hero__sub { opacity: 0; transform: translateY(24px); animation: rise 1.1s var(--ease-out) .2s forwards; }
.page-hero__lede, .page-hero__sub { animation-delay: .4s; }

/* Split: text left, image right with an offset colour block top-right */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: clamp(2rem, 6vw, 5.5rem); align-items: center; max-width: 1100px; }
.split__text .h2 { margin-bottom: 1.25rem; }
.split__text p { font-size: var(--fs-small); color: var(--ink-soft); max-width: 36rem; }
.split__text p + p { margin-top: 1rem; }
.split__text .btn { margin-top: 2rem; }
.split__media { margin: 1.5rem 5% 0 0; }
.offset-media--navy-right .offset-media__block { background: var(--navy); inset: -6% -6% 18% 18%; }
.offset-media--orange-right .offset-media__block { background: var(--orange); inset: -6% -6% 18% 18%; }
.js .offset-media--navy-right[data-reveal] .offset-media__block,
.js .offset-media--orange-right[data-reveal] .offset-media__block { transform: translate(-6%, 6%) scale(.92); }

/* Feature rows: image overlapping a panel, alternating sides, with a coloured edge */
.feature-rows { max-width: 1100px; }
.split + .feature-rows { margin-top: clamp(4.5rem, 9vw, 7rem); }
.feature-rows__inner { display: grid; gap: clamp(3rem, 6vw, 5rem); }
.feature-row { --edge: var(--navy); --panel: var(--surface); position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; isolation: isolate; padding-bottom: 1.25rem; }
.feature-row--navy { --edge: var(--navy); }
.feature-row--orange { --edge: var(--orange); }
.feature-row--green { --edge: var(--green); }
.feature-row--plain { --panel: var(--surface-alt); }
.feature-row::before { /* the panel */
  content: ""; position: absolute; z-index: -1; inset: 1.25rem 1rem 0 3rem;
  background: var(--panel); border-radius: var(--radius);
}
.feature-row::after { /* the coloured edge peeking out behind the panel */
  content: ""; position: absolute; z-index: -2; top: 2.5rem; bottom: 1.25rem; right: 0; width: 3rem;
  background: var(--edge); border-radius: var(--radius);
}
.feature-row--plain::after { display: none; }
.feature-row--plain::before { inset: 1.25rem 0 0 1.5rem; }
.feature-row__media img { width: 100%; aspect-ratio: 7 / 5; object-fit: cover; border-radius: var(--radius); }
.feature-row__text { padding: 2.5rem clamp(1.5rem, 4vw, 3.5rem) 1.5rem; }
.feature-row__title { font-size: clamp(1.5rem, 1.2rem + 1vw, 2.125rem); font-weight: 400; line-height: 1.25; color: var(--ink); margin-bottom: 1rem; text-wrap: balance; }
.feature-row__title--sm { font-size: clamp(1.125rem, 1rem + .4vw, 1.375rem); font-weight: 500; }
.feature-row__text p { font-size: var(--fs-small); color: var(--ink-soft); max-width: 32rem; }
.feature-row__text p + p { margin-top: 1rem; }
/* Links inside body copy */
.feature-row__text a, .split__text p a, .article__body a { color: var(--orange); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .25s; }
.feature-row__text a:hover, .split__text p a:hover, .article__body a:hover { color: var(--orange-dark); }
/* reversed: image on the right, edge on the left */
.feature-row--reverse .feature-row__media { order: 2; }
.feature-row--reverse::before { inset: 1.25rem 3rem 0 1rem; }
.feature-row--reverse::after { right: auto; left: 0; }
.feature-row--plain.feature-row--reverse::before { inset: -1rem 1.5rem 2.25rem 0; }
.feature-row:not(.feature-row--reverse) .feature-row__media { margin-top: -1.25rem; }

/* Timeline */
.timeline-section { --tl-bg: var(--surface-alt); background: var(--tl-bg); padding-block: var(--section-y); margin-top: var(--section-y); }
.timeline-section--home { --tl-bg: var(--surface); margin-top: 0; }
.timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1000px; margin: 0 auto; padding: 0; list-style: none; text-align: center; }
.timeline__item { position: relative; display: flex; flex-direction: column; align-items: center; padding-inline: .5rem; }
.timeline__year { font: 700 clamp(2rem, 1.6rem + 1.2vw, 2.75rem)/1 var(--font-display); color: var(--navy); letter-spacing: -.02em; }
.timeline__dot { position: relative; z-index: 1; width: 14px; height: 14px; margin: 1rem 0; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 5px var(--tl-bg, var(--surface-alt)); }
.timeline__item p { max-width: 9rem; font-weight: 500; color: var(--ink); line-height: 1.45; }
.timeline__item:not(:last-child)::after { /* dashed connector to the next milestone */
  content: ""; position: absolute; top: calc(clamp(2rem, 1.6rem + 1.2vw, 2.75rem) + 1rem + 7px); left: calc(50% + 14px); width: calc(100% - 28px); height: 0;
  border-top: 1.5px dashed rgba(32, 45, 96, .6);
  clip-path: inset(0 0 0 0);
}
.timeline__item:not(:last-child)::before { /* plane at the midpoint */
  content: ""; position: absolute; z-index: 1; top: calc(clamp(2rem, 1.6rem + 1.2vw, 2.75rem) + 1rem + 7px - 11px); left: calc(100% - 13px);
  width: 26px; height: 22px; background: url(../img/plane.svg) center / contain no-repeat;
  background-color: var(--tl-bg, var(--surface-alt)); box-shadow: 0 0 0 4px var(--tl-bg, var(--surface-alt));
}
/* draw each leg in turn when the timeline arrives */
.js .timeline__item:not(:last-child)::after { clip-path: inset(0 100% 0 0); transition: clip-path .9s var(--ease-soft); }
.js .timeline__item:not(:last-child)::before { opacity: 0; transform: translateX(-40px); transition: opacity .5s ease, transform .9s var(--ease-out); }
.js .timeline__dot { transform: scale(0); transition: transform .5s var(--ease-out); }
.js .timeline.is-in .timeline__dot { transform: none; }
.js .timeline.is-in .timeline__item:not(:last-child)::after { clip-path: inset(0 0 0 0); }
.js .timeline.is-in .timeline__item:not(:last-child)::before { opacity: 1; transform: none; }
.js .timeline.is-in .timeline__item:nth-child(2) .timeline__dot { transition-delay: .55s; }
.js .timeline.is-in .timeline__item:nth-child(3) .timeline__dot { transition-delay: 1.1s; }
.js .timeline.is-in .timeline__item:nth-child(4) .timeline__dot { transition-delay: 1.65s; }
.js .timeline.is-in .timeline__item:nth-child(1)::after, .js .timeline.is-in .timeline__item:nth-child(1)::before { transition-delay: .1s; }
.js .timeline.is-in .timeline__item:nth-child(2)::after, .js .timeline.is-in .timeline__item:nth-child(2)::before { transition-delay: .65s; }
.js .timeline.is-in .timeline__item:nth-child(3)::after, .js .timeline.is-in .timeline__item:nth-child(3)::before { transition-delay: 1.2s; }

/* Lab services cards have no button */
.services--lab { padding-top: 0; }

/* Newsroom index */
.news--index .news__grid { row-gap: clamp(2.5rem, 5vw, 4rem); }

/* Article */
.article { background: var(--surface-alt); padding-bottom: var(--section-y); }
.article__hero { position: relative; height: clamp(220px, 26vw, 500px); overflow: hidden; background: #0b1660; }
.article__hero-media { position: absolute; inset: -10% 0; will-change: transform; }
.article__hero-media img { width: 100%; height: 100%; object-fit: cover; }
.article__hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,12,90,.88), rgba(10,22,110,.72)); }
.article__wrap { position: relative; z-index: 1; max-width: calc(860px + var(--gutter) * 2); margin-top: calc(clamp(220px, 26vw, 500px) * -1 + clamp(2rem, 5vw, 3.5rem)); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; font-size: .8125rem; font-weight: 500; color: rgba(255,255,255,.9); }
.breadcrumb li + li::before { content: "/"; margin-right: .5rem; opacity: .7; }
.breadcrumb a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb [aria-current] { opacity: .8; }
.article__card { margin-top: 1rem; padding: clamp(1.5rem, 5vw, 2.5rem) clamp(1.25rem, 5vw, 2.5rem) clamp(2rem, 5vw, 2.5rem); background: var(--surface); border-radius: var(--radius); box-shadow: 0 30px 60px -40px rgba(32,45,96,.4); }
.article__card > .news-card__cat { margin-top: 0; }
.article__title { margin-top: .75rem; font-size: clamp(1.75rem, 1.3rem + 1.5vw, 2.5rem); font-weight: 400; line-height: 1.2; color: var(--ink); }
.news-card__meta--plain { border: 0; padding: 0; margin-top: .75rem; }
.article__lede { margin-top: 1.25rem; font-size: 1.0625rem; font-weight: 600; line-height: 1.55; max-width: 42rem; }
.article__gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.75rem; }
.article__gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
.article__gallery img:only-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.article__body { margin-top: 1.75rem; font-size: var(--fs-small); color: var(--ink-soft); max-width: 46rem; }
.article__body p + p { margin-top: 1rem; }
.article__back { display: inline-block; margin-top: 2rem; font-weight: 700; font-size: var(--fs-small); color: var(--orange); }
.article__back:hover { color: var(--orange-dark); }

/* Contact */
.contact { background: var(--surface-alt); padding-block: clamp(2.5rem, 4vw, 3.5rem) var(--section-y); }
.contact__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2rem, 6vw, 5.5rem); align-items: start; max-width: 1100px; }
.contact__intro { padding-top: 1rem; }
.contact__intro .h2 { max-width: 14ch; margin-bottom: 1rem; }
.contact__intro p { font-size: var(--fs-small); color: var(--ink-soft); max-width: 26rem; }
.contact__intro p + p { margin-top: 1rem; }
.contact__details { margin-top: 3rem; max-width: 26rem; }
.contact__details li { display: flex; align-items: center; gap: 1.25rem; padding-block: 1rem; font-size: var(--fs-small); font-weight: 500; }
.contact__details li + li { border-top: 1px solid var(--border); }
.contact__details a:hover { color: var(--orange); }
.contact__icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--orange); color: #fff; }
.contact__card { position: relative; padding: clamp(1.5rem, 4vw, 2.5rem); background: var(--surface); border-radius: var(--radius); }

.form__field + .form__field { margin-top: 1.5rem; }
.form label { display: block; margin-bottom: .6rem; font-size: var(--fs-small); font-weight: 700; color: var(--ink); }
.form__req { color: var(--orange); }
.form input, .form textarea {
  width: 100%; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 4px; background: var(--surface);
  font: 500 var(--fs-small)/1.4 var(--font-body); color: var(--ink);
  transition: border-color .25s, box-shadow .25s;
}
.form textarea { resize: vertical; min-height: 7.5rem; }
.form input::placeholder, .form textarea::placeholder { color: var(--muted); font-size: .8125rem; }
.form input:hover, .form textarea:hover { border-color: #c9c9c9; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(32, 45, 96, .12); }
.form [aria-invalid="true"] { border-color: #C8102E; }
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__error--send { margin-top: 1rem; }
.form__error--send a { text-decoration: underline; }
.form__error { margin-top: .45rem; font-size: .8125rem; font-weight: 600; color: #C8102E; }
.form .btn { margin-top: 2rem; border: 0; cursor: pointer; }
.form__success { text-align: center; padding: 2.5rem 1rem; outline: none; }
.form__success-icon { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: rgba(255, 85, 21, .1); }
.form__success h3 { margin-top: 1.25rem; font-size: 1.5rem; font-weight: 500; color: var(--navy); }
.form__success p { margin: .75rem auto 0; max-width: 24rem; font-size: var(--fs-small); color: var(--ink-soft); }
.form__success .btn { margin-top: 1.75rem; }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--navy); border: 1.5px solid var(--border); }
.btn--ghost:hover { background: var(--surface-alt); box-shadow: none; }
.js .form__success:not([hidden]) .form__success-icon img { animation: fly-in .9s var(--ease-out) both; }
@keyframes fly-in { from { opacity: 0; transform: translate(-30px, 14px) rotate(-12deg); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .split, .contact__inner { grid-template-columns: 1fr; }
  .split__media { max-width: 460px; margin-top: 1rem; }
  .feature-row, .feature-row--reverse { grid-template-columns: 1fr; padding-bottom: 0; }
  .feature-row--reverse .feature-row__media { order: 0; }
  .feature-row::before, .feature-row--reverse::before, .feature-row--plain::before, .feature-row--plain.feature-row--reverse::before { inset: 3rem 0 0 0; }
  .feature-row::after { top: 4.5rem; bottom: 1rem; right: -.5rem; width: 2rem; }
  .feature-row--reverse::after { right: auto; left: -.5rem; }
  .feature-row__media { padding-inline: 1rem; }
  .feature-row:not(.feature-row--reverse) .feature-row__media { margin-top: 0; }
  .feature-row__text { padding: 1.5rem 1.5rem 2rem; }
  .timeline-section { margin-top: var(--section-y); }
  .band--white { margin-top: calc(var(--section-y) * .75); }
}
@media (max-width: 640px) {
  /* vertical timeline */
  .timeline { grid-template-columns: 1fr; max-width: 20rem; text-align: left; }
  .timeline__item { display: grid; grid-template-columns: 6.5rem 14px 1fr; align-items: center; column-gap: 1rem; padding: 0 0 3rem; }
  .timeline__item:last-child { padding-bottom: 0; }
  .timeline__dot { margin: 0; }
  .timeline__item p { max-width: none; }
  .timeline__item:not(:last-child)::after { top: calc(50% - 1.5rem + 14px); left: calc(6.5rem + 1rem + 6px); width: 0; height: calc(100% - 14px); border-top: 0; border-left: 1.5px dashed rgba(32, 45, 96, .6); }
  .js .timeline__item:not(:last-child)::after { clip-path: inset(0 0 100% 0); }
  .timeline__item:not(:last-child)::before { top: calc(100% - 1.5rem - 11px); left: calc(6.5rem + 1rem + 7px - 13px); transform: rotate(90deg); }
  .js .timeline__item:not(:last-child)::before { transform: translateY(-30px) rotate(90deg); }
  .js .timeline.is-in .timeline__item:not(:last-child)::before { transform: rotate(90deg); }
  .split__text .btn, .contact .btn:not(.btn--ghost) { display: flex; width: 100%; }
  .article__gallery { grid-template-columns: 1fr; }
}

/* ---------- Banner parallax (CSS scroll-driven animation) ----------
   The browser itself moves each banner image as its section passes through the window, so the
   movement is always exactly in step with scrolling (no script, no lag). --p is the strength and
   --h the banner's height. Firefox doesn't support this yet, so it shows still banners. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero, .page-hero, .cta, .article__hero { view-timeline-name: --banner; }
    .hero__media, .page-hero__media, .cta__media, .article__hero-media {
      animation: banner-parallax linear both;
      animation-timeline: --banner;
      animation-range: cover 0% cover 100%;
    }
    .hero__media { --p: .25; --h: clamp(420px, 68vh, 720px); }
    .page-hero__media { --p: .2; --h: clamp(300px, 26vw, 520px); }
    .cta__media { --p: .18; --h: clamp(340px, 40vw, 520px); }
    .article__hero-media { --p: .15; --h: clamp(220px, 26vw, 500px); }
  }
}
@keyframes banner-parallax {
  from { transform: translate3d(0, calc(var(--p) * -1 * (50vh + var(--h) / 2)), 0); }
  to   { transform: translate3d(0, calc(var(--p) * (50vh + var(--h) / 2)), 0); }
}

/* ---------- 7. Motion ---------- */
@keyframes hero-zoom { to { transform: scale(1); } }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Scroll reveal: only applied once JS confirms it is running */
.js [data-reveal] { opacity: 0; transform: translateY(32px); transition: opacity var(--dur) var(--ease-soft) var(--d, 0ms), transform 1.1s var(--ease-out) var(--d, 0ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
/* Smaller elements (cards, feature items) only fade in: no travel, no stagger */
.js .service-card[data-reveal], .js .why__features [data-reveal], .js .news-card[data-reveal] { transform: none; transition: opacity .6s ease; }
/* Colour blocks slide out from behind their image */
.js .offset-media[data-reveal] .offset-media__block { transform: translate(6%, 6%) scale(.92); }
.js .offset-media--green[data-reveal] .offset-media__block { transform: translate(-6%, 6%) scale(.92); }
.js .offset-media[data-reveal].is-in .offset-media__block { transform: none; }

/* Page fade between pages */
/* Page changes: the browser cross-fades straight from one page to the next (no white flash),
   and the header stays put. Browsers without support simply change page instantly. */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .4s; animation-timing-function: ease; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .hero__media img { transform: none; }
  .js [data-reveal], .js .offset-media[data-reveal] .offset-media__block { opacity: 1; transform: none; }
  .js .timeline__dot, .js .timeline__item::before { transform: none !important; opacity: 1 !important; }
  .js .timeline__item::after { clip-path: none !important; }
}
main:focus { outline: none; }
