/*
 * Shared site chrome: theme tokens, header, buttons, theme switch, and footer.
 * Loaded on every page. The active theme lives on <html data-theme>, set by
 * assets/js/site.js before first paint.
 */

/* Dark is the brand default; it uses the palette the site has always had. */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1214;
  --bg-2: #0f1a1f;
  --surface: #12201f;
  --surface-2: #0f1b1d;
  --surface-3: #162827;
  --text: #ffffff;
  --text-soft: #d1d5db;
  --muted: #9ca3af;
  --subtle: #6b7280;
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(255, 255, 255, .16);
  --accent: #2dd4bf;
  --accent-2: #52a2ff;
  --accent-text: #2dd4bf;
  --accent-soft: #9fd0ff;
  --accent-line: rgba(45, 212, 191, .32);
  --gradient: linear-gradient(90deg, #2dd4bf 0%, #52a2ff 100%);
  --tint: linear-gradient(110deg, rgba(45, 212, 191, .1), rgba(82, 162, 255, .1));
  --tint-strong: linear-gradient(110deg, rgba(45, 212, 191, .16), rgba(82, 162, 255, .16));
  --grid-line: rgba(45, 212, 191, .07);
  --risk-high-bg: rgba(239, 83, 80, .18);
  --risk-high-text: #ff8b87;
  --risk-medium-bg: rgba(240, 184, 75, .18);
  --risk-medium-text: #f5c875;
  --risk-clear-bg: rgba(45, 212, 191, .15);
  --risk-clear-text: #2dd4bf;
  --shadow: 0 24px 64px rgba(0, 0, 0, .44), 0 7px 20px rgba(0, 0, 0, .24);
  --shadow-small: 0 15px 36px rgba(0, 0, 0, .34), 0 4px 12px rgba(0, 0, 0, .2);
  --header-bg: rgba(10, 18, 20, .95);
  --header-border: rgba(45, 212, 191, .5);
  --btn-primary-bg: linear-gradient(90deg, rgba(48, 207, 194, .25) 0%, rgba(82, 162, 255, .25) 100%), rgba(15, 26, 31, .4);
  --btn-primary-border: rgba(45, 212, 191, .4);
  --btn-primary-border-hover: rgba(45, 212, 191, .7);
  --btn-primary-text: #ffffff;
  --btn-primary-shadow: 0 0 12px rgba(45, 212, 191, .15), 0 4px 12px rgba(0, 0, 0, .2);
  --btn-primary-shadow-hover: 0 0 20px rgba(45, 212, 191, .3), 0 4px 16px rgba(0, 0, 0, .3);
  --btn-secondary-bg: rgba(255, 255, 255, .03);
  --btn-secondary-bg-hover: rgba(255, 255, 255, .07);
  --footer-bg: #0a1214;
  --logo: url("/assets/icons/logo-taxtherapist.svg");
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-2: #f3f8f8;
  --surface: #ffffff;
  --surface-2: #f6fafa;
  --surface-3: #edf5f4;
  --text: #0f1a1f;
  --text-soft: #334047;
  --muted: #56636b;
  --subtle: #6b7780;
  --line: #e1eaea;
  --line-strong: #cfdcdb;
  --accent: #0d9488;
  --accent-2: #2563eb;
  --accent-text: #0f766e;
  --accent-soft: #1d4ed8;
  --accent-line: rgba(13, 148, 136, .3);
  --gradient: linear-gradient(90deg, #0d9488 0%, #2563eb 100%);
  --tint: linear-gradient(110deg, rgba(13, 148, 136, .07), rgba(37, 99, 235, .07));
  --tint-strong: linear-gradient(110deg, rgba(13, 148, 136, .12), rgba(37, 99, 235, .12));
  --grid-line: rgba(13, 148, 136, .08);
  --risk-high-bg: #fde8e7;
  --risk-high-text: #b42318;
  --risk-medium-bg: #fff3d6;
  --risk-medium-text: #8a5a00;
  --risk-clear-bg: #dff5f1;
  --risk-clear-text: #0f766e;
  --shadow: 0 26px 70px rgba(15, 26, 31, .1), 0 7px 22px rgba(15, 26, 31, .05);
  --shadow-small: 0 14px 36px rgba(15, 26, 31, .08), 0 3px 10px rgba(15, 26, 31, .04);
  --header-bg: rgba(255, 255, 255, .92);
  --header-border: rgba(13, 148, 136, .35);
  --btn-primary-bg: linear-gradient(90deg, rgba(13, 148, 136, .1) 0%, rgba(37, 99, 235, .1) 100%), #ffffff;
  --btn-primary-border: rgba(13, 148, 136, .35);
  --btn-primary-border-hover: rgba(13, 148, 136, .6);
  --btn-primary-text: #0f1a1f;
  --btn-primary-shadow: 0 4px 12px rgba(13, 148, 136, .1);
  --btn-primary-shadow-hover: 0 8px 20px rgba(13, 148, 136, .18);
  --btn-secondary-bg: #ffffff;
  --btn-secondary-bg-hover: #f1f6f6;
  --footer-bg: #f3f8f8;
  --logo: url("/assets/icons/logo-taxtherapist-on-light.svg");
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Urbanist", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* The logo is a CSS background so only the variant for the active theme downloads. */
.brand-logo {
  display: block;
  aspect-ratio: 233 / 59;
  background: var(--logo) left center / contain no-repeat;
}

/* ---------- Header ---------- */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.topbar {
  width: min(1240px, calc(100% - 2 * clamp(22px, 4.2vw, 56px)));
  min-height: 68px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
}

.header-wordmark {
  grid-column: 1;
  justify-self: start;
  width: 132px;
  line-height: 0;
  text-decoration: none;
}

.topbar .primary-nav {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 26px;
}

.topbar .primary-nav a,
.mobile-menu a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: color .32s cubic-bezier(.22, 1, .36, 1);
}

.topbar .primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -6px;
  height: 1px;
  background: currentColor;
  transition: right .38s cubic-bezier(.22, 1, .36, 1);
}

