/* Fluence — ilustraciones propias de operación y proceso. */

.flow-illustration {
  margin-top: clamp(40px, 6vw, 80px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.flow-illustration-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 66px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

.flow-illustration-group { min-width: 0; }
.flow-illustration-label {
  margin-bottom: 22px;
  font: 12px var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.flow-illustration-label--system { color: var(--blue-ink); }

.flow-source-board {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 16px 20px;
  min-height: 294px;
}
.flow-sheet-block {
  position: relative;
  grid-row: 1 / span 2;
  padding-bottom: 40px;
}
.flow-sheet {
  position: relative;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--bg-3);
  transform: rotate(-2deg);
  overflow: hidden;
}
.flow-sheet-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--text-2);
}
.flow-sheet-mark {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 4px;
  background: rgba(60, 203, 142, .12);
  color: #8fe3bd;
  font-weight: 600;
}
.flow-sheet-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  font-size: 12px;
  color: var(--muted);
}
.flow-sheet-grid > span {
  min-width: 0;
  min-height: 35px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}
.flow-sheet-grid > span:nth-child(odd) { border-right: 1px solid var(--line); }
.flow-sheet-grid > span:nth-last-child(-n + 2) { border-bottom: 0; }
.flow-sheet-grid > .flow-sheet-heading { color: var(--text-2); background: rgba(150, 185, 220, .025); }
.flow-sheet-selection {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 58.3%;
  height: 36px;
  border: 1px solid rgba(60, 203, 142, .5);
}
.flow-pen {
  position: absolute;
  bottom: 13px;
  left: 25px;
  width: 147px;
  height: 9px;
  border: 1px solid rgba(159, 210, 255, .5);
  border-radius: 4px 1px 1px 4px;
  background: linear-gradient(180deg, #365671, #142b3f 55%, #1c3a54);
  transform: rotate(-10deg);
}
.flow-pen::before {
  content: '';
  position: absolute;
  left: 12px;
  top: -2px;
  width: 31px;
  height: 3px;
  border-radius: 2px;
  background: #6c8aa4;
}
.flow-pen::after {
  content: '';
  position: absolute;
  right: -12px;
  top: 0;
  width: 12px;
  height: 7px;
  background: #8fa9bf;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.flow-messages { display: grid; gap: 10px; justify-items: start; align-content: center; padding-top: 5px; }
.flow-messages > span {
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 9px 9px 9px 2px;
  background: var(--bg-3);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-2);
}
.flow-messages > span:last-child { margin-left: 13px; border-radius: 9px 9px 2px 9px; color: var(--muted); }
.flow-notebook { position: relative; width: 158px; max-width: 100%; height: 146px; margin-inline: auto; }
.flow-notebook-page { position: absolute; top: 10px; left: 7px; width: 132px; height: 118px; border: 1px solid rgba(150, 185, 220, .4); border-radius: 4px; background: #172a3a; }
.flow-notebook-page--back { transform: rotate(9deg); }
.flow-notebook-page--front { transform: rotate(-8deg); background: #1b3142; }
.flow-notebook-cover {
  position: absolute;
  inset: 16px 12px 10px 5px;
  padding: 23px 19px 16px 27px;
  border: 1px solid rgba(62, 167, 255, .45);
  border-left: 7px solid #183853;
  border-radius: 3px 7px 7px 3px;
  background: #102538;
  transform: rotate(-3deg);
}
.flow-notebook-cover > span:first-child { display: block; margin-bottom: 15px; font: 12px var(--mono); letter-spacing: .1em; color: var(--blue-ink); }
.flow-notebook-cover > i { display: block; width: 70%; height: 1px; margin-top: 8px; background: var(--line-2); }
.flow-notebook-band { position: absolute; top: -1px; right: 15px; bottom: -1px; width: 5px; background: #2c526d; }

.flow-illustration-connector { position: relative; height: 1px; margin-top: 35px; background: rgba(62, 167, 255, .4); }
.flow-illustration-connector::after { content: ''; position: absolute; top: -4px; right: -1px; width: 8px; height: 8px; border-top: 1px solid var(--blue); border-right: 1px solid var(--blue); transform: rotate(45deg); }
.flow-connector-pulse { position: absolute; top: -3px; left: calc(50% - 3px); width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 12px rgba(62, 167, 255, .4); }
.flow-app { border: 1px solid rgba(62, 167, 255, .35); border-radius: 10px; background: var(--mk-bg); box-shadow: 0 24px 70px -45px #000; overflow: hidden; }
.flow-app-bar { display: flex; align-items: center; gap: 9px; min-height: 41px; padding: 11px 18px; border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--text-2); }
.flow-app-bar > span:last-child { margin-left: auto; font-size: 11px; color: var(--muted); }
.flow-app-live { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.flow-app-body { padding: 22px; }
.flow-app-title { display: grid; gap: 7px; margin-bottom: 20px; }
.flow-app-title > span { font-size: 12px; color: var(--muted); }
.flow-app-title > b { font-size: 21px; font-weight: 500; line-height: 1.2; letter-spacing: -.02em; color: var(--text); }
.flow-app-fields > div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 14px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.flow-app-fields dt { color: var(--muted); }
.flow-app-fields dd { color: var(--text-2); }
.flow-app-status { padding: 3px 8px; border: 1px solid rgba(62, 167, 255, .4); border-radius: 4px; background: var(--blue-soft); font-size: 12px; color: var(--blue-ink); }
.flow-app-trail { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 19px; padding-top: 17px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.flow-app-trail > span { position: relative; padding-top: 14px; }
.flow-app-trail > span::before { content: ''; position: absolute; top: 0; left: 0; width: 5px; height: 5px; border: 1px solid var(--muted); border-radius: 50%; }
.flow-app-trail > .is-current { color: var(--blue-ink); }
.flow-app-trail > .is-current::before { border-color: var(--blue); background: var(--blue); }

/* Tres escenas conectadas: trabajo actual, diseño del flujo y uso con ajustes. */
.process-illustration { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.process-step { position: relative; display: grid; align-content: start; gap: 16px; min-width: 0; padding: 24px; border: 1px solid var(--line-2); border-radius: 12px; background: linear-gradient(180deg, rgba(62, 167, 255, .035), transparent 70%), var(--mk-bg); }
.process-scene { width: 100%; margin-bottom: 8px; }
.process-scene svg { width: 100%; height: auto; overflow: visible; }
.process-scene-rule { stroke: var(--line-2); stroke-width: 1; }
.process-scene-ink { stroke: #48637a; stroke-width: 2; stroke-linecap: round; }
.process-blue-line { stroke: var(--blue); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.process-paper { fill: #1b3142; stroke: #496278; }
.process-notebook { fill: #102538; stroke: #356184; }
.process-surface { fill: #0d1c29; stroke: #345067; }
.process-message { fill: #142b3e; stroke: #42647f; stroke-width: 1; stroke-linejoin: round; }
.process-pen-stroke { stroke: #7092ae; stroke-width: 6; stroke-linecap: round; }
.process-device { fill: #0b1824; stroke: #527590; stroke-width: 1.5; }
.process-scene-text { font: 13px var(--font); fill: var(--text-2); }
.process-scene-small { font: 11px var(--mono); letter-spacing: .06em; fill: var(--muted); }
.process-flow-active { fill: #123550; stroke: var(--blue); stroke-width: 1.3; }
.process-flow-node { fill: var(--blue); }
.process-feedback-path { stroke: var(--blue); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.process-step h3 { font-size: clamp(1.4rem, 2vw, 1.75rem); }
.process-step > p { max-width: 29ch; font-size: 16px; color: var(--text-2); }
.process-link { position: absolute; z-index: 1; left: calc(100% + 7px); top: 115px; width: 26px; height: 1px; background: rgba(62, 167, 255, .45); }
.process-link::before { content: ''; position: absolute; top: -3px; right: 0; width: 6px; height: 6px; border-top: 1px solid var(--blue); border-right: 1px solid var(--blue); transform: rotate(45deg); }
.process-link i { position: absolute; left: 0; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }

@media (prefers-reduced-motion: no-preference) {
  .flow-illustration.is-in .flow-connector-pulse { animation: flowIllustrationTransfer 1.5s var(--ease) .1s both; }
  .process-illustration.is-in .process-link i { animation: processIllustrationTransfer 1.2s var(--ease) .15s both; }
  .process-illustration.is-in .process-step:nth-child(2) .process-link i { animation-delay: 1.25s; }
  .process-illustration.is-in .process-design-path { stroke-dasharray: 450; animation: processIllustrationDesign 1.15s var(--ease) .7s both; }
  .process-illustration.is-in .process-feedback-path { stroke-dasharray: 4 4; animation: processIllustrationFeedback 1.3s linear 1.9s both; }
}
@keyframes flowIllustrationTransfer { 0% { left: 0; opacity: 0; } 15%, 75% { opacity: 1; } 100% { left: calc(100% - 4px); opacity: 0; } }
@keyframes processIllustrationTransfer { 0% { left: 0; opacity: 0; } 15%, 75% { opacity: 1; } 100% { left: calc(100% - 4px); opacity: 0; } }
@keyframes processIllustrationDesign { from { stroke-dashoffset: 450; } to { stroke-dashoffset: 0; } }
@keyframes processIllustrationFeedback { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }

/* Keep the scenes readable before three columns become too narrow. */
@media (max-width: 1200px) {
  .flow-illustration-stage { grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); gap: 20px; }
  .flow-source-board { gap: 16px 14px; }
  .flow-sheet-bar { gap: 7px; padding-inline: 9px; }
  .flow-sheet-grid > span { padding-inline: 8px; }
  .flow-notebook { width: 145px; }
  .flow-notebook-page { width: 120px; }
  .flow-notebook-cover { padding-left: 20px; }
  .flow-messages > span { padding: 10px; }
  .process-illustration { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .process-step { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 12px 36px; align-items: center; padding: 24px; }
  .process-scene { grid-column: 1; grid-row: 1 / span 2; max-width: 340px; margin: 0; }
  .process-step h3 { grid-column: 2; align-self: end; font-size: 26px; }
  .process-step > p { grid-column: 2; align-self: start; max-width: 32ch; }
  .process-link { top: auto; bottom: -31px; left: 50%; width: 1px; height: 21px; }
  .process-link::before { top: auto; right: -2.5px; bottom: 0; transform: rotate(135deg); }
  .process-link i { left: -2px; top: 0; }
}

/* The comparison changes direction while both interfaces still have room. */
@media (max-width: 1024px) {
  .flow-illustration-stage { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .flow-illustration-group { width: 100%; max-width: 560px; margin-inline: auto; }
  .flow-illustration-label { margin-bottom: 18px; }
  .flow-source-board { min-height: 260px; gap: 12px 24px; }
  .flow-sheet-bar { gap: 10px; padding-inline: 12px; }
  .flow-sheet-grid > span { padding-inline: 10px; }
  .flow-notebook { height: 127px; width: 145px; }
  .flow-notebook-page { width: 120px; height: 103px; }
  .flow-notebook-cover { inset: 16px 12px 4px 5px; }
  .flow-illustration-connector { width: 1px; height: 28px; margin: -4px auto; }
  .flow-illustration-connector::after { top: auto; right: -3.5px; bottom: 0; transform: rotate(135deg); }
  .flow-connector-pulse { top: calc(50% - 3px); left: -3px; }
}

@media (max-width: 700px) {
  .process-illustration { gap: 40px; }
  .process-step { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 22px; }
  .process-scene { grid-column: auto; grid-row: auto; width: 100%; max-width: 340px; margin: 0 auto 4px; }
  .process-step h3, .process-step > p { grid-column: auto; align-self: auto; }
  .process-step h3 { font-size: 25px; }
  .process-step > p { max-width: 38ch; }
}

@media (max-width: 480px) {
  .flow-source-board { gap: 12px 16px; min-height: 246px; }
  .flow-sheet-grid > span { padding-inline: 8px; }
  .flow-sheet-bar { padding-inline: 8px; gap: 6px; }
  .flow-sheet-mark { flex-shrink: 0; width: 20px; height: 22px; }
  .flow-messages > span { padding: 9px; font-size: 12px; }
  .flow-messages > span:last-child { margin-left: 5px; }
  .flow-notebook { width: 122px; }
  .flow-notebook-page { width: 101px; }
  .flow-notebook-cover { padding-left: 14px; padding-right: 15px; }
  .flow-notebook-band { right: 9px; width: 4px; }
  .flow-pen { left: 11px; width: 120px; }
  .flow-app-body { padding: 18px; }
  .flow-app-trail { gap: 8px; font-size: 11px; }
  .process-step { padding: 18px; }
}

/* At the smallest widths, give the sheet a full row instead of tiny text. */
@media (max-width: 360px) {
  .flow-source-board { grid-template-columns: minmax(0, 1fr) 116px; gap: 16px; }
  .flow-sheet-block { grid-column: 1 / -1; grid-row: auto; padding-bottom: 30px; }
  .flow-sheet-grid > span { min-height: 32px; padding-block: 7px; }
  .flow-pen { bottom: 5px; }
  .flow-messages { padding-top: 0; }
  .flow-notebook { width: 116px; height: 125px; }
  .flow-notebook-page { width: 95px; }
  .flow-app-bar { padding-inline: 14px; }
  .flow-app-fields > div { gap: 7px 12px; }
  .flow-app-fields dd { margin-left: auto; text-align: right; }
  .process-step { padding: 16px; }
  .process-scene { width: calc(100% + 32px); max-width: none; margin-inline: -16px; }
  .process-scene-small { font-size: 12px; letter-spacing: .02em; }
}

@media (max-width: 1200px) and (prefers-reduced-motion: no-preference) {
  .process-illustration.is-in .process-link i { animation-name: processIllustrationTransferVertical; }
}
@media (max-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .flow-illustration.is-in .flow-connector-pulse { animation-name: flowIllustrationTransferVertical; }
}
@keyframes flowIllustrationTransferVertical { 0% { top: 0; opacity: 0; } 15%, 75% { opacity: 1; } 100% { top: calc(100% - 4px); opacity: 0; } }
@keyframes processIllustrationTransferVertical { 0% { top: 0; opacity: 0; } 15%, 75% { opacity: 1; } 100% { top: calc(100% - 4px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .flow-illustration *, .process-illustration * { animation: none !important; transition: none !important; }
  .process-design-path, .process-feedback-path { stroke-dasharray: none; stroke-dashoffset: 0; }
}
