/* ==========================================================================
   Ghandour Global Group — melon360.html stylesheet
   Requires css/base.css to be loaded first.
   ========================================================================== */

/* --------------------------------------------------------------------------
   10. Melon360 page - centralized software intelligence object
   -------------------------------------------------------------------------- */

.melon-flow {
  --melon-green: #1fcc1f;
  --melon-blue: #0040e0;
  isolation: isolate;
  overflow-x: clip;
}

.melon-flow::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 68% 16%, rgba(31, 204, 31, 0.16), transparent 24rem),
    radial-gradient(circle at 22% 72%, rgba(0, 64, 224, 0.18), transparent 28rem);
}

.melon-flow .container,
.melon-flow section {
  position: relative;
  z-index: 1;
}

/* Data rail: one connective thread through hero -> console -> stack -> CTA,
   lit by scroll progress. Purely visual - drives only the pulse position,
   never a structural section animation (see js/melon360.js). */
.melon-data-rail {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  z-index: 1;
  pointer-events: none;
}

.melon-data-rail-track {
  position: absolute;
  inset: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(31, 204, 31, 0.26) 8%,
    rgba(0, 64, 224, 0.26) 92%,
    transparent 100%
  );
}

.melon-data-rail-pulse {
  position: absolute;
  left: 50%;
  top: calc(var(--melon-progress, 0) * 100%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(31, 204, 31, 0.95), transparent 70%);
  box-shadow: 0 0 20px 5px rgba(0, 64, 224, 0.35);
}

.melon-hero,
.melon-interface-section,
.melon-stack-section,
.melon-cta {
  min-height: calc(100svh - var(--header-h, 72px));
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-block: clamp(4rem, 9vw, 7rem);
}

.melon-hero-grid,
.melon-interface-grid,
.melon-stack-grid,
.melon-cta-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(320px, 1.06fr);
  align-items: center;
  gap: clamp(2.5rem, 7vw, 6rem);
}

.melon-copy h1,
.melon-copy h2,
.melon-interface-copy h2 {
  color: var(--color-white);
  text-wrap: balance;
}

.melon-copy h1 {
  max-width: 13ch;
  font-size: clamp(2.5rem, 6vw, 4.85rem);
  line-height: 0.93;
}

.melon-copy h2,
.melon-interface-copy h2 {
  max-width: 14ch;
  font-size: clamp(2rem, 4.8vw, 3.7rem);
  line-height: 0.98;
}

.melon-copy p,
.melon-interface-copy p,
.melon-panel p {
  color: rgba(232, 237, 247, 0.82);
}

.melon-copy .lead {
  max-width: 55ch;
  font-size: clamp(1rem, 1.45vw, 1.18rem);
}

.melon-breadcrumb a,
.melon-breadcrumb li {
  color: rgba(232, 237, 247, 0.7);
}

.melon-breadcrumb a:hover {
  color: var(--melon-green);
}

.melon-core-stage {
  position: relative;
  width: min(86vw, 560px);
  min-height: 560px;
  margin-inline: auto;
  perspective: 1100px;
  transform-style: preserve-3d;
  --pos-scale: 1;
  transform: rotateX(var(--melon-tilt-x, 0deg)) rotateY(var(--melon-tilt-y, 0deg));
  transition: transform 0.45s cubic-bezier(0.16, 0.6, 0.2, 1);
}

.melon-core-glow {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 220px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(31, 204, 31, 0.28), transparent 72%);
  transform: translateX(-50%) rotateX(68deg) translateZ(-70px);
  transform-origin: center;
  opacity: 0.5;
  transition: opacity 0.5s ease;
}

.melon-core-stage.is-assembled .melon-core-glow {
  opacity: 0.7;
}

.melon-core-stage[data-melon-mode="ai"] .melon-core-glow {
  opacity: 0.9;
}

.melon-stage-grid {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 4%;
  height: 48%;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(31, 204, 31, 0.42) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 52px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 52px),
    radial-gradient(ellipse, rgba(31, 204, 31, 0.16), transparent 72%);
  border: 1px solid rgba(31, 204, 31, 0.22);
  transform: rotateX(68deg) translateZ(-88px);
  transform-origin: center bottom;
  box-shadow: 0 0 38px rgba(31, 204, 31, 0.12);
}

.melon-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotateX(66deg) translateZ(18px);
  transform-origin: center;
}

.melon-orbit--outer {
  width: 82%;
  aspect-ratio: 1;
  border: 1px dashed rgba(77, 125, 255, 0.36);
  /* Slowed from 48s/34s (kept proportional) - ambient ring pair, calmer. */
  animation: melon-spin 58s linear infinite;
}

.melon-orbit--inner {
  width: 54%;
  aspect-ratio: 1;
  border: 1px solid rgba(31, 204, 31, 0.28);
  animation: melon-spin 41s linear infinite reverse;
}

