/* ==========================================================================
   NIFM Website — styles.css
   Design system — SAME as NWM per Ryan's directive.
   NIFM uses the NWM visual system (warm paper, bronze, midnight, limestone)
   with EB Garamond + Manrope typography. Distinction from NWM is through
   brand elements (logo, team, regulatory IDs, CMA content), not palette.
   ========================================================================== */

/* ----- Tokens ----- */

:root {
  /* Palette — NWM warm (adopted for NIFM) */
  --midnight:       #0B1B36;
  --midnight-deep:  #060F22;
  --midnight-ink:   #1A2B47;
  --limestone:      #EDE4D3;
  --limestone-deep: #D9CDB4;
  --sand:           #C9B994;
  --paper:          #F7F1E4;
  --bronze:         #8E5A2E;
  --bronze-deep:    #6F4520;
  --bronze-light:   #B98D5E;
  --white-warm:     #FAF6EC;
  --rule:           #B5A582;
  --rule-dark:      #2E3E5A;
  --muted:          #4A5464;
  --muted-dark:     #8998B0;

  /* Typography — NWM fonts (adopted for NIFM) */
  --font-display: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-body:    'Manrope', system-ui, -apple-system, sans-serif;

  --text-display-xl:  clamp(2.75rem, 5.5vw, 5.5rem);
  --text-display-lg:  clamp(2.25rem, 4vw, 3.75rem);
  --text-display-md:  clamp(1.75rem, 3vw, 2.5rem);
  --text-h3:          clamp(1.25rem, 2vw, 1.5rem);
  --text-h4:          clamp(1.125rem, 1.6vw, 1.25rem);
  --text-body-lg:     clamp(1.0625rem, 1.2vw, 1.1875rem);
  --text-body:        1rem;
  --text-body-sm:     0.9375rem;
  --text-caption:     0.8125rem;

  /* Spacing */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs:  0.75rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2rem;
  --space-xl:  3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --space-4xl: 8rem;
  --space-5xl: 12rem;

  --section-pad: clamp(var(--space-2xl), 8vw, var(--space-5xl));
  --edge-pad:    clamp(1.25rem, 5vw, 6rem);

  /* Containers */
  --container-narrow:   38rem;
  --container-reading:  46rem;
  --container-text:     58rem;
  --container-standard: 72rem;
  --container-wide:     84rem;

  /* Motion */
  --ease-editorial: cubic-bezier(0.2, 0.8, 0.2, 1);
  --duration-fast:  200ms;
  --duration-med:   400ms;
  --duration-slow:  800ms;
}

/* ----- Reset & base ----- */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--midnight-ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; height: auto; display: block; }

/* Skip link (accessibility) */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  padding: var(--space-sm) var(--space-md);
  background: var(--midnight);
  color: var(--white-warm);
  font-size: var(--text-body-sm);
  font-weight: 600;
  z-index: 100;
  transition: top var(--duration-fast);
}
.skip-link:focus { top: 0; }

/* ----- Typography ----- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0;
  color: inherit;
}
h1 { font-size: var(--text-display-xl); line-height: 1.02; }
h2 { font-size: var(--text-display-lg); line-height: 1.08; }
h3 { font-size: var(--text-display-md); line-height: 1.15; }
h4 { font-size: var(--text-h3); line-height: 1.25; }

p {
  margin: 0 0 1.25em;
  max-width: 62ch;
}
p:last-child { margin-bottom: 0; }

em {
  font-style: italic;
  font-weight: 400;
}

a { color: inherit; text-decoration: none; }

strong { font-weight: 600; }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--bronze);
  display: inline-block;
  margin-bottom: var(--space-md);
}

.rule {
  display: block;
  width: 3rem;
  height: 1px;
  background: var(--bronze);
  margin: var(--space-lg) 0;
  border: none;
}
.rule-center { margin-left: auto; margin-right: auto; }

/* ----- Layout ----- */

.container {
  max-width: var(--container-standard);
  margin: 0 auto;
  padding-left: var(--edge-pad);
  padding-right: var(--edge-pad);
}
.container-text { max-width: var(--container-text); }
.container-reading { max-width: var(--container-reading); }
.container-wide { max-width: var(--container-wide); }

section {
  padding-top: var(--section-pad);
  padding-bottom: var(--section-pad);
}

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

.nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: var(--space-xl) var(--edge-pad) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  color: var(--midnight);
  background: var(--paper);
}

/* Seamless gradient: paper nav → dark hero */
.nav-fade {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 240px;
  z-index: 9;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    var(--paper) 0%,
    var(--paper) 35%,
    rgba(247, 241, 228, 0.75) 55%,
    rgba(247, 241, 228, 0.3) 80%,
    rgba(247, 241, 228, 0.0) 100%
  );
}

.nav-logo {
  display: block;
  width: clamp(180px, 24vw, 340px);
  height: auto;
  flex-shrink: 0;
}

.nav-menu {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--midnight);
}

.nav-menu a {
  position: relative;
  padding: var(--space-2xs) 0;
  background: linear-gradient(var(--bronze), var(--bronze)) no-repeat left bottom / 0 1px;
  transition: background-size var(--duration-med) var(--ease-editorial);
}
.nav-menu a:hover,
.nav-menu a[aria-current="page"] { background-size: 100% 1px; }

