/* ==========================================================================
   RESPONSIVE — the reference has exactly two breakpoints:
     ≤ 1024  "tablet"  (nav collapses, most rows stack or go to 2 columns)
     ≤  767  "mobile"  (single column, smaller type, icon-above-text timeline)
   Desktop widths 1025–1439 keep the desktop layout (fluid % columns).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Desktop, narrower than the 1400 container: keep the 4 opportunity cards
   inside their boxes (the reference lets the text spill out below ~1440).
   -------------------------------------------------------------------------- */
@media (min-width: 1025px) and (max-width: 1439px) {
  .opportunity { padding-inline: 6px; }
}

/* The extra top-level item "Safekeeping & Storage" (~210 px) needs room: trim link padding below 1440 px and the type size below 1300 px
   so the menu stays on one row down to ~1200 px (below that it wraps onto two rows, as the reference menu does at ≤ 1100). */
@media (min-width: 1025px) and (max-width: 1439px) {
  .primary-nav__list > li > a { padding-inline: 8px; }
}
@media (min-width: 1025px) and (max-width: 1329px) {
  :root { --font-size-nav: 14px; }
}
/* Where the menu wraps, "About Us" sits at the right edge: open its dropdown leftwards so it can't create horizontal scroll. */
@media (min-width: 1025px) and (max-width: 1199px) {
  .has-sub > .sub-menu { left: auto; right: 0; }
}

/* ==========================================================================
   TABLET  ≤ 1024
   ========================================================================== */
@media (max-width: 1024px) {

  /* ---- Header: hamburger + full-width gold panel ------------------------ */
  .site-header__inner { position: static; }          /* panel & logo anchor to the full-width header */
  .site-logo { --logo-size: 52px; top: calc(43px - var(--logo-size) / 2 - 3px); left: 10px; width: var(--logo-size); }
  .site-logo__img { padding: 0; background: transparent; border-radius: 0; }

  .primary-nav { flex: none; }
  .nav-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 46px;
    padding: .35em;
    color: var(--color-primary);
    background: transparent;
    border: 2px solid currentColor;
    border-radius: 10px;
  }
  .nav-toggle__bars {                                   /* 4 bars (2 px, 4 px gap) → ✕ when open */
    position: relative;
    display: block; width: 20px; height: 20px;
    background: repeating-linear-gradient(to bottom, currentColor 0 2px, transparent 2px 6px);
    transition: background-color .2s;
  }
  .nav-toggle__bars::before,
  .nav-toggle__bars::after {
    content: "";
    position: absolute; left: 0; top: 50%;
    width: 100%; height: 2.5px; margin-top: -1.25px;
    background: currentColor; border-radius: 2px;
    opacity: 0; transition: opacity .2s, transform .25s;
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: none; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { opacity: 1; transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars::after  { opacity: 1; transform: rotate(-45deg); }

  .primary-nav__list {
    display: none;
    position: absolute; z-index: 9999;
    top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--color-primary);
    box-shadow: var(--shadow-menu);
  }
  .primary-nav__list.is-open { display: flex; }
  .primary-nav__list > li { display: block; }
  .primary-nav__list > li:not(:last-child) { border-bottom: 1px solid var(--color-border); }
  .primary-nav__list > li > a {
    padding: 15px;
    font-weight: 500;
    text-transform: capitalize;
    color: var(--color-white);
    transition: background var(--transition-fast);
  }
  .primary-nav__list > li > a:hover,
  .primary-nav__list > li:focus-within > a { color: var(--color-white); background: var(--color-secondary); }
  .primary-nav__list > li.is-current > a { color: var(--color-white); background: var(--color-secondary); }

  .has-sub > a { padding-right: 15px; }
  .sub-toggle { position: absolute; top: 0; right: 15px; width: 30px; height: 46px; color: var(--color-white); }
  .has-sub:hover > .sub-toggle { color: var(--color-white); }
  .sub-menu {
    position: static; display: none;
    width: auto; box-shadow: none;
    opacity: 1; visibility: visible;
    border-top: 1px solid var(--color-border);
  }
  .has-sub:hover > .sub-menu,
  .has-sub:focus-within > .sub-menu { display: none; }
  .has-sub.is-open > .sub-menu { display: block; }

  /* ---- Hero: full-width copy; scrim keeps it legible over the artwork -- */
  .hero { background-position: 26% center; }             /* keep the mine, haul trucks and containers in frame when the photo is cropped */
  .hero::before { background: var(--hero-scrim-stacked); }
  .hero__content { width: 100%; }

  /* ---- Trust: 2 × 2 ------------------------------------------------------ */
  .trust__item { width: 50%; }

  /* ---- Why partner: stacked --------------------------------------------- */
  .why-partner__inner { flex-direction: column; }
  .why-partner__text,
  .why-partner__media { width: 100%; }

  /* ---- Gold price: stacked, card centered -------------------------------- */
  .gold-price__inner { flex-direction: column; }
  .gold-price__spacer,
  .gold-price__panel { width: 100%; }

  /* ---- What we do: 2 columns, smaller title ------------------------------ */
  .what-we-do__title { font-size: 42px; }
  .service-cell { width: 50%; }

  /* ---- Safekeeping: photo above the text --------------------------------- */
  .safekeeping__inner { flex-direction: column; align-items: stretch; }
  .safekeeping__media { position: static; flex: none; width: 100%; }
  .safekeeping__img { aspect-ratio: 3 / 2; }
  .safekeeping__content { flex: none; width: 100%; padding-left: var(--col-pad); }

  /* ---- Why invest: smaller title, tighter boxes -------------------------- */
  .why-invest__head { align-items: center; }          /* title + lead vertically centred (reference) */
  .why-invest__title { font-size: 32px; }
  .reason-cell { width: 50%; }
  .reason-card { padding: 25px; }
  .reason-card__title { font-size: 24px; }

  /* ---- Investors: panels stack ------------------------------------------ */
  .investors { flex-direction: column; }
  .investors__panel { width: 100%; padding: 50px; }
  .investors__tag { font-size: 20px; }

  /* ---- Trade process: intro (40 % wide, centered) above the timeline ----- */
  .trade-process__inner { flex-direction: column; }
  .trade-process__timeline { flex: none; width: 100%; }

  /* ---- Final CTA: button drops below the text --------------------------- */
  .final-cta__inner { flex-direction: column; align-items: stretch; }
  .final-cta__text { width: 100%; }
  .final-cta__action { flex: none; justify-content: flex-start; }

  /* ---- Footer: 2 columns, legal bar stacked & centered ------------------- */
  .footer-col { width: 50%; }
  .site-footer__bar-inner { flex-direction: column; }
  .site-footer__copy { flex: none; text-align: center; }
  .site-footer__legal { margin-left: 0; }
  .site-footer__legal { padding-top: 10px; }
  .site-footer__legal ul { justify-content: center; }
  .back-to-top { align-self: flex-start; }               /* bottom-left, as in the reference */
}

