/* ============================================================
   M-Dash branding site — shared styles
   Mirrors the product's design tokens (sky-blue light theme)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  /* Brand — sky (mirrors product tokens) */
  --sky-50:  #F0F9FF;
  --sky-100: #E0F2FE;
  --sky-200: #BAE6FD;
  --sky-300: #7DD3FC;
  --sky-400: #38BDF8;
  --sky-500: #0EA5E9;
  --sky-600: #0284C7;
  --sky-700: #0369A1;
  --sky-800: #075985;
  --sky-900: #0C4A6E;

  /* Accent (tweakable) */
  --accent:        #0EA5E9;
  --accent-hover:  #0284C7;
  --accent-active: #0369A1;
  --accent-50:     #F0F9FF;
  --accent-100:    #E0F2FE;
  --accent-200:    #BAE6FD;
  --accent-glow:   rgba(14,165,233,0.16);

  /* Neutrals */
  --gray-50:  #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E3E8EF;
  --gray-300: #CDD5DF;
  --gray-400: #99A4B3;
  --gray-500: #6A7585;
  --gray-600: #4C5664;
  --gray-700: #364252;
  --gray-800: #202939;
  --gray-900: #0F172A;

  /* Status */
  --success: #059669;
  --success-bg: #D1FAE5;
  --warning: #EAA108;
  --warning-bg: #FEF3C7;
  --error:   #F22B2B;
  --error-bg: #FEE2E2;

  /* Semantic */
  --bg:        #FFFFFF;
  --bg-app:    #F8FAFC;
  --bg-subtle: #F0F9FF;
  --surface:   #FFFFFF;
  --border:    #E3E8EF;
  --border-strong: #CDD5DF;
  --text:      #202939;
  --text-2:    #4C5664;
  --text-3:    #6A7585;
  --text-4:    #99A4B3;

  /* Type */
  --sans: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  --serif: 'Instrument Serif', 'Times New Roman', serif;

  /* Radii */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 20px;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0,0,0,0.08), 0 1px 2px 0 rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px 0 rgba(14,165,233,0.08), 0 2px 4px 0 rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px 0 rgba(0,0,0,0.08), 0 4px 8px 0 rgba(0,0,0,0.04);
  --shadow-card: 0 1.9px 7px 0 rgba(0,0,0,0.01), 0 15px 56px 0 rgba(0,0,0,0.06);
  --shadow-float: 0 8px 32px var(--accent-glow), 0 2px 8px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.1px;
  text-wrap: pretty;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--accent-100); color: var(--accent-active); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

/* ───────── Layout primitives ───────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-wide {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ───────── Top nav ───────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 32px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.4px;
  font-size: 17px;
  color: var(--text);
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-active));
  position: relative;
  box-shadow: 0 4px 12px var(--accent-glow);
  flex-shrink: 0;
}
.brand-mark::before, .brand-mark::after {
  content: "";
  position: absolute;
  background: rgba(255,255,255,0.95);
  border-radius: 1px;
}
.brand-mark::before {
  left: 7px; top: 7px;
  width: 3px; height: 14px;
}
.brand-mark::after {
  right: 7px; top: 7px;
  width: 3px; height: 14px;
}
.brand-mark > span {
  position: absolute;
  left: 11px; top: 11px;
  width: 6px; height: 6px;
  background: rgba(255,255,255,0.95);
  border-radius: 1px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
}
.nav-link {
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--r-md);
  transition: all 150ms ease;
}
.nav-link:hover { background: var(--bg-subtle); color: var(--text); }
.nav-link.active { color: var(--accent-active); background: var(--accent-50); }

.nav-spacer { flex: 1; }
.nav-cta {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--r-md);
  height: 36px;
  padding: 0 16px;
  transition: all 150ms ease;
  border: 1px solid transparent;
  letter-spacing: -0.1px;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 1px 3px 0 rgba(14,165,233,0.30);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 2px 8px 0 rgba(14,165,233,0.35); }
.btn-secondary {
  background: white;
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--bg-subtle); border-color: var(--border-strong); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text); }
.btn-lg { height: 44px; padding: 0 22px; font-size: 15px; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }

/* ───────── Beta badge ───────── */
.beta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 8px;
  background: linear-gradient(180deg, var(--accent-50), white);
  border: 1px solid var(--accent-200);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-active);
  box-shadow: 0 1px 2px rgba(14,165,233,0.08);
}
.beta-pill .dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(14,165,233,0.6); }
  100% { box-shadow: 0 0 0 8px rgba(14,165,233,0); }
}

