/* =====================================================================
   Waterfront Financial — Main Stylesheet
   Ported 1:1 from prototype partials/head.html (shared CSS) +
   assets/css/fonts.css. Per-page styles live in pages/*.css and load
   only on their page template.
   ===================================================================== */

/* ===== FONTS (self-hosted variable fonts, latin subset) ===== */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../../../font/cinzel.woff2') format('woff2');
}

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../../../font/archivo.woff2') format('woff2');
}

/* ===== RESET ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Archivo', sans-serif; background: var(--deep-black); color: #fff; overflow-x: hidden; }
body.menu-open { overflow: hidden; }
img { display: block; max-width: 100%; }
a { text-decoration: none; }

/* ===== COLOR TOKENS ===== */
:root {
  --deep-black:    #0b1320;
  --warm-dark:     #1c2128;
  --dark-navy:     #0d1926;
  --navy:          #162636;
  --slate:         #1e3248;
  --slate-mid:     #2a4058;
  --slate-light:   #3a5570;
  --gold:          #B89F65;
  --gold-light:    #d4bc82;
  --cyan:          #5BA4C9;
  --cyan-deep:     #3D7A9E;
  --cyan-glow:     rgba(91,164,201,0.12);
  --white:         #ffffff;
  --white-soft:    rgba(255,255,255,0.85);
  --white-muted:   rgba(255,255,255,0.55);
  --white-faint:   rgba(255,255,255,0.25);
  --header-height: 88px;
}

/* ===== SECTION FRAMEWORK ===== */
.section {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.section-inner {
  max-width: 1145px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 5;
}
.texture-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 3;
}

/* Cream-to-transparent overlay used by footer variants that need to
   anchor a taller / denser CTA over the parallax photo without
   stretching the footer itself. Sits above the parallax image layers
   (implicit z-index auto) and below the content container (z:100). */
.cta-readability-overlay {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 900px;
  /* z-index: 2 sits above the parallax image layers (auto) but BELOW
     the diagram-to-footer wave transition (z-index: 3), so the wave
     shape that bleeds into the footer top via margin-bottom: -10vh
     stays visible over the overlay. Content container is z:100. */
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    #f9f8f6 0%,
    #f9f8f6 40%,
    rgba(249, 248, 246, 0) 100%
  );
}

/* Optional elements used by footer-exploring variant (and any future
   variant that needs an eyebrow label or a thin divider inside the CTA). */
.footer-cta .footer-eyebrow {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 1.5rem;
}
.footer-cta .footer-divider {
  width: 40px;
  height: 1px;
  background: var(--gold);
  margin: 1.75rem auto;
  opacity: 0.4;
}

/* ===== HERO HALFTONE RIPPLE (shared across all pages) =====
   Replaces the per-frame canvas ripple. Static halftone field via img,
   wave rings + strokes via CSS-animated divs (GPU-composited, zero JS). */
