/**
 * MEAY — Performance OS homepage
 * Premium SaaS aesthetic · Stripe/Linear/Vercel-tier
 *
 * Class prefixes:
 *  .hp-*   = legacy (still used by some pages; safe to keep)
 *  .meay-* = redesign system (new homepage)
 */

:root {
  /* Ink ladder — page → card → elevated → hover */
  --meay-ink-0: #05080F;
  --meay-ink-1: #0B1220;
  --meay-ink-2: #111A2E;
  --meay-ink-3: #1B2540;

  /* Hairlines (barely visible on dark) */
  --meay-line:    rgba(255,255,255,0.06);
  --meay-line-hi: rgba(255,255,255,0.12);
  --meay-line-on: rgba(15,23,42,0.08);

  /* Brand */
  --meay-blue:        #3D7BFF;
  --meay-blue-glow:   #5B9DFF;
  --meay-orange:      #FF6B2C;
  --meay-orange-glow: #FF8A57;
  --meay-mint:        #34D399;
  --meay-rose:        #F43F5E;

  /* Text on dark */
  --meay-text-0: #FFFFFF;
  --meay-text-1: rgba(255,255,255,0.72);
  --meay-text-2: rgba(255,255,255,0.48);
  --meay-text-3: rgba(255,255,255,0.32);

  /* Legacy alias (do not remove — used by other pages) */
  --os-deep: #0b1220;
  --os-panel: #111827;
  --os-blue: #3b82f6;
  --os-orange: #ff6b2c;
  --os-success: #22c55e;
  --os-text: #0f172a;
  --os-soft: #f8fafc;
  --os-border: rgba(148, 163, 184, 0.25);
}

/* ============================================================
   PAGE SHELL
   ============================================================ */
.home-premium-bg {
  background-color: #F8FAFC;
}

/* Enterprise homepage shell (dark body under light content bands) */
.meay-enterprise-shell {
  background-color: #030712;
}

/* Headlines: geometric display (Space Grotesk from layout fonts) */
.meay-display,
.meay-h2 {
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
}

.meay-h3-enterprise {
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-size: clamp(1.125rem, 2.5vw, 1.35rem);
}

.meay-ops-hero .meay-ops-img {
  object-position: center 35%;
}

.meay-cred-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.35rem 0.75rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.meay-kb-card a {
  text-decoration: none;
}
.meay-kb-card a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 1023px) {
  .meay-desk-cta-bar {
    display: none !important;
  }
}

/* Navbar — audit CTA glow (homepage flag) */
.meay-header-cta-glow {
  box-shadow:
    0 0 0 1px rgba(255, 107, 44, 0.45),
    0 0 32px rgba(255, 107, 44, 0.28),
    0 12px 28px -8px rgba(255, 107, 44, 0.45);
}

/* Logo marquee — grayscale → color on hover */
.meay-marquee-agency .meay-logo {
  color: rgba(255, 255, 255, 0.38);
  filter: grayscale(1);
  transition: color 0.35s ease, filter 0.35s ease;
}
.meay-marquee-agency:hover .meay-logo,
.meay-marquee-agency .meay-logo:hover {
  color: rgba(255, 255, 255, 0.92);
  filter: grayscale(0);
}

/* Hero Ads mock — slightly lighter chrome */
.meay-dash--agency {
  box-shadow:
    0 40px 90px -35px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.meay-bg-dark {
  background-color: var(--meay-ink-0);
  color: var(--meay-text-0);
}

/* Subtle ambient noise for dark sections */
.hp-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Linear-style 1px grid background for hero */
.meay-grid-bg {
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

/* One signature ambient glow — restraint */
.meay-hero-glow {
  position: absolute;
  pointer-events: none;
  width: 80%;
  height: 60%;
  top: -10%;
  right: -10%;
  background: radial-gradient(closest-side, rgba(61,123,255,0.18), transparent 70%);
  filter: blur(40px);
}
.meay-hero-glow.right-orange {
  top: auto;
  bottom: -15%;
  right: auto;
  left: -10%;
  width: 60%;
  height: 50%;
  background: radial-gradient(closest-side, rgba(255,107,44,0.14), transparent 70%);
}

/* ============================================================
   TYPOGRAPHY HELPERS
   ============================================================ */
.meay-display {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
  font-size: clamp(2.5rem, 6.4vw, 5.5rem);
}
.meay-h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  font-size: clamp(2rem, 4vw, 3.25rem);
}
.meay-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--meay-blue);
}
.meay-eyebrow-on-light { color: var(--meay-blue); }
.meay-eyebrow-orange { color: var(--meay-orange); }

.meay-num { font-variant-numeric: tabular-nums; }

/* ============================================================
   HAIRLINES & CARDS
   ============================================================ */