/* Variant: nav on light pages (no gradient fade; solid paper strip with bottom rule) */
.nav.nav-on-light {
  position: relative;
  border-bottom: 1px solid var(--rule);
}
.nav.nav-on-light + .nav-fade { display: none; }

/* Variant: nav on dark pages (home page editorial split hero) */
.nav.nav-on-dark {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: var(--space-xl) var(--edge-pad) var(--space-lg);
  background: transparent;
  color: var(--white-warm);
}
.nav.nav-on-dark .nav-menu {
  color: var(--white-warm);
}
.nav.nav-on-dark .nav-menu a {
  color: var(--white-warm);
  background: linear-gradient(var(--bronze-light), var(--bronze-light)) no-repeat left bottom / 0 1px;
}
.nav.nav-on-dark .nav-menu a:hover,
.nav.nav-on-dark .nav-menu a[aria-current="page"] {
  background-size: 100% 1px;
}

/* Home-hero nav legibility: larger + heavier + subtle drop-shadow so links remain
   readable against cloudy/varied hero photography. Scoped to nav-on-dark only. */
.nav.nav-on-dark .nav-menu {
  font-size: var(--text-body);
  font-weight: 700;
}
.nav.nav-on-dark .nav-menu a {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.nav.nav-on-dark .submenu {
  background: var(--midnight-ink);
  border-top: 2px solid var(--bronze);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.55);
}
.nav.nav-on-dark .submenu a {
  color: var(--white-warm);
}
.nav.nav-on-dark .submenu a:hover,
.nav.nav-on-dark .submenu a:focus-visible {
  background: var(--midnight);
  color: var(--bronze-light);
}
.nav.nav-on-dark .submenu a[aria-current="page"] {
  color: var(--bronze-light);
  background: var(--midnight);
}

@media (max-width: 900px) {
  .nav-logo { width: 220px; }
}

/* ----- Hero (home page, dark) ----- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--white-warm);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

/* ----- Hero variant: editorial split (home page, with dedicated portrait image) ----- */

.hero-editorial {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--white-warm);
  background: var(--midnight);
  overflow: hidden;
  position: relative;
  align-items: stretch;
}

/* Subtle noise/texture on the dark text panel to match the site's s-dark band */
.hero-editorial::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: calc(100% * 1.35 / 2.35);  /* only over the text panel */
  height: 100%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 0.95  0 0 0 0 0.85  0 0 0 0.04 0'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>");
  pointer-events: none;
  opacity: 0.5;
  z-index: 1;
}

.hero-text-panel {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  padding: clamp(6rem, 12vw, 9rem) clamp(2rem, 6vw, 6rem) clamp(3rem, 6vw, 5rem);
  background: transparent;
}

.hero-text-inner {
  max-width: 34rem;
  width: 100%;
}

.hero-editorial .hero-eyebrow {
  color: var(--bronze-light);
  opacity: 0;
  animation: fadeUp var(--duration-slow) var(--ease-editorial) forwards;
  margin-bottom: var(--space-lg);
  display: block;
}

.hero-editorial h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 3.8vw, 3.75rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--white-warm);
  margin: 0;
  opacity: 0;
  animation: fadeUp var(--duration-slow) var(--ease-editorial) 80ms forwards;
}
.hero-editorial h1 .line { display: block; }
.hero-editorial h1 em { color: var(--bronze-light); font-style: italic; font-weight: 400; }

.hero-editorial .hero-sub {
  margin-top: var(--space-lg);
  max-width: 44ch;
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--white-warm);
  opacity: 0;
  animation: fadeUp var(--duration-slow) var(--ease-editorial) 240ms forwards;
}

.hero-editorial .hero-actions {
  margin-top: var(--space-xl);
  display: flex;
  gap: var(--space-lg);
  align-items: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp var(--duration-slow) var(--ease-editorial) 400ms forwards;
}

.hero-location {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--rule-dark);
  display: flex;
  gap: var(--space-md);
  align-items: baseline;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp var(--duration-slow) var(--ease-editorial) 560ms forwards;
}
.hero-location-label {
  font-family: var(--font-body);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze-light);
  flex-shrink: 0;
}
.hero-location-addr {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-body);
  color: var(--muted-dark);
  line-height: 1.45;
}

.hero-image-panel {
  position: relative;
  overflow: hidden;
  /* Subtle dark edge that blends into the text panel */
  box-shadow: inset 40px 0 60px -40px rgba(11, 27, 54, 0.85);
}

.hero-image-inner {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 55%;
  animation: fadeIn var(--duration-slow) var(--ease-editorial) 200ms forwards;
  opacity: 0;
}

.hero-image-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(11, 27, 54, 0.15) 0%,
    rgba(11, 27, 54, 0.0) 40%,
    rgba(11, 27, 54, 0.0) 70%,
    rgba(11, 27, 54, 0.55) 100%
  );
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Mobile: stack — photo on top (shorter), text below */
@media (max-width: 860px) {
  .hero-editorial {
    grid-template-columns: 1fr;
    grid-template-rows: 45vh auto;
    min-height: auto;
  }
  .hero-editorial::before { display: none; }
  .hero-image-panel { order: -1; }
  .hero-image-panel .hero-image-inner { box-shadow: inset 0 -40px 60px -40px rgba(11, 27, 54, 0.85); }
  .hero-text-panel {
    padding: clamp(3rem, 8vw, 5rem) clamp(1.5rem, 6vw, 3rem) clamp(3rem, 8vw, 5rem);
    min-height: 60vh;
  }
}

