/* ==========================================================================
   HASIL PERANGSANG GROUP
   Built to the visual identity spec: navy field, gold voice, purple = logo.
   Square corners. Serif display. 8px grid.
   ========================================================================== */

:root {
  /* --- Logo colours (confirmed from master files) --- */
  --hp-purple:      #7759A2;
  --hp-grey:        #8E9099;
  --hp-lilac:       #DDD6E8;

  /* --- Document palette --- */
  --navy:           #2C3E50;
  --navy-deep:      #22303D;
  --navy-soft:      #3A4F63;
  --gold:           #C9A961;
  --gold-dim:       #A88C4A;
  --white:          #FFFFFF;
  --off:            #F7F8F9;
  --pale:           #F2F2F2;
  --line:           #E2E5E8;
  --ink:            #1F2933;
  --ink-soft:       #55606B;

  /* --- Type --- */
  --serif:  "Playfair Display", Georgia, "Times New Roman", serif;
  --sans:   "Poppins", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;

  /* --- 8px grid --- */
  --s1: 8px;   --s2: 16px;  --s3: 24px;  --s4: 32px;
  --s5: 40px;  --s6: 48px;  --s7: 56px;  --s8: 64px;
  --s10: 80px; --s12: 96px; --s16: 128px;

  --shell: 1240px;
  --nav-h: 80px;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 var(--s4); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--navy); color: #fff; padding: var(--s2) var(--s3);
}
.skip:focus { left: 0; }

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.12; }

.display {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5.6vw, 4.4rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
}
.h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); }
.h3 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--s2);
}
.eyebrow--ink { color: var(--hp-grey); }

.lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 62ch; }
.lede--light { color: rgba(255,255,255,.82); }

p + p { margin-top: var(--s2); }

/* Gold rule under a heading — the brand's signature */
.rule {
  width: 88px; height: 3px; background: var(--gold);
  margin: var(--s3) 0;
}
.rule--wide { width: 100%; height: 1px; background: var(--line); }

/* ==========================================================================
   HEADER / NAV
   ========================================================================== */
.hdr {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: transparent;
  transition: background .28s ease, box-shadow .28s ease;
}
/* Gradient scrim: keeps the logo and nav legible over any photo */
.hdr::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  height: calc(var(--nav-h) + 40px);
  background: linear-gradient(180deg, rgba(34,48,61,.72) 0%, rgba(34,48,61,0) 100%);
  opacity: 1; transition: opacity .28s ease;
  pointer-events: none;
}
.hdr.solid::before { opacity: 0; }
.hdr.solid {
  background: var(--white);
  box-shadow: 0 1px 0 var(--line);
}
.hdr .shell { display: flex; align-items: center; gap: var(--s2); width: 100%; }

/* Transparent logo: white knockout over photos, colour version on solid header */
/* flex-shrink:0 + max-width:none keep the logo at its true aspect ratio.
   Without them a long nav (Malay runs widest) squeezes the brand box and
   the global img{max-width:100%} rule squashes the logo horizontally. */
.brand { display: flex; align-items: center; padding: 10px 0; margin-right: auto; flex-shrink: 0; }
.brand img { height: 50px; width: auto; max-width: none; }
.brand .logo-color { display: none; }
.hdr.solid .logo-white { display: none; }
.hdr.solid .logo-color { display: block; }

.nav { display: flex; align-items: center; gap: var(--s1); }

.nav__item { position: relative; }

.nav__link {
  display: block;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--white);
  white-space: nowrap;
  transition: color .18s ease;
}
.hdr.solid .nav__link { color: var(--ink); }
.nav__link:hover,
.nav__link[aria-current="page"] { color: var(--gold); }
.hdr.solid .nav__link:hover,
.hdr.solid .nav__link[aria-current="page"] { color: var(--hp-purple); }

/* Track links get a gold outline — they're the two conversion paths */
.nav__link--track {
  border: 1px solid rgba(201,169,97,.55);
  margin-left: 6px;
}
.hdr.solid .nav__link--track { border-color: rgba(119,89,162,.35); }
.nav__link--track:hover { background: var(--gold); color: var(--navy) !important; border-color: var(--gold); }