/* Forminator (reference newsletter form) adds 10 px inside the form at ≤ 782 px; total column height is unchanged. */
@media (max-width: 782px) {
  .newsletter { padding-bottom: 10px; margin-bottom: 20px; }
}

/* ==========================================================================
   MOBILE  ≤ 767
   ========================================================================== */
@media (max-width: 767px) {

  /* ---- Header logo scales with the phone width (reference: 40 % of 35 % of the width) -- */
  .site-logo { --logo-size: clamp(48px, calc((100vw - 20px) * .14), 64px); }

  /* ---- Hero ------------------------------------------------------------- */
  .hero__title { line-height: 1.1; }
  .hero__lead { font-size: var(--font-size-body); }
  .hero__actions { flex-direction: column; align-items: flex-end; }   /* keeps the 20 px gap */

  /* ---- Trust: one column ------------------------------------------------- */
  .trust__item { width: 100%; }
  .trust__title { font-size: 20px; }

  /* ---- Why partner ------------------------------------------------------- */
  .why-partner__media img { width: 100%; }

  /* ---- Price card: the chart toolbar drops its decorative label on phones -- */
  .gold-chart__tool, .gold-chart__sep { display: none; }
  .gold-chart__legend { font-size: 11px; }

  /* ---- What we do: 1 column, tighter rhythm ------------------------------ */
  .what-we-do__title { font-size: var(--font-size-h2); }
  .service-cell { width: 100%; }
  .service-grid { margin-top: 20px; }

  /* ---- Safekeeping: single-column core values ------------------------------ */
  .safekeeping__values { grid-template-columns: 1fr; }

  /* ---- Why invest --------------------------------------------------------- */
  .why-invest__title { font-size: var(--font-size-h2); }
  .why-invest__head { flex-direction: column; }          /* keeps the 20 px gap, as in the reference */
  .why-invest__head-col { flex: none; width: 100%; }
  .why-invest__lead { font-size: 15px; }
  .reason-grid { margin-top: 20px; }
  .reason-cell { width: 100%; }
  .reason-card { padding: 20px; }
  .reason-card__title { font-size: var(--font-size-h3); }
  .reason-card__text { font-size: 14px; }

  /* ---- Investors: inset panels (the reference pads the whole band) -------- */
  .investors { padding: var(--investors-inset-y, 50px) var(--investors-inset-x, 15px); }
  .investors__panel { padding: 50px; }
  .investors__tag { font-size: 16px; }
  .opportunities { flex-wrap: wrap; row-gap: 20px; }
  .opportunity { padding: 40px 25px; }

  /* ---- Trade process: bar left, icon ABOVE the text ----------------------- */
  .trade-process__inner { align-items: stretch; }
  .trade-process__intro { width: 100%; }
  .process__step { display: block; padding: 0 0 0 30px; }
  .process__body { margin: 0 0 0 10px; }

  /* ---- Final CTA ---------------------------------------------------------- */
  .final-cta__title { line-height: 1; }

  /* ---- Footer: one column ------------------------------------------------- */
  .footer-col { width: 100%; }
  .footer-col + .footer-col { margin-top: 25px; }
}