/* ----- Original single-bleed hero (kept for interior pages via .hero-interior) ----- */

.hero-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 35%;
  z-index: 0;
}

.hero-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(11, 27, 54, 0.0) 0%,
    rgba(11, 27, 54, 0.15) 25%,
    rgba(11, 27, 54, 0.5) 60%,
    rgba(11, 27, 54, 0.9) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 0 var(--edge-pad) clamp(var(--space-2xl), 8vw, var(--space-4xl));
  width: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
}

.hero-eyebrow {
  color: var(--bronze-light);
  opacity: 0;
  animation: fadeUp var(--duration-slow) var(--ease-editorial) forwards;
}

.hero:not(.hero-editorial) h1 {
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 6.5vw, 6rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.02em;
  opacity: 0;
  animation: fadeUp var(--duration-slow) var(--ease-editorial) 80ms forwards;
}
.hero:not(.hero-editorial) h1 .line { display: block; }
.hero:not(.hero-editorial) h1 em { color: var(--bronze-light); font-style: italic; font-weight: 400; }

.hero-sub {
  margin-top: var(--space-xl);
  max-width: 46ch;
  font-size: var(--text-body-lg);
  line-height: 1.55;
  color: var(--white-warm);
  opacity: 0;
  animation: fadeUp var(--duration-slow) var(--ease-editorial) 240ms forwards;
}

.hero-actions {
  margin-top: var(--space-xl);
  display: flex;
  gap: var(--space-lg);
  align-items: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp var(--duration-slow) var(--ease-editorial) 400ms forwards;
}

/* ----- Hero variant: interior pages (shorter, light nav) ----- */

.hero-interior {
  position: relative;
  min-height: 55vh;
  color: var(--white-warm);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding-top: 0;
}
.hero-interior .hero-image::after {
  background: linear-gradient(
    180deg,
    rgba(11, 27, 54, 0.2) 0%,
    rgba(11, 27, 54, 0.45) 60%,
    rgba(11, 27, 54, 0.85) 100%
  );
}
.hero-interior .hero-content {
  padding-bottom: clamp(var(--space-xl), 5vw, var(--space-3xl));
}
.hero-interior h1 {
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  max-width: 20ch;
}
.hero-interior .hero-sub {
  max-width: 52ch;
  font-size: var(--text-body-lg);
}

/* ----- Buttons ----- */

.btn {
  display: inline-block;
  padding: 0.95rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: all var(--duration-fast) var(--ease-editorial);
  text-align: center;
}

.btn-primary {
  background: var(--bronze);
  color: var(--white-warm);
  border-bottom: 1px solid var(--white-warm);
}
.btn-primary:hover {
  background: var(--bronze-deep);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--white-warm);
  border-bottom: 1px solid var(--bronze-light);
  padding-left: 0;
  padding-right: 0;
}
.btn-ghost:hover { color: var(--bronze-light); }

.btn-dark {
  background: var(--midnight);
  color: var(--white-warm);
  border-bottom: 1px solid var(--bronze);
}
.btn-dark:hover { background: var(--midnight-ink); }

/* ----- Links ----- */

.link-text {
  position: relative;
  color: inherit;
  background: linear-gradient(var(--bronze), var(--bronze)) no-repeat left bottom / 0 1px;
  transition: background-size var(--duration-med) var(--ease-editorial);
  padding-bottom: 2px;
}
.link-text:hover { background-size: 100% 1px; }

.cta {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--bronze);
  text-transform: uppercase;
  background: linear-gradient(var(--bronze), var(--bronze)) no-repeat left bottom / 100% 1px;
  padding-bottom: 2px;
  transition: background-size var(--duration-med) var(--ease-editorial);
  display: inline-block;
}
.cta:hover { background-size: 100% 2px; }

/* ----- Section: Positioning (light paper) ----- */

.s-positioning { background: var(--paper); }
.s-positioning .container { max-width: var(--container-text); }
.s-positioning h2 {
  max-width: 20ch;
  margin-bottom: var(--space-xl);
  color: var(--midnight);
}
.s-positioning h2 em { color: var(--bronze); }
.s-positioning p {
  font-size: var(--text-body-lg);
  line-height: 1.75;
  color: var(--midnight-ink);
  max-width: 64ch;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--rule);
}
.stat-item .num {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 500;
  color: var(--bronze);
  line-height: 1;
  display: block;
  margin-bottom: var(--space-sm);
}
.stat-item .label {
  font-family: var(--font-body);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ----- Section: Dark band (credentials, funds, contact) ----- */

.s-dark {
  background: var(--midnight);
  color: var(--white-warm);
  position: relative;
  overflow: hidden;
}
.s-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 0.95  0 0 0 0 0.85  0 0 0 0.04 0'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>");
  pointer-events: none;
  opacity: 0.6;
}
.s-dark .container { position: relative; }
.s-dark .eyebrow { color: var(--bronze-light); }
.s-dark h2 em { color: var(--bronze-light); }