.hero-halftone {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 3;
  opacity: 0.55;
}
.ripple-ring,
.stroke-ring {
  position: absolute;
  left: 50%; top: 50%;
  /* 160vmax ensures the square ring is never clipped by hero aspect.
     Parent section needs overflow:hidden. */
  width: 160vmax; height: 160vmax;
  margin: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(0.05);
  will-change: transform, opacity;
}
.ripple-ring {
  z-index: 4;
  background-image: url('../../../img/hero-ring.webp');
  animation: hero-ripple-cw 15s linear infinite;
}
.ripple-ring.r2 {
  animation-name: hero-ripple-ccw;
  animation-delay: -7.5s;
}
.stroke-ring {
  z-index: 5;
  background-image: url('../../../img/hero-stroke.webp');
  animation: hero-stroke-ripple 10s linear infinite;
}
.stroke-ring.s2 { animation-delay: -5s; }
@keyframes hero-ripple-cw {
  0%   { transform: translate(-50%, -50%) scale(0.05) rotate(0deg);   opacity: 0;    }
  15%  { transform: translate(-50%, -50%) scale(0.22) rotate(2deg);   opacity: 0.07; }
  40%  { transform: translate(-50%, -50%) scale(0.55) rotate(6deg);   opacity: 0.35; }
  48%  { transform: translate(-50%, -50%) scale(0.66) rotate(7deg);   opacity: 0.12; }
  56%  { transform: translate(-50%, -50%) scale(0.77) rotate(8deg);   opacity: 0.35; }
  64%  { transform: translate(-50%, -50%) scale(0.88) rotate(9deg);   opacity: 0.10; }
  72%  { transform: translate(-50%, -50%) scale(0.97) rotate(10deg);  opacity: 0.35; }
  75%  { transform: translate(-50%, -50%) scale(1.00) rotate(10deg);  opacity: 0.35; }
  100% { transform: translate(-50%, -50%) scale(1.30) rotate(13deg);  opacity: 0;    }
}
@keyframes hero-ripple-ccw {
  0%   { transform: translate(-50%, -50%) scale(0.05) rotate(0deg);    opacity: 0;    }
  15%  { transform: translate(-50%, -50%) scale(0.22) rotate(-2deg);   opacity: 0.07; }
  40%  { transform: translate(-50%, -50%) scale(0.55) rotate(-6deg);   opacity: 0.35; }
  44%  { transform: translate(-50%, -50%) scale(0.61) rotate(-7deg);   opacity: 0.35; }
  52%  { transform: translate(-50%, -50%) scale(0.72) rotate(-7deg);   opacity: 0.15; }
  60%  { transform: translate(-50%, -50%) scale(0.83) rotate(-8deg);   opacity: 0.35; }
  68%  { transform: translate(-50%, -50%) scale(0.93) rotate(-9deg);   opacity: 0.08; }
  75%  { transform: translate(-50%, -50%) scale(1.00) rotate(-10deg);  opacity: 0.35; }
  100% { transform: translate(-50%, -50%) scale(1.30) rotate(-13deg);  opacity: 0;    }
}
@keyframes hero-stroke-ripple {
  0%   { transform: translate(-50%, -50%) scale(0.05); opacity: 0;    }
  15%  { transform: translate(-50%, -50%) scale(0.22); opacity: 0.07; }
  40%  { transform: translate(-50%, -50%) scale(0.55); opacity: 0.35; }
  75%  { transform: translate(-50%, -50%) scale(1.00); opacity: 0.35; }
  100% { transform: translate(-50%, -50%) scale(1.30); opacity: 0;    }
}

/* ===== STICKY HEADER ===== */
.sticky-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 0 2rem;
  z-index: 1005;
  background: transparent;
}
/* The frosted bar lives on a layer BEHIND the logo and nav: a backdrop-filter
   on the header itself made the browser flatten its contents (the logo) into
   an image — softer, sometimes stair-stepped edges once you scrolled
   (LOGO-JAGGED-NOTES.md, fix B). Same look, logo drawn as crisp vector. */
.sticky-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: transparent;
  pointer-events: none;
  transition: background 0.4s ease, backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease;
}
.sticky-header.scrolled::before {
  background: rgba(11, 19, 32, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.header-container {
  max-width: 1145px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--header-height);
}
.logo { width: 160px; }
.logo img { width: 100%; height: auto; }

/* ===== DESKTOP NAV ===== */
.main-nav {
  display: flex;
  list-style: none;
  gap: 1.6rem;
  align-items: center;
  height: 100%;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
}
.nav-link {
  color: var(--white-muted);
  text-decoration: none;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: color 0.3s;
  padding: 0.5rem 0;
}
.nav-link.active { color: var(--cyan); }
@media (hover: hover) {
  .nav-link:hover { color: var(--cyan); }
}
.nav-cta {
  border-radius: 24px;
  padding: 8px 20px;
  color: var(--white-soft) !important;
  font-size: 13px;
  letter-spacing: 1px;
  transition: all 0.3s;
}

/* ===== PILL PAIR: Contact + Account Access ===== */
.nav-pill-pair {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: 0.6rem;
}
.nav-ghost {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 8px 20px;
  background: rgba(255,255,255,0.04);
  color: var(--white-muted) !important;
  font-size: 13px;
  letter-spacing: 1px;
  position: relative;
  z-index: 1;
  transition: all 0.35s ease;
}
@media (hover: hover) {
  .nav-ghost:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.22);
    color: var(--white-soft) !important;
  }
}
/* Account Access: SVG-based notched border */
.nav-pill-pair .nav-cta {
  position: relative;
  z-index: 2;
  margin-left: 4px;
  border: none !important;
  background: none !important;
  padding: 8px 20px 8px 24px;
}
.cta-shape {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}
.cta-shape path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.5;
  transition: fill 0.45s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.cta-label {
  position: relative;
  z-index: 1;
  transition: color 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (hover: hover) {
  .nav-pill-pair .nav-cta:hover .cta-shape path {
    fill: var(--gold);
  }
  .nav-pill-pair .nav-cta:hover .cta-label {
    color: var(--deep-black);
  }
}

/* ===== SERVICES TRIGGER ===== */
.nav-plus {
  display: inline-block;
  vertical-align: middle;
  position: relative;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  margin-bottom: 1px;
  opacity: 0.55;
  transition: opacity 0.3s, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-plus::before,
.nav-plus::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
}
.nav-plus::before {
  width: 6px; height: 1.5px;
  transform: translate(-70%, 0) rotate(40deg);
}
.nav-plus::after {
  width: 6px; height: 1.5px;
  transform: translate(-30%, 0) rotate(-40deg);
}
/* Flip upward when overlay is open */
.nav-plus.is-open {
  opacity: 1;
  transform: rotate(180deg);
}
@media (hover: hover) {
  #services-trigger:hover .nav-plus {
    opacity: 1;
  }
}