/* Dropdown */
.nav__sub {
  position: absolute; top: 100%; left: 0;
  min-width: 200px;
  background: var(--white);
  border-top: 2px solid var(--gold);
  box-shadow: 0 12px 32px rgba(31,41,51,.14);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: all .18s ease;
}
.nav__item:hover .nav__sub,
.nav__item:focus-within .nav__sub { opacity: 1; visibility: visible; transform: translateY(0); }
.nav__sub a {
  display: block; padding: 11px 18px;
  font-size: 0.85rem; color: var(--ink);
  border-bottom: 1px solid var(--line);
  transition: background .15s ease, color .15s ease;
}
.nav__sub a:last-child { border-bottom: 0; }
.nav__sub a:hover { background: var(--off); color: var(--hp-purple); }

/* Language switcher — lives in the header bar, not the menu */
.lang { position: relative; }
.lang__btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  font-family: var(--sans); font-size: 0.78rem; font-weight: 600;
  letter-spacing: .04em;
  color: var(--white); background: none;
  border: 1px solid rgba(255,255,255,.4);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}
.hdr.solid .lang__btn { color: var(--ink); border-color: rgba(31,41,51,.28); }
.lang__btn svg { width: 15px; height: 15px; }
.lang.open .lang__menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang__menu {
  position: absolute; top: 100%; right: 0;
  min-width: 150px; background: var(--white);
  border-top: 2px solid var(--gold);
  box-shadow: 0 12px 32px rgba(31,41,51,.14);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: all .18s ease;
}
.lang:hover .lang__menu, .lang:focus-within .lang__menu { opacity:1; visibility:visible; transform: translateY(0); }
.lang__menu a { display:block; padding: 10px 16px; font-size: .84rem; border-bottom: 1px solid var(--line); }
.lang__menu a:last-child { border-bottom: 0; }
.lang__menu a:hover { background: var(--off); color: var(--hp-purple); }
.lang__menu a.on { color: var(--hp-purple); font-weight: 600; }

/* Burger */
.burger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 0; cursor: pointer; padding: 8px;
}
.burger span { display:block; width: 24px; height: 2px; background: var(--white);
  transition: transform .3s ease, opacity .22s ease, background .28s ease; }
.hdr.solid .burger span { background: var(--ink); }
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  overflow: hidden;
  background: var(--navy);
}
.hero__media { position: absolute; inset: 0; }
.hero__media img, .hero__media video {
  width: 100%; height: 100%; object-fit: cover;
}
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(34,48,61,.94) 0%, rgba(34,48,61,.80) 42%, rgba(34,48,61,.35) 100%);
}
.hero__body {
  position: relative; z-index: 2; width: 100%;
  padding-top: calc(var(--nav-h) + var(--s10));
  padding-bottom: var(--s12);
}
.hero__inner { max-width: 720px; }
.hero .display { color: var(--white); }
.hero .lede { margin-top: var(--s3); }

.hero__figures {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  gap: var(--s8);
  margin-top: var(--s8);
  padding-top: var(--s5);
  border-top: 1px solid rgba(255,255,255,.16);
}
.fig__n {
  font-family: var(--serif); font-size: 2.4rem; line-height: 1;
  color: var(--gold);
}
.fig__l {
  font-size: .72rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.6); margin-top: 6px;
}

/* Page hero (interior pages) */
.phero {
  position: relative;
  padding: calc(var(--nav-h) + var(--s10)) 0 var(--s10);
  background: var(--navy);
  overflow: hidden;
}
.phero__media { position: absolute; inset: 0; }
.phero__media img { width:100%; height:100%; object-fit: cover; }
.phero__media::after {
  content:""; position:absolute; inset:0;
  background: linear-gradient(95deg, rgba(34,48,61,.95) 0%, rgba(34,48,61,.78) 55%, rgba(34,48,61,.5) 100%);
}
.phero__body { position: relative; z-index: 2; max-width: 760px; }
.phero .display { color: var(--white); font-size: clamp(2.2rem, 4.4vw, 3.4rem); }
.phero .rule { margin: var(--s3) 0 var(--s3); }

.crumbs { font-size: .78rem; color: rgba(255,255,255,.55); margin-bottom: var(--s3); }
.crumbs a:hover { color: var(--gold); }
.crumbs span { margin: 0 8px; opacity: .5; }