/* ----- Regulatory credentials block ----- */

.credentials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-xl) var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--rule-dark);
}
.credential-item .label {
  font-family: var(--font-body);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-dark);
  margin-bottom: var(--space-xs);
}
.credential-item .value {
  font-family: var(--font-display);
  font-size: var(--text-h4);
  font-weight: 500;
  color: var(--white-warm);
  line-height: 1.3;
}
.activities {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--rule-dark);
}
.activities .label {
  font-family: var(--font-body);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-dark);
  margin-bottom: var(--space-lg);
}
.activities-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  font-family: var(--font-display);
  font-size: var(--text-body-lg);
  font-weight: 500;
  line-height: 1.4;
  list-style: none;
  margin: 0;
  padding: 0;
}
.activities-list li {
  position: relative;
  padding-left: var(--space-md);
}
.activities-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 6px;
  height: 1px;
  background: var(--bronze-light);
}
.activities-list li:first-child { padding-left: 0; }
.activities-list li:first-child::before { display: none; }

/* ----- Services: 3-card grid ----- */

.s-services { background: var(--limestone); }
.s-services h2 {
  max-width: 20ch;
  color: var(--midnight);
  margin-bottom: var(--space-xl);
}
.s-services h2 em { color: var(--bronze); }

/* ============================================================================
   nifm-contrast-spacing — fixes three site-wide issues:
     (a) dark service-cards where h3 + p text was nearly invisible
     (b) stat-item numbers and labels nearly invisible on .s-dark backgrounds
     (c) cramped h2 -> p/ul layouts in .s-dark and .s-positioning sections
   Safe to remove as a single block.
   ============================================================================ */

/* Dark service-card variant — when inline style sets a midnight background,
   text colors need to flip from dark-on-cream to light-on-dark. */
.service-card[style*="midnight-ink"] h3,
.service-card[style*="midnight-deep"] h3,
.service-card[style*="midnight)"] h3,
.service-card[style*="var(--midnight)"] h3 {
  color: var(--white-warm);
}
.service-card[style*="midnight-ink"] p,
.service-card[style*="midnight-deep"] p,
.service-card[style*="midnight)"] p,
.service-card[style*="var(--midnight)"] p {
  color: var(--muted-dark);
}
/* Keep the bronze top border visible on dark too */
.service-card[style*="midnight"] {
  border-top-color: var(--bronze-light);
}

/* Stat-item readable on dark section backgrounds.
   Base .stat-item uses --bronze (2.98:1 on --midnight = fails WCAG)
   and --muted (2.24:1 = fails). Override to lighter palette vars. */
.s-dark .stat-item .num,
.s-contact .stat-item .num {
  color: var(--bronze-light);
}
.s-dark .stat-item .label,
.s-contact .stat-item .label {
  color: var(--muted-dark);
}

/* Breathing room between h2 and an immediately-following paragraph or list.
   Scoped to .s-dark and .s-positioning because those are where h2 -> p/ul
   appears without a .service-grid (which already has its own margin-top).
   Uses --space-xl for a generous editorial gap that matches the scale of
   the display-sized h2 typography. */
.s-dark h2 + p,
.s-dark h2 + ul,
.s-dark h2 + ol,
.s-positioning h2 + p,
.s-positioning h2 + ul,
.s-positioning h2 + ol {
  margin-top: var(--space-xl);
}

/* ========================================================================= */

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: var(--space-xl);
}
.service-card {
  background: var(--paper);
  padding: var(--space-2xl) var(--space-xl);
  border-top: 1px solid var(--bronze);
  transition: transform var(--duration-med) var(--ease-editorial),
              box-shadow var(--duration-med) var(--ease-editorial);
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -20px rgba(11, 27, 54, 0.15);
}
.service-card h3 {
  color: var(--midnight);
  font-size: var(--text-display-md);
  margin-bottom: var(--space-md);
  font-weight: 500;
}
.service-card p {
  color: var(--muted);
  font-size: var(--text-body);
  line-height: 1.65;
  margin-bottom: var(--space-lg);
}

/* ----- "Why NWM" — numbered rationale ----- */

