/* Intelligent Alchemy — shared styles beyond Tailwind utilities */

:root {
  --mm-ivory: #f8f1e3;
  --mm-ink: #0b1f3a;
  --mm-green: #1fb66b;
  --mm-muted: #526073;
  --mm-border: rgba(11, 31, 58, 0.15);
  --mm-card: #ffffff;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background-color: var(--mm-ivory);
  color: var(--mm-ink);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(31, 182, 107, 0.25);
  color: var(--mm-ink);
}

:focus-visible {
  outline: 2px solid var(--mm-green);
  outline-offset: 3px;
}

/* Rubik: display. Also tried: Outfit, Nunito, Baloo Chettan 2, Zain */
.mm-display,
h1,
h2 {
  font-family: Rubik, 'Plus Jakarta Sans', system-ui, sans-serif;
}

.mm-display {
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.88;
  text-transform: uppercase;
}

.mm-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--mm-green);
}

.mm-wordmark {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-ligatures: none;
}

.mm-logo-word {
  letter-spacing: -0.015em;
}

.mm-logo-word .mm-rn {
  letter-spacing: 0.04em;
}

.mm-card {
  background: var(--mm-card);
  border: 1px solid var(--mm-border);
  border-radius: 0.85rem;
  box-shadow: 0 8px 24px rgba(11, 31, 58, 0.05);
}

.mm-card-soft {
  background: var(--mm-card);
  border: 1px solid var(--mm-border);
  border-radius: 0.85rem;
  box-shadow: 0 4px 14px rgba(11, 31, 58, 0.04);
}

.mm-icon-green {
  color: var(--mm-green);
}

.mm-link-arrow {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
}

/* Hero floating flow diagram — pulse/step sync is JS-driven via .is-active */
.mm-hero-diagram {
  position: relative;
  width: 100%;
  min-height: 470px;
  height: 470px;
}

.mm-hero-diagram__intro {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
}

.mm-hero-diagram__lede {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--mm-ink);
  white-space: nowrap;
}

.mm-hero-diagram__stage {
  position: absolute;
  top: 3.15rem;
  right: 0;
  bottom: 2.6rem;
  left: 0;
}

.mm-hero-diagram__caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: auto;
  z-index: 3;
  max-width: 16rem;
  font-size: 0.7rem;
  line-height: 1.35;
  text-align: right;
  color: rgba(11, 31, 58, 0.55);
}

.mm-hero-diagram__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mm-hero-diagram__path {
  fill: none;
  stroke: var(--mm-green);
  stroke-width: 2.25;
  stroke-dasharray: 5 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: mm-dash-flow 32s linear infinite;
}

.mm-hero-diagram__node {
  fill: var(--mm-ivory);
  stroke: var(--mm-green);
  stroke-width: 2.5;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.35s ease, fill 0.35s ease;
}

.mm-hero-diagram__node.is-active {
  fill: #c8f0d8;
  transform: scale(1.45);
}

.mm-hero-diagram__pulse {
  opacity: 0.95;
  filter: drop-shadow(0 0 5px rgba(31, 182, 107, 0.65));
}

.mm-flow-card {
  position: absolute;
  z-index: 2;
  opacity: 0;
}

.mm-flow-card__surface {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 15.5rem;
  padding: 0.75rem 0.9rem;
  background: #fff;
  border: 1px solid var(--mm-border);
  border-radius: 0.75rem;
  box-shadow: 0 12px 32px rgba(11, 31, 58, 0.1);
  transform: scale(1);
  transform-origin: center center;
  transition:
    transform 0.4s ease,
    background-color 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease;
}

.mm-flow-card.is-active .mm-flow-card__surface {
  transform: scale(1.07);
  background: #e8f8ef;
  border-color: rgba(31, 182, 107, 0.55);
  box-shadow: 0 14px 36px rgba(31, 182, 107, 0.22);
}

