/* D² Scheduler — Marketing site styles */

:root {
  --stone: #336B87;
  --stone-700: #2A5A73;
  --mist: #90AFC5;
  --mist-50: #E8EFF4;
  --shadow: #2A3132;
  --shadow-90: rgba(42, 49, 50, 0.9);
  --margarita: #AFC590;
  --margarita-50: #E8F0DC;
  --bg: #F4F7F8;
  --surface: #FFFFFF;
  --text: #2A3132;
  --text-2: #336B87;
  --muted: #6F7F84;
  --border: #C8D5DB;
  --border-2: #DCE5EA;
  --success: #5E8A4C;
  --warn: #B89A4A;
  --error: #873E33;

  /* Accent (toggleable via tweaks: stone | shadow | margarita) */
  --accent: var(--stone);
  --accent-fg: #FFFFFF;

  --r-sm: 2px;
  --r: 4px;
  --r-lg: 6px;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ========== Layout ========== */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 720px) { .container { padding: 0 20px; } }

.row { display: flex; }
.grid { display: grid; }

/* ========== Header ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 247, 248, 0.85);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--border-2);
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px; height: 28px;
  background: var(--shadow);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  border-radius: 2px;
  position: relative;
}
.brand-mark::after {
  content: "²";
  position: absolute;
  top: 2px; right: 4px;
  font-size: 10px;
  color: var(--margarita);
}
.brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
}
.brand-name sup { font-size: 0.7em; }
.brand-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  border-left: 1px solid var(--border);
  margin-left: 6px;
  padding-left: 10px;
}
.nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav a {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text);
  border-radius: var(--r);
  transition: background 120ms ease, color 120ms ease;
}
.nav a:hover { background: var(--mist-50); color: var(--accent); }
.nav a.active { color: var(--accent); }

.header-cta { display: flex; gap: 8px; align-items: center; }

/* Mobile hamburger button — hidden on desktop */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0;
  cursor: pointer;
  position: relative;
  align-items: center;
  justify-content: center;
}
.mobile-menu-btn span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 180ms ease, opacity 120ms ease, top 180ms ease;
}
.mobile-menu-btn span:nth-child(1) { top: 12px; }
.mobile-menu-btn span:nth-child(2) { top: 19px; }
.mobile-menu-btn span:nth-child(3) { top: 26px; }
.mobile-menu-btn.is-open span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.mobile-menu-btn.is-open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.is-open span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

