/* Hero wall hover
   - The tile grows slightly.
   - A light travels around its edge, starting at the top-left corner and running clockwise
     (top -> right -> bottom -> left), and blooms outward from the edge.
   The light lives in <span class="nl-edge"><svg class="nl-edge-svg"> added by hover-sweep.js.
   The hovered tile (front or rear wall) is marked .nl-hot by the script's own hit test.
   Overrides the solid ring from the generated bundle; loaded after it. */

/* ---- size on hover ---- */
/* The tile itself grows and shrinks with a transition (runs both ways). */
html:root body #home .nlf8c .wall-panel {
  transition: scale .45s cubic-bezier(.2, .8, .3, 1), box-shadow .4s, filter .25s;
}
/* The lifted copy is created already hovered, so a transition never runs on it: it grows with an
   animation instead. !important beats the bundle's "animation:none!important" on .scene-lift children. */
html:root body #home .nlf8c .scene-lift .wall-panel.is-lifted {
  animation: nl-tile-grow .45s cubic-bezier(.2, .8, .3, 1) both !important;
}
html:root body #home .nlf8c .wall-panel.nl-hot,
html:root body #home .nlf8c .scene-lift .wall-panel.is-lifted {
  scale: 1.05;
  z-index: 50;
  overflow: visible;                         /* let the glow spread outside the tile */
  box-shadow: 8px 16px 30px #000b;           /* no solid ring; deeper shadow for the lift */
}
html:root body #home .nlf8c .wall-panel.nl-hot .panel-image,
html:root body #home .nlf8c .scene-lift .wall-panel.is-lifted .panel-image {
  border-radius: inherit;                    /* keep rounded corners now that overflow is visible */
}
html:root body #home .nlf8c .nlf8-card:hover:not(.nl-hot),
html:root body #home .nlf8c .nlf8-rear:hover:not(.nl-hot) {
  box-shadow: 5px 10px 17px #0009;
}

/* Keyboard focus keeps a clear static ring. */
html:root body #home .nlf8c .nlf8-card:focus-visible {
  box-shadow: 0 0 0 2px #8fe3ea, 0 0 30px rgba(112, 217, 236, .45), 5px 10px 17px #0009;
}

/* ---- the travelling light ---- */
html:root body #home .nlf8c .wall-panel .nl-edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  transition: opacity .3s ease;
  /* glow stacked from tight to wide: bright core, then a broad cyan bloom */
  filter:
    drop-shadow(0 0 1.5px rgba(96, 165, 250, 1))
    drop-shadow(0 0 5px rgba(37, 99, 235, .7));
}
html:root body #home .nlf8c .wall-panel.nl-hot .nl-edge,
html:root body #home .nlf8c .scene-lift .wall-panel.is-lifted .nl-edge {
  opacity: 1;
}

/* The light is an SVG outline (added by hover-sweep.js). Every stroke uses pathLength=100, so a dash
   of length L always covers L% of the perimeter and moves at the same speed along every edge and
   around every corner. --nl-head is where the head of the light is (0-100 along the outline,
   starting at the top-left and running clockwise); each layer ends exactly at the head, so the
   short white core leads and the longer, dimmer layers trail behind it. */
@property --nl-head {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}
html:root body #home .nlf8c .wall-panel .nl-edge-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
html:root body #home .nlf8c .wall-panel .nl-edge-svg rect {
  x: .75px;
  y: .75px;
  width: calc(100% - 1.5px);
  height: calc(100% - 1.5px);
  rx: 5px;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: var(--len) calc(100 - var(--len));
  stroke-dashoffset: calc(var(--len) - var(--nl-head));
}
html:root body #home .nlf8c .wall-panel .nl-edge-svg .nl-trail-base { stroke: rgba(59, 130, 246, .25); stroke-width: 1; stroke-dasharray: none; stroke-dashoffset: 0; }
html:root body #home .nlf8c .wall-panel .nl-edge-svg .nl-trail-6 { --len: 42; stroke: rgba(37, 99, 235, .45); stroke-width: 1.3; }
html:root body #home .nlf8c .wall-panel .nl-edge-svg .nl-trail-5 { --len: 32; stroke: rgba(37, 99, 235, .65); stroke-width: 1.3; }
html:root body #home .nlf8c .wall-panel .nl-edge-svg .nl-trail-4 { --len: 23; stroke: rgba(59, 130, 246, .85); stroke-width: 1.4; }
html:root body #home .nlf8c .wall-panel .nl-edge-svg .nl-trail-3 { --len: 15; stroke: rgba(59, 130, 246, 1); stroke-width: 1.5; }
html:root body #home .nlf8c .wall-panel .nl-edge-svg .nl-trail-2 { --len: 8;  stroke: rgba(96, 165, 250, 1); stroke-width: 1.6; }
html:root body #home .nlf8c .wall-panel .nl-edge-svg .nl-trail-1 { --len: 4;  stroke: #dbeafe; stroke-width: 1.8; filter: none; }