.s-why { background: var(--paper); position: relative; overflow: hidden; }
.s-why::before {
  content: '';
  position: absolute;
  right: -20%;
  top: -10%;
  width: 80vh;
  height: 80vh;
  background-image: url('/assets/images/hero-al-maryah-galleria.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.10;
  z-index: 0;
  filter: saturate(0.6);
}
.s-why .container { position: relative; max-width: var(--container-text); }
.s-why h2 {
  max-width: 22ch;
  color: var(--midnight);
  margin-bottom: var(--space-xl);
}
.s-why h2 em { color: var(--bronze); }
.s-why .intro {
  font-size: var(--text-body-lg);
  max-width: 60ch;
  color: var(--midnight-ink);
  line-height: 1.75;
  margin-bottom: var(--space-3xl);
}
.why-points { display: grid; gap: var(--space-2xl); }
.why-point {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: var(--space-lg);
  align-items: start;
}
.why-point .num {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-style: italic;
  color: var(--bronze);
  line-height: 1;
  font-weight: 500;
  padding-top: 0.15em;
}
.why-point h3 {
  font-size: var(--text-h3);
  color: var(--midnight);
  margin-bottom: var(--space-sm);
  font-weight: 500;
}
.why-point p {
  color: var(--muted);
  font-size: var(--text-body);
  line-height: 1.75;
  max-width: 60ch;
}

/* ----- Funds list (dark) ----- */

.funds-grid {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule-dark);
}
.fund-row {
  display: grid;
  grid-template-columns: 4rem 1fr auto;
  gap: var(--space-xl);
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--rule-dark);
  align-items: baseline;
  transition: background var(--duration-med) var(--ease-editorial),
              padding-left var(--duration-med) var(--ease-editorial),
              padding-right var(--duration-med) var(--ease-editorial);
}
.fund-row:hover {
  background: rgba(185, 141, 94, 0.06);
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}
.fund-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-body-lg);
  color: var(--bronze-light);
  font-weight: 500;
}
.fund-main h3 {
  font-size: clamp(1.375rem, 2.2vw, 1.875rem);
  color: var(--white-warm);
  margin-bottom: var(--space-sm);
  font-weight: 500;
}
.fund-main .desc {
  color: var(--muted-dark);
  font-size: var(--text-body);
  line-height: 1.6;
  max-width: 62ch;
  margin: 0;
}
.fund-main .desc strong {
  color: var(--white-warm);
  font-weight: 500;
}
.fund-arrow {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--bronze-light);
  opacity: 0.6;
  transition: opacity var(--duration-med) var(--ease-editorial),
              transform var(--duration-med) var(--ease-editorial);
}
.fund-row:hover .fund-arrow { opacity: 1; transform: translateX(4px); }

@media (max-width: 700px) {
  .fund-row { grid-template-columns: 3rem 1fr; }
  .fund-arrow { display: none; }
}

/* ----- Awards ----- */

.s-awards { background: var(--limestone); }
.s-awards .container { max-width: var(--container-text); text-align: center; }
.s-awards h2 {
  max-width: 22ch;
  margin: 0 auto var(--space-xl);
  color: var(--midnight);
}
.s-awards h2 em { color: var(--bronze); }
.s-awards > .container > p {
  max-width: 54ch;
  margin: 0 auto var(--space-3xl);
  color: var(--midnight-ink);
  font-size: var(--text-body-lg);
}
.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-xl);
  text-align: left;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--rule);
}
.award-item { padding: var(--space-lg) 0; }
.award-year {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--bronze);
  font-weight: 500;
  line-height: 1;
  margin-bottom: var(--space-md);
}
.award-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h4);
  color: var(--midnight);
  line-height: 1.3;
  margin-bottom: var(--space-xs);
}
.award-body {
  font-size: var(--text-body-sm);
  color: var(--muted);
  line-height: 1.6;
}

/* ----- Contact band ----- */

.s-contact { background: var(--midnight); color: var(--white-warm); }
.s-contact .container { max-width: var(--container-text); text-align: center; }
.s-contact h2 { margin-bottom: var(--space-xl); }
.s-contact h2 em { color: var(--bronze-light); }
.s-contact .address {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-body-lg);
  max-width: 50ch;
  margin: 0 auto var(--space-xl);
  color: var(--white-warm);
  line-height: 1.5;
}
.contact-channels {
  display: flex;
  gap: var(--space-xl);
  justify-content: center;
  flex-wrap: wrap;
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--rule-dark);
  border-bottom: 1px solid var(--rule-dark);
  margin-bottom: var(--space-2xl);
}
.contact-channels a {
  font-size: var(--text-body);
  color: var(--white-warm);
  background: linear-gradient(var(--bronze-light), var(--bronze-light)) no-repeat left bottom / 0 1px;
  transition: background-size var(--duration-med) var(--ease-editorial);
  padding-bottom: 2px;
}
.contact-channels a:hover { background-size: 100% 1px; }

/* ----- Footer ----- */

.site-footer .eyebrow { color: var(--bronze-light); }

