/* calendar.app marketing — shared responsive styles */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; }

/* ── Header / nav ── */
.site-nav-wrap {
  position: sticky;
  top: 16px;
  z-index: 100;
  padding: 0 16px;
}

.site-nav {
  max-width: 1232px;
  margin: 0 auto;
  background: #FFFFFF;
  border-radius: 100px;
  box-shadow: 0 2px 10px rgba(14, 61, 44, 0.06);
  position: relative;
}

.site-nav.is-open {
  border-radius: 28px;
}

.site-nav-inner {
  padding: 0 12px 0 20px;
  min-height: 64px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.site-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #6BAA75;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #545454;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-nav-links a,
.site-nav-links span {
  font-size: 15px;
  font-weight: 700;
  color: #545454;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.site-btn-ghost {
  background: transparent;
  color: #545454;
  border: 1.5px solid #545454;
  padding: 9px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.site-btn-primary {
  background: #84DD63;
  color: #545454;
  border: none;
  padding: 11px 22px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #EAF4EC;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.site-nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #545454;
  border-radius: 2px;
  position: relative;
}

.site-nav-toggle span::before,
.site-nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: #545454;
  border-radius: 2px;
}

.site-nav-toggle span::before { top: -6px; }
.site-nav-toggle span::after { top: 6px; }

.site-nav.is-open .site-nav-toggle span {
  background: transparent;
}

.site-nav.is-open .site-nav-toggle span::before {
  top: 0;
  transform: rotate(45deg);
}

.site-nav.is-open .site-nav-toggle span::after {
  top: 0;
  transform: rotate(-45deg);
}

.site-nav-drawer {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px 20px 24px;
  border-top: 1px solid #E6EAE7;
}

.site-nav-drawer a {
  display: block;
  padding: 14px 8px;
  font-size: 16px;
  font-weight: 700;
  color: #545454;
  text-decoration: none;
  border-radius: 12px;
}

.site-nav-drawer a:hover {
  background: #EAF4EC;
  text-decoration: none;
}

.site-nav-drawer-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding-top: 8px;
}

.site-nav-drawer-cta .site-btn-ghost,
.site-nav-drawer-cta .site-btn-primary {
  text-align: center;
  padding: 14px 20px;
}

body.nav-open {
  overflow: hidden;
}

/* ── Stack helpers ── */
.stack-mobile-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ── Footer bottom ── */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Legal page tweaks */
.legal-hero h1 {
  word-wrap: break-word;
}

/* Explicit stack class — reliable with Design Canvas / React inline styles */
.m-stack {
  width: 100%;
}

@media (max-width: 1024px) {
  .m-stack {
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
  }

  .m-stack.m-stack-tight {
    gap: 16px !important;
  }
}

@media (max-width: 900px) {
  .site-nav-links,
  .site-nav-cta {
    display: none !important;
  }

  .site-nav-toggle {
    display: flex;
  }

  .site-nav.is-open .site-nav-drawer {
    display: flex;
  }

  .site-nav-wrap {
    top: 10px;
    padding: 0 12px;
  }

  .site-nav-inner {
    height: 60px;
    padding: 0 8px 0 16px;
  }

  /* Force every marked grid to one column */
  .m-stack,
  .m-stack[style] {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Footer / denser sections keep consistent vertical rhythm */
  footer .m-stack,
  .m-stack.m-stack-footer {
    gap: 32px !important;
  }

  /* Hero stats: one below another */
  .hero-stats,
  .hero-stats[style] {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 20px !important;
  }

  .hero-stats > .hero-stat-divider {
    display: none !important;
  }

  /* Fallback: any grid with multiple tracks (React may add spaces in style attr) */
  [style*="grid-template-columns"][style*="1fr"][style*="1fr"]:not([style*="repeat(7"]) {
    grid-template-columns: 1fr !important;
  }

  [style*="grid-template-columns"][style*="repeat(2"]:not([style*="repeat(7"]),
  [style*="grid-template-columns"][style*="repeat(3"]:not([style*="repeat(7"]),
  [style*="grid-template-columns"][style*="repeat(4"]:not([style*="repeat(7"]),
  [style*="grid-template-columns"][style*="repeat(5"]:not([style*="repeat(7"]),
  [style*="grid-template-columns"][style*="repeat(6"]:not([style*="repeat(7"]) {
    grid-template-columns: 1fr !important;
  }

  /* Keep week calendar as 7 cols */
  [style*="grid-template-columns"][style*="repeat(7"] {
    grid-template-columns: repeat(7, 1fr) !important;
  }

  /* Section padding */
  section[style*="padding:130px"],
  section[style*="padding:150px"],
  section[style*="padding:56px"] {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  section[style*="padding:130px"] {
    padding-top: 72px !important;
    padding-bottom: 72px !important;
  }

  section[style*="padding:150px"] {
    padding-top: 80px !important;
    padding-bottom: 80px !important;
  }

  footer[style*="padding:72px"] {
    padding: 56px 20px 28px !important;
  }

  /* Typography */
  h1[style*="font-size:58px"] { font-size: 36px !important; }
  h1[style*="font-size:48px"] { font-size: 32px !important; }
  h2[style*="font-size:46px"],
  h2[style*="font-size:42px"],
  h2[style*="font-size:38px"] { font-size: 28px !important; }

  /* Hero visual */
  .hero-visual,
  [style*="height:560px"] {
    height: 360px !important;
    margin-top: 24px;
  }

  [style*="right:-40px"] {
    right: 8px !important;
    left: auto !important;
    width: min(180px, 46vw) !important;
  }

  [style*="left:-20px"] {
    left: 8px !important;
    width: min(180px, 46vw) !important;
  }

  /* CTA rows wrap / stack */
  .cta-row,
  div[style*="display:flex"][style*="gap:16px"][style*="margin-bottom:56px"],
  div[style*="display:flex"][style*="justify-content:center"][style*="gap:16px"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .cta-row > a,
  .cta-row > div,
  div[style*="display:flex"][style*="gap:16px"][style*="margin-bottom:56px"] > a,
  div[style*="display:flex"][style*="gap:16px"][style*="margin-bottom:56px"] > div,
  div[style*="display:flex"][style*="justify-content:center"][style*="gap:16px"] > a,
  div[style*="display:flex"][style*="justify-content:center"][style*="gap:16px"] > div {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  /* Hero stats */
  .hero-stats,
  div[style*="display:flex"][style*="gap:28px"] {
    flex-wrap: wrap !important;
    gap: 16px !important;
  }

  .hero-stats > div[style*="width:1px"],
  div[style*="display:flex"][style*="gap:28px"] > div[style*="width:1px"] {
    display: none !important;
  }

  /* Product image height */
  [style*="height:440px"] {
    height: 260px !important;
  }

  /* Code block overflow */
  pre, code, [style*="font-family:ui-monospace"], [style*="font-family:Menlo"] {
    overflow-x: auto;
    max-width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .legal {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .legal-hero {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}

@media (max-width: 480px) {
  .site-brand-name { font-size: 16px; }

  h1[style*="font-size:58px"],
  h1[style*="font-size:48px"] { font-size: 28px !important; }

  [style*="height:560px"] {
    height: 300px !important;
  }

  /* Hide floating hero cards on very small screens to avoid overflow */
  [style*="animation:floatCard"] {
    display: none !important;
  }
}