/* Short viewports (small laptops): let the hero grow rather than crop */
@media (max-height: 780px) and (min-width: 901px) {
  .hero { min-height: auto; }
  .hero__body { padding-top: calc(var(--nav-h) + var(--s8)); padding-bottom: var(--s8); }
  .hero__figures { margin-top: var(--s6); padding-top: var(--s4); gap: var(--s6); }
  .fig__n { font-size: 2rem; }
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.sec { padding: var(--s16) 0; }
.sec--tight { padding: var(--s12) 0; }
.sec--navy { background: var(--navy); color: var(--white); }
.sec--navy .lede { color: rgba(255,255,255,.78); }
.sec--navy .h2 { color: var(--white); }
.sec--off { background: var(--off); }

.sec__head { max-width: 760px; margin-bottom: var(--s8); }
.sec__head--center { margin-left: auto; margin-right: auto; text-align: center; }
.sec__head--center .rule { margin-left: auto; margin-right: auto; }

/* Section-label bar — an HP signature component */
.bar {
  display: inline-block;
  background: var(--navy);
  color: var(--gold);
  font-family: var(--sans);
  font-size: .72rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 13px 24px;
  margin-bottom: var(--s4);
}
.sec--navy .bar { background: rgba(255,255,255,.08); }

/* Two-column split */
.split {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--s10); align-items: center;
}
.split--wide { grid-template-columns: 1.15fr 1fr; }
.split__media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }

/* ==========================================================================
   CARDS / GRIDS  (square corners — HP is angular)
   ========================================================================== */
.grid { display: grid; gap: var(--s4); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: border-color .22s ease, transform .22s ease, box-shadow .22s ease;
}
.card:hover { border-color: var(--gold); transform: translateY(-3px); box-shadow: 0 14px 34px rgba(31,41,51,.08); }
.card__media { position: relative; overflow: hidden; aspect-ratio: 3/2; }
.card__media img { width:100%; height:100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card__media img { transform: scale(1.05); }
.card__body { padding: var(--s4); flex: 1; display: flex; flex-direction: column; }
.card__title { font-family: var(--serif); font-size: 1.3rem; margin-bottom: var(--s1); }
.card__text { font-size: .93rem; color: var(--ink-soft); flex: 1; }
.card__more {
  margin-top: var(--s3);
  font-family: var(--sans); font-size: .75rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--hp-purple);
}
.card__more::after { content: " →"; }

/* Navy card variant */
.card--navy { background: var(--navy); border-color: var(--navy); color: var(--white); }
.card--navy .card__text { color: rgba(255,255,255,.7); }
.card--navy .card__more { color: var(--gold); }
.card--navy:hover { border-color: var(--gold); }

/* Lilac card — soft container, the one legit purple-family use */
.card--lilac { background: var(--hp-lilac); border-color: var(--hp-lilac); }

/* ==========================================================================
   NUMBERED LIST — HP style: square badge, navy fill
   ========================================================================== */
.nlist { display: grid; gap: var(--s3); }
.nlist li { display: grid; grid-template-columns: 44px 1fr; gap: var(--s3); align-items: start; }
.nlist .n {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--navy); color: var(--gold);
  font-family: var(--sans); font-weight: 700; font-size: .9rem;
}
.sec--navy .nlist .n { background: var(--gold); color: var(--navy); }
.nlist h4 { font-family: var(--sans); font-weight: 600; font-size: 1rem; margin-bottom: 4px; }
.nlist p { font-size: .93rem; color: var(--ink-soft); }
.sec--navy .nlist p { color: rgba(255,255,255,.7); }

/* Tick list */
.ticks li {
  position: relative; padding-left: 30px; margin-bottom: var(--s2);
  font-size: .96rem;
}
.ticks li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--gold); font-weight: 700;
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tbl thead th {
  background: var(--navy); color: var(--white);
  font-family: var(--sans); font-weight: 600; font-size: .78rem;
  letter-spacing: .08em; text-transform: uppercase;
  text-align: left; padding: 14px 18px;
}
.tbl tbody td { padding: 13px 18px; border-bottom: 1px solid var(--line); }
.tbl tbody tr:nth-child(even) { background: var(--pale); }

/* ==========================================================================
   TWO-TRACK BLOCK  (buyers | partners)
   ========================================================================== */
