/* Optional motion layer. Content stays visible until the JS controller is ready. */
:root {
  --motion-ease: cubic-bezier(.22, .68, .2, 1);
}

html.motion-ready [data-reveal] {
  --reveal-x: 0px;
  --reveal-y: 18px;
  opacity: 0;
  transform: translate3d(var(--reveal-x), var(--reveal-y), 0);
  transition: opacity 620ms var(--motion-ease), transform 760ms var(--motion-ease);
  transition-delay: var(--reveal-delay, 0ms);
}

html.motion-ready [data-reveal="lead"] {
  --reveal-y: 10px;
  opacity: 1;
}

html.motion-ready [data-reveal="soft"] { --reveal-y: 8px; }
html.motion-ready [data-reveal="left"] { --reveal-x: -18px; --reveal-y: 0px; }
html.motion-ready [data-reveal="right"] { --reveal-x: 18px; --reveal-y: 0px; }

[data-reveal-order="0"] { --reveal-delay: 0ms; }
[data-reveal-order="1"] { --reveal-delay: 70ms; }
[data-reveal-order="2"] { --reveal-delay: 140ms; }
[data-reveal-order="3"] { --reveal-delay: 210ms; }
[data-reveal-order="4"] { --reveal-delay: 280ms; }
[data-reveal-order="5"] { --reveal-delay: 350ms; }

html.motion-ready [data-reveal].is-revealed,
html.motion-ready [data-reveal]:focus-within {
  opacity: 1;
  transform: none;
}

html.motion-ready [data-reveal]:focus-within {
  transition: none;
}

html.motion-ready [data-reveal="graphic"] {
  opacity: 1;
  transform: none;
  transition: none;
  transition-delay: 0ms;
}

/* A sibling SVG overlays the photograph without changing the picture content model. */
.hero-image-frame { position: relative; isolation: isolate; }
.hero-visual picture { isolation: isolate; }

.motion-network {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: var(--menta);
  opacity: .5;
  pointer-events: none;
  user-select: none;
}

html.motion-ready .motion-network { display: block; }
html.motion-ready .motion-network[data-reveal] { opacity: .5; }

