/* BLUEPETER — single page, mobile first, no build step */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  /* latin subset without "&" (U+0026): Archivo's ampersand reads like an "E" */
  unicode-range: U+0000-0025, U+0027-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}

:root {
  --navy-950: #06142e;
  --navy-900: #0a1f44;
  --navy-700: #173a78;
  --flag: #1b4fd1;
  --blue-300: #93b4ff;
  --blue-200: #c4d5ff;
  --sky-50: #f3f6fb;
  --sky-100: #e8eef8;
  --ink: #0b1a33;
  --muted: #4b5b74;
  --line: #dbe3ef;
  --white: #fff;

  --head: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1rem, 4vw, 2rem);
  --header-h: 72px;
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--head); line-height: 1.1; text-wrap: balance; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--flag); outline-offset: 3px; border-radius: 4px; }
.hero :focus-visible, .band :focus-visible, .positioning :focus-visible, .footer :focus-visible,
.header:not(.is-solid) :focus-visible { outline-color: var(--blue-200); }

.container { width: 100%; max-width: calc(1200px + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -100px; z-index: 100; padding: .7rem 1rem; background: var(--white); color: var(--navy-900); font-weight: 600; border-radius: 8px; }
.skip:focus { top: 1rem; }

.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon--lg { width: 40px; height: 40px; stroke-width: 1.5; color: var(--flag); }

/* Blue Peter flag: blue field, white square */
.flag {
  display: inline-block;
  width: 24px; height: 17px;
  border-radius: 2px;
  background: linear-gradient(var(--white), var(--white)) center / 8px 8px no-repeat, var(--flag);
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  color: var(--white);
  transition: background-color .3s, color .3s, box-shadow .3s;
}
.header.is-solid, .nav-open .header {
  background: rgba(255, 255, 255, .96);
  color: var(--navy-900);
  box-shadow: 0 1px 0 var(--line);
}
.header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; }
.brand__flag { width: 32px; height: 24px; }
.brand__name { font-family: var(--head); font-weight: 800; font-size: 1.2rem; letter-spacing: .07em; }
.brand__name span { font-weight: 400; }

.burger {
  display: grid; place-items: center;
  width: 48px; height: 48px; margin-right: -.6rem;
  border: 0; background: none; color: inherit; cursor: pointer;
}
.burger .icon { width: 26px; height: 26px; }
.icon--close, .nav-open .icon--open { display: none; }
.nav-open .icon--close { display: block; }

.nav {
  position: absolute;
  top: var(--header-h); left: 0; right: 0;
  display: none;
  flex-direction: column;
  padding: .5rem var(--gutter) 1.25rem;
  background: var(--white);
  box-shadow: 0 12px 24px -12px rgba(10, 31, 68, .25);
}
.nav-open .nav { display: flex; }
.nav a {
  padding: .9rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--head);
  font-weight: 600;
  font-size: 1.15rem;
}
.nav a:last-child { border-bottom: 0; }

/* ---------- Parallax layer (image moved by main.js, ±25% of the section height) ---------- */
.plx { position: absolute; inset: 0; overflow: hidden; z-index: -1; background: var(--navy-900); }
.plx img {
  position: absolute;
  left: 0; top: -25%;
  width: 100%; height: 150%;
  object-fit: cover;
  will-change: transform;
}
/* Overlay sized so that text keeps a 4.5:1 contrast even over the lightest parts of the photos */
.plx::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 20, 46, .7) 0%, rgba(6, 20, 46, .9) 100%);
}

/* ---------- Hero ---------- */
.hero .plx img { object-position: 75% 50%; } /* keeps the ship in frame on narrow screens */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  color: var(--white);
  padding: calc(var(--header-h) + 3rem) 0 6rem;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 1.25rem;
  font-family: var(--head);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--blue-200);
}
.hero h1 {
  font-size: clamp(2.75rem, 9vw, 6rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
  text-transform: uppercase;
}
.hero__lead { margin-top: 1.5rem; max-width: 34rem; font-size: clamp(1.1rem, 2vw, 1.35rem); color: var(--blue-200); }
.scroll-cue {
  position: absolute;
  left: 50%; bottom: 1.75rem;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blue-200);
}
.scroll-cue .icon { animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }

