/* Tokens live on :root for dedicated family sites, and on .family-shell
   when this sheet is imported into an existing product (One Mail marketing). */
:root,
.family-shell {
  color-scheme: light dark;
  --ink: #171827;
  --ink-soft: #5e6074;
  --page: #f7f6fc;
  --page-deep: #efedf8;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --surface-strong: #e9e5f7;
  --line: rgba(71, 62, 110, 0.13);
  --line-strong: rgba(101, 84, 183, 0.28);
  --violet: #6754cf;
  --violet-strong: #4f3cae;
  --lavender: #a99be9;
  --sky: #86bfe9;
  --mint: #8fd5bd;
  --blush: #e9aebf;
  --amber: #e8c37f;
  --teal: #5aa89a;
  --ok: #168e68;
  --error: #c94c63;
  --shadow: rgba(80, 63, 148, 0.16);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --nav-height: 72px;
  --family-ease: cubic-bezier(0.32, 0.72, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root,
  .family-shell {
    --ink: #f4f1ff;
    --ink-soft: #aaa7bd;
    --page: #101019;
    --page-deep: #161522;
    --surface: rgba(31, 29, 46, 0.72);
    --surface-solid: #1c1a29;
    --surface-strong: #262239;
    --line: rgba(206, 196, 255, 0.12);
    --line-strong: rgba(177, 159, 255, 0.3);
    --violet: #a997ff;
    --violet-strong: #c1b4ff;
    --lavender: #b9aaf4;
    --sky: #88c7ef;
    --mint: #87d6bb;
    --blush: #ecaebf;
    --amber: #e9c47e;
    --teal: #7dcec0;
    --ok: #62d3a9;
    --error: #f17d91;
    --shadow: rgba(0, 0, 0, 0.38);
  }
}

.family-nav {
  position: sticky;
  z-index: 15;
  top: 0;
  width: 100%;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--page) 78%, transparent);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}

.family-nav-inner {
  width: min(1380px, calc(100% - 40px));
  height: var(--nav-height);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.family-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: max-content;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 750;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.family-brand img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  box-shadow: 0 8px 22px var(--shadow);
}

.family-apps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-left: auto;
}

.family-app {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  text-decoration: none;
  transition: transform 420ms var(--family-ease), background 420ms var(--family-ease);
}

.family-app img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.family-app:hover,
.family-app:focus-visible {
  background: color-mix(in srgb, var(--surface-strong) 70%, transparent);
  transform: translateY(-1px);
}

.family-app.is-active {
  background: var(--surface-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.family-app-name {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 2;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--page);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 220ms var(--family-ease), transform 220ms var(--family-ease);
}

.family-app:hover .family-app-name,
.family-app:focus-visible .family-app-name {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.family-cta {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--page) !important;
  font-size: 0.84rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 420ms var(--family-ease);
}

.family-cta:hover {
  transform: translateY(-1px);
}

.family-cta:active {
  transform: scale(0.98);
}

.family-menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.family-menu-btn span,
.family-menu-btn span::before,
.family-menu-btn span::after {
  display: block;
  width: 18px;
  height: 1.5px;
  margin: 0 auto;
  background: currentColor;
  border-radius: 99px;
  transition: transform 420ms var(--family-ease), opacity 220ms var(--family-ease);
}

.family-menu-btn span {
  position: relative;
}

.family-menu-btn span::before,
.family-menu-btn span::after {
  position: absolute;
  left: 0;
  content: "";
}

.family-menu-btn span::before {
  top: -6px;
}

.family-menu-btn span::after {
  top: 6px;
}

.family-menu-btn.is-open span {
  background: transparent;
}

.family-menu-btn.is-open span::before {
  top: 0;
  transform: rotate(45deg);
}

.family-menu-btn.is-open span::after {
  top: 0;
  transform: rotate(-45deg);
}

.family-overlay {
  position: fixed;
  inset: 0;
  z-index: 14;
  display: none;
  padding: calc(var(--nav-height) + 24px) 20px 40px;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
}

.family-overlay.is-open {
  display: block;
}

.family-overlay-list {
  display: grid;
  gap: 8px;
  max-width: 420px;
  margin: 0 auto;
}

.family-overlay-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
}

.family-overlay-link img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.family-overlay-link.is-active {
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.family-footer {
  width: min(1380px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 56px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.family-footer a {
  color: var(--ink-soft);
  text-decoration: none;
}

.family-footer a:hover {
  color: var(--ink);
}

.family-footer-brand {
  color: var(--ink);
  font-weight: 760;
}

.family-footer-spacer {
  flex: 1;
}

@media (max-width: 1023px) {
  .family-apps,
  .family-cta {
    display: none;
  }

  .family-menu-btn {
    display: grid;
    place-items: center;
    margin-left: auto;
  }
}

@media (max-width: 767px) {
  :root,
  .family-shell {
    --nav-height: 64px;
  }

  .family-nav-inner {
    width: calc(100% - 32px);
  }

  .family-brand span {
    font-size: 0.92rem;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .family-nav,
  .family-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--page);
  }
}