.topbar .primary-nav a:hover,
.topbar .primary-nav a[aria-current="page"] {
  color: var(--text);
}

.topbar .primary-nav a:hover::after,
.topbar .primary-nav a:focus-visible::after {
  right: 0;
}

.topbar .primary-nav a[aria-current="page"]::after {
  right: 0;
  bottom: -8px;
  height: 2px;
  border-radius: 99px;
  background: var(--gradient);
}

.nav-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-button,
.theme-toggle {
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--btn-secondary-bg);
  color: var(--text);
  cursor: pointer;
  transition: transform .28s cubic-bezier(.22, 1, .36, 1), background-color .28s ease, border-color .28s ease;
}

.menu-button:hover,
.theme-toggle:hover {
  transform: translateY(-1px);
  background: var(--btn-secondary-bg-hover);
  border-color: var(--accent-line);
}

.menu-button svg,
.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Show the icon of the theme the button switches to. */
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.menu-button { display: none; }
.menu-button .icon-close { display: none; }
.menu-button[aria-expanded="true"] .icon-open { display: none; }
.menu-button[aria-expanded="true"] .icon-close { display: block; }

.mobile-menu {
  display: none;
  width: min(1240px, calc(100% - 2 * clamp(18px, 5vw, 24px)));
  margin: 0 auto;
  padding: 0 0 14px;
}

.mobile-menu.open { display: block; }

.mobile-menu a {
  display: block;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

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

/* ---------- Buttons ---------- */
.button {
  position: relative;
  min-height: 50px;
  padding: 0 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .28s cubic-bezier(.22, 1, .36, 1), box-shadow .28s cubic-bezier(.22, 1, .36, 1), background-color .28s ease, border-color .28s ease, color .28s ease;
}

.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }

.button.primary {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-border);
  color: var(--btn-primary-text);
  box-shadow: var(--btn-primary-shadow);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.button.primary:hover {
  border-color: var(--btn-primary-border-hover);
  box-shadow: var(--btn-primary-shadow-hover);
}

.button.secondary {
  background: var(--btn-secondary-bg);
  border-color: var(--line-strong);
  color: var(--text);
}

.button.secondary:hover {
  background: var(--btn-secondary-bg-hover);
  border-color: var(--accent-line);
}

.button.small {
  min-height: 42px;
  padding: 0 19px;
  font-size: 14px;
}

.button svg {
  width: 18px;
  height: 18px;
}

.arrow {
  font-size: 17px;
  line-height: 1;
  transition: transform .28s cubic-bezier(.22, 1, .36, 1);
}

.button:hover .arrow { transform: translateX(2px); }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 3px;
}

@media (max-width: 920px) {
  .topbar {
    display: flex;
    gap: 10px;
  }
  .topbar .primary-nav { display: none; }
  .nav-actions { margin-left: auto; }
  .nav-actions .button.secondary { display: none; }
  .menu-button { display: grid; }
}

