/* AFS Capital Markets - shared base styles (used by both home page designs)
   Author: Sandeep Kapil
   Brand colours come from the logo: deep navy, blue and silver. */

:root {
  --navy-900: #060e26;
  --navy-800: #0a1b4a;
  --navy-700: #12307a;
  --slate: #425e75;
  --slate-light: #8aa0b3;
  --gold: #4d8bff;
  --gold-dark: #2f6fe0;
  --gold-soft: #e8f0ff;
  --silver: #b8c2d0;
  --cream: #f2f5f9;
  --text: #1b2b3c;
  --muted: #5b6b7b;
  --border: #dde3ea;
  --radius: 16px;

  --hdr-bg: rgba(7,21,42,.8);
  --hdr-text: #d4dce5;
  --hdr-border: rgba(255,255,255,.08);
  --logo-text: #fff;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.65;
  color: var(--text); background: #fff;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--navy-800); line-height: 1.15; margin: 0 0 .5em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
img, svg { max-width: 100%; }
dl, dd { margin: 0; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.center { text-align: center; }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 300; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Buttons */
.btn {
  display: inline-block; padding: 12px 26px; border-radius: 999px;
  font: 600 .95rem "Inter", sans-serif; text-decoration: none; text-align: center;
  border: 2px solid transparent; cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-lg { padding: 15px 32px; font-size: 1rem; }
.btn-primary { background: linear-gradient(135deg, #8fb4ff, var(--gold-dark)); color: #fff; box-shadow: 0 8px 22px rgba(77,139,255,.3); }
.btn-primary:hover { box-shadow: 0 12px 30px rgba(77,139,255,.5); }
.btn-outline { border-color: rgba(255,255,255,.4); color: #fff; }
.btn-outline:hover { background: #fff; color: var(--navy-800); }
.btn-dark { background: var(--navy-800); color: #fff; }
.btn-dark:hover { background: var(--navy-700); }
.btn-ghost { color: var(--hdr-text); }
.btn-ghost:hover { background: rgba(127,127,127,.12); }

/* Top risk bar */
.risk-bar { font-size: .84rem; padding: 10px 0; text-align: center; background: #0a1b4a; color: #dbe4f3; border-bottom: 1px solid var(--gold-dark); }
.risk-bar strong { color: var(--gold); }
.risk-bar a { color: var(--gold); text-decoration: underline; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--hdr-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--hdr-border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 74px; }
.logo { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.logo-words { display: flex; flex-direction: column; line-height: 1.1; }
.logo-words strong { font-size: 1.6rem; font-weight: 700; color: var(--logo-text); letter-spacing: 9px; margin-right: -9px; }
.logo-words small { font-size: .68rem; font-weight: 500; letter-spacing: 2.4px; text-transform: uppercase; color: var(--silver); }
.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav ul { display: flex; gap: 24px; }
.main-nav ul a { text-decoration: none; color: var(--hdr-text); font-weight: 500; font-size: .92rem; padding: 6px 0; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.main-nav ul a:hover { color: var(--gold-dark); border-bottom-color: var(--gold); }
.nav-actions { display: flex; gap: 8px; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--hdr-text); margin: 5px 0; }

/* Items Compliance still has to supply (remove before launch) */
.todo { display: inline-block; font-size: .7rem; font-weight: 600; color: #12307a; background: #e8f0ff; border: 1px dashed #4d8bff; padding: 1px 8px; border-radius: 6px; vertical-align: middle; }
.notice { margin-top: 26px; font-size: .88rem; color: var(--muted); text-align: center; }

/* Execution facts */
.facts-list { max-width: 860px; margin: 0 auto; display: grid; gap: 14px; }
.facts-list div { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px 24px; }
.facts-list dt { font-weight: 600; color: var(--navy-800); }
.facts-list dd { color: var(--muted); }

/* Legal documents */
.doc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.doc { display: flex; flex-direction: column; gap: 4px; text-decoration: none; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--gold); border-radius: 12px; padding: 18px 22px; transition: box-shadow .2s, transform .2s; }
.doc:hover { box-shadow: 0 12px 26px rgba(11,31,54,.1); transform: translateY(-2px); }
.doc span { font-weight: 600; color: var(--navy-800); }
.doc em { font-style: normal; font-size: .8rem; color: var(--muted); }
.complaints { margin-top: 34px; background: var(--cream); border-radius: var(--radius); padding: 30px; }
.complaints p { color: var(--muted); }

/* Forms */
.signup { display: flex; gap: 8px; max-width: 500px; background: #fff; padding: 6px; border-radius: 999px; box-shadow: 0 12px 34px rgba(0,0,0,.18); }
.signup input { flex: 1; min-width: 0; border: 0; padding: 12px 20px; font: inherit; border-radius: 999px; color: var(--text); background: transparent; }
.signup input:focus { outline: none; }

/* Footer */
.site-footer { background: var(--navy-900); color: #9fb0c1; padding: 64px 0 28px; font-size: .92rem; }
.site-footer .logo-words strong { color: #fff; }
.footer-top { display: grid; grid-template-columns: 1.3fr .8fr .8fr .8fr 1.4fr; gap: 36px; padding-bottom: 36px; }
.site-footer h4 { color: #fff; font-size: 1rem; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer address { font-style: normal; line-height: 1.8; }
.risk-warning { border: 1px solid rgba(77,139,255,.35); background: rgba(77,139,255,.06); border-radius: 14px; padding: 20px 24px; font-size: .84rem; line-height: 1.7; }
.risk-warning strong { color: var(--gold); }
.footer-bottom { margin-top: 26px; font-size: .8rem; color: #7f92a5; }
.footer-bottom p { margin: 0 0 8px; }
.footer-bottom strong { color: #b6c4d2; }
.footer-bottom .version { color: var(--gold); }

@media (max-width: 1000px) {
  .doc-grid { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 74px; left: 0; right: 0; background: var(--navy-800); border-bottom: 1px solid rgba(255,255,255,.1); flex-direction: column; align-items: stretch; padding: 18px 24px 26px; gap: 18px; }
  .main-nav.is-open { display: flex; }
  .main-nav ul { flex-direction: column; gap: 4px; }
  .main-nav ul a { display: block; padding: 10px 0; color: #d4dce5; }
  .nav-actions { flex-direction: column; }
  .nav-actions .btn-ghost { color: #d4dce5; }
  .doc-grid { grid-template-columns: 1fr; }
  .facts-list div { grid-template-columns: 1fr; gap: 4px; }
  .footer-top { grid-template-columns: 1fr; }
  .signup { flex-direction: column; border-radius: 20px; background: transparent; box-shadow: none; padding: 0; }
  .signup input { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* Icons (inline svg sprite) */
.i { width: 22px; height: 22px; flex: none; vertical-align: middle; }
.i.big { width: 30px; height: 30px; }
.i.sm { width: 16px; height: 16px; }
.signup { margin: 0; }
.signup .btn { flex: none; }
.footer-brand .logo { margin-bottom: 14px; }

/* Dropdown navigation */
:root { --sub-bg: #0a1b4a; --sub-text: #d4dce5; --sub-border: rgba(255,255,255,.12); }
.has-sub { position: relative; }
.has-sub > a::after { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 0 3px 8px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); }
.sub { position: absolute; top: 100%; left: -18px; min-width: 220px; padding: 10px; border-radius: 14px; background: var(--sub-bg); border: 1px solid var(--sub-border); box-shadow: 0 24px 50px rgba(0,0,0,.28); opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility .2s; display: block !important; }
.main-nav .sub li a { display: block; padding: 10px 14px; border-radius: 9px; color: var(--sub-text); border: 0; font-size: .9rem; }
.main-nav .sub li a:hover { background: rgba(77,139,255,.16); color: var(--gold); }
.has-sub:hover > .sub, .has-sub:focus-within > .sub { opacity: 1; visibility: visible; transform: none; }
.main-nav ul.sub { flex-direction: column; gap: 0; }

/* "Know before you trade" cards */
.know-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.know { display: flex; flex-direction: column; gap: 6px; text-decoration: none; padding: 32px; border-radius: 24px; border: 1px solid var(--border); background: #fff; transition: transform .3s, box-shadow .3s, border-color .3s; }
.know:hover { transform: translateY(-6px); border-color: var(--gold); box-shadow: 0 24px 44px rgba(11,31,54,.12); }
.know .i.big { color: var(--gold-dark); margin-bottom: 12px; }
.know p { color: var(--muted); font-size: .95rem; margin-bottom: 14px; }
.know .more { margin-top: auto; color: var(--gold-dark); font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 8px; }

/* Platform showcase with phone mock-up */
.showcase { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.show-visual { position: relative; display: grid; place-items: center; min-height: 520px; }
.glow-disc { position: absolute; width: 440px; height: 440px; border-radius: 50%; background: radial-gradient(circle, rgba(77,139,255,.45), transparent 68%); }
.phone { position: relative; width: 270px; height: 540px; border-radius: 42px; padding: 14px; background: #08162b; border: 2px solid #26405c; box-shadow: 0 40px 70px rgba(0,0,0,.4); display: flex; flex-direction: column; color: #fff; transform: rotate(-4deg); }
.ph-notch { width: 80px; height: 6px; border-radius: 6px; background: #26405c; margin: 4px auto 14px; }
.ph-head { display: flex; justify-content: space-between; align-items: center; padding: 0 8px 8px; }
.ph-head b { font-size: 1.05rem; }
.ph-head span { font-size: .62rem; background: rgba(255,255,255,.12); padding: 2px 9px; border-radius: 999px; }
.ph-chart { width: 100%; height: 130px; display: block; }
.ph-chart .grid { stroke: #fff; stroke-opacity: .07; fill: none; }
.ph-chart .cs { display: none; }
.ph-chart .ln { fill: none; stroke: #4d8bff; stroke-width: 3; vector-effect: non-scaling-stroke; }
.ph-list { margin-top: 8px; flex: 1; }
.ph-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 10px; border-top: 1px solid rgba(255,255,255,.08); font-size: .8rem; }
.ph-list span { font-size: .62rem; color: var(--gold); }
.ph-list i { grid-column: 1 / -1; height: 4px; width: 60%; border-radius: 4px; background: rgba(255,255,255,.1); }
.ph-tabs { display: flex; justify-content: space-around; padding-top: 10px; }
.ph-tabs i { width: 34px; height: 5px; border-radius: 4px; background: rgba(255,255,255,.14); }
.ph-tabs i.on { background: var(--gold); }
.points li { display: grid; grid-template-columns: auto 1fr; gap: 20px; padding: 20px 0; border-top: 1px solid rgba(127,127,127,.25); }
.points li:last-child { border-bottom: 1px solid rgba(127,127,127,.25); }
.points h3 { margin-bottom: 4px; font-size: 1.1rem; }
.points p { margin: 0; font-size: .95rem; }
.show-copy .btn { margin-top: 32px; }
.show-copy > p { margin-bottom: 26px; }

@media (max-width: 1000px) {
  .showcase { grid-template-columns: 1fr; gap: 40px; }
  .show-visual { min-height: 440px; order: -1; }
  .know-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .has-sub > a::after { display: none; }
  .sub { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 6px 14px; background: transparent; min-width: 0; }
  .main-nav .sub li a { padding: 7px 0; font-size: .88rem; color: #9fb0c1; }
  .main-nav ul.sub { gap: 0; }
}
.logo img { border-radius: 4px; flex: none; }
.logo-words { align-items: flex-start; }

/* Footer refresh */
.site-footer { position: relative; background: radial-gradient(900px 320px at 85% -10%, rgba(77,139,255,.16), transparent 70%), linear-gradient(180deg, #0a1b4a, #060e26); padding: 80px 0 0; color: #a9b8c9; border-top: 1px solid rgba(184,194,208,.18); }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, #4d8bff 30%, #b8c2d0 70%, transparent); }
.footer-top { grid-template-columns: 1.4fr repeat(5, 1fr); gap: 32px; padding-bottom: 48px; }
.footer-brand p { max-width: 260px; margin: 0 0 18px; line-height: 1.6; }
.foot-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.foot-badges li { margin: 0; padding: 5px 12px; font-size: .72rem; font-weight: 600; letter-spacing: .6px; color: #dbe4f3; border: 1px solid rgba(184,194,208,.3); border-radius: 999px; background: rgba(255,255,255,.04); }
.site-footer h4 { font-size: .74rem; font-weight: 700; letter-spacing: 2.2px; text-transform: uppercase; color: var(--silver); margin-bottom: 20px; }
.site-footer li { margin-bottom: 12px; }
.site-footer li a { color: #c4d0de; transition: color .2s, padding-left .2s; }
.site-footer li a:hover { color: #fff; padding-left: 4px; }
.site-footer address { color: #c4d0de; line-height: 1.85; }
.risk-warning { background: rgba(255,255,255,.04); border: 1px solid rgba(184,194,208,.2); border-left: 3px solid #4d8bff; border-radius: 12px; color: #b8c6d6; }
.risk-warning strong { color: #fff; }
.footer-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 40px; margin-top: 32px; padding-bottom: 32px; font-size: .78rem; line-height: 1.7; color: #8da0b5; }
.footer-bottom p { margin: 0; }
.footer-bottom strong { color: #dbe4f3; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 20px 0 24px; border-top: 1px solid rgba(184,194,208,.16); font-size: .78rem; color: #8da0b5; }
.footer-base p { margin: 0; }
.footer-base .version { color: var(--silver); }
@media (max-width: 900px) { .footer-top { grid-template-columns: 1fr 1fr; gap: 36px; } .footer-bottom { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .footer-top { grid-template-columns: 1fr; } .site-footer { padding-top: 56px; } }

/* ---------- Modern footer (option 1) ---------- */
.ft { position: relative; margin-top: 120px; background: radial-gradient(800px 360px at 90% 30%, rgba(77, 139, 255, .12), transparent 70%), #040a1a; color: #a9b8c9; font-size: .92rem; }
.ft::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, #4d8bff 30%, #b8c2d0 70%, transparent); }
.ft a { color: inherit; text-decoration: none; }

/* banner overlapping the top edge */
.ft-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; margin-top: -64px; padding: 40px 48px; border-radius: 28px; background: linear-gradient(120deg, #1d4fc4, #2f6fe0 55%, #5d8fe8); box-shadow: 0 30px 60px rgba(8, 20, 60, .5); }
.ft-banner h2 { margin: 0 0 6px; font-size: clamp(1.4rem, 2.6vw, 2rem); color: #fff; }
.ft-banner p { margin: 0; max-width: 520px; color: #dbe7ff; }
.ft-banner .btn-primary { background: #fff; color: #12307a; box-shadow: none; }
.ft-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* brand + info cards */
.ft-main { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 20px; align-items: stretch; padding: 40px 0 28px; }
.ft-brand { display: flex; flex-direction: column; justify-content: center; }
.ft-brand > p { margin: 14px 0 0; max-width: 300px; font-size: .85rem; line-height: 1.6; color: #8da0b5; }
.ft-card { display: flex; gap: 16px; align-items: center; padding: 22px 24px; border: 1px solid rgba(184, 194, 208, .18); border-radius: 18px; background: rgba(255, 255, 255, .04); }
.ft-card .i.big { flex: none; width: 46px; height: 46px; padding: 10px; border-radius: 13px; color: #8fb4ff; background: rgba(77, 139, 255, .14); }
.ft-card p { margin: 0; font-size: .82rem; line-height: 1.6; color: #8da0b5; }
.ft-card b { display: block; margin-bottom: 2px; font-size: .95rem; color: #fff; }

/* risk warning and legal text */
.ft-risk { display: flex; gap: 18px; align-items: flex-start; padding: 22px 26px; border: 1px solid rgba(77, 139, 255, .35); border-left: 4px solid #4d8bff; border-radius: 16px; background: rgba(77, 139, 255, .07); }
.ft-risk .i.big { flex: none; width: 38px; height: 38px; padding: 8px; border-radius: 11px; color: #8fb4ff; background: rgba(77, 139, 255, .16); }
.ft-risk p { margin: 0; font-size: .82rem; line-height: 1.75; color: #b4c3d4; }
.ft-risk strong { color: #fff; }
.ft-legal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 36px; margin-top: 28px; font-size: .78rem; line-height: 1.75; color: #8da0b5; }
.ft-legal p { margin: 0; }
.ft-legal strong { color: #dbe4f3; }
.ft-legal a { color: #8fb4ff; }

/* bottom bar */
.ft-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 28px; margin-top: 28px; padding: 22px 0 28px; border-top: 1px solid rgba(184, 194, 208, .14); font-size: .78rem; color: #8da0b5; }
.ft-bar p { margin: 0; }
.ft-policies { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.ft-policies a:hover { color: #fff; }
.ft-version { flex-basis: 100%; color: #b8c2d0; }

@media (max-width: 1000px) {
  .ft-main { grid-template-columns: 1fr 1fr; }
  .ft-brand { grid-column: 1 / -1; }
  .ft-legal { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .ft { margin-top: 90px; }
  .ft-banner { padding: 30px 24px; }
  .ft-main { grid-template-columns: 1fr; }
  .ft-risk { flex-direction: column; padding: 22px; }
}

/* ---------- portal links (top utility bar) ---------- */
.util-bar { background: #060e26; border-bottom: 1px solid rgba(184, 194, 208, .14); }
.util-bar .container { display: flex; justify-content: flex-end; gap: 10px; padding-block: 8px; }
.util-bar a { display: inline-flex; align-items: center; padding: 5px 16px; border: 1px solid rgba(143, 180, 255, .35); border-radius: 999px; font-size: .78rem; font-weight: 500; letter-spacing: .3px; color: #dbe4f3; text-decoration: none; transition: background .2s, border-color .2s, color .2s; }
.util-bar a:first-child { background: rgba(77, 139, 255, .16); }
.util-bar a:hover { background: #4d8bff; border-color: #4d8bff; color: #fff; }
@media (max-width: 900px) { .util-bar { display: none; } }

/* Modern hamburger: rounded button, lines morph into a close icon, panel fades in */
.nav-toggle { position: relative; width: 44px; height: 44px; padding: 0; border-radius: 12px; border: 1px solid var(--hdr-border); background: rgba(255,255,255,.06); transition: background .25s, border-color .25s, transform .15s; -webkit-tap-highlight-color: transparent; }
.nav-toggle:hover { background: rgba(77,139,255,.16); border-color: rgba(77,139,255,.45); }
.nav-toggle:active { transform: scale(.94); }
.nav-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.nav-toggle span { position: absolute; left: 12px; width: 20px; height: 2px; margin: 0; border-radius: 2px; background: var(--hdr-text); transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .2s, width .3s, background .25s; }
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; width: 14px; }
.nav-toggle span:nth-child(3) { top: 27px; }
.nav-toggle:hover span:nth-child(2) { width: 20px; }
.nav-toggle[aria-expanded="true"] { background: rgba(77,139,255,.2); border-color: rgba(77,139,255,.5); }
.nav-toggle[aria-expanded="true"] span { background: #fff; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: translateX(-8px); }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 820px) {
  .main-nav { display: flex; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-10px); max-height: calc(100vh - 74px); overflow-y: auto; border-radius: 0 0 20px 20px; box-shadow: 0 28px 50px rgba(0,0,0,.35); transition: opacity .25s ease, transform .3s cubic-bezier(.4,0,.2,1), visibility 0s linear .3s; }
  .main-nav.is-open { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition-delay: 0s; }
  .main-nav > ul > li > a { font-size: 1.02rem; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
}
@media (prefers-reduced-motion: reduce) {
  .nav-toggle, .nav-toggle span, .main-nav { transition: none !important; }
}

/* Back to top button */
.back-to-top { position: fixed; right: 22px; bottom: 22px; z-index: 90; width: 46px; height: 46px; display: grid; place-items: center; padding: 0; border-radius: 14px; border: 1px solid rgba(255,255,255,.14); background: var(--navy-800); color: #fff; cursor: pointer; box-shadow: 0 10px 28px rgba(6,14,38,.35); opacity: 0; visibility: hidden; transform: translateY(14px); transition: opacity .25s, transform .3s cubic-bezier(.4,0,.2,1), visibility 0s linear .3s, background .2s, border-color .2s; -webkit-tap-highlight-color: transparent; }
.back-to-top.show { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.back-to-top:hover { background: var(--gold-dark); border-color: var(--gold); }
.back-to-top:hover svg { transform: translateY(-2px); }
.back-to-top svg { transition: transform .2s; }
.back-to-top:active { transform: scale(.94); }
.back-to-top:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@media (max-width: 820px) { .back-to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .back-to-top, .back-to-top svg { transition: none !important; } }

/* Mobile: sub-menus are collapsed by default and open on tap */
@media (max-width: 820px) {
  .main-nav .has-sub > a { display: flex; align-items: center; justify-content: space-between; }
  .main-nav .has-sub > a::after { display: inline-block; margin: 0 4px 3px 0; transition: transform .3s cubic-bezier(.4,0,.2,1); }
  .main-nav .has-sub.sub-open > a::after { transform: rotate(-135deg) translate(-2px, -2px); }
  .main-nav .has-sub > .sub { max-height: 0; overflow: hidden; padding-top: 0; padding-bottom: 0; transition: max-height .35s cubic-bezier(.4,0,.2,1), padding .3s; }
  .main-nav .has-sub.sub-open > .sub { max-height: 600px; padding-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { .main-nav .has-sub > a::after, .main-nav .has-sub > .sub { transition: none !important; } }

/* Mobile menu fills the rest of the screen and locks page scroll while open */
html.menu-open, body.menu-open { overflow: hidden; }
@media (max-width: 820px) {
  .main-nav { height: var(--nav-h, calc(100vh - 74px)); max-height: none; border-radius: 0; box-shadow: none; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: 40px; }
}