/* Mobile menu drawer */
.mobile-menu-scrim {
  position: fixed;
  inset: 64px 0 0 0;
  background: rgba(42, 49, 50, 0.4);
  z-index: 49;
  animation: scrimIn 180ms ease;
}
.mobile-menu {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border-2);
  padding: 16px 20px 24px;
  display: grid;
  gap: 4px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  animation: menuIn 200ms ease;
}
@keyframes scrimIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.mobile-menu-link {
  padding: 14px 12px;
  font-size: 16px;
  color: var(--text);
  border-radius: var(--r);
  border-bottom: 1px solid var(--border-2);
}
.mobile-menu-link:last-of-type { border-bottom: none; }
.mobile-menu-link.active { color: var(--accent); }
.mobile-menu-cta {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.mobile-menu-cta .btn { width: 100%; justify-content: center; }

@media (max-width: 920px) {
  .nav { display: none; }
}

@media (max-width: 720px) {
  /* Swap desktop CTAs for hamburger on phones */
  .header-cta { display: none; }
  .mobile-menu-btn { display: inline-flex; }
  /* Tighten brand sub-label on narrow screens */
  .brand-sub { display: none; }
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 80ms ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
}
.btn-primary:hover { background: var(--stone-700); }
[data-accent="shadow"] .btn-primary:hover { background: #1A1F20; }
[data-accent="margarita"] .btn-primary:hover { background: #94AE74; }
.btn-dark {
  background: var(--shadow);
  color: #fff;
}
.btn-dark:hover { background: #1A1F20; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--shadow); }
.btn-link {
  background: transparent;
  color: var(--accent);
  padding: 6px 0;
  border-radius: 0;
}
.btn-link:hover { color: var(--shadow); }
.btn-arrow { font-family: var(--mono); }

.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ========== Type ========== */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow .dash { width: 24px; height: 1px; background: var(--border); display: inline-block; }
.eyebrow .num { color: var(--accent); }

h1, h2, h3, h4 { letter-spacing: -0.02em; margin: 0; color: var(--text); }
h1 { font-size: 48px; line-height: 1.05; font-weight: 600; }
h2 { font-size: 36px; line-height: 1.1; font-weight: 600; }
h3 { font-size: 20px; line-height: 1.3; font-weight: 600; }
h4 { font-size: 16px; line-height: 1.35; font-weight: 600; }
.lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text);
  max-width: 60ch;
}
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

@media (max-width: 720px) {
  h1 { font-size: 36px; }
  h2 { font-size: 28px; }
  .lead { font-size: 16px; }
}

/* ========== Section ========== */
section { padding: 96px 0; border-top: 1px solid var(--border-2); }
section:first-of-type { border-top: none; }
.section-head { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 36px; }
/* Stack h2 + lead vertically, left-aligned — removes the giant horizontal gap
   that justify-content: space-between caused when the lead column was short */
.section-head .title-row { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.section-head h2 { max-width: 28ch; }
.section-head .title-row .lead { flex: 1 1 auto !important; max-width: 64ch; }
.section-head .lead { color: var(--muted); }

@media (max-width: 720px) { section { padding: 64px 0; } }

/* ========== Hero ========== */
.hero { padding: 80px 0 64px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}
@media (max-width: 1020px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }
.hero h1 { letter-spacing: -0.025em; }
.hero h1 .accent { color: var(--accent); }
.hero .lead { margin-top: 20px; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-meta {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta .dot { width: 6px; height: 6px; background: var(--margarita); display: inline-block; border-radius: 50%; }

/* ========== Cards / panels ========== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.panel-h {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.panel-h .lights { display: flex; gap: 6px; }
.panel-h .lights span { width: 8px; height: 8px; border-radius: 50%; background: var(--border); display: inline-block; }
.panel-h .crumbs { display: flex; gap: 8px; align-items: center; }
.panel-h .crumbs .sep { color: var(--border); }
.panel-b { padding: 16px; }

/* ========== Footer ========== */
footer.site-footer {
  border-top: 1px solid var(--border-2);
  background: var(--surface);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 32px;
}
@media (max-width: 920px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h5 {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 500;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-grid a { font-size: 14px; color: var(--text); }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-2);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* ========== Reveal animation ========== */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ========== Utility ========== */
.tag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--muted);
  display: inline-block;
}
.tag-stone { color: var(--stone); border-color: var(--mist); background: var(--mist-50); }
.tag-margarita { color: var(--success); border-color: var(--margarita); background: var(--margarita-50); }
.tag-warn { color: var(--warn); border-color: #E8DBA8; background: #FAF5E5; }
.tag-error { color: var(--error); border-color: #E5C2BC; background: #F8ECE9; }

.kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: var(--surface);
  color: var(--muted);
}

.divider { height: 1px; background: var(--border-2); margin: 32px 0; }

/* ========== Mobile: stack everything ========== */
@media (max-width: 720px) {
  /* No horizontal scroll from any oversized child */
  html, body { overflow-x: hidden; max-width: 100%; }

  /* Hero "320 WO groups" badge sits at right: -8 — pull it back into view on mobile */
  .hero [style*="bottom: -22"][style*="right: -8"] {
    right: 0 !important;
    bottom: -16px !important;
    font-size: 10px !important;
    padding: 8px 10px !important;
  }

  /* LiveView panel header pill has minWidth: 240 — let it shrink so the chrome doesn't overflow */
  .panel-h .crumbs > span[style*="minWidth"],
  .panel-h .crumbs > span[style*="min-width"] {
    min-width: 0 !important;
    flex: 1 1 auto;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Any inline element using a fixed wide pixel width — let it shrink */
  [style*="maxWidth: 880"], [style*="max-width: 880"] { max-width: 100% !important; }

  /* repeat(N, 1fr) — collapse multi-column layouts to a single column */
  [style*="grid-template-columns: repeat(2"],
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns: repeat(5"],
  [style*="grid-template-columns: repeat(6"] {
    grid-template-columns: 1fr !important;
  }

  /* fr-based 2-column splits used for hero / recap / two-up sections */
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: 1.1fr 1fr"],
  [style*="grid-template-columns: 1.2fr 1fr"],
  [style*="grid-template-columns: 1.3fr 1fr"],
  [style*="grid-template-columns: 1.4fr 1fr"],
  [style*="grid-template-columns: 1fr 1.1fr"],
  [style*="grid-template-columns: 1fr 1.2fr"],
  [style*="grid-template-columns: 1fr 1.3fr"],
  [style*="grid-template-columns: 1fr 1.4fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Tour-section sidebar (280px tab nav) */
  [style*="grid-template-columns: 280px 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Pricing card row with 1px divider */
  [style*="grid-template-columns: 1fr 1px 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Pricing connector layout (1fr | 80px arrow | 1fr) */
  [style*="grid-template-columns: 1fr 80px 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Inline sticky panels (e.g. tour tab-nav at top: 88px) become static
     so they flow with the stack instead of pinning above the content */
  [style*="position: sticky"] {
    position: static !important;
  }

  /* Big inter-column gaps look excessive once stacked */
  [style*="gap: 64px"],
  [style*="gap: 64;"],
  [style*="gap: 48px"],
  [style*="gap: 48;"] {
    gap: 32px !important;
  }
  [style*="gap: 40px"],
  [style*="gap: 40;"],
  [style*="gap: 32px"] {
    gap: 24px !important;
  }

  /* Hero/heading sizing for narrow phones */
  .hero h1, h1 { font-size: 32px !important; line-height: 1.08 !important; }
  h2 { font-size: 26px !important; }
  .lead { font-size: 15px !important; }

  /* Section heads — their inline title-row already wraps via flex-wrap */
  .section-head .title-row { flex-direction: column; align-items: flex-start; }
  .section-head h2 { max-width: none; }

  /* Hero actions and inline button rows */
  .hero-actions, .header-cta { flex-wrap: wrap; }

  /* Footer collapses to single column on small phones */
  .footer-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
  .footer-bottom { flex-direction: column; gap: 8px; align-items: flex-start; }

  /* Tour tabs on mobile: rendered as a vertical list, no sticky */
  .container > div > div > div[style*="grid-template-columns: 1fr"] { gap: 8px; }
}