footer {
  background: var(--midnight-deep);
  color: var(--muted-dark);
  padding: var(--space-2xl) var(--edge-pad);
  font-size: var(--text-body-sm);
  line-height: 1.65;
}
footer .container { max-width: var(--container-wide); padding: 0; }
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2xl);
  flex-wrap: wrap;
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--rule-dark);
  margin-bottom: var(--space-xl);
}
.footer-logo {
  width: 260px;
  max-width: 100%;
  height: auto;
  flex-shrink: 0;
}
.footer-contact {
  color: var(--muted-dark);
  font-size: var(--text-body-sm);
  line-height: 1.7;
  max-width: 30ch;
}
.footer-contact a {
  display: block;
  color: var(--white-warm);
  background: linear-gradient(var(--bronze-light), var(--bronze-light)) no-repeat left bottom / 0 1px;
  transition: background-size var(--duration-med) var(--ease-editorial);
  padding-bottom: 2px;
  margin-top: var(--space-xs);
  width: fit-content;
}
.footer-contact a:hover { background-size: 100% 1px; }
.footer-reg { max-width: 72ch; margin-bottom: var(--space-xl); }
.footer-bottom {
  padding-top: var(--space-lg);
  border-top: 1px solid var(--rule-dark);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: var(--text-caption);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ----- Breadcrumbs ----- */

.breadcrumbs {
  padding: var(--space-lg) var(--edge-pad);
  font-size: var(--text-caption);
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.breadcrumbs ol {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: var(--container-wide);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  align-items: center;
}
.breadcrumbs li::after {
  content: "/";
  margin-left: var(--space-xs);
  color: var(--bronze);
  opacity: 0.5;
}
.breadcrumbs li:last-child::after { content: ""; margin-left: 0; }
.breadcrumbs li:last-child { color: var(--midnight); }
.breadcrumbs a { color: var(--muted); transition: color var(--duration-fast); }
.breadcrumbs a:hover { color: var(--bronze); }

/* ----- Prose sections (About, Services, etc.) ----- */

.s-prose { background: var(--paper); }
.s-prose .container { max-width: var(--container-text); }
.s-prose h2 {
  color: var(--midnight);
  margin-bottom: var(--space-xl);
  max-width: 22ch;
}
.s-prose h2 em { color: var(--bronze); }
.s-prose h3 {
  color: var(--midnight);
  font-size: var(--text-h3);
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-md);
  font-weight: 500;
}
.s-prose p {
  font-size: var(--text-body-lg);
  line-height: 1.75;
  color: var(--midnight-ink);
  max-width: 64ch;
}
.s-prose ul, .s-prose ol {
  max-width: 64ch;
  font-size: var(--text-body);
  line-height: 1.75;
  color: var(--midnight-ink);
  padding-left: var(--space-lg);
}
.s-prose li { margin-bottom: var(--space-sm); }
.s-prose blockquote {
  border-left: 2px solid var(--bronze);
  padding: var(--space-xs) 0 var(--space-xs) var(--space-lg);
  margin: var(--space-xl) 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-body-lg);
  color: var(--midnight-ink);
  max-width: 60ch;
}

/* Prose section on limestone */
.s-prose.s-prose-light { background: var(--limestone); }

/* ----- Team grid ----- */

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-xl);
}
.team-card {
  background: var(--paper);
  text-align: left;
  transition: transform var(--duration-med) var(--ease-editorial);
}
.team-card:hover { transform: translateY(-4px); }
.team-portrait {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--limestone);
  border-bottom: 1px solid var(--bronze);
}
.team-meta { padding: var(--space-md) 0; }
.team-name {
  font-family: var(--font-display);
  font-size: var(--text-h4);
  font-weight: 500;
  color: var(--midnight);
  margin-bottom: var(--space-2xs);
}
.team-role {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: 500;
  color: var(--bronze);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ----- Fund diagram sections ----- */

.diagram-wrap {
  margin: var(--space-2xl) 0;
  max-width: var(--container-wide);
  margin-left: auto;
  margin-right: auto;
}
.diagram-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}
.diagram-caption {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-body-sm);
  color: var(--muted);
  text-align: center;
  max-width: 62ch;
  margin: var(--space-md) auto 0;
}

/* ----- Comparison tables ----- */

table.compare {
  width: 100%;
  max-width: 64rem;
  margin: var(--space-xl) 0;
  border-collapse: collapse;
  font-size: var(--text-body-sm);
}
table.compare th,
table.compare td {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}
table.compare thead th {
  font-family: var(--font-body);
  font-size: var(--text-caption);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bronze);
  border-bottom: 2px solid var(--bronze);
}
table.compare thead th:first-child { color: var(--muted); }
table.compare tbody th {
  font-weight: 600;
  color: var(--midnight);
  font-family: var(--font-body);
  width: 28%;
}
table.compare tbody td { color: var(--midnight-ink); }

/* ----- Motion ----- */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms var(--ease-editorial),
              transform 600ms var(--ease-editorial);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ----- Focus (accessibility) ----- */

a:focus-visible, button:focus-visible, .btn:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 3px;
}

/* ----- Nav submenu / dropdown ----- */

.nav-menu li.has-submenu {
  position: relative;
  /* Hover bridge: extends the parent's hover zone down through the gap to the submenu.
     padding-bottom is hover-eligible; negative margin-bottom cancels the visual height
     impact so the nav row doesn't grow taller. Eliminates flicker when the cursor
     transits from trigger to dropdown panel. */
  padding-bottom: 0.5rem;
  margin-bottom: -0.5rem;
}

.nav-menu li.has-submenu > a {
  /* Keep the same inline layout as other nav links so baseline matches */
  padding-right: 1em;  /* room for caret */
}

/* Constrain the bronze underline to the text portion only (exclude caret padding) */
.nav-menu li.has-submenu > a:hover,
.nav-menu li.has-submenu > a[aria-current="page"] {
  background-size: calc(100% - 1em) 1px;
}

.submenu-caret {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6em;
  line-height: 1;
  opacity: 0.55;
  pointer-events: none;
  transition: transform var(--duration-fast) var(--ease-editorial),
              opacity var(--duration-fast) var(--ease-editorial);
}

.nav-menu li.has-submenu:hover > a .submenu-caret,
.nav-menu li.has-submenu:focus-within > a .submenu-caret {
  transform: translateY(-50%) rotate(180deg);
  opacity: 1;
}

