/* ---------- Main navigation: mega menu ---------- */
.mega { flex: 1; min-width: 0; display: flex; justify-content: flex-end; }
.mega__top { display: flex; gap: 2px; }
.mega__item { position: static; }
.mega__link { display: block; padding: 24px 12px; background: none; border: 0; cursor: pointer; font-family: var(--f-cond); font-stretch: 62%; font-weight: 700; font-size: 17px; letter-spacing: 0.03em; text-transform: uppercase; text-decoration: none; white-space: nowrap; color: var(--fg-2); transition: color .2s, box-shadow .2s; }
.mega__trigger::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-3px) rotate(45deg); transition: transform .3s var(--ease-out); }
.mega__link:hover, .mega__item:hover > .mega__link, .mega__item.is-open > .mega__link, .mega__item:focus-within > .mega__link { color: var(--fg); box-shadow: inset 0 -2px 0 var(--yellow); }
.mega__item.is-open > .mega__trigger::after, .mega__item:hover > .mega__trigger::after { transform: translateY(1px) rotate(225deg); }
.mega__burger { display: none; }

/* Inner container: same width and gutters as .wrap (which the header styles as a flex row, so it is not reused here) */
.mega__wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gut); }

/* Panel: full width under the header */
.mega__panel { position: absolute; left: 0; right: 0; top: 100%; z-index: 39; visibility: hidden; opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .3s var(--ease-out), visibility 0s .3s; background: var(--ink-1); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-2); box-shadow: 0 30px 60px -20px rgba(0,0,0,0.7);
  background-image: radial-gradient(42% 90% at 100% 100% in oklab, rgba(254,168,0,0.22) 0%, rgba(254,168,0,0.12) 22%, rgba(254,168,0,0.05) 44%, rgba(254,168,0,0) 70%); }
.mega__item:hover > .mega__panel, .mega__item.is-open > .mega__panel, .mega__item:focus-within > .mega__panel { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
/* With scripting, a panel closed with Escape stays closed while the pointer is still over it */
.mega.is-dismissed .mega__panel { visibility: hidden !important; opacity: 0 !important; }
.mega__g { position: relative; display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; min-height: 440px; }

/* Left rail: sections */
.mega__rail { grid-column: 1; padding-block: 36px; border-right: 1px solid var(--line-2); display: grid; align-content: start; gap: 2px; }
.mega__sec { position: static; }
.mega__seclink { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: baseline; width: 100%; padding: 12px 20px 12px 0; background: none; border: 0; text-align: left; cursor: pointer; text-decoration: none; color: var(--fg-2); font-family: var(--f-display); font-weight: 700; font-size: 21px; line-height: 1.05; letter-spacing: -0.03em; text-transform: uppercase; position: relative; transition: color .2s; }
.mega__num { font-family: var(--f-text); font-weight: 700; font-size: 13px; letter-spacing: 0; font-variant-numeric: tabular-nums; color: var(--fg-3); transition: color .2s; }
.mega__seclink::after { content: ""; position: absolute; right: -1px; top: 8px; bottom: 8px; width: 2px; background: var(--yellow); transform: scaleY(0); transition: transform .35s var(--ease-factory); }
/* Middle: the pane of the hovered or chosen section; the first one shows until another is chosen */
.mega__pane { position: absolute; left: 300px; right: 300px; top: 0; bottom: 0; padding: 40px 40px 32px; display: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 32px; align-content: start; overflow-y: auto; }
.mega__sec--pane:hover > .mega__pane, .mega__sec--pane:focus-within > .mega__pane, .mega__sec--pane.is-active > .mega__pane { display: grid; z-index: 2; background: var(--ink-1); }
.mega__rail:not(:hover):not(:focus-within):not(.has-active) > .mega__sec--pane:first-child > .mega__pane { display: grid; }
.mega__sec:hover > .mega__seclink, .mega__sec:focus-within > .mega__seclink, .mega__sec.is-active > .mega__seclink,
.mega__rail:not(:hover):not(:focus-within):not(.has-active) > .mega__sec--pane:first-child > .mega__seclink { color: var(--fg); }
.mega__sec:hover > .mega__seclink .mega__num, .mega__sec.is-active > .mega__seclink .mega__num,
.mega__rail:not(:hover):not(:focus-within):not(.has-active) > .mega__sec--pane:first-child > .mega__seclink .mega__num { color: var(--yellow); }
.mega__sec--pane:hover > .mega__seclink::after, .mega__sec--pane:focus-within > .mega__seclink::after, .mega__sec--pane.is-active > .mega__seclink::after,
.mega__rail:not(:hover):not(:focus-within):not(.has-active) > .mega__sec--pane:first-child > .mega__seclink::after { transform: scaleY(1); }
.mega__grp .lbl { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); color: var(--fg-3); }
.mega__grp ul { display: grid; gap: 2px; }
.mega__grp a { display: grid; gap: 3px; padding: 7px 0; text-decoration: none; font-size: var(--fs-sm); line-height: 1.3; color: var(--fg); }
.mega__grp a > span { justify-self: start; box-shadow: inset 0 -1px 0 transparent; transition: box-shadow .2s; }
.mega__grp a:hover > span { box-shadow: inset 0 -2px 0 var(--yellow); }
.mega__grp small { font-size: var(--fs-xs); line-height: 1.35; color: var(--fg-3); }
.mega__all { grid-column: 1 / -1; justify-self: start; margin-top: 4px; }