.tracks { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); }
.track {
  position: relative;
  padding: var(--s10) var(--s8);
  background: var(--white);
  overflow: hidden;
  transition: background .3s ease;
}
.track::before {
  content: ""; position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity .4s ease;
}
.track:hover { background: var(--navy); color: var(--white); }
.track:hover .track__text { color: rgba(255,255,255,.75); }
.track:hover .btn { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.track__k {
  font-family: var(--sans); font-size: .7rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--hp-purple); margin-bottom: var(--s2);
}
.track:hover .track__k { color: var(--gold); }
.track__t { font-family: var(--serif); font-size: 2rem; margin-bottom: var(--s2); }
.track__text { color: var(--ink-soft); margin-bottom: var(--s5); max-width: 42ch; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 15px 32px;
  font-family: var(--sans); font-size: .8rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--navy);
  background: var(--navy); color: var(--white);
  cursor: pointer;
  transition: all .22s ease;
}
.btn:hover { background: var(--gold); border-color: var(--gold); color: var(--navy); }

.btn--ghost { background: transparent; color: var(--navy); }
.btn--ghost:hover { background: var(--navy); color: var(--white); }

.btn--gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn--gold:hover { background: var(--white); border-color: var(--white); }

.btn--light { background: transparent; border-color: rgba(255,255,255,.45); color: var(--white); }
.btn--light:hover { background: var(--white); border-color: var(--white); color: var(--navy); }

.btn--wa { background: #25D366; border-color: #25D366; color: #fff; }
.btn--wa:hover { background: #1da851; border-color: #1da851; color: #fff; }

.btns { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); }

/* ==========================================================================
   PROSE (long-form content blocks)
   ========================================================================== */
.prose { max-width: 76ch; }
.prose h2 { font-size: 1.9rem; margin: var(--s8) 0 var(--s3); }
.prose h3 { font-family: var(--sans); font-weight: 600; font-size: 1.15rem; margin: var(--s5) 0 var(--s2); }
.prose p { margin-bottom: var(--s2); color: var(--ink-soft); }
.prose ul { margin: var(--s2) 0 var(--s3); }
.prose ul li { position: relative; padding-left: 22px; margin-bottom: 8px; color: var(--ink-soft); }
.prose ul li::before { content:""; position:absolute; left:0; top:.65em; width:7px; height:7px; background: var(--gold); }
.prose strong { color: var(--ink); font-weight: 600; }

.prose .fig { margin: var(--s6) auto; text-align: center; }
.fig figcaption { margin-top: var(--s2); font-size: .82rem; color: var(--ink-soft); font-style: italic; }
.prose .fig img {
  width: 100%; max-width: 760px; max-height: 440px;
  object-fit: cover; margin: 0 auto;
}
/* Map figures: show the whole map, don't crop */
.prose .fig--map img { max-height: none; object-fit: contain; max-width: 900px; }
/* Document figures (certificates, portrait scans): show whole, never crop */
.prose .fig--doc img { max-height: 760px; width: auto; max-width: 100%; object-fit: contain; }
/* Spot/detail photos: modest, centered */
.prose .fig--spot img { max-height: 380px; max-width: 620px; object-fit: cover; }

/* Pull quote / callout — gold left rule */
.callout {
  border-left: 3px solid var(--gold);
  padding: var(--s2) 0 var(--s2) var(--s4);
  margin: var(--s5) 0;
  font-size: 1.05rem;
  color: var(--ink);
}

/* ==========================================================================
   FORMS
   ========================================================================== */
.form { display: grid; gap: var(--s3); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.field label {
  display: block; margin-bottom: 7px;
  font-family: var(--sans); font-size: .74rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink);
}
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 15px;
  font-family: var(--sans); font-size: .95rem; color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  transition: border-color .18s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--hp-purple);
}
.field textarea { min-height: 130px; resize: vertical; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.ftr { background: var(--navy-deep); color: rgba(255,255,255,.65); padding: var(--s12) 0 var(--s5); }
.ftr__top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: var(--s8); }
.ftr__logo { display: inline-block; margin-bottom: var(--s4); }
.ftr__logo img { height: 50px; width: auto; }
.ftr__tag { font-size: .82rem; font-style: italic; color: var(--gold); max-width: 38ch; }
.ftr h4 {
  font-family: var(--sans); font-size: .74rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); margin-bottom: var(--s3);
}
.ftr li { margin-bottom: 10px; }
.ftr a { font-size: .9rem; transition: color .18s ease; }
.ftr a:hover { color: var(--gold); }
.ftr__addr { font-size: .85rem; line-height: 1.7; margin-bottom: var(--s3); }
.ftr__addr strong { display:block; color: rgba(255,255,255,.9); font-weight:600; font-size:.75rem; letter-spacing:.08em; text-transform:uppercase; margin-bottom:4px; }
.ftr__bot {
  margin-top: var(--s10); padding-top: var(--s5);
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s2);
  font-size: .8rem; color: rgba(255,255,255,.42);
}