.submenu {
  position: absolute;
  /* top: 100% — submenu touches the parent's bridge edge, no dead zone between them */
  top: 100%;
  left: -1rem;
  min-width: 14rem;
  background: var(--paper);
  border-top: 2px solid var(--bronze);
  box-shadow: 0 18px 40px -20px rgba(11, 27, 54, 0.25);
  padding: 0.75rem 0;
  margin: 0;
  list-style: none;

  /* Hidden by default. Close transition has a 120ms delay on opacity/transform/visibility
     so brief mouse-out (cursor jitter, transit through dead space) doesn't slam the
     dropdown shut before the user has a chance to re-enter it. */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-editorial) 120ms,
              transform var(--duration-fast) var(--ease-editorial) 120ms,
              visibility 0s linear calc(var(--duration-fast) + 120ms);
  z-index: 20;
}

.nav-menu li.has-submenu:hover > .submenu,
.nav-menu li.has-submenu:focus-within > .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  /* Open transition: NO delay. Re-applying the open transition on re-entry within the
     close-delay window means the dropdown never visually starts to close. */
  transition: opacity var(--duration-fast) var(--ease-editorial) 0s,
              transform var(--duration-fast) var(--ease-editorial) 0s,
              visibility 0s linear 0s;
}

.submenu li {
  margin: 0;
  padding: 0;
}

.submenu a {
  display: block;
  padding: 0.625rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--midnight);
  background: none;
  white-space: nowrap;
  transition: background var(--duration-fast),
              color var(--duration-fast);
}

.submenu a:hover,
.submenu a:focus-visible {
  background: var(--limestone);
  color: var(--bronze-deep);
}

.submenu a[aria-current="page"] {
  color: var(--bronze);
  background: var(--limestone);
}

/* Keep the main nav link's bronze underline from inheriting inside the submenu */
.submenu a {
  background-image: none;
}

/* ----- Mobile navigation (< 900px) ----- */

/* Hamburger button (hidden on desktop) */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  padding: 0.75rem;
  cursor: pointer;
  color: inherit;
  position: relative;
  z-index: 30;
  margin-left: auto;
}
.nav-toggle-bars {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  position: relative;
  transition: background var(--duration-fast);
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: '';
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: currentColor;
  transition: transform var(--duration-fast) var(--ease-editorial),
              top var(--duration-fast) var(--ease-editorial);
}
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }

/* Open state: morph to X */
.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
  background: transparent;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

@media (max-width: 900px) {
  .nav-toggle { display: flex; align-items: center; }
  .nav-logo { width: 180px; }

  .nav {
    padding: var(--space-md) var(--edge-pad);
  }

  /* Menu becomes a full-screen overlay */
  .nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--midnight);
    color: var(--white-warm);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 6rem var(--edge-pad) 3rem;
    margin: 0;
    overflow-y: auto;
    z-index: 25;

    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity var(--duration-med) var(--ease-editorial),
                transform var(--duration-med) var(--ease-editorial),
                visibility 0s linear var(--duration-med);
  }

  /* Prevent body scroll when open */
  body.nav-open {
    overflow: hidden;
  }

  /* Open state (driven by .nav-open on body) */
  body.nav-open .nav-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity var(--duration-med) var(--ease-editorial),
                transform var(--duration-med) var(--ease-editorial),
                visibility 0s linear 0s;
  }

  /* Parent menu items (About / Services / Fund Structuring / Funds / Insights / Contact) */
  .nav-menu > li {
    width: 100%;
    padding: 0;
    margin: 0;
    border-bottom: 1px solid rgba(249, 242, 224, 0.08);
  }
  .nav-menu > li:last-child { border-bottom: none; }

  .nav-menu > li > a {
    display: block;
    padding: 1.1rem 0 1.1rem 0;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--white-warm);
    background-image: none;  /* drop the desktop underline effect */
    text-transform: none;
  }

  .nav-menu > li > a[aria-current="page"] {
    color: var(--bronze-light);
  }

  /* Hide the caret on mobile (submenu is always expanded) */
  .submenu-caret {
    display: none;
  }

  /* Always-expanded submenu (no hover/tap to expand) */
  .submenu {
    position: static;
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 0 1rem 0;
    margin: 0;
    min-width: 0;
  }

  .submenu li {
    padding: 0;
    margin: 0;
  }

  .submenu a {
    display: block;
    padding: 0.5rem 0 0.5rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(249, 242, 224, 0.75);
    background: none;
    white-space: normal;
  }

  .submenu a:hover,
  .submenu a:focus-visible {
    color: var(--bronze-light);
    background: none;
  }

  .submenu a[aria-current="page"] {
    color: var(--bronze-light);
    background: none;
  }

  /* Nav-on-dark (home page) — keep dark background consistent with overlay */
  .nav.nav-on-dark .nav-menu {
    background: var(--midnight);
  }
  .nav.nav-on-dark .nav-toggle {
    color: var(--white-warm);
  }

  /* Nav-on-light (all interior pages) — hamburger needs to contrast with paper */
  .nav.nav-on-light .nav-toggle {
    color: var(--midnight);
  }

  /* When menu is open, the button sits over the dark overlay — force white */
  body.nav-open .nav-toggle {
    color: var(--white-warm);
    position: fixed;
    top: var(--space-md);
    right: var(--edge-pad);
    z-index: 30;
  }
  body.nav-open .nav-toggle .nav-toggle-bars,
  body.nav-open .nav-toggle .nav-toggle-bars::before,
  body.nav-open .nav-toggle .nav-toggle-bars::after {
    background: var(--white-warm);
  }
  /* But the middle bar goes transparent (it's the one that morphs to X's center) */
  body.nav-open .nav-toggle .nav-toggle-bars {
    background: transparent;
  }
}