/* Right: call to action */
.mega__promo { grid-column: 3; align-self: center; margin: 32px 0 32px 0; padding: 26px; display: grid; gap: 12px; justify-items: start; background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02)), rgba(11,11,12,0.5); border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 var(--glass-hi); position: relative; z-index: 3; }
.mega__promo-h { font-size: var(--fs-h3); line-height: 1; }
.mega__promo p:not(.mega__promo-h) { color: var(--fg-2); font-size: var(--fs-sm); line-height: 1.45; }
.mega__promo .btn { margin-top: 6px; white-space: normal; text-align: left; padding-block: 10px; justify-self: stretch; justify-content: space-between; }
.mega__bar { border-top: 1px solid var(--line-2); background: var(--ink-0); }
.mega__bar .mega__wrap { display: flex; align-items: center; justify-content: flex-end; gap: 24px; min-height: 60px; }
.mega__bar span { color: var(--fg-2); }
.mega__bar .btn { --h: 60px; align-self: stretch; padding: 0 28px; font-size: 15px; }

@media (max-width: 1180px) and (min-width: 961px) {
  .mega__g { grid-template-columns: 250px minmax(0, 1fr) 240px; }
  .mega__pane { left: 250px; right: 240px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 28px; }
  .mega__seclink { font-size: 18px; }
}

/* Narrow screens: a drawer; top items and sections open in place */
@media (max-width: 960px) {
  .top .wrap { flex-wrap: wrap; gap: 0 12px; }
  .top .brand { margin-right: auto; }
  .mega { order: 3; flex-basis: 100%; display: block; margin-inline: calc(var(--gut) * -1); }
  .js .mega { display: none; max-height: calc(100vh - 68px); overflow-y: auto; border-top: 1px solid var(--line); }
  .js .top.nav-open .mega { display: block; }
  .js .mega__burger { display: grid; place-items: center; width: 44px; height: 44px; background: none; border: 1px solid var(--line-2); color: var(--fg); cursor: pointer; }
  .mega__burger i, .mega__burger i::before, .mega__burger i::after { content: ""; display: block; width: 18px; height: 2px; background: currentColor; position: relative; transition: transform .3s var(--ease-out), background .2s; }
  .mega__burger i::before { position: absolute; top: -6px; } .mega__burger i::after { position: absolute; top: 6px; }
  .nav-open .mega__burger i { background: transparent; }
  .nav-open .mega__burger i::before { transform: translateY(6px) rotate(45deg); } .nav-open .mega__burger i::after { transform: translateY(-6px) rotate(-45deg); }
  .mega__top { display: block; }
  .mega__item { border-bottom: 1px solid var(--line); }
  .mega__link { width: 100%; text-align: left; padding: 16px var(--gut); font-size: 20px; display: flex; justify-content: space-between; align-items: center; }
  .mega__link:hover, .mega__item:hover > .mega__link, .mega__item.is-open > .mega__link, .mega__item:focus-within > .mega__link { box-shadow: none; }
  .mega__panel { position: static; visibility: visible; opacity: 1; transform: none; box-shadow: none; border: 0; display: none; transition: none; }
  .mega__item:hover > .mega__panel, .mega__item:focus-within > .mega__panel { display: none; }
  .mega__item.is-open > .mega__panel, html:not(.js) .mega__panel { display: block; }
  .mega__g { display: block; min-height: 0; padding-bottom: 16px; }
  .mega__rail { padding-block: 4px 12px; border-right: 0; }
  .mega__seclink { padding: 12px 0; font-size: 18px; }
  .mega__seclink::after { content: none; }
  .mega__pane { position: static; padding: 4px 0 16px 34px; grid-template-columns: 1fr; gap: 18px; overflow: visible; background: none !important; }
  .mega__sec--pane:hover > .mega__pane, .mega__sec--pane:focus-within > .mega__pane, .mega__rail:not(:hover):not(:focus-within):not(.has-active) > .mega__sec--pane:first-child > .mega__pane { display: none; }
  .mega__sec--pane.is-active > .mega__pane, html:not(.js) .mega__pane { display: grid; }
  .mega__promo { margin: 8px 0 0; }
  .mega__bar .mega__wrap { justify-content: space-between; gap: 12px; padding-block: 0; }
  .mega__bar span { font-size: 14px; padding-block: 10px; }
  .mega__bar .btn { --h: 52px; padding: 0 18px; }
  .top > .wrap > .btn { display: none; }
}
@media (prefers-reduced-motion: reduce) { .mega__panel { transition: none; } }
/* The panel spans the header, not the centred content column */
.top > .wrap { position: static; }