/* ==========================================================================
   REVEAL ANIMATION
   ========================================================================== */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
[data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}


/* Material grade sample cards: keep circular-sample images modest, never full-bleed huge */
.sec .grid .card__media {
  aspect-ratio: 4 / 3; background: #EEECF0;
  display: flex; align-items: center; justify-content: center;
}
.sec .grid .card__media img { object-fit: contain; max-height: 100%; padding: var(--s3); }
/* A lone grade card shouldn't stretch across the whole row */
.grid--single { display: grid; grid-template-columns: minmax(0, 360px); justify-content: start; }
.grid--single .card__media { aspect-ratio: 1 / 1; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1080px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .ftr__top { grid-template-columns: 1fr 1fr; gap: var(--s6); }
}

/* Between the mobile menu (<=900px) and wide desktop the full nav has to
   fit beside the logo. Malay labels run widest ("Untuk Rakan Niaga"), so
   at these widths the language switcher was pushed off-screen. Scale the
   logo down proportionally and tighten the nav rather than letting the
   brand box squash the logo out of ratio. */
@media (min-width: 1101px) and (max-width: 1400px) {
  .brand img { height: 40px; }
  .nav__link { padding: 10px 9px; font-size: 0.8rem; letter-spacing: 0; }
  .nav__link--track { margin-left: 4px; }
}

/* Nav collapses to the hamburger earlier than the layout does.
   The full horizontal nav needs ~1000px+ beside the logo, and Malay
   labels run widest, so between 901px and 1100px the language switcher
   was pushed off-screen. Layout rules stay at 900px below. */
@media (max-width: 1100px) {
  .burger { display: flex; }
  .nav {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white);
    border-top: 1px solid var(--line);
    box-shadow: 0 20px 40px rgba(31,41,51,.12);
    max-height: 0; overflow: hidden;
    transition: max-height .35s ease;
  }
  .nav.open { max-height: 82vh; overflow-y: auto; }
  .nav__link { color: var(--ink) !important; padding: 15px var(--s4); border-bottom: 1px solid var(--line); }
  .nav__link--track { border: 0; border-bottom: 1px solid var(--line); margin: 0; color: var(--hp-purple) !important; font-weight: 600; }
  .nav__sub {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border-top: 0; background: var(--off);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav__item.open .nav__sub { max-height: 400px; }
  .nav__sub a { padding-left: var(--s6); }
  /* nav items stagger in */
  .nav > .nav__item { opacity: 0; transform: translateX(16px);
    transition: opacity .3s ease, transform .3s ease; }
  .nav.open > .nav__item { opacity: 1; transform: none; }
  .nav.open > .nav__item:nth-child(1) { transition-delay: .04s; }
  .nav.open > .nav__item:nth-child(2) { transition-delay: .08s; }
  .nav.open > .nav__item:nth-child(3) { transition-delay: .12s; }
  .nav.open > .nav__item:nth-child(4) { transition-delay: .16s; }
  .nav.open > .nav__item:nth-child(5) { transition-delay: .20s; }
  .nav.open > .nav__item:nth-child(6) { transition-delay: .24s; }
  .nav.open > .nav__item:nth-child(7) { transition-delay: .28s; }
  .nav.open > .nav__item:nth-child(8) { transition-delay: .32s; }
}

