/* ═══════════════════════════════════════════════════════════════
   Marketing — design tokens, typography, animations, utilities
   Loaded by base.html for all marketing/public pages.
   ═══════════════════════════════════════════════════════════════ */

/* ── Prevent horizontal shift from scrollbar appearing/disappearing ── */
html { scrollbar-gutter: stable; }

/* ── Design Tokens ── */
:root {
  --background: hsl(0 0% 99%);
  --foreground: hsl(0 0% 8%);
  --card: hsl(0 0% 100%);
  --muted-foreground: hsl(0 0% 42%);
  --border: hsl(0 0% 90%);
  --mkt-sage: hsl(155 25% 46%);
  --mkt-sage-soft: hsl(155 25% 46% / 0.08);
  --mkt-sage-text: hsl(155 30% 38%);
  --mkt-body-color: hsl(0 0% 42%);
  --mkt-caption-color: hsl(0 0% 55%);
  --mkt-subtle-color: hsl(0 0% 72%);
  --mkt-card-border: hsl(0 0% 90%);
  --mkt-card-border-hover: hsl(0 0% 78%);
  --mkt-footer-bg: hsl(0 0% 5%);
  --mkt-footer-text: hsl(0 0% 60%);
  --mkt-footer-heading: hsl(155 30% 38%);
  --destructive: hsl(0 65% 50%);
  --mkt-bg-warm: hsl(40 12% 97%);
  --marketing-glass: hsl(0 0% 100% / 0.82);
  --marketing-glass-strong: hsl(0 0% 100% / 0.92);
  --marketing-glass-border: hsl(0 0% 0% / 0.06);
  --chip-bg: hsl(155 25% 46% / 0.08);
  --chip-border: hsl(155 25% 46% / 0.20);
  --chip-text: hsl(155 30% 38%);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-card: 12px;
  --radius-panel: 16px;
  --radius-button: 999px;
  --radius-input: 12px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 200ms;
  --duration-normal: 300ms;
  --duration-slow: 600ms;
  --duration-reveal: 700ms;
  --space-section: clamp(5rem, 8vw, 7rem);
  --space-gutter: clamp(1.25rem, 3vw, 2rem);
  --mk-button-height-compact: 2.5rem;
  --mk-button-height-regular: 2.75rem;
  --mk-font-display: 'Saans', ui-sans-serif, system-ui, sans-serif;
  --mk-font-body: 'Saans', ui-sans-serif, system-ui, sans-serif;
  --mk-font-mono: 'Saans', 'Roboto Mono', SFMono-Regular, Menlo, monospace;
}