.melon-core-object {
  --cube: 158px;
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--cube);
  height: var(--cube);
  transform-style: preserve-3d;
  transform: translate(-50%, -56%) translateZ(120px) rotateX(-14deg) rotateY(calc(var(--melon-core-rot, -28deg) + var(--melon-scroll-rot, 0deg)));
  transition: transform 0.8s cubic-bezier(0.16, 0.6, 0.2, 1);
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.35));
}

.melon-core-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 22px;
  backface-visibility: hidden;
  font-family: var(--font-primary);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-white);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(160deg, rgba(31, 204, 31, 0.28), rgba(4, 13, 31, 0.96));
  border: 1px solid rgba(31, 204, 31, 0.36);
  box-shadow: inset 0 0 28px rgba(31, 204, 31, 0.12);
}

.melon-core-face--right,
.melon-core-face--left,
.melon-core-face--back {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(160deg, rgba(11, 42, 44, 0.92), rgba(2, 7, 18, 0.98));
}

.melon-core-face--top {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 36%),
    linear-gradient(160deg, rgba(54, 188, 92, 0.34), rgba(12, 49, 107, 0.84));
}

.melon-core-face--bottom {
  background: linear-gradient(160deg, rgba(4, 12, 28, 0.98), rgba(1, 6, 16, 0.98));
}

.melon-core-face--front { transform: translateZ(calc(var(--cube) / 2)); }
.melon-core-face--back { transform: rotateY(180deg) translateZ(calc(var(--cube) / 2)); }
.melon-core-face--right { transform: rotateY(90deg) translateZ(calc(var(--cube) / 2)); }
.melon-core-face--left { transform: rotateY(-90deg) translateZ(calc(var(--cube) / 2)); }
.melon-core-face--top { transform: rotateX(90deg) translateZ(calc(var(--cube) / 2)); }
.melon-core-face--bottom { transform: rotateX(-90deg) translateZ(calc(var(--cube) / 2)); }

/* Ambient decorative layer: always present regardless of tab/mode, subtle
   one-shot fade-in on assemble, no interaction-driven motion. */
.melon-ui-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(31, 204, 31, 0.16), rgba(4, 12, 28, 0.92));
  border: 1px solid rgba(31, 204, 31, 0.24);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  transform-style: preserve-3d;
  opacity: 0;
  transform: translate3d(calc(var(--px) * var(--pos-scale)), calc(var(--py) * var(--pos-scale)), calc(var(--pz) * var(--pos-scale))) scale(var(--reveal, 0.6));
  transition: opacity 0.6s ease, transform 0.6s var(--ease-spring);
}

.melon-ui-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.5), transparent);
}

.melon-core-stage.is-assembled .melon-ui-panel {
  opacity: 0.85;
  --reveal: 1;
}

.melon-ui-panel--one { --px: 96px; --py: -168px; --pz: 96px; transition-delay: 0.05s; }
.melon-ui-panel--two { --px: -140px; --py: 60px; --pz: 84px; transition-delay: 0.15s; }
.melon-ui-panel--three { --px: 100px; --py: 150px; --pz: 70px; transition-delay: 0.25s; }

.melon-data-node {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--melon-green);
  box-shadow: 0 0 14px rgba(31, 204, 31, 0.6);
  opacity: 0;
  transform: translate3d(calc(var(--px) * var(--pos-scale)), calc(var(--py) * var(--pos-scale)), calc(var(--pz) * var(--pos-scale))) scale(var(--reveal, 0.4));
  transition: opacity 0.6s ease, transform 0.6s var(--ease-spring);
}

.melon-core-stage.is-assembled .melon-data-node {
  opacity: 1;
  --reveal: 1;
}

.melon-data-node--one { --px: 40px; --py: -70px; --pz: 110px; transition-delay: 0.1s; }
.melon-data-node--two { --px: -80px; --py: -110px; --pz: 90px; transition-delay: 0.2s; }
.melon-data-node--three {
  --px: -30px; --py: 120px; --pz: 100px;
  background: var(--melon-blue);
  box-shadow: 0 0 14px rgba(0, 64, 224, 0.55);
  transition-delay: 0.3s;
}

/* Tab-driven module system: which set is visible/active is controlled by
   [data-melon-mode] on #melon-core-stage (set in setMode()). Opacity +
   transform only, toggled purely by mode - never a continuous loop except
   the AI node breathing-glow, which is scoped to run only in AI mode. */
.melon-module {
  position: absolute;
  left: 50%;
  top: 50%;
  opacity: 0;
  pointer-events: none;
  transform-style: preserve-3d;
  transform: translate3d(calc(var(--px, 0px) * var(--pos-scale)), calc(var(--py, 0px) * var(--pos-scale)), calc(var(--pz, 0px) * var(--pos-scale))) scale(var(--reveal, 0.7));
  transition: opacity 0.5s ease, transform 0.6s var(--ease-spring);
}

