/* Empi docs home page.
 *
 * Scoped entirely under .empi-home so it never touches any other page (the
 * sheet is loaded site-wide via extra_css). Colors build on Material's own
 * palette vars so both themes and the header toggle just work; the brand red
 * gradient (the logo stops) is the one deliberate constant, used for the accent
 * line and the primary CTA. Dark overrides live under [data-md-color-scheme="slate"].
 */

/* Glass fills and borders are rgba overlays, NOT color-mix on
 * var(--md-default-bg-color): Material sets that var as legacy hsla() with a
 * `deg` hue unit, which is invalid inside color-mix and silently drops the
 * whole fill to transparent. rgba over the page background composites the same
 * "glass" look and works in both themes. */
.empi-home {
  --empi-grad: linear-gradient(135deg, #f07040 0%, #d03020 45%, #7a0808 100%);
  --empi-glass: rgba(255, 255, 255, 0.66);
  --empi-border: rgba(0, 0, 0, 0.09);
  --empi-border-strong: rgba(0, 0, 0, 0.16);
  --empi-bar: rgba(0, 0, 0, 0.025);
  --empi-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.08);
  --empi-shadow-pop: 0 2px 4px rgba(0, 0, 0, 0.06), 0 20px 48px rgba(0, 0, 0, 0.14);
}

[data-md-color-scheme="slate"] .empi-home {
  --empi-glass: rgba(255, 255, 255, 0.045);
  --empi-border: rgba(255, 255, 255, 0.09);
  --empi-border-strong: rgba(255, 255, 255, 0.17);
  --empi-bar: rgba(255, 255, 255, 0.03);
  --empi-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 40px rgba(0, 0, 0, 0.4);
  --empi-shadow-pop: 0 2px 6px rgba(0, 0, 0, 0.35), 0 24px 56px rgba(0, 0, 0, 0.5);
}

/* Kill the default first-paragraph / heading rhythm inside the landing. */
.md-typeset .empi-home > * {
  margin: 0;
}

/* ---- Hero ---------------------------------------------------------------- */

.empi-hero {
  position: relative;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  align-items: center;
  gap: 3rem;
  padding: 2rem 0 3.25rem;
}

.empi-kicker {
  font-family: var(--md-code-font, monospace);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--md-primary-fg-color);
  margin-bottom: 1rem !important;
}

.md-typeset .empi-hero__title {
  font-size: clamp(2.1rem, 4.6vw, 3.2rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 1rem !important;
}

.empi-accent {
  background: var(--empi-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.md-typeset .empi-hero__lead {
  max-width: 34ch;
  color: var(--md-default-fg-color--light);
  font-size: 0.98rem;
  line-height: 1.62;
  margin: 0 0 1.75rem !important;
}

.empi-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.empi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.6rem;
  padding: 0 1.35rem;
  border-radius: 0.7rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s, background-color 0.18s, border-color 0.18s;
}

/* color !important: Material's `.md-typeset a` (spec 0,2,0 here) otherwise
 * repaints the label in the primary red, giving red-on-red on the filled CTA. */
.empi-btn--primary {
  color: #fff !important;
  background: var(--empi-grad);
  box-shadow: 0 6px 18px color-mix(in oklab, #d03020, transparent 62%);
}

.empi-btn--primary:hover {
  box-shadow: 0 10px 26px color-mix(in oklab, #d03020, transparent 52%);
}

.empi-btn--ghost {
  color: var(--md-default-fg-color) !important;
  border: 1px solid var(--empi-border-strong);
  background: var(--empi-glass);
}

.empi-btn--ghost:hover {
  border-color: var(--md-primary-fg-color);
  color: var(--md-primary-fg-color) !important;
  background: color-mix(in oklab, var(--md-primary-fg-color), transparent 92%);
}

/* ---- Product window ------------------------------------------------------ */

.empi-window {
  border: 1px solid var(--empi-border);
  border-radius: 0.9rem;
  overflow: hidden;
  background: var(--empi-glass);
  box-shadow: var(--empi-shadow);
}

.empi-window__bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--empi-border);
  background: var(--empi-bar);
}

.empi-window__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--md-default-fg-color--lighter);
}

.md-typeset .empi-window img {
  display: block;
  width: 100%;
  margin: 0;
  border-radius: 0;
}

/* ---- The loop ------------------------------------------------------------ */

.empi-loop {
  margin: 0 0 3rem !important;
}

.md-typeset .empi-loop__list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.md-typeset .empi-loop__step {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
  padding: 1.15rem 1.2rem 1.25rem;
  border: 1px solid var(--empi-border);
  border-radius: 0.85rem;
  background: var(--empi-glass);
}

.empi-loop__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.empi-loop__num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: var(--empi-grad);
}

.empi-loop__head strong {
  font-size: 0.92rem;
  font-weight: 700;
}

.empi-loop__desc {
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--md-default-fg-color--light);
}

/* ---- Destination cards --------------------------------------------------- */

.empi-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  align-items: start;
  gap: 1.1rem;
}

.empi-card {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.9rem;
  align-items: center;
  padding: 1.25rem 1.3rem;
  border: 1px solid var(--empi-border);
  border-radius: 0.9rem;
  background: var(--empi-glass);
  box-shadow: var(--empi-shadow);
  text-decoration: none !important;
  color: inherit !important;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s, border-color 0.18s;
}

.empi-card:hover {
  transform: translateY(-3px);
  border-color: var(--empi-border-strong);
  box-shadow: var(--empi-shadow-pop);
}

.empi-card__icon {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.7rem;
  color: var(--md-primary-fg-color);
  background: color-mix(in oklab, var(--md-primary-fg-color), transparent 88%);
  border: 1px solid color-mix(in oklab, var(--md-primary-fg-color), transparent 72%);
}

.empi-card__icon svg {
  width: 1.3rem;
  height: 1.3rem;
}

.empi-card__title {
  grid-column: 2;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.empi-card__desc {
  grid-column: 2;
  margin-top: 0.25rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--md-default-fg-color--light);
}

/* ---- Responsive ---------------------------------------------------------- */

@media screen and (max-width: 76.1875em) {
  .empi-hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: 1rem;
  }
  .empi-window {
    order: -1;
    max-width: 34rem;
  }
  .md-typeset .empi-loop__list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 44.9375em) {
  .md-typeset .empi-hero__lead {
    max-width: none;
  }
  .md-typeset .empi-loop__list {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .empi-btn,
  .empi-card {
    transition: none;
  }
  .empi-card:hover {
    transform: none;
  }
}
