/* =========================================================
   Lore Playing — Workflow
   Native HTML / CSS workflow diagrams
   ========================================================= */

.lp-workflow {
  --lp-orange: #dc843d;
  --lp-orange-dark: #a9571d;
  --lp-purple: #7957b8;
  --lp-blue: #318ca6;
  --lp-gold: #d39b35;

  --lp-text: #1f2933;
  --lp-muted: #64748b;
  --lp-border: #d8dee6;
  --lp-surface: #ffffff;
  --lp-surface-soft: #f6f7f9;
  --lp-line: #cbd2da;

  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}


/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */

.lp-workflow-header {
  max-width: 760px;
  margin: 0 auto 4rem;
  text-align: center;
}

.lp-workflow-header h1 {
  margin: 0;

  color: var(--lp-text);

  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.lp-workflow-header > p {
  max-width: 620px;
  margin: 1.25rem auto 0;

  color: var(--lp-muted);

  font-size: 1.05rem;
  line-height: 1.7;
}


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

.lp-workflow-section {
  margin-bottom: 5rem;
}

.lp-workflow-section-heading {
  display: flex;
  align-items: center;
  gap: 1rem;

  margin-bottom: 2rem;
}

.lp-workflow-role-icon {
  display: grid;
  place-items: center;

  width: 3.2rem;
  height: 3.2rem;

  flex: 0 0 3.2rem;

  border: 1px solid var(--lp-border);
  border-radius: 12px;

  background: var(--lp-surface);

  box-shadow:
    0 5px 16px rgba(15, 23, 42, 0.07);

  font-size: 1.45rem;
}

.lp-workflow-kicker {
  display: block;

  margin-bottom: 0.2rem;

  color: var(--lp-orange);

  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.lp-workflow-section-heading h2 {
  margin: 0;

  color: var(--lp-text);

  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 750;
}


/* ---------------------------------------------------------
   Diagram
   --------------------------------------------------------- */

.lp-workflow-diagram {
  position: relative;

  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    70px
    minmax(0, 1fr)
    70px
    minmax(0, 1fr)
    70px
    minmax(0, 1fr);

  align-items: center;

  margin-bottom: 2.5rem;
}


/* ---------------------------------------------------------
   Step cards
   --------------------------------------------------------- */

.lp-workflow-step {
  position: relative;
  z-index: 2;

  min-height: 205px;

  padding: 1.5rem 1.25rem;

  border: 1px solid var(--lp-border);
  border-radius: 18px;

  background: var(--lp-surface);

  box-shadow:
    0 8px 25px rgba(15, 23, 42, 0.07);

  text-align: center;

  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.lp-workflow-step:hover {
  transform: translateY(-4px);

  border-color: color-mix(
    in srgb,
    var(--lp-orange) 45%,
    var(--lp-border)
  );

  box-shadow:
    0 14px 34px rgba(15, 23, 42, 0.11);
}


/* ---------------------------------------------------------
   Clickable step cards
   --------------------------------------------------------- */

.lp-workflow-step-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.lp-workflow-step-link:hover {
  color: inherit;
  text-decoration: none;
}

.lp-workflow-step-link:focus-visible {
  outline: 2px solid var(--lp-orange);
  outline-offset: 4px;
}


/* ---------------------------------------------------------
   Step number
   --------------------------------------------------------- */

.lp-workflow-number {
  position: absolute;

  top: 0.75rem;
  right: 0.85rem;

  color: var(--lp-muted);

  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}


/* ---------------------------------------------------------
   Icon
   --------------------------------------------------------- */

.lp-workflow-icon {
  display: grid;
  place-items: center;

  width: 4rem;
  height: 4rem;

  margin: 0 auto 1rem;

  border-radius: 14px;

  background:
    linear-gradient(
      145deg,
      color-mix(
        in srgb,
        var(--lp-orange) 14%,
        var(--lp-surface)
      ),
      color-mix(
        in srgb,
        var(--lp-purple) 10%,
        var(--lp-surface)
      )
    );

  font-size: 1.65rem;
}


/* ---------------------------------------------------------
   Step titles
   --------------------------------------------------------- */

.lp-workflow-step h3 {
  margin: 0;

  color: var(--lp-text);

  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.25;
}

.lp-workflow-step p {
  margin: 0.55rem 0 0;

  color: var(--lp-muted);

  font-size: 0.85rem;
  line-height: 1.45;
}


/* Colorful step titles */

.lp-workflow-step:nth-child(1) h3 {
  color: var(--lp-orange);
}

.lp-workflow-step:nth-child(3) h3 {
  color: var(--lp-purple);
}

.lp-workflow-step:nth-child(5) h3 {
  color: var(--lp-blue);
}

.lp-workflow-step:nth-child(7) h3 {
  color: var(--lp-gold);
}


/* ---------------------------------------------------------
   Connectors
   --------------------------------------------------------- */

.lp-workflow-connector {
  position: relative;

  height: 4px;

  background: var(--lp-line);

  border-radius: 999px;
}

.lp-workflow-connector::after {
  content: "";

  position: absolute;

  right: -1px;
  top: 50%;

  width: 10px;
  height: 10px;

  border-top: 3px solid var(--lp-orange);
  border-right: 3px solid var(--lp-orange);

  transform:
    translateY(-50%)
    rotate(45deg);
}

.lp-workflow-connector span {
  position: absolute;

  inset: 0;

  transform-origin: left center;
  transform: scaleX(0);

  background: var(--lp-orange);

  border-radius: inherit;

  transition:
    transform 700ms cubic-bezier(.2, .7, .2, 1);
}


/* ---------------------------------------------------------
   Activated workflow
   --------------------------------------------------------- */

.lp-workflow-diagram.is-visible
  .lp-workflow-connector span {
  transform: scaleX(1);
}

.lp-workflow-diagram.is-visible
  .lp-workflow-step {
  animation: lpWorkflowStepIn 500ms both;
}

.lp-workflow-diagram.is-visible
  .lp-workflow-step:nth-child(1) {
  animation-delay: 0ms;
}

.lp-workflow-diagram.is-visible
  .lp-workflow-step:nth-child(3) {
  animation-delay: 120ms;
}

.lp-workflow-diagram.is-visible
  .lp-workflow-step:nth-child(5) {
  animation-delay: 240ms;
}

.lp-workflow-diagram.is-visible
  .lp-workflow-step:nth-child(7) {
  animation-delay: 360ms;
}

@keyframes lpWorkflowStepIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ---------------------------------------------------------
   Detailed numbered steps
   --------------------------------------------------------- */

.lp-workflow-details {
  width: 100%;
  max-width: 900px;

  margin: 0 auto;

  padding: 1.75rem 2rem;

  border: 1px solid var(--lp-border);
  border-radius: 16px;

  background: var(--lp-surface-soft);

  box-sizing: border-box;
}

.lp-workflow-details h3 {
  margin: 0 0 1.25rem;

  color: var(--lp-text);

  font-size: 1rem;
  font-weight: 750;
}


/* Ordered list */

.lp-workflow-details ol {
  display: flex;
  flex-direction: column;

  gap: 0.7rem;

  list-style: none;

  width: 100%;

  margin: 0;
  padding: 0;

  counter-reset: workflow-step;
}


/* Individual step */

.lp-workflow-details li {
  counter-increment: workflow-step;

  display: grid;

  grid-template-columns: 2rem minmax(0, 1fr);

  align-items: start;

  column-gap: 0.85rem;

  width: 100%;

  margin: 0;
  padding: 0.75rem 0;

  box-sizing: border-box;

  color: var(--lp-muted);

  font-size: 0.95rem;
  line-height: 1.65;
}


/* Number badge */

.lp-workflow-details li::before {
  content: counter(workflow-step);

  display: grid;
  place-items: center;

  width: 2rem;
  height: 2rem;

  margin-top: 0.05rem;

  border-radius: 50%;

  background: var(--lp-orange);

  color: #ffffff;

  font-size: 0.75rem;
  font-weight: 800;

  line-height: 1;
}


/* Text container */

.lp-workflow-details li > span {
  display: block;

  min-width: 0;

  overflow-wrap: break-word;
  word-break: normal;
}


/* Important text */

.lp-workflow-details strong {
  color: var(--lp-text);
  font-weight: 700;
}


/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

.lp-workflow-footer {
  display: flex;
  justify-content: center;
  align-items: center;

  gap: 0.65rem;

  margin: 1rem 0 3rem;

  color: var(--lp-muted);

  font-size: 0.82rem;

  text-align: center;
}

.lp-workflow-footer span {
  color: var(--lp-orange);
}


/* ---------------------------------------------------------
   Dark mode
   --------------------------------------------------------- */

.dark .lp-workflow {
  --lp-text: #f1f5f9;
  --lp-muted: #a8b3c2;
  --lp-border: #374151;
  --lp-surface: #171b22;
  --lp-surface-soft: #1d232c;
  --lp-line: #4b5563;
}

.dark .lp-workflow-role-icon,
.dark .lp-workflow-step {
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.22);
}

.dark .lp-workflow-icon {
  background:
    linear-gradient(
      145deg,
      rgba(220, 132, 61, 0.15),
      rgba(121, 87, 184, 0.15)
    );
}


/* ---------------------------------------------------------
   Tablet
   --------------------------------------------------------- */

@media (max-width: 900px) {

  .lp-workflow-diagram {
    grid-template-columns:
      minmax(0, 1fr)
      45px
      minmax(0, 1fr)
      45px
      minmax(0, 1fr)
      45px
      minmax(0, 1fr);
  }

  .lp-workflow-step {
    min-height: 190px;

    padding: 1.25rem 0.9rem;
  }

  .lp-workflow-step h3 {
    font-size: 0.95rem;
  }

  .lp-workflow-step p {
    font-size: 0.78rem;
  }

  .lp-workflow-details {
    padding: 1.5rem;
  }
}


/* ---------------------------------------------------------
   Mobile
   --------------------------------------------------------- */

@media (max-width: 700px) {

  .lp-workflow-header {
    margin-bottom: 3rem;
  }

  .lp-workflow-header > p {
    font-size: 0.95rem;
  }

  .lp-workflow-section {
    margin-bottom: 4rem;
  }

  .lp-workflow-section-heading {
    margin-bottom: 1.5rem;
  }


  /* -------------------------------------------------------
     Workflow diagram
     ------------------------------------------------------- */

  .lp-workflow-diagram {
    display: flex;
    flex-direction: column;
    align-items: stretch;

    gap: 0;
  }


  /* Mobile workflow card */

  .lp-workflow-step {
    width: 100%;

    min-height: auto;

    padding: 1.35rem 1.25rem;

    display: grid;

    grid-template-columns:
      3.2rem
      minmax(0, 1fr)
      auto;

    grid-template-areas:
      "icon title number"
      "icon text number";

    column-gap: 1rem;

    text-align: left;

    box-sizing: border-box;
  }

  .lp-workflow-number {
    position: static;

    grid-area: number;

    align-self: center;

    font-size: 0.65rem;
  }

  .lp-workflow-icon {
    grid-area: icon;

    width: 3.2rem;
    height: 3.2rem;

    margin: 0;

    border-radius: 11px;

    font-size: 1.35rem;
  }

  .lp-workflow-step h3 {
    grid-area: title;

    align-self: end;

    min-width: 0;

    font-size: 1rem;
  }

  .lp-workflow-step p {
    grid-area: text;

    align-self: start;

    min-width: 0;

    margin-top: 0.25rem;

    font-size: 0.82rem;
  }


  /* Mobile connectors */

  .lp-workflow-connector {
    width: 3px;
    height: 32px;

    margin-left: 2.85rem;

    background: var(--lp-line);
  }

  .lp-workflow-connector::after {
    display: none;
  }

  .lp-workflow-connector span {
    transform-origin: top center;
    transform: scaleY(0);
  }

  .lp-workflow-diagram.is-visible
    .lp-workflow-connector span {
    transform: scaleY(1);
  }


  /* -------------------------------------------------------
     Mobile detailed steps
     ------------------------------------------------------- */

  .lp-workflow-details {
    width: 100%;

    margin: 0;

    padding: 1.35rem 1rem;

    border-radius: 14px;
  }

  .lp-workflow-details h3 {
    margin-bottom: 1rem;

    font-size: 1rem;
  }

  .lp-workflow-details ol {
    gap: 0.4rem;
  }

  .lp-workflow-details li {
    grid-template-columns:
      1.85rem
      minmax(0, 1fr);

    column-gap: 0.7rem;

    width: 100%;

    padding: 0.65rem 0;

    font-size: 0.9rem;
    line-height: 1.55;
  }

  .lp-workflow-details li::before {
    width: 1.85rem;
    height: 1.85rem;

    margin-top: 0.05rem;

    font-size: 0.7rem;
  }

  .lp-workflow-details li > span {
    width: 100%;
    min-width: 0;
  }


  /* Footer */

  .lp-workflow-footer {
    padding: 0 1rem;

    line-height: 1.5;
  }
}


/* ---------------------------------------------------------
   Small phones
   --------------------------------------------------------- */

@media (max-width: 400px) {

  .lp-workflow-section-heading {
    gap: 0.75rem;
  }

  .lp-workflow-role-icon {
    width: 2.8rem;
    height: 2.8rem;

    flex-basis: 2.8rem;

    font-size: 1.25rem;
  }

  .lp-workflow-kicker {
    font-size: 0.62rem;
  }

  .lp-workflow-section-heading h2 {
    font-size: 1.3rem;
  }

  .lp-workflow-step {
    padding: 1.15rem 1rem;

    grid-template-columns:
      2.8rem
      minmax(0, 1fr)
      auto;

    column-gap: 0.75rem;
  }

  .lp-workflow-icon {
    width: 2.8rem;
    height: 2.8rem;

    font-size: 1.2rem;
  }

  .lp-workflow-details {
    padding: 1.15rem 0.85rem;
  }

  .lp-workflow-details li {
    grid-template-columns:
      1.7rem
      minmax(0, 1fr);

    column-gap: 0.6rem;

    font-size: 0.86rem;
  }

  .lp-workflow-details li::before {
    width: 1.7rem;
    height: 1.7rem;

    font-size: 0.65rem;
  }
}


/* ---------------------------------------------------------
   Reduced motion
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

  .lp-workflow-step,
  .lp-workflow-connector span {
    animation: none !important;
    transition: none !important;
  }
}