/* SVG paths use pathLength="1". The initial drawing finishes within 3.3 seconds. */
.motion-path {
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.motion-network .motion-path {
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  opacity: 0;
}

.motion-node {
  fill: var(--menta);
  stroke: var(--perla);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
}

.motion-node.node-ring { fill: none; stroke: var(--menta); stroke-width: 1; }
.motion-node.node-highlight { fill: var(--perla); }

.motion-path:nth-of-type(2) { --path-delay: 90ms; }
.motion-path:nth-of-type(3) { --path-delay: 180ms; }
.motion-path:nth-of-type(4) { --path-delay: 270ms; }
.motion-path:nth-of-type(5) { --path-delay: 360ms; }
.motion-path:nth-of-type(6) { --path-delay: 450ms; }

html.motion-ready .motion-network:is(.is-playing, .is-revealed) .motion-path,
html.motion-ready .ecosystem.is-playing .motion-path:not(.motion-signal) {
  animation: motion-draw 2800ms var(--motion-ease) 1 both;
  animation-delay: clamp(0ms, var(--path-delay, 0ms), 500ms);
}

.motion-node:nth-of-type(2) { --node-delay: 1600ms; }
.motion-node:nth-of-type(3) { --node-delay: 1800ms; }
.motion-node:nth-of-type(4) { --node-delay: 2000ms; }
.motion-node:nth-of-type(5) { --node-delay: 2200ms; }
.motion-node:nth-of-type(6) { --node-delay: 2400ms; }

html.motion-ready .motion-network:is(.is-playing, .is-revealed) .motion-node,
html.motion-ready .ecosystem.is-playing .motion-node {
  animation: motion-node-in 850ms var(--motion-ease) 1 both;
  animation-delay: clamp(0ms, var(--node-delay, 1400ms), 2600ms);
}

/* A single passing signal; the original ecosystem lines keep their own color. */
.motion-signal {
  fill: none;
  stroke: var(--menta);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-dasharray: .075 .925;
  stroke-dashoffset: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0;
}

html.motion-ready .ecosystem.is-playing .motion-signal {
  animation: motion-signal-pass 2400ms ease-in-out 350ms 1 both;
}

@keyframes motion-draw {
  from { stroke-dashoffset: 1; opacity: 0; }
  12% { opacity: 1; }
  to { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes motion-node-in {
  from { opacity: 0; transform: scale(.72); }
  60% { opacity: .9; transform: scale(1.1); }
  to { opacity: .9; transform: scale(1); }
}

@keyframes motion-signal-pass {
  from { stroke-dashoffset: 1; opacity: 0; }
  20%, 75% { opacity: .85; }
  to { stroke-dashoffset: 0; opacity: 0; }
}

/* Showing a selected panel restarts this finite entrance without changing layout. */
html.motion-ready:not(.motion-paused) .industry-panel:not([hidden]) {
  animation: motion-panel-in 600ms var(--motion-ease) 1 both;
}

@keyframes motion-panel-in {
  from { opacity: .45; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: none; }
}

/* Native entry transition; unsupported browsers simply open the disclosure. */
@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  @supports (translate: 0 1px) {
    html.motion-ready:not(.motion-paused) .main-nav.open {
      opacity: 1;
      translate: 0 0;
      transition: opacity 180ms ease, translate 260ms var(--motion-ease);
    }

    @starting-style {
      html.motion-ready:not(.motion-paused) .main-nav.open {
        opacity: 0;
        translate: 0 -8px;
      }
    }
  }
}

/* Compact inline control; labels and aria-pressed are owned by the JS controller. */
.motion-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
}

html.motion-ready .motion-toggle:not([hidden]) { display: inline-flex; }
html.motion-ready .hero-footnote { flex-wrap: wrap; row-gap: 10px; }
html.motion-ready .footer-bottom { flex-wrap: wrap; row-gap: 12px; align-items: center; }
.motion-toggle svg { width: 14px; height: 14px; flex: 0 0 auto; }
.motion-toggle-mark {
  width: 8px;
  height: 10px;
  flex: 0 0 auto;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.motion-toggle[aria-pressed="true"] .motion-toggle-mark {
  width: 9px;
  border: 0;
  border-left: 7px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.motion-toggle:focus-visible { outline: 3px solid var(--arandano); outline-offset: 4px; }
.site-footer .motion-toggle:focus-visible { outline-color: var(--menta); }

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  html.motion-ready:not(.motion-paused) :is(a.button, .icon-button, .motion-toggle) {
    transition: transform 240ms var(--motion-ease), background-color 240ms ease;
  }

  html.motion-ready:not(.motion-paused) :is(a.button, .icon-button:not(:disabled)):hover {
    transform: translateY(-2px);
  }

  html.motion-ready:not(.motion-paused) :is(a.button, .text-link) > span[aria-hidden="true"],
  html.motion-ready:not(.motion-paused) .solution-card .icon {
    transition: transform 280ms var(--motion-ease);
  }

  html.motion-ready:not(.motion-paused) :is(a.button, .text-link):hover > span[aria-hidden="true"] {
    transform: translate(3px, -1px);
  }

  html.motion-ready:not(.motion-paused) .solution-card {
    transition: background-color 240ms ease, box-shadow 280ms ease;
  }

  html.motion-ready:not(.motion-paused) .solution-card:hover {
    box-shadow: inset 0 0 0 1px var(--prado);
  }

  html.motion-ready:not(.motion-paused) .solution-card:hover .icon {
    transform: translateY(-3px);
  }

  html.motion-ready:not(.motion-paused) .project-image img {
    transition: transform 420ms var(--motion-ease);
  }

  html.motion-ready:not(.motion-paused) .project-card:hover .project-image img {
    transform: scale(1.035);
  }
}

/* Pause never leaves a heading or paragraph concealed halfway through a reveal. */
html.motion-paused { scroll-behavior: auto !important; }

html.motion-paused *,
html.motion-paused *::before,
html.motion-paused *::after {
  animation-play-state: paused !important;
  transition: none !important;
}

html.motion-paused [data-reveal],
html.motion-paused .industry-panel:not([hidden]) {
  opacity: 1 !important;
  transform: none !important;
}

html.motion-paused .industry-panel { animation: none !important; }
html.motion-ready.motion-paused .motion-network[data-reveal] { opacity: .5 !important; }
html.motion-paused :is(a.button, .icon-button, .solution-card .icon, .project-image img),
html.motion-paused :is(a.button, .text-link) > span[aria-hidden="true"] {
  transform: none !important;
}

@media (hover: none), (pointer: coarse) {
  html.motion-ready :is(a.button, .icon-button):hover { transform: none; }
  .motion-toggle { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html.motion-ready [data-reveal],
  html.motion-ready .industry-panel:not([hidden]) {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  html.motion-ready .motion-network { display: none !important; }
  html.motion-ready :is(.motion-path, .motion-node, .motion-signal) {
    animation: none !important;
    transition: none !important;
    stroke-dashoffset: 0 !important;
    stroke-dasharray: none !important;
    transform: none !important;
    opacity: 1 !important;
  }

  html.motion-ready .ecosystem .motion-signal { opacity: 0 !important; }
  html.motion-ready :is(a.button, .icon-button, .solution-card .icon, .project-image img),
  html.motion-ready :is(a.button, .text-link) > span[aria-hidden="true"] {
    transform: none !important;
    transition: none !important;
  }
}

/* Second pass: a living network, tactile surfaces and an explorable ecosystem.
   The image/card layers move independently of reveal and carousel geometry. */
.hero-image-frame { border-radius: 120px 5px 5px 5px; overflow: hidden; }
.hero-image { transform-origin: center; }
html.motion-interactive .motion-network[data-reveal] { opacity: .92; }
.motion-network .line-trunk { stroke-width: 1.8; }
.motion-network .line-filament { stroke: var(--prado); stroke-width: .85; }
.motion-network .line-accent { stroke: var(--arandano); stroke-width: 1.2; }
.motion-network .network-signal { stroke: var(--perla); stroke-width: 2.5; fill: none; stroke-dasharray: .045 .955; opacity: .85; }
.motion-network .network-halo { fill: none; stroke: var(--menta); stroke-width: 1; transform-box: fill-box; transform-origin: center; }

html.motion-interactive .network-signal {
  animation: network-flow 4600ms linear infinite;
  animation-play-state: paused;
}
html.motion-interactive .network-signal:nth-child(2) { animation-delay: -1600ms; animation-duration: 5600ms; }
html.motion-interactive .network-signal:nth-child(3) { animation-delay: -3200ms; }
html.motion-interactive .network-halo {
  animation: network-breathe 3600ms ease-out infinite;
  animation-play-state: paused;
}
html.motion-interactive .hero-image-frame.motion-in-view :is(.network-signal, .network-halo) { animation-play-state: running; }

@keyframes network-flow { from { stroke-dashoffset: 1; } to { stroke-dashoffset: -1; } }
@keyframes network-breathe {
  from { transform: scale(.65); opacity: .7; }
  to { transform: scale(2.1); opacity: 0; }
}

/* Preserve each texture and let its linework unfold when the card is explored. */
.solution-card::before { transition: transform 900ms var(--motion-ease), opacity 600ms ease; transform-origin: 80% 20%; }
.solution-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--prado), var(--menta), var(--arandano));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 650ms var(--motion-ease);
  pointer-events: none;
}
html.motion-interactive:not(.motion-paused) .solution-card:hover::before { transform: scale(1.18) rotate(-7deg); opacity: .95; }
html.motion-interactive:not(.motion-paused) .solution-card:hover::after { transform: scaleX(1); }
html.motion-interactive .card-top { transform-origin: center; }
html.motion-interactive .tags span { transition: background-color 300ms ease, translate 350ms var(--motion-ease); }
html.motion-interactive:not(.motion-paused) .solution-card:hover .tags span { translate: 0 -2px; background-color: var(--menta); color: var(--acero); }
html.motion-interactive .tags span:nth-child(2) { transition-delay: 35ms; }
html.motion-interactive .tags span:nth-child(3) { transition-delay: 70ms; }
html.motion-interactive .tags span:nth-child(4) { transition-delay: 105ms; }

/* Controls stay in their original cross layout; only their inner icons float. */
.eco-node { border: 1px solid transparent; border-radius: 8px; color: inherit; font-family: inherit; line-height: 1.4; text-align: center; }
.eco-node:disabled { opacity: 1; }
.eco-node:not(:disabled) { cursor: pointer; }
.eco-node[aria-pressed="true"] { border-color: var(--menta); background: #20362A; box-shadow: 0 0 0 4px #B6E2C112; }
.eco-node:focus-visible { outline: 3px solid var(--perla); outline-offset: 5px; }
.eco-interactive .eco-node { transition: background-color 260ms ease, border-color 260ms ease, box-shadow 400ms ease; }
.eco-interactive .eco-node:hover { border-color: var(--menta); box-shadow: 0 0 0 5px #B6E2C110; }
.eco-orbits { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--menta); stroke-width: .6; opacity: .35; pointer-events: none; }
.eco-orbits ellipse { transform-origin: 250px 200px; stroke-dasharray: 2 13; }
html.motion-interactive .eco-orbits ellipse { animation: eco-orbit 44s linear infinite; animation-play-state: paused; }
html.motion-interactive .eco-orbits ellipse + ellipse { animation-direction: reverse; animation-duration: 58s; opacity: .5; }
html.motion-interactive .ecosystem.is-playing .motion-signal {
  animation: motion-signal-pass 3200ms ease-in-out infinite;
  animation-play-state: paused;
  stroke-width: 2.6;
}
html.motion-interactive .ecosystem .motion-signal:nth-of-type(3) { animation-delay: -800ms; }
html.motion-interactive .ecosystem .motion-signal:nth-of-type(4) { animation-delay: -1600ms; }
html.motion-interactive .ecosystem .motion-signal:nth-of-type(5) { animation-delay: -2400ms; }
html.motion-interactive .eco-node .icon { animation: eco-float 4s ease-in-out infinite; animation-play-state: paused; }
html.motion-interactive .eco-left .icon { animation-delay: -1s; }
html.motion-interactive .eco-right .icon { animation-delay: -2s; }
html.motion-interactive .eco-bottom .icon { animation-delay: -3s; }
html.motion-interactive .ecosystem.motion-in-view :is(.eco-orbits ellipse, .motion-signal, .eco-node .icon) { animation-play-state: running; }
@keyframes eco-orbit { to { transform: rotate(360deg); } }
@keyframes eco-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* Selection directs light through the chosen connection, without fictional data. */
.ecosystem[data-active="iot"] .motion-signal:nth-of-type(2),
.ecosystem[data-active="software"] .motion-signal:nth-of-type(3),
.ecosystem[data-active="auto"] .motion-signal:nth-of-type(4),
.ecosystem[data-active="data"] .motion-signal:nth-of-type(5) { stroke: var(--perla); stroke-width: 4; }
.ecosystem-detail {
  min-height: 145px;
  padding: 20px 22px;
  border: 1px solid #B6E2C12B;
  border-radius: 4px 20px 4px 4px;
  background: linear-gradient(120deg, #B6E2C10D, #2B537F12);
}
.eco-detail-index { display: block; color: var(--menta); font-size: 9px; letter-spacing: .12em; margin-bottom: 10px; }
.ecosystem-detail strong { display: block; font-size: 20px; font-weight: 500; letter-spacing: -.025em; color: var(--perla); }
.ecosystem-detail p { margin-top: 8px; font-size: 12px; line-height: 1.75; color: #D0DACC; max-width: 42ch; }

html.motion-interactive:not(.motion-paused) .industry-panel:not([hidden]) > img { animation: industry-pan 7s var(--motion-ease) 1 both; }
@keyframes industry-pan { from { transform: scale(1.06); } to { transform: scale(1); } }

/* Native scroll timelines progressively add depth with no scroll event loop. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) and (min-width: 761px) {
    html.motion-interactive:not(.motion-paused) .founder-card > img {
      animation: portrait-depth linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 100%;
    }
    @keyframes portrait-depth { from { transform: translateY(7px) scale(1.02); } to { transform: translateY(-7px) scale(1.02); } }
  }
}

html.motion-document-hidden *,
html.motion-document-hidden *::before,
html.motion-document-hidden *::after { animation-play-state: paused !important; }

html.motion-paused :is(.hero-image, .motion-network, .card-top, .eco-node .icon, .industry-panel > img, .founder-card > img) { transform: none !important; }
html.motion-paused :is(.tags span, .process .step-number) { translate: none !important; }
html.motion-paused .solution-card:hover::before { transform: none; }
html.motion-paused .solution-card:hover::after { transform: scaleX(0); }

@media (max-width: 760px) {
  .hero-image-frame { border-top-left-radius: 80px; }
  .ecosystem-detail { min-height: 154px; padding: 18px; }
}
@media (hover: none), (pointer: coarse) {
  html.motion-interactive .solution-card:hover::before { transform: none; }
  html.motion-interactive .solution-card:hover .tags span { translate: none; }
}
@media (max-width: 360px) {
  .ecosystem-map .eco-node { min-width: 84px; max-width: 94px; padding: 12px 6px; font-size: 9px; }
  .ecosystem-map .eco-center { width: 88px; height: 88px; }
}
@media (prefers-reduced-motion: reduce) {
  html.motion-interactive *, html.motion-interactive *::before, html.motion-interactive *::after { animation: none !important; transition: none !important; }
  html.motion-interactive :is(.hero-image, .card-top, .eco-node .icon, .industry-panel > img, .founder-card > img) { transform: none !important; }
  html.motion-interactive .solution-card:hover::before { transform: none; }
  html.motion-interactive :is(.tags span, .process .step-number) { translate: none !important; }
}