.melon-module--panel,
.melon-module--swatch {
  border-radius: 10px;
}

.melon-module--panel::before,
.melon-module--swatch::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.45), transparent);
}

.melon-module--panel::after,
.melon-module--swatch::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 6px;
  border-radius: 0 0 10px 10px;
  background: rgba(1, 6, 16, 0.4);
}

[data-melon-mode="platforms"] .melon-module--panel,
[data-melon-mode="mobile"] .melon-module--phone,
[data-melon-mode="ai"] .melon-module--node,
[data-melon-mode="ai"] .melon-module--link,
[data-melon-mode="design"] .melon-module--swatch {
  opacity: 1;
  pointer-events: auto;
  --reveal: 1;
}

/* Platforms - dashboard panels assemble around the cube. */
.melon-module--panel {
  width: 64px;
  height: 40px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 6px 8px;
  background: linear-gradient(160deg, rgba(31, 204, 31, 0.2), rgba(4, 12, 28, 0.94));
  border: 1px solid rgba(31, 204, 31, 0.32);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.32);
}

.melon-module--panel span {
  display: block;
  height: 3px;
  border-radius: var(--radius-pill);
  background: rgba(31, 204, 31, 0.6);
}

.melon-module--panel span:nth-child(2) { width: 65%; background: rgba(77, 125, 255, 0.55); }

.melon-module--panel-1 { --px: 100px; --py: -150px; --pz: 100px; transition-delay: 0.05s; }
.melon-module--panel-2 { --px: -150px; --py: 20px; --pz: 90px; transition-delay: 0.15s; }
.melon-module--panel-3 { --px: 90px; --py: 160px; --pz: 80px; transition-delay: 0.25s; }

/* Mobile - a phone interface rotates forward toward the viewer. */
.melon-module--phone {
  width: 74px;
  height: 130px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(18, 36, 76, 0.96), rgba(4, 9, 22, 0.96));
  border: 1px solid rgba(232, 237, 247, 0.18);
  box-shadow: 10px 12px 0 rgba(1, 6, 16, 0.5);
  --px: 80px;
  --py: -30px;
  --pz: 220px;
  transform: translate3d(calc(var(--px) * var(--pos-scale)), calc(var(--py) * var(--pos-scale)), calc(var(--pz) * var(--pos-scale))) rotateY(-40deg) scale(var(--reveal, 0.7));
}

[data-melon-mode="mobile"] .melon-module--phone {
  transform: translate3d(calc(var(--px) * var(--pos-scale)), calc(var(--py) * var(--pos-scale)), calc(var(--pz) * var(--pos-scale))) rotateY(0deg) scale(1);
}

.melon-module--phone span {
  position: absolute;
  left: 14px;
  right: 14px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: rgba(31, 204, 31, 0.4);
}

.melon-module--phone span:nth-child(1) { top: 24px; }
.melon-module--phone span:nth-child(2) { top: 46px; right: 30px; }
.melon-module--phone span:nth-child(3) { bottom: 24px; background: rgba(77, 125, 255, 0.45); }

/* AI - neural nodes connect and glow, light paths scaleX in from the
   connecting point rather than just fading, to sell "connecting." */
.melon-module--node {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--melon-green);
  box-shadow: 0 0 16px rgba(31, 204, 31, 0.6);
}

[data-melon-mode="ai"] .melon-module--node {
  animation: melon-node-breathe 2.4s ease-in-out infinite;
}

@keyframes melon-node-breathe {
  0%, 100% { box-shadow: 0 0 16px rgba(31, 204, 31, 0.6); }
  50% { box-shadow: 0 0 26px rgba(31, 204, 31, 0.95); }
}

.melon-module--node-1 { --px: 90px; --py: -110px; --pz: 110px; transition-delay: 0.05s; }
.melon-module--node-2 { --px: -110px; --py: -40px; --pz: 100px; transition-delay: 0.15s; }
.melon-module--node-3 { --px: -60px; --py: 130px; --pz: 90px; transition-delay: 0.25s; }
.melon-module--node-4 {
  --px: 120px; --py: 90px; --pz: 80px;
  background: var(--melon-blue);
  box-shadow: 0 0 16px rgba(0, 64, 224, 0.55);
  transition-delay: 0.35s;
}

.melon-module--link {
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, rgba(31, 204, 31, 0.85), rgba(77, 125, 255, 0.5));
  box-shadow: 0 0 10px rgba(31, 204, 31, 0.3);
  transform-origin: left center;
  transform: translate3d(calc(var(--px, 0px) * var(--pos-scale)), calc(var(--py, 0px) * var(--pos-scale)), calc(var(--pz, 0px) * var(--pos-scale))) rotate(var(--angle, 0deg)) scaleX(var(--reveal, 0));
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.22, 0.9, 0.3, 1);
}

