/* =========================================================
   Home page (scoped to .replimap-home)
   ========================================================= */
.replimap-home{
  --hm-teal: var(--replimap-teal, #1d9aaa);
  --hm-teal-dark: var(--replimap-teal-dark, #167f8f);
  --hm-teal-soft: var(--replimap-teal-soft, rgba(29,154,170,.12));
  --hm-accent-fg: var(--hm-teal-dark);
  --hm-line: rgba(0,0,0,.16);
  --hm-card: var(--md-default-bg-color);
  --hm-sunken: var(--md-code-bg-color);
  --hm-muted: var(--md-default-fg-color);
  --hm-shadow: 0 10px 28px -18px rgba(0,0,0,.35);
  --hm-shadow-hover: 0 20px 38px -20px rgba(29,154,170,.55);
}
[data-md-color-scheme="slate"] .replimap-home{
  --hm-accent-fg: #7fe0ea;
  --hm-line: rgba(255,255,255,.18);
  --hm-shadow: 0 10px 28px -18px rgba(0,0,0,.8);
  --hm-shadow-hover: 0 20px 38px -20px rgba(29,154,170,.45);
}

.md-content:has(.replimap-home) .md-content__inner > h1:first-child{ display:none; }

.replimap-home svg{ flex:none; }

/* ---------- Hero ---------- */
.replimap-home .hm-hero{
  position:relative; overflow:hidden;
  display:flex; flex-wrap:wrap; align-items:center; gap:1.6rem;
  margin:.5rem 0 1.5rem; padding:2rem 1.8rem;
  border-radius:22px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(29,154,170,.20), transparent 55%),
    radial-gradient(90% 120% at 100% 100%, rgba(29,154,170,.12), transparent 60%),
    var(--hm-card);
  border:1px solid rgba(29,154,170,.25);
  box-shadow:0 18px 40px -24px rgba(29,154,170,.6);
}
.replimap-home .hm-hero::before{ /* faint road-grid texture */
  content:""; position:absolute; inset:0; pointer-events:none; opacity:.4;
  background-image:
    linear-gradient(rgba(29,154,170,.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29,154,170,.14) 1px, transparent 1px);
  background-size:28px 28px;
  -webkit-mask-image:radial-gradient(80% 90% at 85% 50%, #000, transparent 75%);
          mask-image:radial-gradient(80% 90% at 85% 50%, #000, transparent 75%);
}
.replimap-home .hm-hero > *{ position:relative; z-index:1; }
.replimap-home .hm-hero__text{ flex:1 1 100%; min-width:0; }
.replimap-home .hm-hero__shot{ flex:1 1 100%; min-width:0; }
.replimap-home .hm-hero h1{
  margin:0 0 .8rem !important; padding:0 !important; border:none !important;
  font-size:2.6rem; font-weight:800; line-height:1.05; letter-spacing:-.02em;
  background:linear-gradient(90deg, var(--hm-teal-dark), var(--hm-teal) 55%, #39c3d3);
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.replimap-home .hm-hero h1 .headerlink{ display:none; }
.replimap-home .hm-lead{ margin:0 0 .8rem; line-height:1.65; color:var(--md-default-fg-color); }
.replimap-home .hm-lead + p{ margin:0; font-size:inherit; line-height:1.65; color:var(--hm-muted); }
.replimap-home .hm-cta{ display:flex; flex-wrap:wrap; gap:.6rem; margin-top:1.4rem; }
.replimap-home .hm-btn{
  display:inline-flex; align-items:center; gap:.45rem; min-height:2.4rem; box-sizing:border-box;
  font-size:inherit; font-weight:700; text-decoration:none !important;
  padding:.55rem 1.05rem; border-radius:10px;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.replimap-home .hm-btn svg{ width:1rem; height:1rem; }
.replimap-home .hm-btn--primary{ background:var(--hm-teal); color:#fff !important; box-shadow:0 8px 18px -10px rgba(29,154,170,.9); }
.replimap-home .hm-btn--primary:hover{ background:var(--hm-teal-dark); transform:translateY(-2px); }
.replimap-home .hm-btn--ghost{ background:var(--hm-card); color:var(--hm-accent-fg) !important; border:1px solid rgba(29,154,170,.45); }
.replimap-home .hm-btn--ghost:hover{ background:var(--hm-teal-soft); transform:translateY(-2px); }

/* Screenshot in an app-window frame */
.replimap-home .hm-window{
  border-radius:14px; overflow:hidden; background:var(--hm-card);
  border:1px solid var(--hm-line); box-shadow:0 26px 50px -22px rgba(0,0,0,.45);
  transform:perspective(1200px) rotateY(-6deg) rotateX(2deg);
  transition:transform .5s ease;
}
.replimap-home .hm-window:hover{ transform:perspective(1200px) rotateY(0) rotateX(0); }
.replimap-home .hm-window__bar{
  display:flex; align-items:center; gap:.35rem; padding:.5rem .7rem;
  background:var(--hm-sunken); border-bottom:1px solid var(--hm-line);
}
.replimap-home .hm-window__bar span{ width:.55rem; height:.55rem; border-radius:50%; background:#ff5f57; }
.replimap-home .hm-window__bar span:nth-child(2){ background:#febc2e; }
.replimap-home .hm-window__bar span:nth-child(3){ background:#28c840; }
.replimap-home .hm-window__bar em{ margin-left:auto; font-style:normal; font-size:.62rem; color:var(--hm-muted); letter-spacing:.04em; }
.replimap-home .hm-window .replimap-expandable-media{ position:relative; display:block; width:100%; margin:0; max-width:none !important; }
.replimap-home .hm-window img{ display:block; width:100% !important; max-width:none !important; height:auto; margin:0; cursor:zoom-in; }

/* OpenDRIVE strip */
.replimap-home .hm-format{
  display:flex; align-items:center; gap:1rem;
  margin:0 0 1rem; padding:1rem 1.2rem; border-radius:14px;
  background:var(--hm-sunken); border:1px solid var(--hm-line);
}
.replimap-home .hm-format p{ margin:0; font-size:inherit; line-height:1.6; }
.replimap-home .hm-format__badge{
  flex:none; display:flex; align-items:center; justify-content:center; flex-direction:column;
  width:4.2rem; height:4.2rem; border-radius:14px;
  background:var(--hm-teal); color:#fff; font-weight:800; font-size:inherit; letter-spacing:.02em;
  box-shadow:0 10px 20px -12px rgba(29,154,170,.9);
}
.replimap-home .hm-format__badge small{ font-size:.55rem; font-weight:600; opacity:.85; letter-spacing:.06em; }

/* ---------- Section headings ---------- */
.replimap-home h2{ margin-top:2.2rem !important; }

/* ---------- Why RepliMap ---------- */
.replimap-home .hm-benefits{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:.8rem; margin:1.1rem 0; }
.replimap-home .hm-benefit{
  box-sizing:border-box; padding:1.1rem 1rem; border-radius:16px;
  background:var(--hm-card); border:1px solid var(--hm-line); box-shadow:var(--hm-shadow);
  line-height:1.55; display:flex; align-items:center; gap:.85rem;
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.replimap-home .hm-benefit .hm-icon{ flex:none; margin:0; }
.replimap-home .hm-benefit:hover{ transform:translateY(-4px); box-shadow:var(--hm-shadow-hover); border-color:rgba(29,154,170,.45); }
.replimap-home .hm-icon{
  display:flex; align-items:center; justify-content:center;
  width:2.4rem; height:2.4rem; margin-bottom:.75rem; border-radius:11px;
  background:var(--hm-teal-soft); color:var(--hm-accent-fg);
}
.replimap-home .hm-icon svg{ width:1.25rem; height:1.25rem; }

/* ---------- Documentation sections ---------- */
.replimap-home .hm-sections{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:.85rem; }
.replimap-home a.hm-section{
  position:relative; display:flex; flex-direction:column; gap:.35rem;
  box-sizing:border-box; padding:1.1rem 1.15rem 1rem; border-radius:16px;
  background:var(--hm-card); border:1px solid var(--hm-line); box-shadow:var(--hm-shadow);
  color:var(--md-default-fg-color) !important; text-decoration:none !important;
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.replimap-home a.hm-section:hover,
.replimap-home a.hm-section:focus-visible{ transform:translateY(-4px); box-shadow:var(--hm-shadow-hover); border-color:rgba(29,154,170,.5); outline:none; }
.replimap-home a.hm-section:focus-visible{ box-shadow:0 0 0 3px var(--hm-teal-soft), var(--hm-shadow-hover); }
.replimap-home .hm-section__head{ display:flex; align-items:center; gap:.7rem; }
.replimap-home .hm-section__head .hm-icon{ margin:0; transition:background .2s ease, color .2s ease; }
.replimap-home a.hm-section:hover .hm-icon,
.replimap-home a.hm-section:focus-visible .hm-icon{ background:var(--hm-teal); color:#fff; }
.replimap-home .hm-section strong{ flex:1; }
.replimap-home .hm-section__arrow{ width:1rem; height:1rem; color:var(--hm-teal); opacity:0; transform:translateX(-4px); transition:opacity .2s ease, transform .2s ease; }
.replimap-home a.hm-section:hover .hm-section__arrow,
.replimap-home a.hm-section:focus-visible .hm-section__arrow{ opacity:1; transform:none; }
.replimap-home .hm-section p{ margin:.2rem 0 0; font-size:inherit; line-height:1.55; color:var(--hm-muted); }
.replimap-home .hm-section ul{ display:flex; flex-wrap:wrap; gap:.35rem; margin:.45rem 0 0 !important; padding:0 !important; list-style:none; }
.replimap-home .hm-section li{
  margin:0 !important; padding:.18rem .55rem; border-radius:999px;
  font-size:.66rem; font-weight:600; background:var(--hm-teal-soft); color:var(--hm-accent-fg);
}
.replimap-home .hm-section li::before{ content:none !important; }
.replimap-home .hm-section[hidden]{ display:none; }

/* ---------- Workflow ---------- */
.replimap-home .hm-flow{
  --hm-p:0;
  position:relative; display:grid; grid-template-columns:repeat(5, minmax(0,1fr)); gap:.6rem;
  margin:1.2rem 0 0 !important; padding:0 !important; list-style:none;
}
.replimap-home .hm-flow::before,
.replimap-home .hm-flow::after{ /* rail + progress fill behind the step dots */
  content:""; position:absolute; top:1.3rem; left:10%; height:3px; border-radius:2px;
}
.replimap-home .hm-flow::before{ right:10%; background:var(--hm-line); }
.replimap-home .hm-flow::after{ width:calc(80% * var(--hm-p)); background:var(--hm-teal); transition:width .45s ease; }
.replimap-home .hm-flow li{ margin:0 !important; padding:0 !important; }
.replimap-home .hm-flow li::before{ content:none !important; }
.replimap-home .hm-step{
  position:relative; z-index:1; width:100%; height:100%; box-sizing:border-box;
  display:flex; flex-direction:column; align-items:center; gap:.7rem;
  padding:0 .4rem .9rem; border:0; border-radius:14px; background:transparent;
  color:var(--md-default-fg-color); font:inherit; text-align:center; cursor:pointer;
}
.replimap-home .hm-step__num{
  display:flex; align-items:center; justify-content:center;
  width:2.6rem; height:2.6rem; border-radius:50%;
  background:var(--hm-card); border:2px solid var(--hm-line); color:var(--hm-muted);
  font-weight:800;
  transition:background .3s ease, border-color .3s ease, color .3s ease, transform .3s ease, box-shadow .3s ease;
}
.replimap-home .hm-step__text{ font-size:inherit; line-height:1.5; color:var(--hm-muted); transition:color .3s ease; }
.replimap-home .hm-step.is-done .hm-step__num{ background:linear-gradient(var(--hm-teal-soft), var(--hm-teal-soft)), var(--hm-card); border-color:var(--hm-teal); color:var(--hm-accent-fg); }
.replimap-home .hm-step.is-active .hm-step__num{
  background:var(--hm-teal); border-color:var(--hm-teal); color:#fff; transform:scale(1.12);
  box-shadow:0 0 0 6px var(--hm-teal-soft);
}
.replimap-home .hm-step.is-active .hm-step__text{ color:var(--md-default-fg-color); font-weight:600; }
.replimap-home .hm-step:hover .hm-step__num{ border-color:var(--hm-teal); }
.replimap-home .hm-step:focus-visible{ outline:2px solid var(--hm-teal); outline-offset:2px; }
.replimap-home .hm-flow-note{ margin:.6rem 0 0; font-size:inherit; color:var(--hm-muted); text-align:center; }

/* ---------- About ---------- */
.replimap-home .hm-about{
  display:flex; flex-wrap:wrap; gap:1.5rem; align-items:center;
  padding:1.4rem 1.5rem; border-radius:18px;
  background:var(--hm-card); border:1px solid var(--hm-line); box-shadow:var(--hm-shadow);
}
.replimap-home .hm-about__text{ flex:1 1 260px; min-width:0; }
.replimap-home .hm-about__text p{ margin:0 0 .6rem; font-size:inherit; line-height:1.6; }
.replimap-home .hm-about__text p:last-child{ margin:0; color:var(--hm-muted); }
.replimap-home .hm-checks{ flex:1 1 300px; display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:.55rem; margin:0 !important; padding:0 !important; list-style:none; }
.replimap-home .hm-checks li{
  display:flex; align-items:center; gap:.55rem; margin:0 !important;
  padding:.65rem .75rem; border-radius:12px; background:var(--hm-sunken);
  font-size:inherit; font-weight:600;
}
.replimap-home .hm-checks li::before{ content:none !important; }
.replimap-home .hm-checks svg{ width:1.1rem; height:1.1rem; color:var(--hm-teal); }

@media (prefers-reduced-motion: reduce){
  .replimap-home *{ animation:none !important; transition:none !important; }
  .replimap-home .hm-window{ transform:none; }
}

/* ---------- Responsive ---------- */
@media screen and (max-width: 76.1875em){
}
@media screen and (max-width: 44.9375em){
  .replimap-home .hm-hero{ padding:1.6rem 1.2rem; }
  .replimap-home .hm-hero h1{ font-size:2rem; }
  .replimap-home .hm-window{ transform:none; }
  .replimap-home .hm-sections,
  .replimap-home .hm-benefits,
  .replimap-home .hm-checks{ grid-template-columns:1fr; }
  .replimap-home .hm-format{ align-items:flex-start; }
  /* Workflow becomes a vertical timeline */
  .replimap-home .hm-flow{ grid-template-columns:1fr; gap:.3rem; }
  .replimap-home .hm-flow::before,
  .replimap-home .hm-flow::after{ top:1.3rem; left:1.3rem; right:auto; width:3px; height:auto; }
  .replimap-home .hm-flow::before{ bottom:1.3rem; }
  .replimap-home .hm-flow::after{ height:calc((100% - 2.6rem) * var(--hm-p)); width:3px; transition:height .45s ease; }
  .replimap-home .hm-step{ flex-direction:row; text-align:left; padding:.2rem 0; gap:.9rem; }
  .replimap-home .hm-flow-note{ text-align:left; }
}

/* Theme list styles would otherwise override the workflow grid. */
.md-typeset .replimap-home ol.hm-flow{ display:grid !important; }
.md-typeset .replimap-home ul.hm-checks{ display:grid !important; }
.md-typeset .replimap-home .hm-section ul{ display:flex !important; }
@media screen and (max-width: 44.9375em){
  .md-typeset .replimap-home ol.hm-flow{ grid-template-columns:1fr; }
}

/* Workflow as a vertical timeline (fits the normal documentation column). */
.md-typeset .replimap-home ol.hm-flow{ grid-template-columns:1fr; gap:.3rem; }
.replimap-home .hm-flow::before,
.replimap-home .hm-flow::after{ top:1.3rem; left:1.3rem; right:auto; width:3px; height:auto; }
.replimap-home .hm-flow::before{ bottom:1.3rem; }
.replimap-home .hm-flow::after{ height:calc((100% - 2.6rem) * var(--hm-p)); width:3px; transition:height .45s ease; }
.replimap-home .hm-step{ flex-direction:row; align-items:center; text-align:left; padding:.25rem 0; gap:.9rem; }
.replimap-home .hm-flow-note{ text-align:left; }

/* About: paragraph, list, closing sentence (in reading order). */
.replimap-home .hm-about{ flex-direction:column; align-items:stretch; gap:.9rem; }
.replimap-home .hm-about__text, .replimap-home .hm-checks{ flex:none; }
.replimap-home .hm-about__text p{ margin:0; }
.md-typeset .replimap-home ul.hm-checks{ grid-template-columns:repeat(2, minmax(0,1fr)); }
.replimap-home .hm-checks li{ font-weight:normal; }
.replimap-home .hm-about__end{ margin:0; }
@media screen and (max-width: 44.9375em){
  .md-typeset .replimap-home ul.hm-checks{ grid-template-columns:1fr; }
}

/* ---------- Hero screenshot slideshow ---------- */
.replimap-home .hm-slides{ position:relative; aspect-ratio:2230/1326; background:var(--hm-sunken); }
.replimap-home .hm-window .hm-slide{ position:absolute; inset:0; opacity:0; visibility:hidden; transition:opacity .6s ease, visibility .6s; }
.replimap-home .hm-window .hm-slide.is-active{ opacity:1; visibility:visible; }
.replimap-home .hm-window .hm-slide img{ width:100% !important; height:100% !important; object-fit:cover; object-position:center; }
.replimap-home .hm-slides__nav{
  display:flex; justify-content:center; gap:.4rem; padding:.55rem .6rem;
  background:var(--hm-sunken); border-top:1px solid var(--hm-line);
}
.replimap-home .hm-dot{
  display:inline-flex; align-items:center; gap:.4rem; padding:.25rem .7rem; border-radius:999px;
  border:1px solid var(--hm-line); background:var(--hm-card); color:var(--md-default-fg-color);
  font:inherit; font-size:.62rem; font-weight:600; cursor:pointer;
  transition:background .2s ease, color .2s ease, border-color .2s ease;
}
.replimap-home .hm-dot::before{ content:""; width:.45rem; height:.45rem; border-radius:50%; background:var(--hm-line); transition:background .2s ease; }
.replimap-home .hm-dot:hover{ border-color:var(--hm-teal); }
.replimap-home .hm-dot.is-active{ background:var(--hm-teal); border-color:var(--hm-teal); color:#fff; }
.replimap-home .hm-dot.is-active::before{ background:#fff; }
.replimap-home .hm-dot:focus-visible{ outline:2px solid var(--hm-teal); outline-offset:2px; }
@media (prefers-reduced-motion: reduce){
  .replimap-home .hm-window .hm-slide{ transition:none; }
}

/* Documentation sections: one card per row (line by line). */
.replimap-home .hm-sections{ grid-template-columns:1fr; gap:.6rem; }
.replimap-home a.hm-section{ padding:.9rem 1.1rem; }
