/* Shared chrome styles used across all pages */

:root {
  --bg: #f6f6f3;
  --footer-logo-url: url("../../img/SM_logo_black.png?v=20260226a");
}

html[data-theme="dark"] {
  --bg: #141618;
  --footer-logo-url: url("../../img/SM_logo_white.png?v=20260226a");
}

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

html.sm-preloader-active,
html.sm-preloader-active body {
  overflow: hidden !important;
  background: #000 !important;
}

.sm-site-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: #000;
  opacity: 1;
  visibility: visible;
  transition: opacity 420ms cubic-bezier(0.22, 1, 0.36, 1), visibility 420ms linear;
}

.sm-site-preloader.is-hiding {
  opacity: 0;
  visibility: hidden;
}

.sm-site-preloader video {
  width: min(66vw, 540px);
  max-height: 72vh;
  display: block;
  object-fit: contain;
}

@view-transition {
  navigation: auto;
}

::view-transition-group(root) {
  background: var(--bg);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 600ms;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  background: var(--bg);
}

::view-transition-old(root) {
  animation-name: blur-out-page;
}

::view-transition-new(root) {
  animation-name: blur-in-page;
}

@keyframes blur-out-page {
  from {
    opacity: 1;
    filter: blur(0px);
    transform: scale(1);
  }
  to {
    opacity: 0.78;
    filter: blur(7px);
    transform: scale(0.995);
  }
}

@keyframes blur-in-page {
  from {
    opacity: 0.78;
    filter: blur(7px);
    transform: scale(1.005);
  }
  to {
    opacity: 1;
    filter: blur(0px);
    transform: scale(1);
  }
}

.site-nav a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.33rem 0.7rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.site-nav a.current {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

.mobile-menu-links a {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.mobile-menu-links a.current,
.mobile-menu-links a[aria-current="page"] {
  border-color: transparent !important;
  background: transparent !important;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 1rem;
  padding-bottom: 1rem;
}

.footer-col {
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.footer-brand,
.footer-title {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.footer-copy,
.footer-small {
  margin: 0;
}

.footer-links {
  display: grid;
  gap: 0.3rem;
}

.footer-links a,
.footer-mail {
  text-decoration: none;
  color: var(--muted);
}

.footer-links a:hover,
.footer-mail:hover {
  color: var(--text);
}

.footer-top-btn {
  width: fit-content;
}

.footer-row {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

@media (max-width: 980px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .sm-site-preloader video {
    width: min(84vw, 420px);
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0ms;
  }
}

/* Global clickable affordance: make interactive controls clearly different from static boxes */
:where(
  a.button,
  button,
  .icon-btn,
  .text-btn,
  .chip,
  .tab-btn,
  .faq-trigger,
  .showcase-btn,
  .compare-chip,
  .layoutgen-generate,
  .mobile-submenu-toggle,
  .mobile-menu-close
):not(:disabled) {
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    background-color 0.22s ease,
    color 0.22s ease,
    opacity 0.22s ease;
}

:where(
  a.button,
  button,
  .icon-btn,
  .text-btn,
  .chip,
  .tab-btn,
  .showcase-btn,
  .compare-chip,
  .layoutgen-generate,
  .mobile-submenu-toggle,
  .mobile-menu-close
):not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px -20px rgba(0, 0, 0, 0.62);
}

:where(
  a.button,
  button,
  .icon-btn,
  .text-btn,
  .chip,
  .tab-btn,
  .faq-trigger,
  .showcase-btn,
  .compare-chip,
  .layoutgen-generate,
  .mobile-submenu-toggle,
  .mobile-menu-close
):not(:disabled):active {
  transform: translateY(0);
  box-shadow: none;
}

/* Keep static pills/chips visually non-interactive */
:where(.tag, .intro-pill, .legend-item, .flashlight-mini, .metric-card, .proof-grid .card) {
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  :where(
    a.button,
    button,
    .icon-btn,
    .text-btn,
    .chip,
    .tab-btn,
    .faq-trigger,
    .showcase-btn,
    .compare-chip,
    .layoutgen-generate,
    .mobile-submenu-toggle,
    .mobile-menu-close
  ):not(:disabled) {
    transition: none !important;
  }
}

/* Unified footer v2 */
.site-footer {
  position: relative;
  margin-top: 1.2rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 78%, transparent) !important;
  background:
    radial-gradient(1200px 340px at 14% -20%, color-mix(in srgb, var(--surface) 82%, transparent), transparent 70%),
    color-mix(in srgb, var(--bg) 90%, var(--surface) 10%) !important;
  color: var(--muted) !important;
  padding: 2rem 0 1.4rem !important;
}

.site-footer .footer-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)) !important;
  gap: 1rem !important;
  padding-bottom: 1.1rem !important;
}

