/*
 * Documentation homepage (tools/site/overrides/landing.html).
 *
 * Colours come only from the palette variables in site.css, so the page and
 * its architecture graph follow the light and dark themes. Elements carry a
 * data-c attribute that selects their accent.
 */

/* Accent selection */
.idp-home [data-c="blue"] { --c: var(--idp-blue); }
.idp-home [data-c="purple"] { --c: var(--idp-purple); }
.idp-home [data-c="amber"] { --c: var(--idp-amber); }
.idp-home [data-c="green"] { --c: var(--idp-green); }
.idp-home [data-c="cyan"] { --c: var(--idp-cyan); }
.idp-home [data-c="pink"] { --c: var(--idp-pink); }
.idp-home [data-c="git"] { --c: var(--idp-git); }

/* ------------------------------------------------------------------ */
/* Page frame                                                         */
/* ------------------------------------------------------------------ */

.md-content.idp-home {
  min-width: 0;
  max-width: none;
  color: var(--idp-text-body);
  font-family: var(--idp-font-text);
}

.idp-home__section {
  border-top: 1px solid var(--idp-border);
}

.idp-home__section:first-of-type {
  border-top: 0;
  border-bottom: 1px solid var(--idp-border);
}

.idp-home__section--raised {
  background-color: var(--idp-surface);
}

.idp-dots {
  background-image: radial-gradient(var(--idp-dots) 1px, transparent 1px);
  background-size: 24px 24px;
}

.idp-home__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px clamp(16px, 3vw, 40px);
}

.idp-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.idp-split {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}

.idp-split__intro {
  display: flex;
  flex: 1 1 280px;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.idp-split > :last-child:not(.idp-split__intro) {
  flex: 2 1 480px;
  min-width: 0;
}

/* Type */
.idp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--idp-font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--idp-text-tertiary);
}

.idp-accent {
  color: var(--c);
}

.idp-home__h2 {
  margin: 0;
  font-size: clamp(26px, 2.8vw, 36px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--idp-text);
}

.idp-home__lead {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--idp-text-secondary);
}

.idp-home__lead--small {
  font-size: 14px;
  color: var(--idp-text-tertiary);
}

.idp-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--idp-text);
}

.idp-muted {
  font-size: 13px;
  line-height: 1.55;
  color: var(--idp-text-tertiary);
}

.idp-muted--small {
  font-size: 12px;
  line-height: 1.5;
}

.idp-tag {
  font-family: var(--idp-font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--c);
}

.idp-arrow {
  color: var(--idp-text-label);
}

.idp-note {
  margin: 0;
  font-size: 13px;
  color: var(--idp-text-tertiary);
}

.idp-home ul,
.idp-home ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.idp-home a {
  color: var(--idp-text);
  text-decoration: none;
}

.idp-home a:hover {
  color: var(--idp-link-hover);
}

/* Buttons */
.idp-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--idp-border-stronger);
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
}

.idp-home .idp-button--primary,
.idp-home .idp-button--primary:hover {
  border-color: var(--idp-text);
  background-color: var(--idp-text);
  color: var(--idp-bg);
  font-weight: 600;
}

.idp-home .idp-button:not(.idp-button--primary):hover {
  border-color: var(--idp-text-label);
}

.idp-text-link {
  font-size: 14px;
}

.idp-home .idp-text-link {
  color: var(--idp-text-quiet);
}

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

.idp-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 32px;
  padding-top: 40px;
  padding-bottom: 36px;
}

.idp-hero__text {
  display: flex;
  flex: 1 1 300px;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.idp-hero__title {
  margin: 0;
  font-size: clamp(34px, 3.6vw, 50px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--idp-text);
}

.idp-hero__lead {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--idp-text-secondary);
}

.idp-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.idp-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--idp-text-label);
}

.idp-key li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.idp-key__swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--c);
}

/* Architecture graph */
.idp-graph-frame {
  flex: 1 1 520px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}

.idp-graph {
  display: block;
  width: 100%;
  min-width: 540px;
  max-width: 640px;
  height: auto;
  margin: 0 auto;
  overflow: visible;
  font-family: var(--idp-font-text);
}

.idp-graph-hint {
  display: none;
  flex-basis: 100%;
  margin: 0;
  font-size: 12px;
  color: var(--idp-text-label);
}

.idp-graph-credit {
  flex-basis: 100%;
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--idp-text-label);
}