@media (max-width: 900px) {

  /* hero: let it grow to its content. A fixed height was squeezing the
     eyebrow under the header and clipping the stats off the bottom. */
  .hero {
    min-height: 0;
    align-items: flex-start;
    padding-top: var(--nav-h);
  }
  .hero__body { padding-top: var(--s10); padding-bottom: var(--s10); }
  .phero { padding: calc(var(--nav-h) + var(--s8)) 0 var(--s8); }

  .split, .split--wide { grid-template-columns: 1fr; gap: var(--s6); }
  .tracks { grid-template-columns: 1fr; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .sec { padding: var(--s12) 0; }
  .hero__figures { grid-template-columns: repeat(2, 1fr); gap: var(--s5) var(--s4); }
}

@media (max-width: 640px) {
  :root { --nav-h: 72px; }
  .shell { padding: 0 var(--s3); }
  .brand img { height: 38px; }
  .display { font-size: clamp(2rem, 8vw, 2.7rem); }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }

  /* generous top padding so the eyebrow clears the header, and real
     bottom padding so the stats are never cut off */
  .hero__body { padding-top: var(--s8); padding-bottom: var(--s10); }
  .hero .btns { margin-top: var(--s5); }

  /* stats: 2×2 grid with room to breathe */
  .hero__figures {
    grid-template-columns: 1fr 1fr;
    gap: var(--s5) var(--s3);
    margin-top: var(--s7);
    padding-top: var(--s5);
  }
  .fig__n { font-size: 1.9rem; }
  .fig__l { font-size: .66rem; line-height: 1.4; }

  .track { padding: var(--s8) var(--s4); }
  .sec { padding: var(--s10) 0; }

  /* compact footer */
  .ftr { padding: var(--s8) 0 var(--s4); }
  .ftr__top { grid-template-columns: 1fr 1fr; gap: var(--s5) var(--s4); }
  .ftr__top > div:first-child,
  .ftr__top > div:nth-child(4) { grid-column: 1 / -1; }
  .ftr h4 { margin-bottom: var(--s2); }
  .ftr li { margin-bottom: 7px; }
  .ftr__bot { margin-top: var(--s6); padding-top: var(--s3); flex-direction: column; gap: 6px; }
}

/* CSR / multi-image gallery grid */
.imgrid{display:grid;gap:var(--s5) var(--s3);margin:var(--s5) 0;align-items:start}
.imgrid--2{grid-template-columns:repeat(2,1fr)}
.imgrid--3{grid-template-columns:repeat(3,1fr)}
.imgrid .fig{margin:0;display:flex;flex-direction:column}
/* default: show the whole image, never crop (maps, diagrams) */
.imgrid .fig img{width:100%;height:auto;object-fit:contain;border-radius:2px;display:block}
/* uniform: identical frames, centre-cropped (photo galleries) */
.imgrid--uniform .fig img{aspect-ratio:1.1;height:auto;object-fit:cover}
.imgrid figcaption{font-size:.82rem;line-height:1.5;color:var(--hp-grey);margin-top:10px;font-style:italic}
@media(max-width:720px){.imgrid--2,.imgrid--3{grid-template-columns:1fr}}


/* Homepage hero logo — right side (option B) */
.hero__logo{
  position:absolute; z-index:3;
  right:6%; top:50%; transform:translateY(-50%);
  width:min(30%,380px); height:auto;
  opacity:.95; pointer-events:none;
}
/* Hero stacks on narrow screens — no empty right side, so hide it */
@media (max-width:900px){ .hero__logo{ display:none; } }

/* ---------------------------------------------------------------
   Cookie consent banner
   Bottom sheet, out of the way of the content. Hidden until the JS
   decides to show it, so it never flashes for returning visitors.
--------------------------------------------------------------- */
.cookie {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  background: var(--hp-navy, #1B2A4A);
  border-top: 2px solid var(--gold, #C9A961);
  color: #fff;
  transform: translateY(100%);
  transition: transform .3s ease;
  box-shadow: 0 -8px 30px rgba(0,0,0,.18);
}
.cookie.open { transform: translateY(0); }
.cookie__inner {
  max-width: var(--shell, 1200px); margin: 0 auto;
  padding: var(--s4, 18px) var(--s4, 18px);
  display: flex; align-items: center; gap: var(--s5, 24px);
  flex-wrap: wrap; justify-content: space-between;
}
.cookie__title { font-weight: 600; margin-bottom: 4px; font-size: .95rem; }
.cookie__text { font-size: .85rem; line-height: 1.5; color: rgba(255,255,255,.82); max-width: 74ch; margin: 0; }
.cookie__text a { color: var(--gold, #C9A961); text-decoration: underline; }
.cookie__btns { display: flex; gap: var(--s2, 10px); flex-shrink: 0; }
.cookie .btn { padding: 10px 22px; font-size: .82rem; }
.cookie__no {
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.4);
}
.cookie__no:hover { border-color: #fff; }

/* Footer legal link sits beside the copyright line */
.ftr__legal { color: rgba(255,255,255,.7); text-decoration: underline; margin-left: var(--s4, 18px); }
.ftr__legal:hover { color: var(--gold, #C9A961); }

@media (max-width: 640px) {
  .cookie__inner { flex-direction: column; align-items: stretch; gap: var(--s3, 14px); }
  .cookie__btns { justify-content: stretch; }
  .cookie__btns .btn { flex: 1; text-align: center; }
}
