/* ==========================================================================
   Optrical — header
   Two bands: a dark utility strip carrying the positioning line and the
   consumer-facing actions, and a white navigation row that sticks on scroll.
   Depends on tokens.css.
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--c-surface);
  /*
   * Keeps the header itself from being picked as the scroll anchor.
   *
   * Note this does NOT stop the browser compensating for the height the
   * utility strip gives up when it collapses — anchoring selects a node in
   * the scrolling element, and excluding one candidate only moves the choice
   * elsewhere. That 46px correction is handled where it actually matters, by
   * the dead band between the two thresholds in site.js, which is set wider
   * than the correction can ever be.
   */
  overflow-anchor: none;
}

/*
 * Anything an anchor can land on clears the sticky row. Without this the
 * heading a fragment link targets ends up underneath the header.
 */
:target,
.section[id] { scroll-margin-top: 96px; }

/* --- Utility strip --------------------------------------------------------- */

.header-utility {
  background: var(--c-navy-deep);
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  overflow: hidden;
  max-height: 46px;
  transition: max-height 0.3s var(--ease), opacity 0.25s var(--ease);
}

.header-utility__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 46px;
}

/* The positioning line does the balancing work in one sentence: films and
   digital services, named together, above everything else on the page. */
.header-utility__tag {
  font-family: var(--f-head);
  letter-spacing: 0.02em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-utility__tag b { color: #fff; font-weight: 600; }

.header-utility__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex: 0 0 auto;
}

.u-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px var(--sp-2);
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--f-head);
  font-size: 14px;
  white-space: nowrap;
  border-radius: 3px;
  transition: color var(--transition), background-color var(--transition);
}
.u-link:hover, .u-link:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.u-link svg { width: 15px; height: 15px; flex: 0 0 15px; }

/* The LinkedIn link in the utility strip. At 0.78 opacity beside a text
   label it disappeared; a filled tile at full opacity gives it equal weight
   without competing with the QRSys link. */
.u-link--icon {
  padding: 0;
  width: 30px;
  height: 30px;
  justify-content: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 5px;
}
.u-link--icon svg { width: 16px; height: 16px; }
.u-link--icon:hover,
.u-link--icon:focus-visible {
  background: var(--c-orange);
  color: #fff;
}

/* Verify is the one consumer-facing action on a business site, so it gets
   the accent rather than blending into the other utility links. */
.u-verify {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  font-family: var(--f-head);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  color: #fff;
  background: var(--c-orange);
  border-radius: 3px;
  transition: background-color var(--transition), transform var(--transition);
}
.u-verify:hover, .u-verify:focus-visible {
  color: #fff;
  background: var(--c-orange-deep);
}
.u-verify svg { width: 15px; height: 15px; flex: 0 0 15px; }

/* --- Navigation row -------------------------------------------------------- */

.header-main { border-bottom: 1px solid var(--c-rule); background: var(--c-surface); }

.header-main__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  min-height: 86px;
  transition: min-height 0.3s var(--ease);
}

.site-logo { flex: 0 0 auto; margin-right: auto; }
.site-logo__img { width: 189px; }
.site-logo .img-ph { padding: 4px; }
.site-logo .img-ph__label { font-size: 10px; }

.header-cta { flex: 0 0 auto; }
.header-cta .btn {
  padding: 11px 24px;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 15px;
}

/* --- Sticky state ---------------------------------------------------------- */

.site-header[data-stuck="true"] .header-utility {
  max-height: 0;
  opacity: 0;
}
.site-header[data-stuck="true"] .header-main {
  box-shadow: 0 2px 20px rgba(2, 49, 81, 0.10);
  border-bottom-color: transparent;
}
.site-header[data-stuck="true"] .header-main__inner { min-height: 66px; }

/* --- Nav links ------------------------------------------------------------- */

.nav__list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__item { position: relative; }

.nav__link {
  position: relative;
  display: inline-block;
  font-family: var(--f-head);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--c-navy);
  padding: 10px 13px 12px;
  transition: color var(--transition);
}
.nav__link:hover, .nav__link:focus-visible { color: var(--c-navy); }

/* The underline shifts navy to orange as it draws in — a quiet nod to the
   colour-shifting micro-optic films the company actually makes. */
.nav__link::before {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--c-navy) 0%, var(--c-orange) 100%);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s var(--ease);
}
.nav__item:hover > .nav__link::before,
.nav__link:focus-visible::before,
.nav__item--current > .nav__link::before { transform: scaleX(1); }

.nav__item--current > .nav__link { color: var(--c-navy); font-weight: 600; }

.nav__expand { display: none; border: 0; background: transparent; color: var(--c-navy); padding: var(--sp-2); font-size: 12px; }

.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  padding: 10px;
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--c-navy);
}
.nav-toggle:hover { border-color: var(--c-steel); }

/* --- Dropdowns ------------------------------------------------------------- */

