/* ==========================================================================
   AGP — Global chrome: header, mobile menu, footer, floating actions
   ========================================================================== */

/* --------------------------------------------------------------------------
   Wordmark (temporary logo until AGP has one)
   -------------------------------------------------------------------------- */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex: none;
}

.wordmark__mark {
  font-family: var(--font-mark);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  line-height: 1;
  margin-right: -0.2em;
  background: var(--gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.wordmark__tag {
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  padding-top: var(--safe-top);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(170%) blur(18px);
  backdrop-filter: saturate(170%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: box-shadow var(--dur-base) ease, border-color var(--dur-base) ease, background-color 0.35s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 12px 30px -24px rgba(40, 26, 10, 0.5);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--header-h);
}

.nav {
  display: flex;
  gap: clamp(18px, 2.2vw, 30px);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.nav a {
  position: relative;
  padding: 6px 0;
  transition: color var(--dur-base) ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1.5px;
  background: var(--gold-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}

.nav a:hover::after,
.nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav a[aria-current="page"] {
  color: var(--accent-strong);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle .icon-sun,
[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

.menu-toggle {
  display: none;
}

/* --------------------------------------------------------------------------
   Mobile menu (grouped list inside a sheet)
   -------------------------------------------------------------------------- */
.menu-group {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  border-radius: 16px;
  background: var(--bg-2);
  overflow: hidden;
}

.menu-group a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  color: var(--ink);
  transition: background-color var(--dur-fast) ease;
}

.menu-group li:last-child a {
  border-bottom: 0;
}

.menu-group a:active {
  background: var(--bg-3);
}

.menu-group a[aria-current="page"] {
  color: var(--accent-strong);
}

.menu-group svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.menu-settings {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--bg-2);
}

.menu-settings__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 8vw, 110px) 0 calc(28px + var(--safe-bottom));
  background: var(--night-gold-glow), var(--footer-bg);
  color: var(--on-night-muted);
  font-size: 0.92rem;
}

.site-footer__watermark {
  position: absolute;
  right: -2vw;
  bottom: -4vw;
  z-index: 0;
  font-family: var(--font-mark);
  font-size: clamp(8rem, 26vw, 22rem);
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: 0.08em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(207, 165, 101, 0.16);
  pointer-events: none;
  user-select: none;
}

.site-footer__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
}

.site-footer .wordmark__tag {
  border-left-color: rgba(255, 255, 255, 0.18);
  color: var(--on-night-muted);
}

.site-footer__about {
  max-width: 34ch;
  margin-top: 22px;
}

.site-footer h2 {
  margin-bottom: 16px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-300);
}

.site-footer ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  transition: color var(--dur-base) ease;
}

.site-footer a:hover {
  color: var(--gold-200);
}

.site-footer__bottom {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: clamp(48px, 6vw, 80px);
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.site-footer__disclaimer {
  flex-basis: 100%;
  max-width: 90ch;
  margin: 0;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.42);
}

/* --------------------------------------------------------------------------
   Floating actions
   -------------------------------------------------------------------------- */
.fab-stack {
  position: fixed;
  z-index: var(--z-fab);
  right: calc(18px + var(--safe-right));
  bottom: calc(18px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  transition: transform var(--dur-sheet) var(--ease-ios), opacity var(--dur-base) ease;
}

body.has-sheet .fab-stack {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

.fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 56px;
  height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: 22px 8px 22px 8px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow-float);
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-base) ease;
}

.fab:active {
  transform: scale(0.94);
}

.fab svg {
  flex: none;
  width: 24px;
  height: 24px;
}

.fab--ai {
  position: relative;
  background: var(--night);
  color: var(--gold-200);
  border: 1px solid rgba(207, 165, 101, 0.4);
}

.fab--ai::before {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(207, 165, 101, 0.5);
  border-radius: 26px 10px 26px 10px;
  animation: fab-pulse 2.8s var(--ease-out) infinite;
}

.fab--wa {
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  background: var(--wa);
  color: #fff;
}

.fab--wa svg {
  width: 24px;
  height: 24px;
}

@keyframes fab-pulse {
  0% {
    opacity: 0.9;
    transform: scale(0.94);
  }

  70%,
  100% {
    opacity: 0;
    transform: scale(1.14);
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .wordmark__tag {
    display: none;
  }
}

@media (max-width: 960px) {
  .nav,
  .header-controls .segmented,
  .header-controls .theme-toggle {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
  }
}

@media (max-width: 860px) {
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__grid > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .header-cta {
    display: none;
  }

  .fab--ai .fab__label {
    display: none;
  }

  .fab--ai {
    width: 58px;
    padding: 0;
  }
}

@media (max-width: 640px) {
  /* Leaves room so the floating actions never cover the legal disclaimer. */
  .site-footer {
    padding-bottom: calc(150px + var(--safe-bottom));
  }
}