.meay-hairline-t { border-top: 1px solid var(--meay-line); }
.meay-hairline-b { border-bottom: 1px solid var(--meay-line); }

.meay-card-dark {
  background: linear-gradient(165deg, rgba(17,26,46,0.92), rgba(11,18,32,0.96));
  border: 1px solid var(--meay-line);
  border-radius: 16px;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.25s ease,
              box-shadow 0.25s ease;
}
.meay-card-dark:hover {
  transform: translateY(-4px);
  border-color: var(--meay-line-hi);
  box-shadow: 0 0 0 1px rgba(61,123,255,0.12), 0 24px 60px rgba(0,0,0,0.45);
}

.meay-card-light {
  background: #FFFFFF;
  border: 1px solid #EEF1F5;
  border-radius: 16px;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.25s ease,
              box-shadow 0.25s ease;
}
.meay-card-light:hover {
  transform: translateY(-4px);
  border-color: #DCE4ED;
  box-shadow: 0 18px 40px -12px rgba(11,18,32,0.10);
}

/* "Recommended" hairline accent (pricing) */
.meay-card-recommend {
  position: relative;
  overflow: hidden;
}
.meay-card-recommend::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--meay-blue), var(--meay-orange));
}

/* ============================================================
   STATUS DOT (animate only the live one)
   ============================================================ */
.meay-dot {
  display: inline-flex;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--meay-mint);
  position: relative;
}
.meay-dot.live::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--meay-mint);
  opacity: 0.35;
  animation: meay-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes meay-ping {
  75%, 100% { transform: scale(2.2); opacity: 0; }
}

/* ============================================================
   ENTRANCE ANIMATIONS (reveal + stagger)
   ============================================================ */
.hp-reveal,
.meay-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.hp-reveal.hp-in-view,
.meay-reveal.hp-in-view {
  opacity: 1;
  transform: translateY(0);
}
.meay-stagger > * { transition-delay: 0ms; }
.meay-stagger.hp-in-view > *:nth-child(1) { transition-delay: 0ms; }
.meay-stagger.hp-in-view > *:nth-child(2) { transition-delay: 80ms; }
.meay-stagger.hp-in-view > *:nth-child(3) { transition-delay: 160ms; }
.meay-stagger.hp-in-view > *:nth-child(4) { transition-delay: 240ms; }
.meay-stagger.hp-in-view > *:nth-child(5) { transition-delay: 320ms; }
.meay-stagger.hp-in-view > *:nth-child(6) { transition-delay: 400ms; }

/* ============================================================
   LOGO MARQUEE (continuous, paused on hover)
   ============================================================ */
.meay-marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.meay-marquee-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: meay-marquee 36s linear infinite;
}
.meay-marquee:hover .meay-marquee-track,
.meay-marquee:focus-within .meay-marquee-track {
  animation-play-state: paused;
}
@keyframes meay-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.meay-logo {
  flex: 0 0 auto;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: rgba(255,255,255,0.42);
  white-space: nowrap;
  transition: color 0.3s ease;
}
.meay-logo:hover { color: rgba(255,255,255,0.95); }

/* ============================================================
   TABS (Campaign Intelligence)
   ============================================================ */
.meay-tab {
  position: relative;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--meay-text-1);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}
.meay-tab:hover { color: var(--meay-text-0); }
.meay-tab[aria-selected="true"] {
  color: var(--meay-text-0);
}
.meay-tab[aria-selected="true"]::after {
  content: '';
  position: absolute;
  left: 16px; right: 16px;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--meay-blue), var(--meay-orange));
  border-radius: 2px;
}

.meay-tabpanel {
  animation: meay-fade-in 0.4s ease-out;
}
@keyframes meay-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   SPARKLINE / CHART DRAW
   ============================================================ */
.meay-draw-line path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.meay-draw-line.hp-in-view path {
  stroke-dashoffset: 0;
}

/* Bar growth */
.meay-bar-grow {
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.meay-reveal.hp-in-view .meay-bar-grow { transform: scaleY(1); }

/* ============================================================
   PRIMARY CTA (orange)
   ============================================================ */
.meay-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 28px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  color: #FFFFFF;
  background: linear-gradient(180deg, var(--meay-orange-glow), var(--meay-orange));
  box-shadow:
    0 1px 0 rgba(255,255,255,0.18) inset,
    0 0 0 1px rgba(255,107,44,0.5),
    0 12px 28px -8px rgba(255,107,44,0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.meay-cta:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.22) inset,
    0 0 0 1px rgba(255,107,44,0.6),
    0 18px 36px -10px rgba(255,107,44,0.6);
}
.meay-cta-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  color: var(--meay-text-0);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--meay-line-hi);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.meay-cta-ghost:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
}

.meay-cta-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  color: #0F172A;
  background: #FFFFFF;
  border: 1px solid #E5E9EF;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.meay-cta-light:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -8px rgba(11,18,32,0.15);
}