/* ---------- Parts: photo band + content ---------- */
.part--tint { background: var(--sky-50); }
.band {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: clamp(320px, 62vh, 600px);
  padding: 5rem 0 3rem;
  overflow: hidden; /* the title moves with the parallax, never let it spill out */
  color: var(--white);
}
.band__num {
  display: block;
  margin-bottom: .75rem;
  font-family: var(--head);
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .2em;
  color: var(--white);
}
.band__num::after { content: ""; display: inline-block; width: 48px; height: 2px; margin-left: .8rem; vertical-align: middle; background: var(--blue-300); }
.band h2 {
  font-size: clamp(2.25rem, 7vw, 5rem);
  font-weight: 800;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.band__lead { margin-top: 1rem; max-width: 36rem; font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--blue-200); }

.part__body { display: grid; gap: 1.25rem; padding-block: clamp(3rem, 7vw, 5.5rem); }

.block-title { font-size: clamp(1.35rem, 2.6vw, 1.75rem); font-weight: 700; margin-bottom: 1.25rem; }
.block-text { color: var(--muted); margin-bottom: 1.25rem; max-width: 34rem; }

.equip { display: grid; gap: .6rem; }
.equip li {
  display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.3;
}
.equip .icon { width: 28px; height: 28px; stroke-width: 1.6; color: var(--flag); }

.brands {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.brands li {
  display: grid; place-items: center;
  min-height: 62px;
  padding: .5rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--head);
  font-weight: 700;
  font-size: clamp(.85rem, 2.6vw, 1rem);
  letter-spacing: .06em;
  color: var(--navy-700);
  text-align: center;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.card h3 { font-size: 1.3rem; font-weight: 700; }
.card > p { font-family: var(--head); font-size: clamp(1.15rem, 2.2vw, 1.35rem); font-weight: 600; line-height: 1.35; }
.card h3 + p { font-family: var(--body); font-size: 1rem; font-weight: 400; color: var(--muted); }

.list li { padding: .45rem 0; border-top: 1px solid var(--line); color: var(--muted); }
.list li:first-child { border-top: 0; padding-top: 0; }

.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; }
.tags li {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .8rem;
  border-radius: 999px;
  background: var(--sky-100);
  color: var(--navy-700);
  font-size: .875rem;
  font-weight: 600;
}
.tags .icon { width: 16px; height: 16px; }

/* ---------- Positioning ---------- */
.positioning {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 80vh;
  padding: 6rem 0;
  overflow: hidden;
  color: var(--white);
}
.positioning .plx::after { background: linear-gradient(100deg, rgba(6, 20, 46, .88) 0%, rgba(6, 20, 46, .74) 50%, rgba(6, 20, 46, .5) 100%); }
.positioning__text {
  max-width: 22ch;
  font-family: var(--head);
  font-size: clamp(2rem, 5.5vw, 4.25rem);
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
  text-wrap: balance;
}

/* ---------- Footer ---------- */
.footer { background: var(--navy-950); color: var(--blue-200); font-size: .9rem; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 2rem; }
.footer .brand { color: var(--white); }

/* ---------- Reveal on scroll (classes set by main.js) ---------- */
.reveal { transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-hidden { opacity: 0; transform: translateY(24px); }

/* ---------- Larger screens ---------- */
@media (min-width: 360px) {
  .equip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 640px) and (max-width: 899px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  :root { --header-h: 84px; }
  .burger { display: none; }
  .nav {
    position: static;
    display: flex;
    flex-direction: row;
    gap: 2rem;
    padding: 0;
    background: none;
    box-shadow: none;
  }
  .nav a { position: relative; padding: .4rem 0; border: 0; font-family: var(--body); font-weight: 500; font-size: .975rem; }
  .nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
  .nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 4.5rem); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* Text sits bottom-left in the bands: darker there, the photo shows on the top right */
  .plx::after {
    background:
      linear-gradient(0deg, rgba(6, 20, 46, .8) 0%, rgba(6, 20, 46, .2) 75%),
      linear-gradient(100deg, rgba(6, 20, 46, .75) 0%, rgba(6, 20, 46, .45) 55%, rgba(6, 20, 46, .25) 100%);
  }
  /* Hero text is vertically centred, and the transparent header sits on top of it */
  .hero .plx::after {
    background:
      linear-gradient(180deg, rgba(6, 20, 46, .7) 0%, rgba(6, 20, 46, 0) 22%),
      linear-gradient(100deg, rgba(6, 20, 46, .9) 0%, rgba(6, 20, 46, .78) 45%, rgba(6, 20, 46, .35) 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; }
  .scroll-cue .icon { animation: none; }
  .reveal.is-hidden { opacity: 1; transform: none; }
}