.melon-module--link-1 { --px: -20px; --py: -80px; --pz: 100px; --angle: -20deg; transition-delay: 0.3s; }
.melon-module--link-2 { --px: -80px; --py: 40px; --pz: 90px; --angle: 35deg; transition-delay: 0.42s; }

/* Design - color/material panels fan outward from the core. */
.melon-module--swatch {
  width: 30px;
  height: 52px;
  background: var(--melon-green);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.melon-module--swatch-1 { --px: 110px; --py: -80px; --pz: 100px; transition-delay: 0.05s; }
.melon-module--swatch-2 { --px: -20px; --py: -140px; --pz: 90px; background: var(--melon-blue); transition-delay: 0.14s; }
.melon-module--swatch-3 { --px: -130px; --py: 60px; --pz: 80px; background: #ffffff; transition-delay: 0.23s; }
.melon-module--swatch-4 { --px: 60px; --py: 150px; --pz: 70px; background: #0c316b; transition-delay: 0.32s; }

.melon-data-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(68vw, 410px);
  height: 2px;
  --line-dim: 1;
  background: linear-gradient(90deg, transparent, rgba(31, 204, 31, 0.68), rgba(77, 125, 255, 0.42), transparent);
  transform: translate(-50%, -50%) translateZ(50px);
  box-shadow: 0 0 14px rgba(31, 204, 31, 0.14);
  animation: melon-line-pulse 3.6s ease-in-out infinite;
  animation-play-state: paused;
}

.melon-core-stage.is-assembled .melon-data-line {
  animation-play-state: running;
}

.melon-data-line--one { transform: translate(-50%, -50%) rotate(22deg) translateZ(50px); animation-delay: 0.4s; }
.melon-data-line--two { --line-dim: 0.75; transform: translate(-50%, -50%) rotate(-32deg) translateZ(46px); animation-delay: 1.1s; }
.melon-data-line--three { --line-dim: 0.6; width: min(50vw, 300px); transform: translate(-50%, -50%) rotate(78deg) translateZ(54px); animation-delay: 1.8s; }

@keyframes melon-line-pulse {
  0%, 100% { opacity: calc(var(--line-dim, 1) * 0.35); box-shadow: 0 0 14px rgba(31, 204, 31, calc(var(--line-dim, 1) * 0.14)); }
  50% { opacity: calc(var(--line-dim, 1) * 1); box-shadow: 0 0 22px rgba(31, 204, 31, calc(var(--line-dim, 1) * 0.32)); }
}

@keyframes melon-spin {
  to { transform: translate(-50%, -50%) rotateX(66deg) translateZ(18px) rotateZ(360deg); }
}

.melon-interface-grid {
  grid-template-columns: minmax(0, 0.78fr) minmax(360px, 1.22fr);
}

.melon-console {
  border-radius: var(--radius-xl);
  padding: clamp(1rem, 2vw, 1.35rem);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 38%),
    rgba(4, 11, 27, 0.72);
  backdrop-filter: blur(var(--blur-md));
  border: 1px solid rgba(122, 160, 255, 0.22);
  box-shadow:
    var(--shadow-console),
    inset 0 0 30px rgba(0, 64, 224, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 0.6, 0.2, 1);
}

.melon-console.is-assembled {
  opacity: 1;
  transform: translateY(0);
}

.melon-console-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.melon-tab {
  position: relative;
  min-height: 44px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(232, 237, 247, 0.14);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(232, 237, 247, 0.78);
  font-family: var(--font-primary);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.melon-tab::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 0;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--melon-green);
  box-shadow: 0 0 10px rgba(31, 204, 31, 0.7);
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.melon-tab:hover,
.melon-tab:focus,
.melon-tab:focus-visible,
.melon-tab.is-active {
  color: var(--color-white);
  border-color: rgba(31, 204, 31, 0.55);
  background: rgba(31, 204, 31, 0.14);
  transform: translateY(-2px);
}

.melon-tab.is-active::after {
  width: 60%;
}

.melon-console-screen {
  position: relative;
  /* Tall enough for the Mobile tab's copy (the longest of the four) at
     desktop widths - 340px clipped its last line (and AI/Design's at
     wider viewports where their copy also wraps to its full height). */
  min-height: 356px;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 72% 30%, rgba(31, 204, 31, 0.12), transparent 34%),
    linear-gradient(160deg, rgba(9, 24, 53, 0.82), rgba(2, 6, 16, 0.82));
  backdrop-filter: blur(8px);
  background-size: 42px 42px, 42px 42px, auto, auto;
  border: 1px solid rgba(232, 237, 247, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.melon-console-screen::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(31, 204, 31, 0.14), transparent);
  transform: translateY(-100%);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
}

.melon-console-screen.is-scanning::before {
  animation: melon-scan-sweep 0.6s ease-out;
}