/* ===== SERVICES FULL-SCREEN OVERLAY ===== */
.services-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(11, 19, 32, 0.92);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.services-overlay.active {
  opacity: 1;
  visibility: visible;
}
.services-overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
/* Shared circle-icon base: same size/position as hamburger button */
.services-overlay-back,
.services-overlay-close {
  position: absolute;
  top: calc((var(--header-height) - 44px) / 2);
  right: 2rem;
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: var(--white-muted);
  cursor: pointer;
  z-index: 10;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.4s, border-color 0.4s, box-shadow 0.4s;
  padding: 0;
  line-height: 1;
}
/* Back arrow: only visible on mobile when opened from mobile menu */
.services-overlay-back {
  display: none;
}
.services-overlay-back span {
  font-size: 1.1rem;
  font-weight: 300;
  display: block;
  margin-top: -1px;
}
.services-overlay.show-back .services-overlay-back {
  display: flex;
}
@media (hover: hover) {
  .services-overlay-back:hover,
  .services-overlay-close:hover {
    color: var(--cyan);
    border-color: var(--cyan);
    box-shadow: 0 0 20px rgba(91,164,201,0.15);
  }
}
/* × close: visible on desktop, hidden on mobile when back arrow shows */
.services-overlay-close {
  position: absolute;
  transition: color 0.4s, transform 0.5s, border-color 0.4s, box-shadow 0.4s;
}
.services-overlay-close::before,
.services-overlay-close::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
}
.services-overlay-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
.services-overlay-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
.services-overlay.show-back .services-overlay-close {
  display: none;
}
@media (hover: hover) {
  .services-overlay-close:hover {
    transform: rotate(90deg);
  }
}
.services-overlay-content {
  position: relative;
  z-index: 5;
  text-align: center;
}
.services-overlay-label {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--white-muted);
  margin-bottom: 3rem;
}
.services-overlay-circles {
  display: flex;
  gap: 3rem;
  align-items: center;
  justify-content: center;
}
.overlay-circle-wrap {
  position: relative;
  width: 260px;
  height: 260px;
}
.outer-pulse-canvas {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 0;
}
.overlay-circle {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1.5px solid var(--cyan-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: all 0.4s ease;
  background: rgba(91,164,201,0.04);
  transform: scale(0.9);
  opacity: 0;
  overflow: hidden;
  z-index: 1;
}
.services-overlay.active .overlay-circle {
  transform: scale(1);
  opacity: 1;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.services-overlay.active .overlay-circle:nth-child(2) {
  transition-delay: 0.08s;
}
.services-overlay.active .overlay-circle:nth-child(3) {
  transition-delay: 0.16s;
}
.circle-ripple-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}
.overlay-circle span {
  position: relative;
  z-index: 5;
  font-size: 14px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--white-soft);
  font-weight: 400;
  line-height: 1.7;
  padding: 0 1.5rem;
  transition: color 0.3s;
}
@media (hover: hover) {
  .overlay-circle:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 40px rgba(91,164,201,0.15), 0 0 80px rgba(91,164,201,0.07);
    background: rgba(91,164,201,0.08);
  }
  .overlay-circle:hover span { color: var(--white); }
}


@media (max-width: 700px) {
  .services-overlay-circles {
    flex-direction: column;
    gap: 2.5rem;
  }
  .overlay-circle-wrap {
    width: 200px;
    height: 200px;
  }
  .overlay-circle {
    width: 200px;
    height: 200px;
  }
  .overlay-circle span {
    font-size: 12px;
    letter-spacing: 2px;
  }
  /* overlay buttons already match hamburger position via base styles */
}