.idp-home .idp-graph-credit a {
  color: var(--idp-text-tertiary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.idp-edge {
  fill: none;
  stroke: var(--c);
  stroke-opacity: 0.55;
  stroke-width: 1.6;
}

.idp-edge--dashed {
  stroke-dasharray: 4 5;
}

.idp-port {
  fill: var(--idp-bg);
  stroke: var(--c);
  stroke-width: 2;
}

.idp-lane {
  font-family: var(--idp-font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  fill: var(--c);
}

.idp-node__box {
  fill: var(--idp-graph-node);
  stroke: var(--idp-border-stronger);
  stroke-width: 1;
}

.idp-node__ring {
  fill: none;
  stroke: var(--c);
  stroke-opacity: 0.3;
  stroke-width: 2;
}

.idp-node__top {
  stroke: var(--c);
  stroke-width: 2;
  stroke-linecap: round;
}

.idp-node__tile {
  fill: color-mix(in srgb, var(--c) 12%, transparent);
  stroke: color-mix(in srgb, var(--c) 33%, transparent);
  stroke-width: 1;
}

.idp-node__logo-tile {
  fill: var(--idp-logo-tile);
  stroke: var(--idp-border-stronger);
  stroke-width: 1;
}

/* Logos with an official dark-background variant: one image per theme. */
[data-md-color-scheme="slate"] .idp-logo--light,
[data-md-color-scheme="default"] .idp-logo--dark {
  display: none;
}

.idp-node__tile-text {
  font-family: var(--idp-font-mono);
  font-size: 10px;
  font-weight: 600;
  fill: var(--c);
}

.idp-node__icon {
  fill: none;
  stroke: var(--c);
  stroke-width: 2.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.idp-node__title {
  font-size: 13px;
  font-weight: 600;
  fill: var(--idp-text);
}

.idp-node__sub {
  font-size: 11px;
  fill: var(--idp-text-tertiary);
}

.idp-node:hover .idp-node__box {
  stroke: var(--c);
}

.idp-node:focus {
  outline: none;
}

.idp-node:focus-visible .idp-node__box {
  stroke: var(--idp-blue);
  stroke-width: 3;
}

.idp-edge-label rect {
  fill: var(--idp-bg);
  stroke: color-mix(in srgb, var(--c) 27%, transparent);
  stroke-width: 1;
}

.idp-edge-label text {
  font-family: var(--idp-font-mono);
  font-size: 10px;
  fill: var(--c);
}

/* Signal */
.idp-halo {
  fill: none;
  stroke: var(--c);
  stroke-width: 3;
}

.idp-trail {
  fill: none;
  stroke: var(--c);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.idp-pulse {
  fill: var(--c);
  opacity: 0.35;
}

.idp-pulse-core {
  fill: var(--idp-text);
}

@media (prefers-reduced-motion: reduce) {
  .signal {
    display: none;
  }
}

/* ------------------------------------------------------------------ */
/* Sections                                                           */
/* ------------------------------------------------------------------ */

/* 01 Overview */
.idp-principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  border-top: 1px solid var(--idp-border);
  border-left: 1px solid var(--idp-border);
}

.idp-principle {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 20px;
  border-right: 1px solid var(--idp-border);
  border-bottom: 1px solid var(--idp-border);
}

/* 02 Layers */
.idp-layers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.idp-home .idp-layer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--idp-border-strong);
  border-radius: 12px;
  background-color: var(--idp-card);
  box-shadow: inset 3px 0 0 var(--c);
}

.idp-home .idp-layer:hover {
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
}

.idp-layer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 03 Explore */
.idp-areas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
}

.idp-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--idp-border-strong);
  border-radius: 14px;
}

.idp-area__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.idp-area__head .idp-card-title {
  font-size: 16px;
}

.idp-area__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--c) 12%, transparent);
}

.idp-area__icon svg {
  fill: none;
  stroke: var(--c);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.idp-area__count {
  margin-left: auto;
  font-family: var(--idp-font-mono);
  font-size: 10px;
  color: var(--idp-text-label);
}

.idp-area__links {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--idp-border);
}

.idp-home .idp-area__links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border-bottom: 1px solid var(--idp-border-subtle);
  font-size: 13px;
  color: var(--idp-text-body);
}

.idp-home .idp-area__links a:hover {
  color: var(--idp-text);
}

/* 04 Workflow */
.idp-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  overflow: hidden;
  border: 1px solid var(--idp-border-strong);
  border-radius: 14px;
  background-color: var(--idp-surface);
}

.idp-flow__step {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  padding: 16px 14px;
  border-top: 2px solid var(--c);
  border-right: 1px solid var(--idp-border);
}

.idp-flow__step .idp-tag {
  font-size: 11px;
  letter-spacing: 0;
}

.idp-flow__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--idp-text);
}