.site-footer .footer-col {
  display: grid !important;
  gap: 0.5rem !important;
  align-content: start;
  padding: 0.9rem !important;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
}

.site-footer .footer-col:first-child {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, transparent), color-mix(in srgb, var(--surface) 86%, transparent));
}

.site-footer .footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  margin: 0 !important;
  color: var(--text) !important;
  font-weight: 650 !important;
  font-size: 1.02rem;
}

.site-footer .footer-brand::before {
  content: "";
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-block;
  border-radius: 9px;
  background-image: var(--footer-logo-url);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.site-footer .footer-title {
  margin: 0 !important;
  color: var(--text) !important;
  font-weight: 600 !important;
}

.site-footer .footer-copy,
.site-footer .footer-small {
  margin: 0 !important;
}

.site-footer .footer-links {
  display: grid !important;
  gap: 0.42rem !important;
}

.site-footer .footer-links a,
.site-footer .footer-mail {
  width: fit-content;
  text-decoration: none !important;
  color: var(--muted) !important;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1.5px;
  transition: color 0.22s ease, text-decoration-color 0.22s ease;
}

.site-footer .footer-links a:hover,
.site-footer .footer-links a:focus-visible,
.site-footer .footer-mail:hover,
.site-footer .footer-mail:focus-visible {
  color: var(--text) !important;
  text-decoration: underline !important;
  text-decoration-color: currentColor;
}

.site-footer .footer-top-btn {
  display: none !important;
}

.site-footer .footer-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap;
  gap: 0.55rem !important;
  border-top: 1px solid color-mix(in srgb, var(--line) 74%, transparent) !important;
  padding-top: 1rem !important;
}

.site-footer .footer-row p {
  margin: 0 !important;
}

.scroll-top-fab {
  position: fixed;
  right: clamp(14px, 2.5vw, 24px);
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  width: 44px;
  height: 44px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--text) 22%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 94%, var(--bg) 6%);
  color: var(--text);
  display: grid;
  place-items: center;
  z-index: 140;
  opacity: 0;
  transform: translateY(10px) scale(0.94);
  pointer-events: none;
  box-shadow: 0 10px 24px -16px rgba(0, 0, 0, 0.45);
  transition: opacity 0.24s ease, transform 0.24s ease, border-color 0.24s ease, background-color 0.24s ease;
}

.scroll-top-fab svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scroll-top-fab.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

body.menu-open .scroll-top-fab {
  opacity: 0 !important;
  pointer-events: none !important;
}

.scroll-top-fab:hover,
.scroll-top-fab:focus-visible {
  border-color: color-mix(in srgb, var(--text) 44%, var(--line));
  background: color-mix(in srgb, var(--surface) 76%, var(--text) 10%);
}

@media (max-width: 980px) {
  .site-footer .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 780px) {
  .site-footer {
    padding: 1.5rem 0 1.1rem !important;
  }

  .site-footer .footer-grid {
    grid-template-columns: 1fr !important;
  }

  .site-footer .footer-col {
    padding: 0.84rem !important;
  }

  .scroll-top-fab {
    right: 12px;
    width: 42px;
    height: 42px;
  }
}