html:root body #home .nlf8c .wall-panel.nl-hot .nl-edge-svg,
html:root body #home .nlf8c .scene-lift .wall-panel.is-lifted .nl-edge-svg {
  animation: nl-edge-run 2.2s linear infinite !important;
}

@keyframes nl-tile-grow {
  0%   { scale: 1;     box-shadow: 5px 10px 17px #0009; }
  60%  { scale: 1.042; }
  100% { scale: 1.05;  box-shadow: 8px 16px 30px #000b; }
}

@keyframes nl-edge-run {
  from { --nl-head: 0; }
  to   { --nl-head: 100; }
}

@media (prefers-reduced-motion: reduce) {
  html:root body #home .nlf8c .wall-panel { transition: none; }
  html:root body #home .nlf8c .wall-panel.nl-hot,
  html:root body #home .nlf8c .scene-lift .wall-panel.is-lifted { scale: 1; animation: none !important; }
  html:root body #home .nlf8c .wall-panel.nl-hot .nl-edge-svg,
  html:root body #home .nlf8c .scene-lift .wall-panel.is-lifted .nl-edge-svg { animation: none !important; }
  html:root body #home .nlf8c .wall-panel .nl-edge-svg .nl-trail-base { stroke: rgba(143, 227, 234, .8); }
  html:root body #home .nlf8c .wall-panel .nl-edge-svg [class^="nl-trail-"]:not(.nl-trail-base) { display: none; }
}

/* ---- hover callout: thin line from the hovered tile to a large screen showing that site ---- */
html:root body #home .nl-callout {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}
html:root body #home .nlf8c.is-open ~ .nl-callout,
html:root body #home .nl-callout:not(.is-on) .nl-callout-screen { opacity: 0; }
html:root body #home .nl-callout-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
/* The callout line travels like a comet: a bright head runs from the tile to the screen and the
   trail behind it disappears as it goes, so the full line is never left standing.
   Paths use pathLength=1. --nl-run is the head's position (0 = tile, 1 = screen); each layer is a
   dash of length --L ending at the head. The run goes to 1.65 so the longest trail (.65) also leaves;
   with a .75s linear run the head reaches the screen at ~.45s, when the screen starts to open. */
@property --nl-run {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}
html:root body #home .nl-callout-line {
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: var(--L) 3;
  stroke-dashoffset: calc(var(--L) - var(--nl-run));
  opacity: 0;
}
html:root body #home .nl-callout-line.l5 { --L: .9;  stroke: rgba(37, 99, 235, .4); stroke-width: 1; }
html:root body #home .nl-callout-line.l4 { --L: .6;  stroke: rgba(37, 99, 235, .65); stroke-width: 1; }
html:root body #home .nl-callout-line.l3 { --L: .36; stroke: rgba(59, 130, 246, .9); stroke-width: 1.1; }
html:root body #home .nl-callout-line.l2 { --L: .18; stroke: rgba(96, 165, 250, 1); stroke-width: 1.2; filter: drop-shadow(0 0 3px rgba(59, 130, 246, .9)); }
html:root body #home .nl-callout-line.l1 { --L: .06; stroke: #dbeafe; stroke-width: 1.5; filter: drop-shadow(0 0 3px rgba(96, 165, 250, 1)) drop-shadow(0 0 7px rgba(37, 99, 235, .8)); }
html:root body #home .nl-callout-dot {
  fill: #e6fdff;
  filter: drop-shadow(0 0 4px #8fe3ea);
  opacity: 0;
}
html:root body #home .nl-callout.is-on .nl-callout-svg {
  animation: nl-callout-run .7s cubic-bezier(.35, .1, .3, 1) both;
}
html:root body #home .nl-callout.is-on .nl-callout-line { opacity: 1; }
/* the start point glows while the head leaves it, then fades with the trail */
html:root body #home .nl-callout.is-on .nl-callout-dot {
  animation: nl-callout-dot .7s ease both;
}
@keyframes nl-callout-run { from { --nl-run: 0; } to { --nl-run: 1.9; } }
@keyframes nl-callout-dot { 0% { opacity: 0; } 12% { opacity: 1; } 45% { opacity: 1; } 100% { opacity: 0; } }