/* ───────── Section ───────── */
.section {
  padding: 96px 0;
}
.section-tight { padding: 64px 0; }
.section-bg-subtle { background: var(--bg-app); }

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-active);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.h1 {
  font-size: clamp(36px, 5.5vw, 64px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -1.6px;
  margin: 0 0 20px;
  color: var(--text);
}
.h2 {
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1px;
  margin: 0 0 16px;
  color: var(--text);
}
.h3 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin: 0 0 8px;
  color: var(--text);
}
.lede {
  font-size: 19px;
  line-height: 1.55;
  color: var(--text-2);
  max-width: 640px;
  margin: 0 0 28px;
}
.serif-em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.5px;
}

/* ───────── Footer ───────── */
.footer {
  background: var(--bg-app);
  border-top: 1px solid var(--border);
  padding: 56px 0 32px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.footer h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-3);
  margin: 0 0 14px;
  font-weight: 600;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer a { color: var(--text-2); font-size: 14px; }
.footer a:hover { color: var(--accent-active); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-size: 13px;
  color: var(--text-3);
}
.footer-bottom .links { display: flex; gap: 20px; }

/* ───────── Cards / surfaces ───────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: all 200ms ease;
}
.card:hover { border-color: var(--accent-200); box-shadow: var(--shadow-md); }
.card-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--accent-50);
  color: var(--accent-active);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border: 1px solid var(--accent-100);
}

/* ───────── Mock UI: shared ───────── */
.mock-window {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  font-size: 13px;
  position: relative;
}
.mock-titlebar {
  height: 32px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
}
.mock-titlebar .dots { display: flex; gap: 6px; }
.mock-titlebar .dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gray-300);
}
.mock-titlebar .title {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  margin-left: auto;
  margin-right: auto;
  padding-right: 60px;
}

/* ───────── Logo strip ───────── */
.logo-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 32px;
  align-items: center;
  padding: 24px 0;
}
.logo-item {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  color: var(--text-3);
  opacity: 0.65;
  letter-spacing: -0.3px;
}
.logo-item.serif { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 22px; }
.logo-item.mono { font-family: var(--mono); font-weight: 500; font-size: 14px; }

/* ───────── Animations / interactions ───────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms cubic-bezier(0.16,1,0.3,1), transform 700ms cubic-bezier(0.16,1,0.3,1);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-revealed { opacity: 1; transform: translateY(0); }
[data-reveal="left"]  { transform: translateX(-24px); }
[data-reveal="right"] { transform: translateX(24px); }
[data-reveal="left"].is-revealed,
[data-reveal="right"].is-revealed { transform: translateX(0); }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* card hover lift */
.card-lift { transition: transform 220ms cubic-bezier(0.16,1,0.3,1), box-shadow 220ms ease, border-color 220ms ease; }
.card-lift:hover { transform: translateY(-4px); }

/* gradient text shimmer for accent words */
.text-shimmer {
  background: linear-gradient(90deg, var(--accent), var(--accent-active), var(--accent));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: text-shimmer 4s linear infinite;
}
@keyframes text-shimmer { to { background-position: 200% 0; } }

/* live flow dashed edge animation */
.flow-edge-animated {
  stroke-dasharray: 6 6;
  animation: flow-dash 1s linear infinite;
}
@keyframes flow-dash { to { stroke-dashoffset: -24; } }

/* node pulse */
@keyframes node-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(14,165,233,0.0), var(--shadow-sm); }
  50%      { box-shadow: 0 0 0 4px rgba(14,165,233,0.18), var(--shadow-sm); }
}
.node-active { animation: node-pulse 1.6s ease-in-out infinite; }

/* widget tick — value updates */
@keyframes widget-tick {
  0%   { transform: translateY(0); opacity: 1; }
  40%  { transform: translateY(-6px); opacity: 0; }
  60%  { transform: translateY(6px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.tick { display: inline-block; animation: widget-tick 0.6s ease both; }

/* button shine */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transition: left 600ms ease;
}
.btn-primary:hover::after { left: 130%; }

/* ───────── Utility ───────── */
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .section { padding: 64px 0; }
  .logo-strip { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}