.mm-flow-card__icon {
  display: flex;
  height: 2.1rem;
  width: 2.1rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: rgba(31, 182, 107, 0.12);
  color: var(--mm-green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: background 0.3s ease, color 0.3s ease;
}

.mm-flow-card.is-active .mm-flow-card__icon {
  background: rgba(31, 182, 107, 0.22);
}

.mm-flow-card--done.is-active .mm-flow-card__icon {
  background: var(--mm-green);
  color: #fff;
}

.mm-flow-card__title {
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--mm-ink);
}

.mm-flow-card--1 {
  top: 12%;
  left: 2%;
  animation:
    mm-card-in 0.7s ease 0.15s forwards,
    mm-float 5.5s ease-in-out 0.85s infinite;
}

.mm-flow-card--2 {
  top: 34%;
  right: 0;
  animation:
    mm-card-in 0.7s ease 0.4s forwards,
    mm-float 6s ease-in-out 1.1s infinite;
}

.mm-flow-card--3 {
  top: 58%;
  left: 6%;
  animation:
    mm-card-in 0.7s ease 0.65s forwards,
    mm-float 5.7s ease-in-out 1.35s infinite;
}

.mm-flow-card--4 {
  bottom: 2%;
  right: 4%;
  animation:
    mm-card-in 0.7s ease 0.9s forwards,
    mm-float 6.2s ease-in-out 1.6s infinite;
}

@keyframes mm-card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mm-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

@keyframes mm-dash-flow {
  to {
    stroke-dashoffset: -280;
  }
}

.mm-fit-line {
  position: relative;
}

.mm-fit-line::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 12%;
  right: 12%;
  height: 2px;
  background: var(--mm-green);
  opacity: 0.85;
  z-index: 0;
}

.mm-fit-line::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 12%;
  right: 12%;
  height: 0;
  border-top: 2px dashed transparent;
  z-index: 0;
}

.mm-fit-node {
  position: relative;
  z-index: 1;
  height: 0.7rem;
  width: 0.7rem;
  border-radius: 999px;
  background: var(--mm-ivory);
  border: 2.5px solid var(--mm-green);
}

/* Subtle entrance motion */
.mm-reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.mm-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1023px) {
  .mm-hero-diagram {
    height: auto;
    min-height: 0;
  }

  .mm-hero-diagram__intro,
  .mm-hero-diagram__caption,
  .mm-hero-diagram__stage {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    max-width: none;
  }

  .mm-hero-diagram__lede {
    white-space: normal;
  }

  .mm-hero-diagram__intro {
    margin-bottom: 1rem;
  }

  .mm-hero-diagram__caption {
    margin-top: 0.25rem;
  }

  .mm-hero-diagram__canvas {
    display: none;
  }

  .mm-flow-card {
    position: relative;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100%;
    margin-bottom: 0.75rem;
    opacity: 1;
    animation: none !important;
  }

  .mm-flow-card__surface {
    max-width: none;
    transform: none !important;
  }

  .mm-flow-card.is-active .mm-flow-card__surface {
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .mm-reveal,
  .mm-hero-diagram .mm-flow-card,
  .mm-flow-card,
  .mm-flow-card__surface,
  .mm-hero-diagram__path,
  .mm-hero-diagram__node {
    opacity: 1;
    transform: none;
    animation: none !important;
    transition: none;
  }

  .mm-hero-diagram__pulse {
    display: none;
  }
}

/* Everyday task cards — transform-only grow so the grid layout stays fixed */
.mm-task-grid {
  isolation: isolate;
}

.mm-task-card {
  transform: scale(1);
  transform-origin: center center;
  transition:
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.7s ease,
    border-color 0.7s ease;
  will-change: transform;
}

.mm-task-card.is-grown {
  z-index: 2;
  transform: scale(1.06);
  border-color: rgba(31, 182, 107, 0.55);
  box-shadow:
    0 0 0 1px rgba(31, 182, 107, 0.25),
    0 0 28px rgba(31, 182, 107, 0.35),
    0 16px 36px rgba(11, 31, 58, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .mm-task-card,
  .mm-task-card.is-grown {
    transform: none !important;
    transition: none !important;
    box-shadow: none;
  }
}

.mm-field-error {
  border-color: #c23b32 !important;
}

.mm-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
