/* How we operate: the hub diagram and the six capabilities (markup in components/hub.html,
   motion in components/hub.js). Tokens from styles.css only. Cream lines on the oxford band;
   gold only for the hub lamp, the pulses and their trace, the call rings, and the windows that
   light when the properties line up as one building. */

/* Head: centred, like the other section heads (center-head in styles.css) */
.hx-head { text-align: center; max-width: 920px; margin: 0 auto; }
.hx-head h2 { margin-inline: auto; max-width: 20ch; }
.hx-head .rule { margin: 28px auto; }
.hx-head .lead { margin-inline: auto; max-width: 60ch; }

/* The diagram */
.hx { position: relative; margin: clamp(44px, 6vw, 80px) 0 0; color: var(--on-band); }
.hx-art { width: 100%; max-width: none; height: auto; overflow: hidden; }
.hx-art .hx-st { stroke: currentColor; stroke-opacity: .13; stroke-width: 1; }
.hx-art .hx-al { stroke: currentColor; stroke-opacity: .09; stroke-width: 1; stroke-dasharray: 2 6; }
.hx-art .hx-ln { stroke: currentColor; stroke-opacity: .3; stroke-width: 1; }
.hx-art .hx-nd { fill: currentColor; fill-opacity: .85; }
/* property drawings are drawn small and scaled 1.4x, so these widths are 1.3, .8 and 1.1 on screen */
.hx-art .hx-p .m { stroke: currentColor; stroke-width: .93; stroke-linejoin: round; stroke-linecap: round; }
.hx-art .hx-p .d { stroke: currentColor; stroke-width: .57; stroke-opacity: .78; stroke-linejoin: round; }
.hx-art .hx-p .g { stroke: currentColor; stroke-width: .79; stroke-opacity: .5; }
.hx-art .hx-portico { stroke: currentColor; }
.hx-art .hx-ring { fill: var(--band); stroke: currentColor; stroke-opacity: .28; stroke-width: 1; }
.hx-art .hx-lamp { fill: var(--gold); }
.hx-art .hx-halo { opacity: .7; }
.hx-art .hx-s0 { stop-color: var(--on-band-accent); stop-opacity: .75; }
.hx-art .hx-s1 { stop-color: var(--gold); stop-opacity: .22; }
.hx-art .hx-s2 { stop-color: var(--gold); stop-opacity: 0; }
.hx-art .hx-hub-label { font-family: var(--sans); font-weight: 600; font-size: 11.5px; letter-spacing: .2em; fill: var(--on-band-accent); }
.hx-art .hx-pl { stroke: currentColor; stroke-width: .9; }
.hx-art .hx-dc { fill: var(--on-band-accent); }
.hx-art .hx-ping { fill: none; stroke: var(--on-band-accent); stroke-width: 1.2; }
.hx-art .hx-tr { fill: none; stroke: var(--on-band-accent); stroke-width: 1.2; }
.hx-art .hx-wl { fill: var(--gold); stroke: none; }
/* Before the figure arrives (set by hub.js when motion is allowed) */
.hx.is-live .hx-ln { stroke-dasharray: 1 2; }

/* Tablets and phones: the drawing runs to the screen edges at a larger scale and the outer
   blocks fade off the sides, the way a neighborhood carries on past the frame. */