.nav__sub {
  list-style: none;
  margin: 0;
  padding: var(--sp-2) 0;
  min-width: 248px;
  background: var(--c-surface);
  /* No top edge: the hover underline already draws a line just above this
     panel, and a second rule a few pixels below it reads as a mistake. The
     shadow separates the panel from the header; the accent moves to the base. */
  border: 1px solid var(--c-rule);
  border-top: 0;
  border-bottom: 2px solid var(--c-orange);
  box-shadow: 0 14px 34px rgba(2, 49, 81, 0.14);
}
.nav__sublink {
  display: block;
  font-family: var(--f-head);
  font-size: 15px;
  color: var(--c-navy);
  padding: 10px var(--sp-4);
  border-left: 2px solid transparent;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}
.nav__sublink:hover, .nav__sublink:focus-visible {
  background: var(--c-panel);
  color: var(--c-navy);
  border-left-color: var(--c-orange);
}
.nav__sublink.is-current { color: var(--c-orange); font-weight: 600; border-left-color: var(--c-orange); }

@media (min-width: 1101px) {
  .nav__item--has-children > .nav__link { padding-right: 24px; }
  .nav__item--has-children > .nav__link::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -4px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.55;
    transition: transform var(--transition), opacity var(--transition);
  }
  .nav__item--has-children:hover > .nav__link::after { opacity: 1; transform: rotate(225deg); margin-top: -1px; }

  .nav__sub {
    position: absolute;
    top: 100%;
    left: 4px;
    z-index: 30;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s var(--ease);
  }
  .nav__item--has-children:hover > .nav__sub,
  .nav__item--has-children:focus-within > .nav__sub {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/* --- Below 1100px ---------------------------------------------------------- */

@media (max-width: 1100px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    background: var(--c-surface);
    border-top: 1px solid var(--c-rule);
    box-shadow: 0 16px 28px rgba(2, 49, 81, 0.12);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
  .nav[data-open="true"] { display: block; }

  .nav__list { flex-direction: column; align-items: stretch; }
  .nav__item { border-bottom: 1px solid var(--c-rule); }
  .nav__item--has-children { display: grid; grid-template-columns: 1fr auto; align-items: center; }

  .nav__link { padding: 15px var(--gutter); font-size: 16px; }
  .nav__link::before { display: none; }

  /*
   * The tap target was already 48px, but the chevron inside it was set at
   * 12px by the desktop rule and read as a stray speck next to 16px nav
   * links. Size and weight it so it is unmistakably a control, and give it a
   * tinted disc so the affordance is visible before anyone taps.
   */
  .nav__expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-right: 6px;
    font-size: 20px;
    line-height: 1;
    color: var(--c-navy);
    border-radius: 50%;
    background: var(--c-panel);
    transition: transform var(--transition), background var(--transition);
  }
  .nav__expand > span { display: block; transform: translateY(-1px); }
  .nav__expand[aria-expanded="true"] {
    transform: rotate(180deg);
    background: var(--c-orange);
    color: #fff;
  }

  .nav__sub {
    grid-column: 1 / -1;
    display: none;
    border: 0;
    border-top: 1px solid var(--c-rule);
    border-bottom: 0;
    box-shadow: none;
    background: var(--c-panel);
    padding: var(--sp-1) 0;
    min-width: 0;
  }
  .nav__sub[data-open="true"] { display: block; }
  .nav__sublink { padding-left: var(--sp-7); }
}

@media (max-width: 860px) {
  .header-utility__tag { display: none; }
  .header-utility__inner { justify-content: flex-end; }
}
@media (max-width: 560px) {
  .u-link span, .u-verify span { display: none; }
  .u-verify { padding: 6px 10px; }
  .header-main__inner { min-height: 70px; }
  .header-cta .btn { padding: 9px 16px; font-size: 14px; }
  .site-logo__img { width: 150px; }
}

/* --- Dropdown group headings --------------------------------------------- */

.nav__group {
  margin: var(--sp-2) 0 4px;
  padding: 0 var(--sp-4);
  /* An empty group is a plain rule; a named one is a small caption. */
  border-top: 1px solid var(--c-rule);
  padding-top: var(--sp-2);
}
.nav__group:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.nav__group span {
  display: block;
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--c-eyebrow);
}
@media (max-width: 1100px) {
  .nav__group { padding-left: var(--sp-6); background: var(--c-panel-alt); }
}

/* --- Dropdown dividers ---------------------------------------------------- */
/* A rule with no caption. .nav__group carries its own border-top, so the two
   are never emitted back to back — prune() keeps only the last of a run. */

.nav__divider {
  height: 1px;
  margin: var(--sp-2) 0;
  background: var(--c-rule);
}
.nav__divider + .nav__group { border-top: 0; padding-top: 0; margin-top: 0; }

/* --- Entries that are not links ------------------------------------------- */
/* Same metrics as .nav__sublink so the column does not step in or out, but
   muted and inert: no hover, no pointer, no focus. */

.nav__sublink--static {
  color: var(--c-steel);
  cursor: default;
  font-weight: 600;
}

/* --- Badges --------------------------------------------------------------- */

.nav__badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--c-panel-alt);
  color: var(--c-navy);
  font-family: var(--f-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  vertical-align: 1px;
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .nav__divider { margin-left: var(--gutter); margin-right: var(--gutter); }
}