/* ── Typography ── */
.marketing-eyebrow {
  font-family: var(--mk-font-mono);
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em;
}
.marketing-display {
  font-family: var(--mk-font-display);
  font-size: clamp(2.75rem, 6vw, 4.5rem); font-weight: 550;
  line-height: 1.08; letter-spacing: -0.025em;
}
.marketing-section {
  font-family: var(--mk-font-display);
  font-size: clamp(1.75rem, 4vw, 3rem); font-weight: 500;
  line-height: 1.12; letter-spacing: -0.02em;
}
.marketing-card-heading {
  font-family: var(--mk-font-display);
  font-size: clamp(1.125rem, 1.8vw, 1.5rem); font-weight: 500;
  line-height: 1.25; letter-spacing: -0.01em;
}
.marketing-subtitle {
  font-family: var(--mk-font-display);
  font-size: 1.125rem; font-weight: 500;
  line-height: 1.4; letter-spacing: -0.01em;
}
.marketing-body { font-family: var(--mk-font-body); font-size: 1rem; font-weight: 400; line-height: 1.6; color: var(--muted-foreground); }
.marketing-card-body { font-family: var(--mk-font-body); font-size: 0.9375rem; font-weight: 400; line-height: 1.6; }
.marketing-caption { font-family: var(--mk-font-body); font-size: 0.8125rem; font-weight: 400; line-height: 1.5; }
.marketing-cta {
  font-family: var(--mk-font-mono);
  font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.marketing-ui-label {
  font-family: var(--mk-font-mono);
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.marketing-footer-heading {
  font-family: var(--mk-font-body);
  font-size: 14px; font-weight: 500;
  letter-spacing: 0; line-height: 1.4;
}
.marketing-legal {
  font-family: var(--mk-font-mono);
  font-size: 9px; font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.06em;
  line-height: 1.7; opacity: 0.5;
}

/* ── Auth Inputs ── */
.auth-input {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid var(--mkt-card-border);
  border-radius: var(--radius-md);
  background: hsl(0 0% 97%);
  font-family: var(--mk-font-body);
  font-size: 0.9375rem; color: var(--foreground);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.auth-input::placeholder { color: var(--muted-foreground); }
.auth-input:focus {
  border-color: var(--mkt-sage);
  box-shadow: 0 0 0 3px hsl(155 25% 46% / 0.10);
}
.auth-submit {
  width: 100%; height: 46px;
  border: none; border-radius: var(--radius-button);
  background: var(--foreground); color: white;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
}
.auth-submit:disabled { opacity: 0.62; cursor: not-allowed; }
.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; width: 100%;
  border: 1px solid var(--mkt-card-border);
  border-radius: var(--radius-md);
  background: var(--card);
  font-size: 0.875rem; font-weight: 500; color: var(--foreground);
  text-decoration: none; cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.oauth-btn:hover {
  border-color: var(--mkt-card-border-hover);
  background: hsl(0 0% 98%);
  box-shadow: 0 1px 4px hsl(0 0% 0% / 0.04);
}

/* ── Auth pages: hide nav ── */
.auth-page nav { display: none !important; }
.auth-page body, .auth-page { padding-top: 0 !important; }

/* ── Base ── */
body {
  font-family: var(--mk-font-body);
  padding-top: 80px;
}

/* ── Scroll Reveal ── */
/* .reveal starts visible by default to prevent FOUC.
   JS adds .reveal-ready on below-fold elements to hide them,
   then .visible to animate them in on scroll. */
.reveal {
  transition: opacity var(--duration-reveal) var(--ease-out),
              transform var(--duration-reveal) var(--ease-out);
}
.reveal.reveal-ready {
  opacity: 0; transform: translateY(20px);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.stagger-1 { transition-delay: 100ms; }
.stagger-2 { transition-delay: 200ms; }
.stagger-3 { transition-delay: 400ms; }
.stagger-4 { transition-delay: 600ms; }

/* ── Button Lift ── */
.btn-lift {
  transition: transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) ease,
              background-color var(--duration-fast) ease,
              border-color var(--duration-fast) ease;
}
.btn-lift:hover { transform: translateY(-1px); box-shadow: 0 4px 12px hsl(0 0% 0% / 0.15); }
.btn-lift:active { transform: scale(0.97); }

/* ── Card Lift ── */
.card-lift {
  transition: transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) ease,
              border-color var(--duration-fast) ease;
}
.card-lift:hover {
  transform: translateY(-2px);
  border-color: var(--mkt-card-border-hover);
  box-shadow: 0 8px 24px hsl(0 0% 0% / 0.08);
}
.ask-card-lift {
  transition: transform var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease;
}
.ask-card-lift:hover {
  transform: translateY(-2px);
  border-color: var(--mkt-card-border-hover);
  box-shadow: 0 6px 20px hsl(0 0% 0% / 0.06);
}
.card-lift:hover .cta-underline,
.ask-card-lift:hover .cta-underline { text-decoration: underline; }

/* ── Arrow Slide ── */
.arrow-slide { transition: transform 170ms ease; }
.group:hover .arrow-slide,
.card-lift:hover .arrow-slide { transform: translateX(2px); }

/* ── Nav Link Underline ── */
.link-underline { position: relative; }
.link-underline::after {
  content: ''; position: absolute; bottom: -2px; left: 50%;
  width: 0; height: 1px; background: currentColor;
  transition: width 250ms var(--ease-out), left 250ms var(--ease-out);
}
.link-underline:hover::after { width: 60%; left: 20%; }

/* ── Hover utilities (replace inline onmouseover/onmouseleave) ── */
.hover-fg { transition: color 180ms ease; }
.hover-fg:hover { color: var(--foreground); }
.hover-light { transition: color 180ms ease; }
.hover-light:hover { color: hsl(0 0% 95%); }

/* Docs cards — border darkens on hover (e.g. mcp.html cards) */
.docs-card-hover { transition: border-color 180ms ease, box-shadow 180ms ease; }
.docs-card-hover:hover { border-color: var(--muted-foreground); }

/* Docs landing cards — border + subtle shadow on hover (overview.html) */
.docs-link-card-hover { transition: border-color 180ms ease, box-shadow 180ms ease; }
.docs-link-card-hover:hover { border-color: var(--mkt-card-border-hover); box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }

/* Table row tint on hover (example_companies_tbody.html) */
.row-hover { transition: background 180ms ease; }
.row-hover:hover { background: hsl(0 0% 98%); }

/* ── Section Backgrounds ── */
.section-warm { background-color: var(--mkt-bg-warm); }

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.reveal-ready { opacity: 1; transform: none; transition: none; }
  .btn-lift, .card-lift, .ask-card-lift { transition: none; }
  .btn-lift:hover, .card-lift:hover, .ask-card-lift:hover { transform: none; }
  .arrow-slide { transition: none; }
}

/* Mobile readability: lift sub-12px micro-text to 12px on small screens
   (WCAG soft floor + audit threshold). Desktop typography is unchanged;
   only small viewports get the bump. .marketing-legal stays smaller since
   it's intentionally de-emphasized footer fine-print, but >= 11px. */
@media (max-width: 768px) {
  .marketing-eyebrow,
  .marketing-ui-label {
    font-size: 12px;
  }
  .marketing-legal {
    font-size: 11px;
  }

  /* Sledgehammer: many marketing-page mockup cards (workflow assets, demo
     hero, infrastructure section) are styled with inline `font-size: 9-11px`
     attributes that can't be reached by a class selector. Bump every such
     element to the 12px floor on mobile. The `!important` is required to
     override the inline style. Desktop is unaffected (this rule only fires
     under the media query). */
  [style*="font-size: 9px"],
  [style*="font-size: 10px"],
  [style*="font-size: 11px"] {
    font-size: 12px !important;
  }
}