@media (max-width: 860px) {
  .hx { margin-inline: calc(-1 * var(--gutter)); overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
  .hx-art { width: 130%; margin-left: -15%; }
}
@media (max-width: 600px) {
  .hx-art { width: 172%; margin-left: -36%; }
  .hx-art .hx-p .m { stroke-width: 1.25; }
  .hx-art .hx-p .d { stroke-width: .8; }
  .hx-art .hx-p .g { stroke-width: 1; }
  .hx-art .hx-ln, .hx-art .hx-ring { stroke-width: 1.5; }
  .hx-art .hx-st { stroke-width: 1.4; }
  .hx-art .hx-hub-label { font-size: 17px; }
}

/* The six capabilities */
.hx-caps { list-style: none; padding: 0; margin: clamp(56px, 7vw, 96px) 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 56px; }
.hx-cap { display: grid; gap: 10px; align-content: start; padding-top: 28px; border-top: 1px solid var(--band-rule); }
.hx-cap h3 { font-family: var(--display); font-weight: 600; font-size: clamp(26px, 2.4vw, 30px); line-height: 1.1; }
.hx-cap p { font-size: 16px; line-height: 1.55; color: var(--on-band-muted); max-width: 34ch; }
.hx-ico { width: 40px; height: 40px; margin-bottom: 14px; overflow: visible; color: var(--on-band); fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 860px) {
  .hx-caps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 40px; }
}
@media (max-width: 600px) {
  .hx-caps { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hx-cap { grid-template-columns: 40px minmax(0, 1fr); column-gap: 20px; row-gap: 6px; padding: 22px 0 24px; }
  .hx-cap .hx-ico { grid-row: span 2; margin: 2px 0 0; }
  .hx-cap h3 { font-size: 26px; }
}

/* Icon parts (final, still state; this is what shows without JS or with reduced motion) */
.hx-ico .nd { fill: var(--band); }
.hx-ico .core { fill: var(--on-band-accent); stroke: none; }
.hx-ico .core-glow { stroke: var(--on-band-accent); stroke-width: 1; opacity: .35; }
.hx-ico .dome { fill: var(--band); }
.hx-ico .back { opacity: .5; }
.hx-ico .chk { stroke: var(--on-band-accent); stroke-width: 1.4; }
.hx-ico .ky { fill: currentColor; stroke: none; opacity: .6; }
.hx-ico .led { stroke-opacity: .5; }
.hx-ico .fov { stroke-dasharray: 1.4 2.6; stroke-opacity: .6; stroke-width: 1.1; }
.hx-ico .gr { stroke-opacity: .4; }
.hx-ico .dot { fill: var(--on-band-accent); stroke: none; }
.hx-ico .top { fill: var(--band); }
.hx-ico .drop { fill: var(--on-band-accent); stroke: none; }
.hx-ico .c { fill: var(--band); }
.hx-ico .sw { stroke: var(--on-band-accent); }
.hx-ico .pin { fill: var(--on-band-accent); stroke: none; }
.hx-ico .head, .hx-ico .c, .hx-ico .back { transform-box: view-box; }
.hx-ico .head { transform-origin: 9.5px 11.5px; }
.hx-ico .c { transform-origin: 20px 27.5px; }
.hx-ico .c1 { transform: rotate(-22deg); }
.hx-ico .c3 { transform: rotate(22deg); }

/* Icon motion: once as each capability arrives (.go), then a slow loop where it fits.
   hub.js adds these classes only when motion is allowed, and pauses loops off screen. */
@media (prefers-reduced-motion: no-preference) {
  .hx-caps.hx-idle * { animation-play-state: paused !important; }
  .go .i-hub .sp { stroke-dasharray: 1 2; animation: hx-draw .7s cubic-bezier(.2, .7, .2, 1) both; }
  .go .i-hub .sp:nth-of-type(1) { animation-delay: calc(var(--d, 0s) + 0s); }
  .go .i-hub .sp:nth-of-type(2) { animation-delay: calc(var(--d, 0s) + .08s); }
  .go .i-hub .sp:nth-of-type(3) { animation-delay: calc(var(--d, 0s) + .16s); }
  .go .i-hub .sp:nth-of-type(4) { animation-delay: calc(var(--d, 0s) + .24s); }
  .go .i-hub .sp:nth-of-type(5) { animation-delay: calc(var(--d, 0s) + .32s); }
  .go .i-hub .sp:nth-of-type(6) { animation-delay: calc(var(--d, 0s) + .4s); }
  .go .i-hub .nd { transform-box: fill-box; transform-origin: center; animation: hx-pop .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--d, 0s) + .55s); }
  .go .i-hub .core-glow { transform-box: fill-box; transform-origin: center; animation: hx-breathe 4.8s ease-in-out infinite; animation-delay: calc(var(--d, 0s) + 1s); }

  .go .i-firm .back { animation: hx-slide 1s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--d, 0s) + .2s); }
  .go .i-firm .chk { stroke-dasharray: 1 2; animation: hx-draw .55s ease-out both; animation-delay: calc(var(--d, 0s) + 1s); }

  .go .i-key .k2, .go .i-key .k9, .go .i-key .k4, .go .i-key .k8 { animation: hx-key 7s ease-in-out infinite; }
  .go .i-key .k2 { animation-delay: calc(var(--d, 0s) + .6s); }
  .go .i-key .k9 { animation-delay: calc(var(--d, 0s) + 1.05s); }
  .go .i-key .k4 { animation-delay: calc(var(--d, 0s) + 1.5s); }
  .go .i-key .k8 { animation-delay: calc(var(--d, 0s) + 1.95s); }
  .go .i-key .led { animation: hx-led 7s ease-in-out infinite; animation-delay: calc(var(--d, 0s) + .6s); }

  .go .i-cam .head { animation: hx-pan 11s ease-in-out infinite; animation-delay: calc(var(--d, 0s) + .4s); }
  .go .i-cam .dot { animation: hx-blink 3.2s ease-in-out infinite; animation-delay: var(--d, 0s); }

  .go .i-data .drop { animation: hx-drop 6s cubic-bezier(.45, 0, .55, 1) infinite; animation-delay: calc(var(--d, 0s) + .5s); }
  .go .i-data .top { animation: hx-rim 6s ease-in-out infinite; animation-delay: calc(var(--d, 0s) + .5s); }

  .go .i-std .c1 { animation: hx-close1 1.5s cubic-bezier(.2, .7, .2, 1) both, hx-fan1 12s ease-in-out infinite; animation-delay: calc(var(--d, 0s) + .3s), calc(var(--d, 0s) + 5s); }
  .go .i-std .c3 { animation: hx-close3 1.5s cubic-bezier(.2, .7, .2, 1) both, hx-fan3 12s ease-in-out infinite; animation-delay: calc(var(--d, 0s) + .3s), calc(var(--d, 0s) + 5s); }
}
@keyframes hx-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes hx-pop { from { transform: scale(0); } to { transform: none; } }
@keyframes hx-breathe { 0%, 100% { opacity: .1; transform: scale(.85); } 50% { opacity: .6; transform: scale(1.2); } }
@keyframes hx-slide { from { transform: translate(-8px, 5px); opacity: 0; } to { transform: none; opacity: .5; } }
@keyframes hx-key { 0% { fill: currentColor; opacity: .6; } 3%, 11% { fill: var(--on-band-accent); opacity: 1; } 22%, 100% { fill: currentColor; opacity: .6; } }
@keyframes hx-led { 0%, 30% { stroke: currentColor; stroke-opacity: .5; } 33%, 46% { stroke: var(--on-band-accent); stroke-opacity: 1; } 56%, 100% { stroke: currentColor; stroke-opacity: .5; } }
@keyframes hx-pan { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(10deg); } }
@keyframes hx-blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes hx-drop { 0% { transform: translateY(-13px); opacity: 0; } 12% { opacity: 1; } 34% { transform: none; opacity: 1; } 48%, 100% { transform: none; opacity: 0; } }
@keyframes hx-rim { 0%, 32% { stroke: currentColor; } 38% { stroke: var(--on-band-accent); } 62%, 100% { stroke: currentColor; } }
@keyframes hx-close1 { from { transform: rotate(0deg); } to { transform: rotate(-22deg); } }
@keyframes hx-close3 { from { transform: rotate(0deg); } to { transform: rotate(22deg); } }
@keyframes hx-fan1 { 0%, 70%, 100% { transform: rotate(-22deg); } 82%, 86% { transform: rotate(-4deg); } }
@keyframes hx-fan3 { 0%, 70%, 100% { transform: rotate(22deg); } 82%, 86% { transform: rotate(4deg); } }