/* ===== MOBILE MENU ===== */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--white-muted);
  cursor: pointer;
  padding: 0;
  z-index: 1003;
  position: relative;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease, filter 0.3s ease;
}
.mobile-menu-btn .hamburger {
  display: block; width: 22px; height: 2px; background: currentColor;
  position: relative; transition: all 0.3s ease;
}
.mobile-menu-btn .hamburger::before, .mobile-menu-btn .hamburger::after {
  content: ''; display: block; width: 22px; height: 2px; background: currentColor;
  position: absolute; transition: all 0.3s ease;
}
.mobile-menu-btn .hamburger::before { top: -7px; }
.mobile-menu-btn .hamburger::after { bottom: -7px; }
/* Active: collapse to × with thinner lines */
.mobile-menu-btn.active .hamburger {
  background: transparent;
}
.mobile-menu-btn.active .hamburger::before {
  top: 0; left: 50%;
  height: 1.5px; width: 18px;
  transform: translateX(-50%) rotate(45deg);
}
.mobile-menu-btn.active .hamburger::after {
  top: 0; bottom: auto; left: 50%;
  height: 1.5px; width: 18px;
  transform: translateX(-50%) rotate(-45deg);
}
/* Hamburger hover: lines + ring go cyan with glow */
@media (hover: hover) {
  .mobile-menu-btn:hover {
    color: var(--cyan);
  }
  .mobile-menu-btn:hover .hamburger-ring circle {
    stroke: var(--cyan);
  }
  .mobile-menu-btn.active:hover {
    filter: drop-shadow(0 0 12px rgba(91,164,201,0.2));
  }
}
/* SVG circle ring: hidden by default, draws clockwise when active */
.hamburger-ring {
  position: absolute;
  top: 0; left: 0;
  width: 44px; height: 44px;
  pointer-events: none;
  transform: rotate(-90deg); /* start at 12 o'clock */
}
.hamburger-ring circle {
  fill: none;
  stroke: rgba(255,255,255,0.15);
  stroke-width: 1;
  stroke-dasharray: 131.95; /* 2πr = 2π×21 ≈ 131.95 */
  stroke-dashoffset: 131.95; /* fully hidden */
  transition: stroke-dashoffset 0.22s ease-in, stroke 0.3s ease; /* undraw + color */
}
.mobile-menu-btn.active .hamburger-ring circle {
  stroke-dashoffset: 0; /* fully drawn */
  transition: stroke-dashoffset 0.28s ease-out 0.12s; /* draw: 280ms, 120ms delay */
}

.mobile-menu-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px);
  opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 1001;
}
.mobile-menu-overlay.active { opacity: 1; visibility: visible; }

.mobile-menu {
  position: fixed; top: 0; right: -100vw; width: 100vw; height: 100vh;
  background: rgba(11, 19, 32, 0.97); z-index: 1002; transition: transform 0.3s ease;
  display: flex; flex-direction: column; padding: 6rem 2rem 2rem;
}
.mobile-menu.active { transform: translateX(-100vw); }
.mobile-nav-list { list-style: none; }
.mobile-nav-item { border-bottom: 1px solid rgba(255,255,255,0.06); }
.mobile-nav-link {
  display: block; color: var(--white-soft); padding: 1.25rem 0; font-size: 1.1rem; transition: color 0.3s; cursor: pointer;
}
@media (hover: hover) {
  .mobile-nav-link:hover { color: var(--gold); }
}
.mobile-nav-item.has-submenu .mobile-nav-link { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.mobile-nav-item.has-submenu .mobile-nav-link::after {
  content: '+'; font-size: 1.4rem; transition: transform 0.3s;
}
.mobile-nav-item.has-submenu.open .mobile-nav-link::after { transform: rotate(45deg); }
.mobile-submenu {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
}
.mobile-nav-item.has-submenu.open .mobile-submenu { max-height: 200px; }
.mobile-submenu a {
  display: block; color: var(--white-muted); padding: 0.75rem 0 0.75rem 1.5rem;
  font-size: 0.95rem; transition: color 0.3s;
}
@media (hover: hover) {
  .mobile-submenu a:hover { color: var(--gold); }
}

/* ===== SCROLL ANIMATIONS ===== */
.anim-fade-up { opacity: 0; transform: translateY(30px); }

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .main-nav { display: none; }
  .mobile-menu-btn { display: flex; }
}

/* =====================================================================
   WP INTEGRATION ADDITIONS (not from prototype)
   ===================================================================== */

/* Skip link: visually hidden until keyboard focus */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 3000;
  background: var(--deep-black);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  font-size: 14px;
}
.skip-link:focus {
  left: 0;
}

/* WP admin bar offset for the fixed header (logged-in views only) */
body.admin-bar .sticky-header { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .sticky-header { top: 46px; }
}
