/*
 * Homepage-family surface + Light Chrome canon.
 * Path B: public-family override layer. Does NOT mutate shared portal tokens in
 * canonical-chrome-v1.css (Ken / Ernie remain on their existing Light chrome).
 *
 * Surfaces: home (ph-home), mission (toward-mission), contact, login.
 */

/* ---- Light chrome tokens (white / ice-blue glass) ---- */

body.ph-home.aa-chrome-page,
body.toward-mission.aa-chrome-page,
body.aa-contact-page.aa-chrome-page,
body.aa-login-page.aa-chrome-page {
  --aa-chrome-light-bg: #fbfdff;
  --aa-chrome-light-surface: rgba(247, 251, 255, 0.88);
  --aa-chrome-light-surface-strong: rgba(255, 255, 255, 0.94);
  --aa-chrome-light-text: #141820;
  --aa-chrome-light-muted: #3a4554;
  --aa-chrome-light-glass-bg: linear-gradient(
    166deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(247, 251, 255, 0.92) 48%,
    rgba(238, 245, 252, 0.94) 100%
  );
  --aa-chrome-light-glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.96);
  --aa-chrome-light-glass-shadow: 0 16px 46px rgba(17, 42, 63, 0.12);
  --aa-chrome-light-glass-border: 1px solid rgba(167, 199, 225, 0.36);
}

/* ---- Contact / Login page foundations ---- */