@media (max-width: 620px) {
  .topbar {
    width: min(1240px, calc(100% - 2 * clamp(18px, 5vw, 24px)));
    min-height: 60px;
  }
  .header-wordmark { width: 112px; }
  .nav-actions { gap: 6px; }
  .nav-actions .button.small {
    min-height: 40px;
    padding-inline: 14px;
    font-size: 13px;
  }
  .menu-button,
  .theme-toggle {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 380px) {
  .header-wordmark { width: 96px; }
  .nav-actions .button.small { padding-inline: 11px; }
  .nav-actions .button.small .arrow { display: none; }
}

/* ---------- Footer (same layout and content as before the redesign) ---------- */
.site-footer {
  width: 100%;
  padding: 40px 16px 32px;
  background: var(--footer-bg);
  border-top: 1px solid var(--line);
  font-family: "Urbanist", sans-serif;
  line-height: 1.5;
  text-align: left;
}

.site-footer .footer-inner {
  max-width: 1400px;
  margin: 0 auto;
}

.site-footer .footer-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.site-footer .footer-brand {
  max-width: 100%;
  text-align: center;
}

.site-footer .footer-logo {
  height: 40px;
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .07)) drop-shadow(0 2px 2px rgba(0, 0, 0, .06));
}

.site-footer .footer-logo a {
  display: inline-block;
  height: 100%;
}

.site-footer .footer-logo .brand-logo {
  display: inline-block;
  height: 100%;
  vertical-align: top;
}

.site-footer .footer-tagline {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.625;
}

.site-footer .footer-email {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.site-footer .footer-email a {
  color: var(--text);
  font-size: 12px;
  text-decoration: none;
  transition: color .2s ease;
}

.site-footer .footer-email a:hover { color: var(--accent); }

.site-footer .footer-disclaimer {
  width: 100%;
  margin: 0;
  color: var(--subtle);
  font-size: 9px;
  line-height: 1.625;
}

.site-footer .footer-social {
  display: flex;
  gap: 8px;
}

.site-footer .footer-social a {
  display: block;
  transition: opacity .2s ease;
}

.site-footer .footer-social a:hover { opacity: .8; }

.site-footer .footer-social img {
  display: block;
  width: 36px;
  height: 36px;
}

.site-footer .footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.site-footer .footer-copyright {
  order: 2;
  color: var(--subtle);
  font-size: 12px;
}

.site-footer .footer-legal {
  order: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.site-footer .footer-legal a,
.site-footer .footer-legal button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: color .2s ease;
}

.site-footer .footer-legal a:hover,
.site-footer .footer-legal button:hover { color: var(--text); }

@media (min-width: 640px) {
  .site-footer { padding-inline: 32px; }
}

@media (min-width: 768px) {
  .site-footer { padding: 64px 32px 40px; }
  .site-footer .footer-top {
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 40px;
  }
  .site-footer .footer-brand {
    max-width: 384px;
    text-align: left;
  }
  .site-footer .footer-logo {
    height: 48px;
    margin-bottom: 16px;
    justify-content: flex-start;
  }
  .site-footer .footer-tagline {
    margin-bottom: 16px;
    font-size: 14px;
  }
  .site-footer .footer-email { justify-content: flex-start; }
  .site-footer .footer-email a { font-size: 14px; }
  .site-footer .footer-disclaimer { font-size: 10px; }
  .site-footer .footer-social { gap: 12px; }
  .site-footer .footer-social img {
    width: 44px;
    height: 44px;
  }
  .site-footer .footer-bottom {
    flex-direction: row;
    gap: 0;
  }
  .site-footer .footer-copyright {
    order: 1;
    font-size: 14px;
  }
  .site-footer .footer-legal {
    order: 2;
    gap: 32px;
  }
  .site-footer .footer-legal a,
  .site-footer .footer-legal button { font-size: 14px; }
}

@media (min-width: 1024px) {
  .site-footer { padding-inline: 48px; }
  .site-footer .footer-disclaimer {
    font-size: 11px;
    white-space: nowrap;
  }
}

/* ---------- Legal pages: light theme for their Tailwind-styled content ---------- */
:root[data-theme="light"] .legal-page .taxtherapist-websire {
  background-color: var(--bg-2);
  color: var(--text);
}

:root[data-theme="light"] .legal-page main .bg-teal-500\/40 { background-color: rgba(45, 212, 191, .16); }
:root[data-theme="light"] .legal-page main .bg-blue-500\/40 { background-color: rgba(82, 162, 255, .16); }
:root[data-theme="light"] .legal-page main .text-white { color: var(--text); }
:root[data-theme="light"] .legal-page main .text-gray-300 { color: var(--text-soft); }
:root[data-theme="light"] .legal-page main .border-white\/10,
:root[data-theme="light"] .legal-page main .border-white\/20,
:root[data-theme="light"] .legal-page main .divide-white\/10 > * + * { border-color: var(--line-strong); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav-wrap *,
  .site-footer * {
    transition-duration: .01ms !important;
  }
}

/* index.css reserves room for the old fixed header; the new one is sticky and in flow. */
body.legal-page { padding-top: 0; }