.idp-home .idp-flow__code {
  margin-top: auto;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--idp-font-mono);
  font-size: 10px;
  color: var(--idp-text-label);
}

/* 05 Implementation journey */
.idp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--idp-text-tertiary);
}

.idp-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.idp-stage-dot {
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--idp-text-muted);
  border-radius: 50%;
}

.idp-stage-dot--done {
  border-color: var(--idp-green);
  background: var(--idp-green);
}

.idp-legend .idp-stage-dot {
  width: 9px;
  height: 9px;
}

.idp-stages {
  display: flex;
  flex-direction: column;
}

.idp-stage {
  display: flex;
  gap: 16px;
}

.idp-stage__rail {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  width: 14px;
}

.idp-stage__rail .idp-stage-dot {
  margin-top: 18px;
}

.idp-stage__line {
  flex: 1;
  width: 1px;
  background: var(--idp-border);
}

.idp-stage--done .idp-stage__line {
  background: var(--idp-green-border);
}

.idp-stage__body {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  min-width: 0;
  padding: 13px 0;
  border-bottom: 1px solid var(--idp-border-subtle);
}

.idp-stage__n {
  width: 46px;
  font-family: var(--idp-font-mono);
  font-size: 11px;
  color: var(--idp-text-label);
}

.idp-stage__title {
  flex: 1 1 200px;
  font-size: 15px;
  color: var(--idp-text-tertiary);
}

.idp-stage--done .idp-stage__title {
  color: var(--idp-text);
}

.idp-status {
  padding: 2px 7px;
  border: 1px solid var(--idp-chip-border);
  border-radius: 5px;
  font-family: var(--idp-font-mono);
  font-size: 10px;
  color: var(--idp-text-label);
}

.idp-status--done {
  border-color: var(--idp-green-border);
  color: var(--idp-green);
}

.idp-stage__area {
  width: 100%;
  padding-left: 60px;
  font-family: var(--idp-font-mono);
  font-size: 11px;
  color: var(--c);
}

/* 06 Decisions */
.idp-decisions__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.idp-decisions__intro {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
}

.idp-adrs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.idp-home .idp-adr {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--idp-border-strong);
  border-radius: 12px;
  background-color: var(--idp-bg);
}

.idp-home .idp-adr:hover {
  border-color: var(--idp-border-stronger);
}

.idp-adr__n {
  flex: none;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--c) 33%, transparent);
  border-radius: 6px;
  font-family: var(--idp-font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--c);
}

.idp-adr__text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.idp-adr__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.idp-adr__area {
  font-family: var(--idp-font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--idp-text-label);
}

/* 07 Operations */
.idp-ops {
  overflow: hidden;
  border: 1px solid var(--idp-border-strong);
  border-radius: 14px;
}

.idp-ops li + li .idp-op {
  border-top: 1px solid var(--idp-border);
}

.idp-home .idp-op {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  min-height: 44px;
  padding: 15px 18px;
}

.idp-home .idp-op:hover {
  background-color: var(--idp-surface);
}

.idp-op__kind {
  width: 74px;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--c) 33%, transparent);
  border-radius: 5px;
  font-family: var(--idp-font-mono);
  font-size: 10px;
  text-align: center;
  color: var(--c);
}

.idp-op__text {
  display: flex;
  flex: 1 1 200px;
  flex-direction: column;
  gap: 2px;
}

.idp-op__title {
  font-size: 14px;
  font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Tablet and phone                                                   */
/* ------------------------------------------------------------------ */

@media screen and (max-width: 59.984375em) {
  .idp-home__inner {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .idp-hero {
    padding-top: 28px;
  }
}

@media screen and (max-width: 44.984375em) {
  .idp-graph-hint {
    display: block;
  }

  .idp-home__inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .idp-flow__step {
    min-height: 0;
  }

  .idp-stage__area {
    padding-left: 0;
  }

  .idp-key li {
    min-height: 24px;
  }
}

/* Wide screens: section bands and dividers span the whole region to the
   right of the sidebar; each section's content, including the hero, graph
   and credit line, is centred in it at up to 1320px, so all sections share
   the same left and right edges. The footer content uses the same width. */
@media screen and (min-width: 76.25em) {
  .md-content.idp-home {
    flex: 1 1 auto;
    max-width: none;
  }

  .idp-home__inner {
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
  }

  .md-container:has(.idp-home) .idp-footer__inner {
    max-width: 1320px;
    padding-left: clamp(16px, 3vw, 40px);
    padding-right: clamp(16px, 3vw, 40px);
  }

  .idp-graph {
    max-width: 820px;
  }

  .idp-graph-frame {
    flex-basis: 560px;
  }
}
