/* Nav and footer. The frame the whole site sits in. */

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 18px;
  padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med) var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--border); }

.nav__brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; }
.nav__mark {
  width: 30px; height: 30px; flex: 0 0 auto;
  border-radius: 9px; background: var(--grad);
  display: grid; place-items: center; color: var(--bg);
  font-family: Georgia, "Times New Roman", serif; font-weight: 900; font-size: 17px;
  box-shadow: 0 6px 22px rgba(139, 92, 246, .45);
}

.nav__links { margin-inline: auto; }
.nav__links ul { display: flex; gap: clamp(14px, 1.7vw, 26px); }
.nav__links a {
  font-size: var(--step-0); font-weight: 600; color: var(--muted);
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a[aria-current="page"] { color: var(--text); }

.nav__end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav__burger { display: none; }

/* ---------- the menu, below the desktop link row ---------- */
@media (max-width: 1080px) {
  .nav__burger { display: inline-grid; }

  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0;
    margin: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--sh-card);
    display: block;
  }
  .nav__links ul {
    flex-direction: column; gap: 0;
    overflow: hidden;
    max-height: 0;
    padding-inline: var(--gutter);
    transition: max-height var(--t-med) var(--ease);
  }
  .nav__links li + li { border-top: 1px solid var(--border); }
  .nav__links a { display: block; padding: 15px 0; font-size: var(--step-1); }

  /* Never taller than the screen below the header, and scrollable if the
     links do not fit, so Contact is always reachable on a short phone. */
  .nav.is-open .nav__links ul { max-height: calc(100svh - var(--nav-h)); overflow-y: auto; overscroll-behavior: contain; }
  .nav:not(.is-open) .nav__links { border-bottom-color: transparent; box-shadow: none; }
}

@media (max-width: 520px) {
  .nav__cta { display: none; }             /* the menu carries it instead */
}

/* Theme toggle. Shows the icon of the theme you would switch TO,
   which is the convention people already read correctly. */
.theme__sun, .theme__moon { grid-area: 1 / 1; }
.theme { display: grid; }
:root .theme__sun  { display: block; }
:root .theme__moon { display: none; }
:root[data-theme="light"] .theme__sun  { display: none; }
:root[data-theme="light"] .theme__moon { display: block; }

@media (max-width: 880px) {
  .theme { margin-left: auto; }
}

/* ---------- footer ---------- */
.foot {
  position: relative; z-index: 2;
  margin-top: 0;               /* the section above already carries its own bottom space */
  padding-top: 54px;
  border-top: 1px solid var(--border);
}
.foot__grid {
  display: grid; gap: 34px;
  grid-template-columns: 1.4fr 1fr 1fr;
  padding-bottom: 40px;
}
@media (max-width: 760px) { .foot__grid { grid-template-columns: 1fr; gap: 26px; } }

.foot__who { margin-top: 12px; }
.foot__h {
  font-size: 11.5px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted-2); margin-bottom: 12px;
}
.foot ul { display: grid; gap: 9px; }
.foot a { color: var(--muted); font-size: var(--step--1); transition: color var(--t-fast) var(--ease); }
.foot a:hover { color: var(--text); }

.foot__base {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-block: 20px 40px;
  border-top: 1px solid var(--border);
}

/* ---------- floating WhatsApp button, bottom right on every page ---------- */
.wa-float {
  position: fixed; z-index: 60;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: #25D366; color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.wa-float svg { width: 32px; height: 32px; }
.wa-float:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0, 0, 0, .45); }
.wa-float:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
@media (max-width: 520px) {
  .wa-float { width: 52px; height: 52px; right: 14px; bottom: 14px; }
  .wa-float svg { width: 29px; height: 29px; }
}
/* Room under the footer's last line, so the button never sits on Privacy
   wherever the page column reaches the right edge of the screen. */
@media (max-width: 1280px) { .foot__base { padding-bottom: 96px; } }
