/*
 * Giganeed ON pop-out in the home "Our products" section
 * (template-parts/home4-on.php, assets/giganeed-on.js).
 * Blue is the Giganeed ON colour and is used nowhere else on the page.
 */
.material-home .range { position: relative; isolation: isolate; }
.material-home .family-image picture { display: contents; }
/* The drawn cable is tied to the drum photo, so that photo does not zoom on hover. */
@media (min-width: 1101px) { .material-home .range .family:first-child .family-main:hover img { transform: none; } }

.gn-on {
  --on: #0a6cff;
  --on-deep: #0055d4;
  --on-ink: #151515;
  --on-dim: #686c75;
  position: absolute; inset: 0; z-index: 3;
  pointer-events: none;
  overflow: hidden;
  overflow: clip visible;
}

/* ---------- Cable and plug (drawn by the script in stage pixels) ---------- */
.gn-on-cable { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; overflow: visible; opacity: 0; transition: opacity .2s ease; }
.gn-on-cable.is-live { opacity: 1; }
.gn-on-strand { fill: none; stroke-linecap: round; stroke-linejoin: round; }
/* Shadow: three soft strokes, tight while the cable lies on the floor (--air 0), looser in the air (--air 1). */
.gn-on-cable-shadow { transform: translate(calc(var(--cw, 10) * .12px), calc(var(--cw, 10) * (.3 + .55 * var(--air, 0)) * 1px)); }
.gn-on-cable-shadow path { stroke: url(#gn-on-g-shadow); stroke-opacity: .16; stroke-width: calc(var(--cw, 10) * 1px); }
.gn-on-cable-shadow path:nth-child(2) { stroke-opacity: .085; stroke-width: calc(var(--cw, 10) * 1.5px); }
.gn-on-cable-shadow path:nth-child(3) { stroke-opacity: .045; stroke-width: calc(var(--cw, 10) * 2.2px); }
/* Jacket: dark underside, body, lit upper half, highlight. Colours come from the gradients in home4-on.php,
   which blend the drawn cable into the photographed one where it starts. */
.gn-on-cable-edge { stroke: url(#gn-on-g-edge); stroke-width: calc(var(--cw, 10) * 1px); }
.gn-on-cable-body { stroke: url(#gn-on-g-body); stroke-width: calc(var(--cw, 10) * .84px); transform: translateY(calc(var(--cw, 10) * -.04px)); }
.gn-on-cable-light { stroke: url(#gn-on-g-light); stroke-width: calc(var(--cw, 10) * .5px); transform: translateY(calc(var(--cw, 10) * -.13px)); }
.gn-on-cable-shine { stroke: url(#gn-on-g-shine); stroke-opacity: .9; stroke-width: calc(var(--cw, 10) * .16px); transform: translateY(calc(var(--cw, 10) * -.15px)); }   /* the photo's highlight sits .13 above centre */
.gn-on-plug { filter: drop-shadow(0 3px 3px #1e1e1c38); }

/* ---------- Cloud: position and the three views ---------- */
.gn-on-cloud {
  --w: clamp(440px, 34vw, 640px);
  --shift: 86%;
  position: absolute; z-index: 1; top: 24%; right: calc(var(--w) * -.21);
  width: var(--w); aspect-ratio: 640 / 400;
  font-size: clamp(13px, calc(var(--w) / 40), 16px);
  transform: translate3d(var(--shift), 0, 0);
  transition: transform .85s cubic-bezier(.2, 1.18, .32, 1), opacity .25s ease, visibility 0s;
  will-change: transform;
}
.gn-on[data-view="hidden"] .gn-on-cloud { --shift: 86%; opacity: 0; visibility: hidden; transition: transform .6s cubic-bezier(.5, 0, .25, 1), opacity .25s ease .3s, visibility 0s .6s; }
.gn-on[data-view="docked"] .gn-on-cloud { --shift: 62.5%; transition: transform .7s cubic-bezier(.5, 0, .2, 1), opacity .25s ease, visibility 0s; }
.gn-on[data-view="docked"] .gn-on-cloud:has(.gn-on-tab:hover, .gn-on-tab:focus-visible) { --shift: 60.4%; transition-duration: .35s; }
.gn-on[data-view="open"] .gn-on-cloud { --shift: 0%; }

.gn-on-puff, .gn-on-shape { position: absolute; inset: 0; }
.gn-on-shape { width: 100%; height: 100%; overflow: visible; }
.gn-on-body { pointer-events: auto; }
.gn-on-shadow { fill: #1e1e1c; opacity: .16; transform: translateY(16px); }
.gn-on-edge { fill: none; stroke: #d3d6dc; stroke-width: 1.3; }

/* ---------- Switched off (default) ---------- */
.gn-on-halo { fill: none; stroke: var(--on); stroke-width: 16; opacity: 0; transition: opacity .3s ease; }
.gn-on-rim { fill: none; stroke: var(--on); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 0 100 0 0; opacity: 0; transition: opacity .3s ease, stroke-dasharray 0s .3s; }
.gn-on-wash, .gn-on-ring { opacity: 0; }
.gn-on-ring { fill: none; stroke: var(--on); stroke-width: 2; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; }
.gn-on-led { fill: #aab0ba; transition: fill .2s ease; }
.gn-on-led-glow { fill: var(--on); opacity: 0; transition: opacity .2s ease; }

.gn-on-copy { position: absolute; left: 21.5%; top: 25%; width: 51%; display: grid; justify-items: center; text-align: center; pointer-events: none; }
.gn-on-copy > * { pointer-events: auto; }
.gn-on-kicker, .gn-on-line, .gn-on-cta { opacity: 0; visibility: hidden; transform: translateY(.7em); transition: opacity .25s ease, transform .25s ease, visibility 0s .25s, background-color .2s ease; }
.gn-on .gn-on-kicker { display: flex; align-items: center; gap: .8em; margin: 0; color: var(--on-dim); font: 600 .72em/1 var(--body); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; }
.gn-on-kicker i { width: 1.7em; height: 2px; background: var(--on); }
.gn-on-logo { width: 92%; margin: .95em 0 .35em; }
.gn-on-logo svg { display: block; width: 100%; height: auto; overflow: visible; }
.gn-on .gn-on-line { margin: 0; color: var(--on-ink); font: 600 1.1em/1.25 var(--head); letter-spacing: -.015em; white-space: nowrap; }
.gn-on .gn-on-cta { display: inline-flex; align-items: center; gap: .7em; margin-top: 1em; padding: .78em 1.2em; border-radius: 3px; background: var(--on); color: #fff; font: 600 .94em/1 var(--body); white-space: nowrap; }
.gn-on .gn-on-cta span { font-size: 1.2em; line-height: .8; transition: transform .2s ease; }
.gn-on .gn-on-cta:hover { background: var(--on-deep); }
.gn-on .gn-on-cta:hover span { transform: translate(2px, -2px); }

/* Logo, dark until the plug is in */
.gn-on-logo .gn-letters path { opacity: .13; transition: opacity .25s ease, fill .25s ease; }
.gn-on-logo .gn-letters path:nth-child(2) { fill: #9aa0ab; }
.gn-on-logo .gn-power circle { fill: #b4b9c2; transition: fill .25s ease; }
.gn-on-logo .gn-line path { stroke-dasharray: 1843; stroke-dashoffset: 1843; transition: stroke-dashoffset 0s .25s, opacity .25s ease; opacity: 0; }
.gn-on-logo .gn-line circle { transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform .2s ease; }

/* ---------- Switched on (the plug has clicked in) ---------- */
.gn-on[data-state="on"] .gn-on-led { fill: var(--on); animation: gn-on-blink .42s steps(1, end) 1; }
.gn-on[data-state="on"] .gn-on-led-glow { opacity: .9; }
.gn-on[data-state="on"] .gn-on-wash { animation: gn-on-wash 1.25s ease-out 1; }
.gn-on[data-state="on"] .gn-on-ring { animation: gn-on-ring 1.25s cubic-bezier(.16, .6, .3, 1) 1; }
.gn-on[data-state="on"] .gn-on-ring + .gn-on-ring { animation-delay: .17s; }
.gn-on[data-state="on"] .gn-on-rim { opacity: 1; stroke-dasharray: 50 0 50 0; transition: opacity .12s ease, stroke-dasharray 1.05s cubic-bezier(.5, 0, .18, 1); }
.gn-on[data-state="on"] .gn-on-halo { opacity: .5; transition: opacity 1s ease .45s; animation: gn-on-breathe 4.8s ease-in-out 1.6s infinite alternate; }

.gn-on[data-state="on"] .gn-on-logo .gn-power circle { fill: var(--on); animation: gn-on-flick .62s linear .12s 1 backwards; }
.gn-on[data-state="on"] .gn-on-logo .gn-power { animation: gn-on-pop .7s cubic-bezier(.2, .7, .2, 1) .12s 1; transform-box: fill-box; transform-origin: center; }
.gn-on[data-state="on"] .gn-on-logo .gn-letters path { opacity: 1; transition: opacity .42s ease, fill .3s ease; }
.gn-on[data-state="on"] .gn-on-logo .gn-letters path:nth-child(1) { transition-delay: .26s; }
.gn-on[data-state="on"] .gn-on-logo .gn-letters path:nth-child(2) { transition-delay: .2s; fill: var(--on); }
.gn-on[data-state="on"] .gn-on-logo .gn-letters path:nth-child(3) { transition-delay: .31s; }
.gn-on[data-state="on"] .gn-on-logo .gn-letters path:nth-child(4) { transition-delay: .36s; }
.gn-on[data-state="on"] .gn-on-logo .gn-letters path:nth-child(5) { transition-delay: .41s; }
.gn-on[data-state="on"] .gn-on-logo .gn-letters path:nth-child(6) { transition-delay: .46s; }
.gn-on[data-state="on"] .gn-on-logo .gn-letters path:nth-child(7) { transition-delay: .51s; }
.gn-on[data-state="on"] .gn-on-logo .gn-letters path:nth-child(8) { transition-delay: .56s; }
.gn-on[data-state="on"] .gn-on-logo .gn-line path { opacity: 1; stroke-dashoffset: 0; transition: stroke-dashoffset .8s cubic-bezier(.6, 0, .2, 1) .58s, opacity 0s .58s; }
.gn-on[data-state="on"] .gn-on-logo .gn-line circle { transform: scale(1); transition: transform .5s cubic-bezier(.3, 1.7, .5, 1) 1.3s; }
.gn-on[data-state="on"] .gn-on-logo .gn-line circle:nth-of-type(1) { transition-duration: .9s; }

.gn-on[data-state="on"] :is(.gn-on-kicker, .gn-on-line, .gn-on-cta) { opacity: 1; visibility: visible; transform: none; transition: opacity .55s ease, transform .6s cubic-bezier(.2, .7, .2, 1), visibility 0s, background-color .2s ease; }
.gn-on[data-state="on"] .gn-on-kicker { transition-delay: .34s, .34s, 0s, 0s; }
.gn-on[data-state="on"] .gn-on-line { transition-delay: .82s, .82s, 0s, 0s; }
.gn-on[data-state="on"] .gn-on-cta { transition-delay: .96s, .96s, 0s, 0s; }

@keyframes gn-on-blink { 0%, 50% { fill: var(--on); } 25%, 75% { fill: #aab0ba; } 100% { fill: var(--on); } }
@keyframes gn-on-wash { 0% { opacity: 0; } 14% { opacity: 1; } 100% { opacity: 0; } }
@keyframes gn-on-ring { 0% { transform: scale(.5); opacity: 0; } 10% { opacity: .6; } 100% { transform: scale(50); opacity: 0; } }
@keyframes gn-on-breathe { from { stroke-opacity: 1; } to { stroke-opacity: .62; } }
@keyframes gn-on-flick { 0% { fill: #b4b9c2; } 18% { fill: var(--on); } 30% { fill: #b4b9c2; } 44% { fill: var(--on); } 56% { fill: #6f9be0; } 70%, 100% { fill: var(--on); } }
@keyframes gn-on-pop { 0% { transform: scale(1); } 35% { transform: scale(1.16); } 100% { transform: scale(1); } }
@keyframes gn-on-standby { 0%, 100% { opacity: 0; } 50% { opacity: .85; } }

/* ---------- Close button and the docked tab ---------- */
.gn-on .gn-on-close { position: absolute; left: 68.6%; top: 19.5%; width: 2.2em; height: 2.2em; min-width: 30px; min-height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid #d3d6dc; border-radius: 50%; background: #fff; color: var(--on-ink); pointer-events: auto; opacity: 0; transition: opacity .3s ease, border-color .2s ease, color .2s ease; }
.gn-on[data-state="on"] .gn-on-close { opacity: 1; transition-delay: 1.05s, 0s, 0s; }
.gn-on .gn-on-close:hover { border-color: var(--on); color: var(--on); }
/* The plug and its socket: a transparent button laid over them by the script. */
.gn-on .gn-on-unplug { position: absolute; z-index: 5; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; pointer-events: none; opacity: 0; }
.gn-on[data-state="on"] .gn-on-unplug { pointer-events: auto; opacity: 1; }
.gn-on .gn-on-unplug:hover { box-shadow: 0 0 0 2px var(--on), 0 0 18px #0a6cff66; }
.gn-on .gn-on-unplug:focus-visible { outline: 3px solid var(--on); outline-offset: 3px; }
.gn-on-unplug-tip { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translate(-50%, 4px); padding: .5em .7em; border-radius: 3px; background: var(--on-ink); color: #fff; font: 600 12px/1 var(--body); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease; }
.gn-on .gn-on-unplug:hover .gn-on-unplug-tip, .gn-on .gn-on-unplug:focus-visible .gn-on-unplug-tip { opacity: 1; transform: translate(-50%, 0); }
.gn-on-close svg { width: .72em; height: .72em; min-width: 10px; min-height: 10px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

.gn-on .gn-on-tab { position: absolute; left: 1%; top: 33%; width: 27%; height: 46%; padding: 0; border: 0; border-radius: 50%; background: none; pointer-events: auto; }
.gn-on-tab-label { position: absolute; right: calc(100% + 4px); top: 50%; padding: .62em .8em; border-radius: 3px; background: var(--on); color: #fff; font: 600 12px/1 var(--body); white-space: nowrap; opacity: 0; transform: translate(6px, -50%); transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.gn-on .gn-on-tab:hover .gn-on-tab-label, .gn-on .gn-on-tab:focus-visible .gn-on-tab-label { opacity: 1; transform: translate(0, -50%); }
.gn-on[data-view="docked"] .gn-on-led { fill: var(--on); }
.gn-on[data-view="docked"] .gn-on-led-glow { animation: gn-on-standby 2.6s ease-in-out infinite; }

/* ---------- Narrow screens: the cloud sits under the cards, still off the right edge,
   and the cable comes in from the left edge of the screen ---------- */
@media (max-width: 1100px) {
  .gn-on { position: relative; inset: auto; margin-top: 34px; }
  .gn-on-cloud { --w: min(108vw, 520px); position: relative; top: auto; right: auto; margin-left: auto; margin-right: calc(var(--w) * -.21); }
  .gn-on .gn-on-close, .gn-on .gn-on-tab { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gn-on *, .gn-on .gn-on-cloud { animation: none !important; transition-duration: .01s !important; transition-delay: 0s !important; }
}
