/* the hero's 3D Marrinn octopus (2026-10-15, Saife: "replace it with a 3D marrinn octopus ... its orange eyes
   follow [the mouse] ... make it smile"). Replaces the ring of layer tiles on the v3 homepage.
   Render: kie.ai seedream/5-pro from the octopus mark, background removed on kie.ai (sources in v3 gen/).

   Second render, same day (Saife: "its tentacles that's on the floor should be in a resting position like it looks
   naturally on the ground ... you can have everything else moving"): seen from slightly above, six tentacles lie
   flat on the floor, two arms curl up at the sides. The render is used twice:
     .octo__rest  the lower part, below the mantle: the resting tentacles. It never moves.
     .octo__rig   the upper part: head, raised arms, eyes. It breathes, shifts its weight and turns toward the
                  cursor, all pivoting on the mantle base (50% 60%), so the seam with the still part barely moves.
   The rest copy is opaque through the seam (from 56%); the top copy feathers out over it (56% to 62%).
   All positions are measured from the render, in % of the image: mantle base ~60%, the tentacles' footprint on
   the floor runs from 61% (farthest back) to 97.85% (front tips), eyes as set inline in the markup.
   pages/octo.js stands the front tips on the plate's floor and moves the pupils. */

.octo { position: absolute; left: 72%; top: 78%; width: clamp(390px, 46vw, 760px); aspect-ratio: 1400 / 989; /* 2026-10-15: "a bit bigger" (was 71%, 40vw, 340-660px) */
  transform: translate(-50%, -97.85%); perspective: 1400px; pointer-events: none; }
/* the octopus sits on the floor, so it stands in front of the floor's fade to dark, not under it */
.hero__subject:has(#hero-octo) { z-index: 4; }

.octo__aura { position: absolute; inset: -12% -6% 30%; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(150 105 255 / .32), rgb(123 88 197 / .12) 55%, transparent 78%);
  filter: blur(8px); animation: octo-aura 5.5s ease-in-out infinite; }
/* ambient occlusion on the floor under the whole footprint */
.octo__shadow { position: absolute; left: 2%; right: 2%; top: 60%; height: 42%;
  background: radial-gradient(closest-side, rgb(2 2 8 / .5), rgb(2 2 8 / .22) 62%, transparent); }

/* the violet glow is one blurred silhouette behind everything: a glow on the top copy lit up its own faded bottom
   edge and drew a light band across the body where the two copies meet */
.octo__halo { position: absolute; inset: 0; background: rgb(150 105 255);
  -webkit-mask: url(/assets/v2/img/octo/octo-3d-rest.webp) center / 100% 100% no-repeat; mask: url(/assets/v2/img/octo/octo-3d-rest.webp) center / 100% 100% no-repeat;
  filter: blur(12px); opacity: .5; }
.octo__img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; user-select: none; -webkit-user-drag: none; }
/* filters sit on the wrappers, never on the masked images: a mask clips everything outside its own box, so a
   glow on the image is cut off along the box edges and draws a rectangle round the octopus */
/* no filter on either copy: a drop-shadow traces each copy's faded seam edge and draws a band across the body.
   The glow is .octo__halo, and the contact shadow is its own dark silhouette, kept to the floor part (from 64%). */
.octo__rest { position: absolute; inset: 0; }
.octo__contact { position: absolute; inset: 0; background: #020208; opacity: .75; transform: translateY(1.1%); filter: blur(3px);
  -webkit-mask: url(/assets/v2/img/octo/octo-3d-rest.webp) center / 100% 100% no-repeat, linear-gradient(to bottom, transparent 62%, #000 68%);
  -webkit-mask-composite: source-in;
  mask: url(/assets/v2/img/octo/octo-3d-rest.webp) center / 100% 100% no-repeat, linear-gradient(to bottom, transparent 62%, #000 68%);
  mask-composite: intersect; }
.octo__img--rest { -webkit-mask-image: linear-gradient(to bottom, transparent 52%, #000 56%); mask-image: linear-gradient(to bottom, transparent 52%, #000 56%); }
.octo__img--top { -webkit-mask-image: linear-gradient(to bottom, #000 56%, transparent 62%); mask-image: linear-gradient(to bottom, #000 56%, transparent 62%); }

.octo__rig { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: 50% 60%; will-change: transform; }
.octo__breath { position: absolute; inset: 0; transform-origin: 50% 60%; animation: octo-breath 4.2s ease-in-out infinite; }
/* the weight shift carries the eyes with it, so the pupils never slip off the almonds */
.octo__sway { position: absolute; inset: 0; transform-origin: 50% 60%; animation: octo-shift 7s ease-in-out infinite; }
.octo__body { position: absolute; inset: 0; }

.octo__eyes { position: absolute; inset: 0;
  -webkit-mask: url(/assets/v2/img/octo/octo-3d-rest-eyes.png) center / 100% 100% no-repeat; mask: url(/assets/v2/img/octo/octo-3d-rest-eyes.png) center / 100% 100% no-repeat; }
/* the eye keeps its own orange; this only adds a warm core so the pupil sits in light */
.octo__eye { position: absolute; left: var(--l); top: var(--t); width: var(--w); height: var(--h);
  background: radial-gradient(closest-side, rgb(255 196 90 / .55), transparent); }
.octo__pupil { position: absolute; left: var(--cx); top: var(--cy); width: 2.9%; aspect-ratio: 1; border-radius: 50%;
  margin: -1.45% 0 0 -1.45%; /* % margins resolve against the width, so this centres the round pupil */
  background: radial-gradient(circle at 50% 50%, #12071f 0 55%, #2b0f45 78%, #4a1d63 100%);
  box-shadow: 0 0 0 .15em rgb(120 40 0 / .35); will-change: transform; }
.octo__pupil::after { content: ""; position: absolute; left: 22%; top: 18%; width: 30%; height: 30%; border-radius: 50%; background: rgb(255 255 255 / .9); }
.octo__lid { position: absolute; left: var(--l); top: calc(var(--t) - 1%); width: var(--w); height: calc(var(--h) + 2%);
  background: linear-gradient(to bottom, var(--lid) 0 80%, color-mix(in srgb, var(--lid) 60%, #000) 100%);
  transform-origin: 50% 0; transform: scaleY(0); transition: transform .09s ease-in; }
.octo.is-blink .octo__lid { transform: scaleY(1); }

@keyframes octo-breath { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.018); } }
/* a slow weight shift from side to side, pivoting on the mantle base */
@keyframes octo-shift { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(1.2deg); } 75% { transform: rotate(-1.2deg); } }
@keyframes octo-aura { 0%, 100% { opacity: .75; transform: scale(.97); } 50% { opacity: 1; transform: scale(1.03); } }

/* tablets and small laptops (2026-10-25 mobile audit): at 72% and 46vw its tentacles crossed the hero paragraph */
@media (min-width: 761px) and (max-width: 1100px) {
  .octo { left: 75%; width: min(42vw, 470px); }
}
@media (max-width: 760px) {
  /* on a phone the floor sits behind the headline, so the octopus stays above it, without the floor shadow */
  .octo { left: 50%; top: 26%; width: min(88vw, 470px); transform: translate(-50%, -50%); }
  .octo__shadow { display: none; }
  .hero__subject:has(#hero-octo) { z-index: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .octo__aura, .octo__breath, .octo__sway { animation: none; }
}