html[data-theme="light"] body.aa-contact-page.aa-chrome-page,
html[data-theme="light"] body.aa-login-page.aa-chrome-page {
  color: #141820;
  background:
    radial-gradient(ellipse 120% 55% at 18% 0%, rgba(206, 228, 248, 0.42) 0%, transparent 58%),
    radial-gradient(ellipse 100% 65% at 88% 18%, rgba(192, 218, 242, 0.28) 0%, transparent 62%),
    radial-gradient(ellipse 90% 50% at 50% 100%, rgba(255, 255, 255, 0.65) 0%, transparent 68%),
    linear-gradient(180deg, #f7fbff 0%, #eef5fc 28%, #e8f1fa 52%, #f3f9ff 78%, #ffffff 100%);
  background-repeat: no-repeat;
}

html[data-theme="dark"] body.aa-contact-page.aa-chrome-page,
html[data-theme="stellar"] body.aa-contact-page.aa-chrome-page {
  background:
    radial-gradient(circle at 70% 12%, rgba(48, 84, 118, 0.16), transparent 34%),
    linear-gradient(180deg, #050b12 0%, #07111c 54%, #081521 100%);
}

html[data-theme="stellar"] body.aa-login-page.aa-chrome-page {
  background:
    radial-gradient(circle at 72% 18%, rgba(53, 92, 128, 0.14), transparent 32%),
    radial-gradient(circle at 8% 78%, rgba(43, 79, 112, 0.1), transparent 28%),
    linear-gradient(180deg, #03070c 0%, #07111c 54%, #081521 100%);
}

/* ---- Light glass blades (contact / login; home+mission also covered for coherence) ---- */

html[data-theme="light"] body.ph-home .aa-chrome-header .glass-bar,
html[data-theme="light"] body.toward-mission .aa-chrome-header .glass-bar,
html[data-theme="light"] body.aa-contact-page .aa-chrome-header .glass-bar,
html[data-theme="light"] body.aa-login-page .aa-chrome-header .glass-bar {
  border: var(--aa-chrome-light-glass-border) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.94) 42%, rgba(244, 250, 255, 0.88) 100%),
    radial-gradient(ellipse 58% 150% at 92% -12%, rgba(193, 226, 250, 0.3) 0%, transparent 62%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset -1px 0 0 rgba(255, 255, 255, 0.26),
    0 16px 46px rgba(17, 42, 63, 0.12) !important;
}

/* ---- Light drawer: white / ice-blue floating glass (not gray slab) ---- */

html[data-theme="light"] body.ph-home .aa-chrome-drawer,
html[data-theme="light"] body.toward-mission .aa-chrome-drawer,
html[data-theme="light"] body.aa-contact-page .aa-chrome-drawer,
html[data-theme="light"] body.aa-login-page .aa-chrome-drawer {
  border: 1px solid rgba(167, 199, 225, 0.42) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.94) 36%, rgba(244, 250, 255, 0.9) 100%),
    radial-gradient(ellipse 70% 120% at 88% -20%, rgba(193, 226, 250, 0.28) 0%, transparent 62%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 0 rgba(136, 173, 205, 0.12),
    0 18px 52px rgba(17, 42, 63, 0.14) !important;
}

html[data-theme="light"] body.ph-home .aa-chrome-drawer__links a.aa-chrome-nav-link,
html[data-theme="light"] body.toward-mission .aa-chrome-drawer__links a.aa-chrome-nav-link,
html[data-theme="light"] body.aa-contact-page .aa-chrome-drawer__links a.aa-chrome-nav-link,
html[data-theme="light"] body.aa-login-page .aa-chrome-drawer__links a.aa-chrome-nav-link {
  color: rgba(20, 24, 32, 0.92) !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

html[data-theme="light"] body.ph-home .aa-chrome-drawer__links a.aa-chrome-nav-link[data-nav-state="current"],
html[data-theme="light"] body.toward-mission .aa-chrome-drawer__links a.aa-chrome-nav-link[data-nav-state="current"],
html[data-theme="light"] body.aa-contact-page .aa-chrome-drawer__links a.aa-chrome-nav-link[data-nav-state="current"],
html[data-theme="light"] body.aa-login-page .aa-chrome-drawer__links a.aa-chrome-nav-link[data-nav-state="current"] {
  color: #141820 !important;
}

html[data-theme="light"] body.ph-home .aa-chrome-drawer__links a.aa-chrome-nav-link[data-nav-state="current"]::before,
html[data-theme="light"] body.toward-mission .aa-chrome-drawer__links a.aa-chrome-nav-link[data-nav-state="current"]::before,
html[data-theme="light"] body.aa-contact-page .aa-chrome-drawer__links a.aa-chrome-nav-link[data-nav-state="current"]::before,
html[data-theme="light"] body.aa-login-page .aa-chrome-drawer__links a.aa-chrome-nav-link[data-nav-state="current"]::before {
  background: #1f5f73 !important;
  opacity: 0.9 !important;
  box-shadow: 0 0 8px rgba(31, 95, 115, 0.35) !important;
}

html[data-theme="light"] body.ph-home .public-nav-toggle__bars,
html[data-theme="light"] body.ph-home .public-nav-toggle__bars::before,
html[data-theme="light"] body.ph-home .public-nav-toggle__bars::after,
html[data-theme="light"] body.toward-mission .public-nav-toggle__bars,
html[data-theme="light"] body.toward-mission .public-nav-toggle__bars::before,
html[data-theme="light"] body.toward-mission .public-nav-toggle__bars::after,
html[data-theme="light"] body.aa-contact-page .public-nav-toggle__bars,
html[data-theme="light"] body.aa-contact-page .public-nav-toggle__bars::before,
html[data-theme="light"] body.aa-contact-page .public-nav-toggle__bars::after,
html[data-theme="light"] body.aa-login-page .public-nav-toggle__bars,
html[data-theme="light"] body.aa-login-page .public-nav-toggle__bars::before,
html[data-theme="light"] body.aa-login-page .public-nav-toggle__bars::after {
  color: rgba(20, 24, 32, 0.88) !important;
}

html[data-theme="light"] body.ph-home .aa-chrome-home-slot,
html[data-theme="light"] body.toward-mission .aa-chrome-home-slot,
html[data-theme="light"] body.aa-contact-page .aa-chrome-home-slot,
html[data-theme="light"] body.aa-login-page .aa-chrome-home-slot {
  color: rgba(20, 24, 32, 0.88) !important;
}

/* ---- Contact secondary + footer readability ---- */

body.aa-contact-page .pc-secondary__links a.aa-chrome-footer-link {
  color: var(--pc-muted);
  font-size: clamp(0.72rem, 1.6vw, 0.82rem);
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid rgba(191, 220, 246, 0.28);
  padding-bottom: 3px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

html[data-theme="light"] body.aa-contact-page .pc-secondary__links a.aa-chrome-footer-link {
  color: rgba(20, 24, 32, 0.78);
  border-bottom-color: rgba(31, 95, 115, 0.24);
}

html[data-theme="dark"] body.aa-contact-page .pc-secondary__links a.aa-chrome-footer-link,
html[data-theme="stellar"] body.aa-contact-page .pc-secondary__links a.aa-chrome-footer-link {
  color: rgba(222, 233, 244, 0.72);
  border-bottom-color: rgba(191, 220, 246, 0.24);
}

body.aa-contact-page .pc-secondary__links a.aa-chrome-footer-link:hover,
body.aa-contact-page .pc-secondary__links a.aa-chrome-footer-link:focus-visible {
  color: var(--pc-ink);
  border-bottom-color: currentColor;
  outline: none;
}

html[data-theme="light"] body.aa-contact-page .aa-chrome-footer-fixture__inner,
html[data-theme="light"] body.aa-login-page .aa-chrome-footer-fixture__inner {
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.85);
}

html[data-theme="light"] body.aa-contact-page .aa-chrome-footer-link:not([aria-current="page"]),
html[data-theme="light"] body.aa-login-page .aa-chrome-footer-link:not([aria-current="page"]) {
  color: rgba(20, 24, 32, 0.72) !important;
  text-shadow: none !important;
}

html[data-theme="light"] body.aa-contact-page .aa-chrome-footer-link[aria-current="page"],
html[data-theme="light"] body.aa-login-page .aa-chrome-footer-link[aria-current="page"] {
  color: #141820 !important;
}

@media (prefers-reduced-motion: reduce) {
  body.aa-contact-page .pc-secondary__links a.aa-chrome-footer-link {
    transition: none;
  }
}

/* ---- Public-family edge-to-edge chrome (no exterior gutters) ---- */

html:has(body.ph-home.aa-chrome-page),
html:has(body.toward-mission.aa-chrome-page),
html:has(body.aa-contact-page.aa-chrome-page),
html:has(body.aa-login-page.aa-chrome-page) {
  scrollbar-gutter: auto;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  overscroll-behavior-x: none;
}

body.ph-home.aa-chrome-page,
body.toward-mission.aa-chrome-page,
body.aa-contact-page.aa-chrome-page,
body.aa-login-page.aa-chrome-page {
  overflow-x: clip;
  max-width: 100%;
  min-width: 0;
  overscroll-behavior-x: none;
}

body.ph-home.aa-chrome-page .aa-chrome-header,
body.toward-mission.aa-chrome-page .aa-chrome-header,
body.aa-contact-page.aa-chrome-page .aa-chrome-header,
body.aa-login-page.aa-chrome-page .aa-chrome-header {
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
}

body.ph-home.aa-chrome-page .header-bars,
body.toward-mission.aa-chrome-page .header-bars,
body.aa-contact-page.aa-chrome-page .header-bars,
body.aa-login-page.aa-chrome-page .header-bars {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
}

body.ph-home.aa-chrome-page .glass-bar,
body.toward-mission.aa-chrome-page .glass-bar,
body.aa-contact-page.aa-chrome-page .glass-bar,
body.aa-login-page.aa-chrome-page .glass-bar {
  border-radius: 0;
}

body.ph-home.aa-chrome-page,
body.toward-mission.aa-chrome-page,
body.aa-contact-page.aa-chrome-page,
body.aa-login-page.aa-chrome-page {
  --aa-family-compact-chrome-inset: calc(
    env(safe-area-inset-top, 0px) + 10px + var(--tm-top-height, 62px) + var(--tm-chrome-gap, 8px) +
      var(--tm-controls-height, 40px) + 16px + 12px
  );
}

@media (min-width: 761px) {
  body.tm-chrome-family-compact {
    --aa-family-compact-chrome-inset: calc(
      env(safe-area-inset-top, 0px) + 10px + var(--tm-top-height, 68px) + var(--tm-chrome-gap, 9px) +
        var(--tm-controls-height, 42px) + 16px + 12px
    );
  }
}

body.tm-chrome-family-compact .aa-chrome-header-spacer {
  display: block !important;
  height: var(--aa-chrome-header-height, var(--aa-family-compact-chrome-inset)) !important;
  flex: 0 0 auto !important;
}