/* The screen's outline and glow come from drop-shadows on the wrapper, so they follow whatever shape
   the inner .nl-callout-shape is clipped to (rectangle, hexagon, octagon, ...). */
html:root body #home .nl-callout-screen {
  position: absolute;
  filter:
    drop-shadow(0 0 .6px #8fe3ea)
    drop-shadow(0 0 1px rgba(143, 227, 234, .9))
    drop-shadow(0 0 16px rgba(112, 217, 236, .4))
    drop-shadow(0 24px 40px rgba(0, 0, 0, .6));
  opacity: 0;
  transition: opacity .25s ease;             /* hiding: a quick fade */
  /* transform-origin is set by hover-sweep.js to the vertex where the line arrives */
}
/* Showing: the line draws first (.45s); then the screen opens out of the point the line reached. */
html:root body #home .nl-callout.is-on .nl-callout-screen {
  opacity: 1;
  animation: nl-screen-open .7s cubic-bezier(.3, .6, .25, 1) .3s both;
}
@keyframes nl-screen-open {
  0%   { opacity: 0; transform: scale(.03); }
  18%  { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
html:root body #home .nl-callout-shape {
  position: relative;
  background: #0b1016;
  clip-path: inset(0 round 8px);
}
html:root body #home .nl-callout-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px 0 calc(var(--bar-pad, 0%) + 10px);  /* clear of the shape's slanted top corners */
  background: #111a26;
  font: 600 11px/1 var(--mono, ui-monospace, monospace);
  color: #9fb3c4;
}
html:root body #home .nl-callout-bar i { width: 8px; height: 8px; border-radius: 50%; background: #2b3a4c; }
html:root body #home .nl-callout-bar span { margin-left: 8px; color: #e6fdff; letter-spacing: .04em; }
html:root body #home .nl-callout-screen img { display: block; width: 100%; aspect-ratio: 2.05; object-fit: cover; object-position: top; }
html:root body #home .nl-callout-glare {
  position: absolute; inset: 26px 0 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, .10), transparent 35%);
}
@media (prefers-reduced-motion: reduce), (max-width: 900px) {
  html:root body #home .nl-callout.is-on .nl-callout-svg { animation-duration: .4s; }
  html:root body #home .nl-callout-screen,
  html:root body #home .nl-callout.is-on .nl-callout-screen { transition: none; transform: none; animation: none; }
}
@media (max-width: 900px) {
  html:root body #home .nl-callout { display: none; }
}

/* corner markers used to anchor the callout line */
html:root body #home .nlf8c .wall-panel .nl-edge > .nl-corner { position: absolute; width: 0; height: 0; }
html:root body #home .nlf8c .wall-panel .nl-edge > .nl-corner-tl { left: 0; top: 0; }
html:root body #home .nlf8c .wall-panel .nl-edge > .nl-corner-tr { right: 0; top: 0; }
html:root body #home .nlf8c .wall-panel .nl-edge > .nl-corner-bl { left: 0; bottom: 0; }
html:root body #home .nlf8c .wall-panel .nl-edge > .nl-corner-br { right: 0; bottom: 0; }