@keyframes melon-scan-sweep {
  0% { transform: translateY(-100%); opacity: 0.85; }
  100% { transform: translateY(220%); opacity: 0; }
}

.melon-console-status {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--melon-green);
  box-shadow: 0 0 10px rgba(31, 204, 31, 0.7);
  z-index: 2;
}

.melon-console-status.is-pulsing {
  animation: melon-status-pulse 0.6s ease-out;
}

@keyframes melon-status-pulse {
  0% { transform: scale(0.4); opacity: 0.4; }
  60% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.melon-panel {
  position: absolute;
  inset: 0;
  padding: clamp(1.4rem, 3vw, 2.3rem);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.melon-panel.is-active {
  opacity: 1;
  transform: none;
}

.melon-panel h3 {
  max-width: 20ch;
  color: var(--color-white);
  font-size: clamp(1.45rem, 2.8vw, 2.2rem);
}

.melon-panel p:not(.eyebrow) {
  max-width: 23ch;
}

.melon-mini-ui,
.melon-phone-ui,
.melon-neural-ui,
.melon-palette-ui {
  position: absolute;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
}

.melon-mini-ui {
  width: min(38%, 208px);
  display: grid;
  gap: 0.6rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  /* A frosted preview panel that reads as part of the glass console
     rather than a card pasted on top of it: translucent fill over the
     grid, a hairline inset highlight, and a soft ambient shadow instead
     of the old hard offset drop that made it look like a floating
     sticker overlapping the copy. */
  background: linear-gradient(160deg, rgba(14, 32, 60, 0.5), rgba(4, 10, 24, 0.55));
  border: 1px solid rgba(140, 190, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 26px rgba(1, 6, 16, 0.32);
  backdrop-filter: blur(6px);
}

.melon-mini-ui span {
  display: block;
  width: var(--w);
  height: 9px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, rgba(31, 204, 31, 0.72), rgba(77, 125, 255, 0.5));
  box-shadow: 0 0 8px rgba(31, 204, 31, 0.12);
}

.melon-phone-ui {
  width: 110px;
  height: 184px;
  bottom: -14px;
  border-radius: 22px;
  transform-style: preserve-3d;
  /* Same treatment as the dashboard preview: a frosted device that
     settles into the glass console instead of a bright opaque sticker
     with a hard offset drop-shadow floating over the copy. */
  background: linear-gradient(180deg, rgba(16, 34, 66, 0.62), rgba(4, 10, 24, 0.66));
  border: 1px solid rgba(140, 190, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 28px rgba(1, 6, 16, 0.34);
  backdrop-filter: blur(6px);
}

.melon-phone-ui::before,
.melon-phone-ui::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.melon-phone-ui::before {
  top: 14px;
  right: -14px;
  width: 14px;
  height: calc(100% - 28px);
  border-radius: 0 16px 16px 0;
  background: linear-gradient(180deg, rgba(20, 34, 58, 0.66), rgba(4, 9, 20, 0.7));
  transform-origin: left center;
  transform: rotateY(82deg);
}

.melon-phone-ui::after {
  left: 18px;
  top: -10px;
  width: calc(100% - 26px);
  height: 12px;
  border-radius: 14px 14px 3px 3px;
  background: linear-gradient(90deg, rgba(52, 66, 92, 0.66), rgba(12, 20, 34, 0.7));
  transform-origin: bottom center;
  transform: rotateX(82deg);
}

.melon-phone-ui span {
  position: absolute;
  left: 22px;
  right: 22px;
  height: 12px;
  border-radius: var(--radius-pill);
  background: rgba(31, 204, 31, 0.34);
}

.melon-phone-ui span:nth-child(1) { top: 42px; }
.melon-phone-ui span:nth-child(2) { top: 72px; right: 38px; }
.melon-phone-ui span:nth-child(3) { bottom: 42px; background: rgba(77, 125, 255, 0.38); }

.melon-neural-ui {
  width: 190px;
  height: 150px;
  padding: 0.5rem;
  border-radius: 18px;
  /* Same frosted-glass treatment as the other panel previews so the
     node graph settles into the console instead of floating on a hard
     offset shadow. */
  background: linear-gradient(160deg, rgba(14, 32, 60, 0.5), rgba(4, 10, 24, 0.55));
  border: 1px solid rgba(140, 190, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 26px rgba(1, 6, 16, 0.32);
  backdrop-filter: blur(6px);
}

.melon-neural-ui::before,
.melon-neural-ui::after {
  content: "";
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, rgba(31, 204, 31, 0.5), rgba(77, 125, 255, 0.34));
}

.melon-neural-ui::before {
  left: 26px;
  top: 58px;
  width: 138px;
  transform: rotate(22deg);
}

.melon-neural-ui::after {
  left: 34px;
  top: 86px;
  width: 128px;
  transform: rotate(-18deg);
}

.melon-neural-ui span {
  position: absolute;
  width: 15px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(31, 204, 31, 0.78);
  box-shadow: 0 0 9px rgba(31, 204, 31, 0.32);
}

.melon-neural-ui span:nth-child(1) { left: 16px; top: 58px; }
.melon-neural-ui span:nth-child(2) { right: 22px; top: 28px; }
.melon-neural-ui span:nth-child(3) { right: 38px; bottom: 22px; }
.melon-neural-ui span:nth-child(4) { left: 80px; top: 72px; background: rgba(77, 125, 255, 0.82); }

.melon-palette-ui {
  display: flex;
  gap: 0.65rem;
  perspective: 600px;
}

.melon-palette-ui span {
  position: relative;
  width: 42px;
  height: 76px;
  border-radius: 14px;
  background: var(--melon-green);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
  transform: rotateX(10deg) rotateY(-16deg);
  transform-style: preserve-3d;
}

.melon-palette-ui span::after {
  content: "";
  position: absolute;
  top: 6px;
  right: -9px;
  width: 9px;
  height: calc(100% - 10px);
  border-radius: 0 10px 10px 0;
  background: rgba(1, 6, 16, 0.42);
  transform-origin: left center;
  transform: rotateY(82deg);
}

.melon-palette-ui span:nth-child(2) { background: #0040e0; }
.melon-palette-ui span:nth-child(3) { background: #ffffff; }
.melon-palette-ui span:nth-child(4) { background: #0c316b; }

.melon-stack-grid {
  grid-template-columns: minmax(320px, 1fr) minmax(0, 0.9fr);
}

.melon-stack-visual {
  position: relative;
  width: min(88vw, 560px);
  height: 520px;
  perspective: 1100px;
  transform-style: preserve-3d;
}

/* Shallow tilt (not the steep 58deg used elsewhere) so labels stay
   legible; each card snaps into place once via an overshoot easing when
   the stack assembles, then holds still - no continuous bounce, unlike
   eMagine's deployment cards. */
.melon-layer {
  position: absolute;
  left: 8%;
  right: 8%;
  top: calc(42px + var(--i) * 78px);
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  transform-style: preserve-3d;
  font-family: var(--font-primary);
  font-weight: 700;
  color: var(--color-white);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.13), transparent 28%),
    linear-gradient(160deg, rgba(31, 204, 31, 0.16), rgba(5, 13, 30, 0.94));
  border: 1px solid rgba(31, 204, 31, 0.28);
  box-shadow: 0 22px 34px rgba(1, 6, 16, 0.46), 0 0 28px rgba(31, 204, 31, 0.1);
  opacity: 0;
  transform:
    rotateX(20deg) rotateZ(-6deg)
    translateZ(calc(var(--i) * 16px))
    translateY(24px)
    scale(0.94);
  transition: opacity 0.5s ease, transform 0.55s var(--ease-spring);
  transition-delay: calc(var(--i) * 0.12s);
}

.melon-stack-visual.is-assembled .melon-layer {
  opacity: 1;
  transform: rotateX(20deg) rotateZ(-6deg) translateZ(calc(var(--i) * 16px)) translateY(0) scale(1);
}

.melon-layer::before,
.melon-layer::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.melon-layer::before {
  top: 8px;
  right: -18px;
  width: 18px;
  height: calc(100% - 10px);
  border-radius: 0 12px 12px 0;
  background: linear-gradient(180deg, rgba(15, 62, 50, 0.82), rgba(2, 7, 18, 0.96));
  transform-origin: left center;
  transform: rotateY(84deg);
}

.melon-layer::after {
  left: 14px;
  bottom: -16px;
  width: calc(100% - 12px);
  height: 16px;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(90deg, rgba(8, 42, 38, 0.82), rgba(2, 7, 18, 0.98));
  transform-origin: top center;
  transform: rotateX(-84deg);
}

.melon-layer--one { --i: 0; }
.melon-layer--two { --i: 1; }
.melon-layer--three { --i: 2; }
.melon-layer--four { --i: 3; }
.melon-layer--five { --i: 4; border-color: rgba(77, 125, 255, 0.34); }

.melon-metrics {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.melon-metrics div {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(232, 237, 247, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.melon-metrics strong {
  color: var(--melon-green);
  font-family: var(--font-primary);
}

.melon-metrics span {
  color: rgba(232, 237, 247, 0.86);
}

.melon-cta {
  min-height: 82svh;
}

.melon-cta-grid {
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1fr);
}

/* "Build With Melon360" CTA: a software product being assembled - an
   upright 3D app window (title bar, sidebar nav, content rows, a mini
   chart) with two modular component blocks docking into it and a green
   "+" piece snapping on. The assemble-on-scroll flies each part into
   place, so the scene literally builds itself as it enters view -
   concrete and on-theme, versus the old abstract floor bars. */
.melon-build {
  position: relative;
  width: min(86vw, 440px);
  height: 340px;
  margin-inline: auto;
  transform-style: preserve-3d;
  transform: perspective(1100px) rotateX(4deg) rotateY(-17deg);
}

.melon-build > span {
  position: absolute;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.melon-build.is-assembled > span {
  opacity: 1;
  transform: none;
}

/* Main app-product window */
.melon-build-window {
  left: 6%;
  top: 40px;
  width: 300px;
  height: 210px;
  border-radius: 16px;
  transform-style: preserve-3d;
  transform: translateY(20px) scale(0.94);
  background:
    linear-gradient(180deg, rgba(15, 34, 64, 0.96) 0 34px, transparent 34px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 32%),
    linear-gradient(160deg, rgba(9, 22, 47, 0.97), rgba(4, 10, 24, 0.98));
  border: 1px solid rgba(140, 190, 255, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 22px 40px rgba(1, 6, 16, 0.5);
}

/* Window thickness: a right edge face and a bottom face */
.melon-build-window::before,
.melon-build-window::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.melon-build-window::before {
  top: 5px;
  right: -16px;
  width: 16px;
  height: calc(100% - 6px);
  border-radius: 0 12px 12px 0;
  background: linear-gradient(180deg, rgba(12, 28, 54, 0.98), rgba(2, 7, 18, 0.99));
  transform-origin: left center;
  transform: rotateY(90deg);
}

.melon-build-window::after {
  left: 6px;
  bottom: -15px;
  width: calc(100% - 6px);
  height: 15px;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(90deg, rgba(9, 22, 44, 0.98), rgba(2, 7, 18, 0.99));
  transform-origin: top center;
  transform: rotateX(-90deg);
}

/* Window-chrome traffic-light dots on the title bar */
.melon-build-dot {
  top: 13px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: none;
}

.melon-build-dot--r { left: 16px; background: rgba(255, 106, 96, 0.9); }
.melon-build-dot--y { left: 32px; background: rgba(255, 200, 92, 0.9); }
.melon-build-dot--g { left: 48px; background: rgba(70, 214, 120, 0.95); }

/* Sidebar nav rail inside the window */
.melon-build-nav {
  left: 16px;
  top: 52px;
  width: 60px;
  height: 140px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(rgba(140, 190, 255, 0.32), rgba(140, 190, 255, 0.32)) 12px 14px / 34px 6px no-repeat,
    linear-gradient(rgba(140, 190, 255, 0.2), rgba(140, 190, 255, 0.2)) 12px 32px / 28px 6px no-repeat,
    linear-gradient(rgba(31, 204, 31, 0.5), rgba(31, 204, 31, 0.5)) 12px 50px / 34px 6px no-repeat,
    linear-gradient(rgba(140, 190, 255, 0.2), rgba(140, 190, 255, 0.2)) 12px 68px / 24px 6px no-repeat,
    rgba(6, 16, 36, 0.85);
  transform: translateX(-18px);
}

/* Content rows in the main pane */
.melon-build-line {
  left: 92px;
  height: 8px;
  border-radius: var(--radius-pill);
}

.melon-build-line--one {
  top: 60px;
  width: 150px;
  background: linear-gradient(90deg, rgba(31, 204, 31, 0.65), rgba(31, 204, 31, 0.1));
  transform: translateY(-10px);
}

.melon-build-line--two {
  top: 80px;
  width: 118px;
  background: linear-gradient(90deg, rgba(140, 190, 255, 0.55), rgba(140, 190, 255, 0.08));
  transform: translateY(-10px);
}

/* Mini bar chart in the lower-right of the main pane */
.melon-build-chart {
  left: 92px;
  top: 108px;
  width: 176px;
  height: 74px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 0 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(6, 16, 36, 0.6);
  transform: translateY(14px);
}

.melon-build-chart i {
  display: block;
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, rgba(31, 204, 31, 0.85), rgba(77, 125, 255, 0.4));
}

.melon-build-chart i:nth-child(1) { height: 48%; }
.melon-build-chart i:nth-child(2) { height: 72%; }
.melon-build-chart i:nth-child(3) { height: 40%; }
.melon-build-chart i:nth-child(4) { height: 88%; }

/* Modular component blocks docking into the product from the right */
.melon-build-block {
  right: -2%;
  width: 78px;
  height: 60px;
  border-radius: var(--radius-md);
  transform-style: preserve-3d;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 40%),
    linear-gradient(160deg, rgba(14, 34, 64, 0.96), rgba(5, 12, 28, 0.97));
  border: 1px solid rgba(31, 204, 31, 0.34);
  box-shadow: 0 16px 26px rgba(1, 6, 16, 0.42);
}

.melon-build-block::before {
  content: "";
  position: absolute;
  top: 4px;
  right: -12px;
  width: 12px;
  height: calc(100% - 5px);
  border-radius: 0 10px 10px 0;
  background: linear-gradient(180deg, rgba(10, 26, 50, 0.98), rgba(2, 7, 18, 0.99));
  transform-origin: left center;
  transform: rotateY(90deg);
}

.melon-build-block::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 6px;
  border-radius: var(--radius-pill);
  transform: translate(-50%, -50%);
  background: rgba(31, 204, 31, 0.6);
  box-shadow: 0 0 10px rgba(31, 204, 31, 0.35);
}

.melon-build-block--one {
  top: 96px;
  transform: translateX(46px);
  transition-delay: 0.18s;
}

.melon-build-block--two {
  top: 176px;
  border-color: rgba(77, 125, 255, 0.36);
  transform: translateX(46px);
  transition-delay: 0.3s;
}

.melon-build-block--two::after {
  background: rgba(77, 125, 255, 0.55);
  box-shadow: 0 0 10px rgba(77, 125, 255, 0.32);
}

/* The finishing "+" piece snapping on top */
.melon-build-spark {
  right: 6%;
  top: 52px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 40%, rgba(94, 235, 130, 0.95), rgba(31, 204, 31, 0.7));
  box-shadow: 0 0 20px rgba(31, 204, 31, 0.55);
  transform: translateY(-24px) scale(0.6);
  transition-delay: 0.44s;
}

.melon-build-spark::before,
.melon-build-spark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(4, 20, 10, 0.9);
  border-radius: 2px;
}

.melon-build-spark::before {
  width: 16px;
  height: 3.5px;
  transform: translate(-50%, -50%);
}

.melon-build-spark::after {
  width: 3.5px;
  height: 16px;
  transform: translate(-50%, -50%);
}

.melon-build.is-assembled {
  animation: melon-build-flash 0.8s ease 0.4s;
}

@keyframes melon-build-flash {
  0% { filter: brightness(1); }
  55% { filter: brightness(1.25); }
  100% { filter: brightness(1); }
}

@media (max-width: 900px) {
  .melon-hero,
  .melon-interface-section,
  .melon-stack-section,
  .melon-cta {
    min-height: auto;
    padding-block: clamp(4rem, 14vw, 6rem);
  }

  .melon-hero-grid,
  .melon-interface-grid,
  .melon-stack-grid,
  .melon-cta-grid {
    grid-template-columns: 1fr;
  }

  .melon-core-stage {
    width: min(92vw, 420px);
    min-height: 420px;
  }

  .melon-core-object {
    --cube: 122px;
  }

  /* Simplify the core: drop the ambient panel chips and one data-line/node,
     shrink the module system's spread via the shared --pos-scale
     multiplier, and reduce orbiting details generally. */
  .melon-core-stage {
    --pos-scale: 0.68;
  }

  .melon-ui-panel,
  .melon-data-line--three,
  .melon-data-node--three,
  .melon-module--panel-3,
  .melon-module--node-4,
  .melon-module--swatch-4 {
    display: none;
  }

  .melon-console-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .melon-console-screen {
    min-height: 390px;
  }

  .melon-stack-visual {
    height: 420px;
  }
}

@media (max-width: 600px) {
  .melon-copy h1 {
    font-size: clamp(2.05rem, 13vw, 3.1rem);
  }

  .melon-copy h2,
  .melon-interface-copy h2 {
    font-size: clamp(1.7rem, 10vw, 2.55rem);
  }

  .melon-core-stage {
    min-height: 360px;
  }

  .melon-console {
    padding: 0.8rem;
  }

  .melon-panel {
    padding: 1.2rem;
  }

  .melon-mini-ui,
  .melon-phone-ui,
  .melon-neural-ui,
  .melon-palette-ui {
    position: relative;
    right: auto;
    bottom: auto;
    margin-top: 1.5rem;
  }

  /* Stacking the preview below the copy makes the panel taller than the
     console-screen's 390px (set for the side-by-side desktop/tablet
     layout), and the screen's overflow: hidden was cropping the bottom
     of whichever preview didn't fit - worst case the phone mock on the
     Mobile tab at narrow widths. Give the screen enough room for that. */
  .melon-console-screen {
    min-height: 560px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .melon-orbit,
  .melon-core-object,
  .melon-data-line,
  .melon-module--node,
  .melon-console-screen::before,
  .melon-console-status,
  .melon-build,
  .melon-build > span {
    animation: none;
  }

  .melon-core-stage,
  .melon-core-object,
  .melon-core-glow,
  .melon-ui-panel,
  .melon-data-node,
  .melon-module,
  .melon-module--phone,
  .melon-module--link,
  .melon-console,
  .melon-tab,
  .melon-tab::after,
  .melon-layer,
  .melon-build > span {
    transition: none;
  }
}