/* ============================================================
   GLASS PANELS (used sparingly)
   ============================================================ */
.hp-glass-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.hp-glass-light {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ============================================================
   DASHBOARD MOCK CHROME
   ============================================================ */
.meay-dash {
  border-radius: 18px;
  border: 1px solid var(--meay-line);
  background: linear-gradient(170deg, #0F172A 0%, #0B1220 55%, #111A2E 100%);
  box-shadow:
    0 60px 120px -30px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.06);
  overflow: hidden;
}
.meay-dash-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--meay-line);
  background: rgba(255,255,255,0.02);
}
.meay-dash-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #475569;
}
.meay-dash-dot.r { background: #EF4444; }
.meay-dash-dot.y { background: #F59E0B; }
.meay-dash-dot.g { background: #22C55E; }

.meay-metric-tile {
  border: 1px solid var(--meay-line);
  background: rgba(255,255,255,0.025);
  border-radius: 12px;
  padding: 14px;
}
.meay-metric-tile-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--meay-text-2);
}
.meay-metric-tile-value {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--meay-text-0);
  margin-top: 4px;
}
.meay-delta-up { color: var(--meay-mint); font-size: 11px; font-weight: 600; }
.meay-delta-down { color: var(--meay-rose); font-size: 11px; font-weight: 600; }

/* ============================================================
   PROCESS TIMELINE — horizontal on desktop, vertical on mobile
   ============================================================ */
.meay-timeline-h {
  position: relative;
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 1024px) {
  .meay-timeline-h {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
  .meay-timeline-h::before {
    content: '';
    position: absolute;
    left: 5%;
    right: 5%;
    top: 36px;
    height: 1px;
    background: linear-gradient(90deg,
      transparent,
      rgba(61,123,255,0.4) 15%,
      rgba(61,123,255,0.4) 50%,
      rgba(255,107,44,0.4) 85%,
      transparent);
  }
}
.meay-timeline-step {
  position: relative;
}
.meay-timeline-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(160deg, #FFFFFF, #F1F5F9);
  border: 1px solid #E2E8F0;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: #0F172A;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  box-shadow: 0 8px 20px -6px rgba(11,18,32,0.08);
  position: relative;
  z-index: 1;
}

/* ============================================================
   LEGACY (still used by some pages — do not delete)
   ============================================================ */
.hp-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.42;
  animation: hp-float 20s ease-in-out infinite;
}
@keyframes hp-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(24px, -18px) scale(1.04); }
  66% { transform: translate(-18px, 14px) scale(0.96); }
}

.hp-dashboard-mock {
  transform-style: preserve-3d;
  transition: transform 0.12s ease-out;
}

.hp-gradient-border-os {
  position: relative;
  border-radius: 1rem;
  background: linear-gradient(165deg, rgba(255,255,255,0.98), rgba(248,250,252,0.95));
}
.hp-gradient-border-os::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--os-blue), rgba(59, 130, 246, 0.35), var(--os-orange));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.hp-metric-dark {
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(160deg, rgba(17, 24, 39, 0.95), rgba(11, 18, 32, 0.98));
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.06), 0 24px 60px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.hp-metric-dark:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15), 0 28px 70px rgba(0, 0, 0, 0.45);
}

.hp-shimmer-bar {
  position: relative;
  overflow: hidden;
}
.hp-shimmer-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.06) 50%, transparent 60%);
  animation: hp-shimmer 2.4s ease-in-out infinite;
}
@keyframes hp-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.hp-dash-preview {
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, #0f172a 0%, #0b1220 50%, #111827 100%);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hp-pulse-cta {
  position: relative;
}
.hp-pulse-cta::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255,107,44,0.5), rgba(61,123,255,0.4));
  filter: blur(12px);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}
.hp-pulse-cta:hover::before { opacity: 0.7; }

.hp-scroll-snap-x {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.hp-scroll-snap-x > * {
  scroll-snap-align: start;
}

.hp-wave {
  display: block;
  width: 100%;
  line-height: 0;
}

.hp-nav-link {
  position: relative;
}
.hp-nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--os-blue), var(--os-orange));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.hp-nav-link:hover::after,
.hp-nav-link.hp-active::after {
  transform: scaleX(1);
}

.hp-timeline-os {
  position: relative;
  padding-left: 0;
}
.hp-timeline-os::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--os-blue), var(--os-orange));
}

.hp-float-soft { animation: hp-float-soft 6s ease-in-out infinite; }
.hp-float-soft.d2 { animation-delay: -2s; }
.hp-float-soft.d4 { animation-delay: -4s; }
@keyframes hp-float-soft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .hp-reveal,
  .meay-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
  .meay-draw-line path {
    stroke-dashoffset: 0 !important;
  }
}