/* Nav dropdown only shows on hover on desktop (above 900px) */
@media (min-width: 901px) {
  .nav-toggle { display: none; }
}

/* Mid-width: ensure the submenu doesn't overflow off-screen right edge */
@media (min-width: 901px) and (max-width: 1100px) {
  .submenu {
    left: auto;
    right: -1rem;
  }
}

/* ----- Print basics ----- */

@media print {
  .nav, .nav-fade, footer, .hero-actions { display: none; }
  .hero { min-height: auto; color: var(--midnight); }
  .hero-image { display: none; }
  body { background: white; color: black; }
}

/* ==========================================================================
   Cookie Consent modal — appended to styles.css
   ========================================================================== */

.nv-consent[hidden] { display: none; }

.nv-consent {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md, 1.5rem);
}

.nv-consent-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 27, 54, 0.55);
  backdrop-filter: blur(2px);
}

.nv-consent-dialog {
  position: relative;
  width: 100%;
  max-width: 32rem;
  background: var(--paper, #F7F1E4);
  color: var(--midnight, #0B1B36);
  border: 1px solid var(--rule, #B5A582);
  border-radius: 2px;
  box-shadow: 0 20px 60px rgba(11, 27, 54, 0.25);
  animation: nv-consent-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes nv-consent-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nv-consent-inner {
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.nv-consent-title {
  font-family: var(--font-display, 'EB Garamond', Georgia, serif);
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-md, 1.5rem) 0;
  color: var(--midnight, #0B1B36);
}

.nv-consent-body {
  font-family: var(--font-body, 'Manrope', system-ui, sans-serif);
  font-size: var(--text-body-sm, 0.9375rem);
  line-height: 1.6;
  color: var(--midnight-ink, #1A2B47);
}

.nv-consent-body p {
  margin: 0 0 var(--space-sm, 1rem) 0;
}
.nv-consent-body p:last-child { margin-bottom: 0; }

.nv-consent-body strong { font-weight: 600; }

.nv-consent-policy a {
  color: var(--bronze, #8E5A2E);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.nv-consent-policy a:hover { color: var(--bronze-deep, #6F4520); }

.nv-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm, 1rem);
  margin-top: var(--space-lg, 2rem);
}

.nv-consent-actions .btn {
  flex: 1 1 auto;
  min-width: 0;
}

/* Make the consent modal lock scroll on the page underneath */
body.nv-consent-open {
  overflow: hidden;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .nv-consent-dialog { animation: none; }
}

/* Mobile: stack buttons */
@media (max-width: 480px) {
  .nv-consent-actions { flex-direction: column; }
  .nv-consent-actions .btn { width: 100%; }
}

/* Cookie consent: ensure Decline button is legible on the modal background */
.nv-consent-actions .btn-ghost {
  color: var(--midnight);
  border: 1px solid var(--rule);
}
.nv-consent-actions .btn-ghost:hover {
  color: var(--midnight-deep);
  background: var(--limestone);
}


/* === Back-to-top button v4 === */
.back-to-top {
  position: fixed;
  inset-inline-end: clamp(1rem, 2.5vw, 2.25rem);
  inset-block-end: clamp(1rem, 2.5vw, 2.25rem);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #9A6B3E;
  color: #0C1E3E;
  border: 1px solid #7A5530;
  display: grid; place-items: center;
  cursor: pointer;
  z-index: 60;
  opacity: 0; visibility: hidden;
  transform: translateY(8px);
  transition: opacity .35s var(--ease-editorial), transform .35s var(--ease-editorial), visibility 0s linear .35s, background .25s var(--ease-editorial), color .25s var(--ease-editorial), border-color .25s var(--ease-editorial);
  box-shadow: 0 6px 18px rgba(10, 17, 28, 0.28);
  padding: 0;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); transition: opacity .35s var(--ease-editorial), transform .35s var(--ease-editorial), visibility 0s linear 0s, background .25s var(--ease-editorial), color .25s var(--ease-editorial), border-color .25s var(--ease-editorial); }
.back-to-top:hover { background: #0C1E3E; color: #FAF6EC; border-color: #9A6B3E; }
.back-to-top:focus-visible { outline: 2px solid #0C1E3E; outline-offset: 4px; }
.back-to-top svg { width: 18px; height: 18px; display: block; transition: transform .25s var(--ease-editorial); }
.back-to-top:hover svg { transform: translateY(-2px); }
@media (max-width: 720px) { .back-to-top { width: 42px; height: 42px; inset-inline-end: 1rem; inset-block-end: 1rem; } .back-to-top svg { width: 16px; height: 16px; } }
@media print { .back-to-top { display: none !important; } }
