/* ============================================================
   HotLync AIRA — Radial Hub (AAILink design system)
   Scoped to .hub-page — inherits project tokens from style.css
   ============================================================ */

.hub-page {
  --hr-fg: var(--text, #0F172A);
  --hr-fg-muted: var(--text-2, #475569);
  --hr-surface: var(--bg, #FFFFFF);
  --hr-card-bg: color-mix(in srgb, var(--bg, #FFFFFF) 94%, transparent);
  --hr-card-border: var(--border, #E5E9F0);
  --hr-connector: var(--brand, #2563EB);
  --hr-glow: var(--brand-soft, #EFF4FF);
  --hr-grid: color-mix(in srgb, var(--brand, #2563EB) 10%, transparent);
  --hr-status-dot: var(--ok, #059669);
  --hr-icon-bg: var(--brand-soft, #EFF4FF);
  --hr-icon-border: var(--brand-bdr, #BFD3FE);
  --hr-icon-fg: var(--brand, #2563EB);
  --hr-card-face-glow: rgba(37, 99, 235, 0.1);
  --hr-pill-bg: var(--bg, #FFFFFF);
  --hr-pill-border: var(--border, #E5E9F0);
  --hr-shadow: var(--sh-md, 0 12px 24px rgba(15,23,42,.08));
  --hr-shadow-deep: var(--sh-lg, 0 24px 48px rgba(15,23,42,.12));

  --hub-canvas: min(calc(100vw - 24px), calc(100dvh - 96px), 780px);
  --layout-scale: 1;
  --hub-size: calc(150px * var(--layout-scale));
  --hub-card-gap: 60px;
  --orbit-radius: calc((268px + var(--hub-card-gap)) * var(--layout-scale));
  --hub-connector-gap: calc(20px * var(--layout-scale));
  --hub-icon-size: calc(100px * var(--layout-scale));
  --hub-icon-glyph: calc(52px * var(--layout-scale));
  --hub-icon-radius: calc(22px * var(--layout-scale));
  --card-w: calc(112px * var(--layout-scale));
  --card-h: calc(126px * var(--layout-scale));
  --card-radius: calc(var(--r-lg) * var(--layout-scale) / 1.15);
  --pill-h-min: 32px;
  --pill-h: max(var(--pill-h-min), calc(36px * var(--layout-scale)));
  --pill-pad-x: max(12px, calc(14px * var(--layout-scale)));
  --pill-pad-icon: max(8px, calc(10px * var(--layout-scale)));
  --pill-gap: max(6px, calc(8px * var(--layout-scale)));
  --pill-font: max(0.72rem, calc(0.72rem * var(--layout-scale)));
  --pill-max-w: calc(220px * var(--layout-scale));

  --font-display: var(--fd, 'Sora'), system-ui, sans-serif;

  --ease-apple-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-apple-in-out: cubic-bezier(0.45, 0, 0.15, 1);
}

[data-theme="dark"] .hub-page {
  --hr-fg: #F3F7FF;
  --hr-fg-muted: #9DA9BF;
  --hr-surface: #050B18;
  --hr-card-bg: rgba(11, 23, 51, 0.72);
  --hr-card-border: rgba(96, 165, 250, 0.28);
  --hr-connector: #4F9AFF;
  --hr-glow: rgba(37, 99, 235, 0.22);
  --hr-grid: rgba(79, 154, 255, 0.11);
  --hr-icon-bg: rgba(11, 23, 51, 0.78);
  --hr-icon-border: rgba(96, 165, 250, 0.38);
  --hr-icon-fg: #6EE7FF;
  --hr-card-face-glow: rgba(37, 120, 255, 0.24);
  --hr-pill-bg: rgba(11, 23, 51, 0.88);
  --hr-pill-border: rgba(96, 165, 250, 0.28);
  --hr-shadow: 0 12px 28px rgba(0, 8, 24, 0.42);
  --hr-shadow-deep: 0 24px 48px rgba(0, 8, 24, 0.55);
}

body.hub-standalone {
  padding-top: 0;
}

/* ── Page shell ── */
.hub-page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(72px, 10vh, 96px) 12px 24px;
  isolation: isolate;
  font-family: var(--font-display);
  color: var(--hr-fg);
  -webkit-font-smoothing: antialiased;
}

.hub-page__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--hr-surface);
  filter: none;
  transform: none;
}

.hub-page__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse at center, var(--hr-glow) 0%, transparent 72%);
}

.hub-page__grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image:
    linear-gradient(var(--hr-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--hr-grid) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, #000 40%, transparent 100%);
  pointer-events: none;
}

.hub-page__vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: radial-gradient(ellipse at center, transparent 42%, color-mix(in srgb, var(--bg-2) 65%, transparent) 100%);
  pointer-events: none;
}

/* ── Status badge ── */
.status-badge {
  position: absolute;
  top: clamp(20px, 3vh, 36px);
  left: clamp(20px, 3vw, 40px);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 100px;
  background: var(--ok-soft);
  border: 1px solid color-mix(in srgb, var(--ok) 28%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--sh-sm);
}

.status-badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hr-status-dot);
  box-shadow: 0 0 10px color-mix(in srgb, var(--ok) 50%, transparent);
  flex-shrink: 0;
}

.status-badge__label {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ok);
  text-transform: uppercase;
}

.status-badge__state {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--hr-fg-muted);
}

/* ── Radial container ── */
.radial-hub {
  position: relative;
  z-index: 10;
  width: var(--hub-canvas);
  height: var(--hub-canvas);
  max-width: 780px;
  max-height: 780px;
  flex-shrink: 0;
  overflow: visible;

  /* Scaled tokens — resolved from this element's --layout-scale */
  --hub-size: calc(150px * var(--layout-scale));
  --hub-card-gap: 60px;
  --orbit-radius: calc((268px + var(--hub-card-gap)) * var(--layout-scale));
  --hub-connector-gap: calc(20px * var(--layout-scale));
  --hub-icon-size: calc(100px * var(--layout-scale));
  --hub-icon-glyph: calc(52px * var(--layout-scale));
  --hub-icon-radius: calc(22px * var(--layout-scale));
  --card-w: calc(112px * var(--layout-scale));
  --card-h: calc(126px * var(--layout-scale));
  --card-radius: calc(20px * var(--layout-scale));
  --pill-h-min: 32px;
  --pill-h: max(var(--pill-h-min), calc(36px * var(--layout-scale)));
  --pill-pad-x: max(12px, calc(14px * var(--layout-scale)));
  --pill-pad-icon: max(8px, calc(10px * var(--layout-scale)));
  --pill-gap: max(6px, calc(8px * var(--layout-scale)));
  --pill-font: max(0.72rem, calc(0.72rem * var(--layout-scale)));
}

.radial-hub__stage {
  position: absolute;
  inset: 0;
  overflow: visible;
}

/* ── SVG guides ── */
.radial-hub__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 3;
}

.radial-hub__svg .guide-ring-layer,
.radial-hub__svg .nodes {
  transform-box: fill-box;
  transform-origin: 390px 390px;
}

.radial-hub__svg .node {
  transform-box: fill-box;
  transform-origin: center;
}

.radial-hub__svg.is-ambient-active .guide-ring-layer,
.radial-hub__svg.is-ambient-active .node {
  will-change: transform, opacity;
}

.radial-hub__svg .guide-ring {
  fill: none;
  stroke: var(--hr-connector);
  transform-origin: center;
}

.radial-hub__svg .guide-ring--solid {
  stroke-width: 1;
  opacity: 0.14;
}

.radial-hub__svg .guide-ring--dashed {
  stroke-width: 1;
  stroke-dasharray: 6 8;
  opacity: 0.1;
}

.radial-hub__svg .guide-ring--faint {
  stroke-width: 1;
  opacity: 0.06;
}

.radial-hub__svg .guide-pentagon {
  fill: none;
  stroke: color-mix(in srgb, var(--brand) 35%, transparent);
  stroke-width: 1;
  opacity: 0.55;
}

.radial-hub__svg .node {
  fill: var(--hr-connector);
  filter: url(#nodeGlow);
}

/* ── Lifecycle orbit FX (JS-injected) ── */
.hub-energy-rings {
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: 390px 390px;
}

.hub-energy-ring {
  fill: none;
  stroke: var(--hr-connector, #2563EB);
  stroke-width: 1;
  transform-box: fill-box;
  transform-origin: 390px 390px;
  will-change: transform;
}

.hub-energy-ring--outer {
  opacity: 0.1;
  stroke-dasharray: 4 10;
  animation: hub-energy-ring-cw 18s linear infinite;
}

.hub-energy-ring--inner {
  opacity: 0.08;
  stroke-dasharray: 2 8;
  animation: hub-energy-ring-ccw 12s linear infinite;
}

.hub-compact .hub-energy-ring--outer,
.hub-compact .hub-energy-ring--inner {
  opacity: 0.06;
}

@keyframes hub-energy-ring-cw {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes hub-energy-ring-ccw {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

.hub-orbit-particles {
  pointer-events: none;
}

.hub-orbit-particle-wrap {
  transform-box: fill-box;
  transform-origin: 390px 390px;
  will-change: transform;
}

.hub-orbit-particle {
  fill: #93C5FD;
  opacity: 0.45;
  filter: drop-shadow(0 0 3px rgba(96, 165, 250, 0.65));
  will-change: opacity, transform;
}

.hub-compact .hub-orbit-particle {
  opacity: 0.32;
  filter: none;
}

@property --hub-card-collapse {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

/* ── Workflow connectors ── */
.radial-hub__connectors {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 4;
  shape-rendering: geometricPrecision;
}

.workflow-connector.is-intro-pending {
  pointer-events: none;
  visibility: hidden;
}

.workflow-connector.is-intro-pending .workflow-connector__track,
.workflow-connector.is-intro-pending .workflow-connector__flow,
.workflow-connector.is-intro-pending .workflow-checkpoint {
  opacity: 0;
  visibility: hidden;
}

.workflow-connector.is-flowing {
  visibility: visible;
}

.workflow-connector__path {
  fill: none;
  stroke: transparent;
  stroke-width: var(--connector-stroke, 2.5);
  pointer-events: none;
}

.workflow-connector__track {
  fill: none;
  stroke: var(--hr-connector);
  stroke-width: var(--connector-stroke, 2.5);
  stroke-linecap: round;
  opacity: 0.22;
}

.workflow-connector__flow {
  fill: none;
  stroke: var(--hr-connector);
  stroke-width: var(--connector-stroke, 2.5);
  stroke-linecap: round;
  opacity: 0.72;
  will-change: stroke-dashoffset;
  transition: opacity 0.5s var(--ease-apple-out), stroke-width 0.5s var(--ease-apple-out), filter 0.5s var(--ease-apple-out);
}

.workflow-checkpoint {
  will-change: transform;
}

.workflow-checkpoint__bg {
  filter: drop-shadow(0 1px 4px color-mix(in srgb, var(--brand) 25%, transparent));
}

.workflow-connector.is-flow-active .workflow-connector__track {
  opacity: 0.38;
}

.workflow-connector.is-flow-active .workflow-connector__flow {
  stroke-width: calc(var(--connector-stroke, 2.5) * 1.18);
  opacity: 0.95;
  filter: url(#connectorGlow);
}

.workflow-connector.is-flow-active .workflow-checkpoint {
  filter: url(#checkpointGlow);
}

.workflow-connector.is-flow-active .workflow-checkpoint__bg {
  fill: var(--hr-connector);
}

/* ── Intro animation initial / final states ── */
.hub-page[data-intro="pending"] .hub-core {
  opacity: 0;
  --hub-core-scale: 0.9;
}

.hub-page[data-intro="pending"] .hub-core__logo,
.hub-page[data-intro="pending"] .hub-core__aira {
  opacity: 0;
}

.hub-page[data-intro="pending"] .hub-card__surface {
  opacity: 0;
  transform: scale(0.96) translateY(15px);
}

.hub-page[data-intro="pending"] .feature-pill {
  opacity: 0;
  visibility: hidden;
}

.hub-page[data-intro="pending"] .radial-hub__svg {
  opacity: 0;
}

.hub-page[data-intro="pending"] .radial-hub__connectors {
  opacity: 1;
}

.hub-page.is-intro-complete .hub-core,
.hub-page.is-intro-complete .hub-card__surface,
.hub-page.is-intro-complete .radial-hub__svg,
.hub-page.is-intro-complete .radial-hub__connectors {
  opacity: 1;
}

.hub-page.is-intro-complete .hub-core {
  --hub-core-scale: 1;
}

.hub-page.is-intro-complete .hub-card__surface {
  transform: none;
}

.hub-page.is-intro-complete.is-orbit-settled .hub-card__surface {
  transform: scale(1.02);
}

.hub-page.is-intro-complete .feature-pill {
  opacity: 1;
  visibility: visible;
}

.hub-page.is-pills-dismissed .feature-pill {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hub-page.is-intro-complete.is-pills-dismissed .feature-pill {
  opacity: 0;
  visibility: hidden;
}

.hub-page.is-orbit-settled .hub-card__surface {
  transform: scale(1.02);
}

/* ── Center hub ── */
@property --hub-core-breathe {
  syntax: '<number>';
  inherits: false;
  initial-value: 1;
}

.hub-core {
  --hub-core-border: rgba(186, 230, 255, 0.74);
  --hub-core-glow: rgba(37, 120, 255, 0.52);
  --hub-core-glow-wide: rgba(37, 99, 235, 0.3);
  --hub-core-breathe: 1;

  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  width: var(--hub-size);
  height: var(--hub-size);
  transform: translate(-50%, -50%) scale(calc(var(--hub-core-scale, 1) * var(--hub-core-breathe, 1)));
  transform-origin: center center;
  border-radius: 50%;
  isolation: isolate;
  pointer-events: none;
}

.hub-page.is-intro-complete .hub-core {
  animation: hub-core-scale-breathe 2.8s var(--ease-apple-in-out) infinite;
  will-change: transform;
}

.hub-page.is-lifecycle-live .hub-core {
  animation: hub-core-scale-breathe 2.8s var(--ease-apple-in-out) infinite;
  will-change: transform;
}

.hub-core::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    circle,
    transparent 52%,
    rgba(96, 165, 255, 0.28) 62%,
    rgba(59, 130, 246, 0.18) 72%,
    transparent 78%
  );
  opacity: 0;
  transform: scale(1);
  will-change: transform, opacity;
}

.hub-core.is-core-wave::before {
  animation: hub-core-energy-wave 1.1s var(--ease-apple-out) forwards;
}

.hub-core::after {
  content: '';
  position: absolute;
  inset: calc(-1px * var(--layout-scale));
  border-radius: 50%;
  z-index: 3;
  pointer-events: none;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 300deg,
    rgba(255, 255, 255, 0.08) 320deg,
    rgba(186, 230, 255, 0.55) 340deg,
    rgba(255, 255, 255, 0.18) 350deg,
    transparent 360deg
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 1.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 1.5px));
  opacity: 0.55;
  will-change: transform;
}

.hub-page.is-intro-complete .hub-core::after {
  animation: hub-core-edge-rotate 13s linear infinite;
}

.hub-core__halo {
  position: absolute;
  inset: calc(-14px * var(--layout-scale));
  border-radius: 50%;
  z-index: 0;
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.42) 0%,
    rgba(37, 99, 235, 0.18) 42%,
    transparent 72%
  );
  filter: blur(calc(6px * var(--layout-scale)));
  animation: hub-halo-breathe 2.9s var(--ease-apple-in-out) infinite;
  will-change: opacity, transform;
}

.hub-core__surface {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(3px * var(--layout-scale));
  padding: calc(18px * var(--layout-scale));
  overflow: hidden;
  background:
    radial-gradient(
      circle at 50% 38%,
      rgba(96, 165, 255, 0.94) 0%,
      rgba(37, 99, 235, 0.92) 38%,
      rgba(29, 78, 216, 0.96) 72%,
      rgba(15, 58, 180, 1) 100%
    );
  border: calc(1.5px * var(--layout-scale)) solid var(--hub-core-border);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.42),
    inset 0 -10px 28px rgba(0, 32, 96, 0.32),
    inset 0 0 22px rgba(255, 255, 255, 0.07),
    0 0 0 calc(0.5px * var(--layout-scale)) rgba(59, 130, 246, 0.38),
    0 0 calc(22px * var(--layout-scale)) var(--hub-core-glow),
    0 0 calc(46px * var(--layout-scale)) var(--hub-core-glow-wide),
    0 calc(10px * var(--layout-scale)) calc(28px * var(--layout-scale)) rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(calc(14px * var(--layout-scale))) saturate(1.25);
  -webkit-backdrop-filter: blur(calc(14px * var(--layout-scale))) saturate(1.25);
  animation: hub-core-glow-breathe 2.9s var(--ease-apple-in-out) infinite;
  will-change: filter, box-shadow;
}

.hub-core__surface::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 34% 26%,
    rgba(255, 255, 255, 0.28) 0%,
    rgba(255, 255, 255, 0.06) 34%,
    transparent 58%
  );
  background-size: 140% 140%;
  background-position: 34% 26%;
  pointer-events: none;
  animation: hub-core-inner-shift 9s var(--ease-apple-in-out) infinite;
  will-change: background-position;
}

.hub-core__surface::after {
  content: '';
  position: absolute;
  inset: calc(5px * var(--layout-scale));
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 calc(12px * var(--layout-scale)) rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

@property --hub-amber-fill {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}

@property --hub-amber-bloom {
  syntax: '<number>';
  inherits: false;
  initial-value: 0;
}

.hub-core__blend {
  --hub-amber-fill: 0%;
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    to top right,
    #FFD080 0%,
    #FFBF66 28%,
    #E8A838 62%,
    #D97706 100%
  );
  -webkit-mask-image: linear-gradient(
    to top right,
    #000 0%,
    #000 var(--hub-amber-fill),
    rgba(0, 0, 0, 0.62) calc(var(--hub-amber-fill) + 8%),
    rgba(0, 0, 0, 0.28) calc(var(--hub-amber-fill) + 22%),
    transparent calc(var(--hub-amber-fill) + 42%),
    transparent 100%
  );
  mask-image: linear-gradient(
    to top right,
    #000 0%,
    #000 var(--hub-amber-fill),
    rgba(0, 0, 0, 0.62) calc(var(--hub-amber-fill) + 8%),
    rgba(0, 0, 0, 0.28) calc(var(--hub-amber-fill) + 22%),
    transparent calc(var(--hub-amber-fill) + 42%),
    transparent 100%
  );
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  will-change: opacity, --hub-amber-fill;
}

.hub-page.is-core-amber .hub-core__blend {
  opacity: 1;
  animation: hub-core-amber-blend-flow 0.65s var(--ease-apple-out) both;
}

.hub-core__brand-glow {
  --hub-amber-bloom: 0;
  position: absolute;
  inset: calc(-30px * var(--layout-scale));
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(
      circle at 50% 42%,
      rgba(255, 191, 64, 0.9) 0%,
      rgba(255, 168, 46, 0.58) 44%,
      transparent 70%
    ),
    radial-gradient(
      circle at 40% 55%,
      rgba(232, 168, 56, 0.45) 0%,
      transparent 58%
    ),
    radial-gradient(
      circle at 72% 22%,
      rgba(255, 208, 128, 0.55) 0%,
      transparent 50%
    );
  filter: blur(calc(14px * var(--layout-scale)));
  transform: scale(calc(0.86 + (0.14 * var(--hub-amber-bloom))));
  transform-origin: center center;
  will-change: opacity, --hub-amber-bloom, transform;
}

.hub-core__ripples {
  --hub-ripple-duration: 5.6s;
  --hub-ripple-stagger: 1.65s;
  --hub-ripple-launch-delay: 0.65s;

  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.hub-core__ripple {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: calc(1.5px * var(--layout-scale)) solid color-mix(in srgb, var(--hr-connector) 50%, transparent);
  opacity: 0;
  transform: scale(1);
  transform-origin: center center;
  will-change: transform, opacity;
}

.hub-core__ripple:nth-child(1) { --ripple-i: 0; }
.hub-core__ripple:nth-child(2) { --ripple-i: 1; }
.hub-core__ripple:nth-child(3) { --ripple-i: 2; }
.hub-core__ripple:nth-child(4) { --ripple-i: 3; }

.hub-page.is-core-amber .hub-core__ripple {
  animation: hub-core-ripple-pulse var(--hub-ripple-duration) linear infinite;
  animation-delay: calc(var(--hub-ripple-launch-delay) + (var(--ripple-i, 0) * var(--hub-ripple-stagger)));
}

.hub-page.is-core-amber .hub-core__brand-glow {
  opacity: 1;
  animation: hub-core-amber-glow-flow 0.65s var(--ease-apple-out) both;
}

.hub-page.is-core-amber .hub-core__halo {
  background:
    radial-gradient(
      circle at 50% 40%,
      rgba(255, 191, 64, calc(0.82 * var(--hub-amber-bloom))) 0%,
      rgba(255, 168, 46, calc(0.52 * var(--hub-amber-bloom))) 48%,
      rgba(232, 168, 56, calc(0.22 * var(--hub-amber-bloom))) 66%,
      transparent 78%
    ),
    radial-gradient(
      circle,
      rgba(59, 130, 246, calc(0.42 * (1 - var(--hub-amber-bloom)))) 0%,
      rgba(37, 99, 235, calc(0.18 * (1 - var(--hub-amber-bloom)))) 42%,
      transparent 72%
    );
  animation:
    hub-halo-breathe 2.9s var(--ease-apple-in-out) 0.65s infinite,
    hub-core-amber-halo-flow 0.65s var(--ease-apple-out) both;
}

.hub-page.is-orbit-settled .hub-core__surface,
.hub-page.is-intro-complete .hub-core__surface {
  border-color: rgba(196, 234, 255, 0.82);
}

.hub-core__ticks {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.hub-core__tick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(1.5px * var(--layout-scale));
  height: calc(7px * var(--layout-scale));
  margin-left: calc(-0.75px * var(--layout-scale));
  margin-top: calc(-3.5px * var(--layout-scale));
  border-radius: calc(1px * var(--layout-scale));
  background: linear-gradient(
    180deg,
    rgba(235, 248, 255, 1) 0%,
    rgba(147, 197, 253, 0.92) 100%
  );
  box-shadow:
    0 0 calc(5px * var(--layout-scale)) rgba(147, 197, 253, 0.85),
    0 0 calc(1px * var(--layout-scale)) rgba(255, 255, 255, 0.9);
}

.hub-core__tick[data-pos="n"] {
  transform: translate(-50%, -50%) translateY(calc((var(--hub-size) / -2) + calc(1px * var(--layout-scale))));
}

.hub-core__tick[data-pos="s"] {
  transform: translate(-50%, -50%) translateY(calc((var(--hub-size) / 2) - calc(1px * var(--layout-scale)))) rotate(180deg);
}

.hub-core__tick[data-pos="e"] {
  transform: translate(-50%, -50%) translateX(calc((var(--hub-size) / 2) - calc(1px * var(--layout-scale)))) rotate(90deg);
}

.hub-core__tick[data-pos="w"] {
  transform: translate(-50%, -50%) translateX(calc((var(--hub-size) / -2) + calc(1px * var(--layout-scale)))) rotate(-90deg);
}

.hub-core__logo,
.hub-core__aira {
  position: relative;
  z-index: 1;
}

.hub-core__logo {
  width: auto;
  max-width: 86%;
  font-family: var(--font-display);
  font-size: calc(39px * var(--layout-scale));
  font-weight: 800;
  color: #FFFFFF;
  text-align: center;
  line-height: 1;
  letter-spacing: -0.03em;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12),
    0 2px calc(10px * var(--layout-scale)) rgba(0, 40, 120, 0.38);
}

.hub-core__aira {
  font-family: var(--font-display);
  font-size: calc(21px * var(--layout-scale));
  font-weight: 500;
  letter-spacing: 0.015em;
  text-transform: none;
  color: rgba(255, 255, 255, 0.94);
  line-height: 1.15;
  margin-top: calc(2px * var(--layout-scale));
  text-shadow: 0 1px calc(6px * var(--layout-scale)) rgba(0, 40, 120, 0.28);
}

.radial-hub:hover .hub-core__halo {
  opacity: 1;
  transform: scale(1.05);
}

.radial-hub:hover .hub-core__surface {
  border-color: rgba(210, 242, 255, 0.88);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    inset 0 -10px 28px rgba(0, 32, 96, 0.34),
    inset 0 0 26px rgba(255, 255, 255, 0.1),
    0 0 0 calc(0.5px * var(--layout-scale)) rgba(96, 165, 255, 0.5),
    0 0 calc(30px * var(--layout-scale)) rgba(59, 130, 246, 0.62),
    0 0 calc(58px * var(--layout-scale)) rgba(37, 99, 235, 0.36),
    0 calc(10px * var(--layout-scale)) calc(32px * var(--layout-scale)) rgba(15, 23, 42, 0.16);
}

@keyframes hub-halo-breathe {
  0%, 100% {
    opacity: 0.88;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

@keyframes hub-core-amber-blend-flow {
  0% {
    opacity: 1;
    --hub-amber-fill: 5%;
  }
  100% {
    opacity: 1;
    --hub-amber-fill: 100%;
  }
}

@keyframes hub-core-amber-glow-flow {
  0% {
    --hub-amber-bloom: 0.05;
  }
  100% {
    --hub-amber-bloom: 1;
  }
}

@keyframes hub-core-amber-halo-flow {
  0% {
    --hub-amber-bloom: 0.05;
  }
  100% {
    --hub-amber-bloom: 1;
  }
}

@keyframes hub-core-ripple-pulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(2.65);
    opacity: 0;
  }
}

@keyframes hub-core-glow-breathe {
  0%, 100% {
    filter: brightness(1);
    box-shadow:
      inset 0 1px 1px rgba(255, 255, 255, 0.42),
      inset 0 -10px 28px rgba(0, 32, 96, 0.32),
      inset 0 0 22px rgba(255, 255, 255, 0.07),
      0 0 0 calc(0.5px * var(--layout-scale)) rgba(59, 130, 246, 0.38),
      0 0 calc(22px * var(--layout-scale)) var(--hub-core-glow),
      0 0 calc(46px * var(--layout-scale)) var(--hub-core-glow-wide),
      0 calc(10px * var(--layout-scale)) calc(28px * var(--layout-scale)) rgba(15, 23, 42, 0.14);
  }
  50% {
    filter: brightness(1.04);
    box-shadow:
      inset 0 1px 1px rgba(255, 255, 255, 0.42),
      inset 0 -10px 28px rgba(0, 32, 96, 0.32),
      inset 0 0 22px rgba(255, 255, 255, 0.07),
      0 0 0 calc(0.5px * var(--layout-scale)) rgba(59, 130, 246, 0.42),
      0 0 calc(28px * var(--layout-scale)) rgba(37, 120, 255, 0.58),
      0 0 calc(52px * var(--layout-scale)) rgba(37, 99, 235, 0.34),
      0 calc(10px * var(--layout-scale)) calc(28px * var(--layout-scale)) rgba(15, 23, 42, 0.14);
  }
}

@keyframes hub-core-energy-wave {
  0% {
    opacity: 0.35;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.22);
  }
}

@keyframes hub-core-edge-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes hub-core-inner-shift {
  0%, 100% { background-position: 34% 26%; }
  50% { background-position: 38% 32%; }
}

@keyframes hub-core-scale-breathe {
  0%, 100% { --hub-core-breathe: 1; }
  50% { --hub-core-breathe: 1.02; }
}

.workflow-connector.is-core-wave-sync .workflow-connector__flow {
  opacity: 0.95;
  filter: url(#connectorGlow);
  transition: opacity 0.28s var(--ease-apple-out), filter 0.28s var(--ease-apple-out);
}

.workflow-connector.is-core-wave-sync .workflow-connector__track {
  opacity: 0.36;
  transition: opacity 0.28s var(--ease-apple-out);
}

.workflow-connector.is-core-wave-sync .workflow-checkpoint__bg {
  filter: brightness(1.35);
  transition: filter 0.28s var(--ease-apple-out);
}

/* ── Hub cards ── */
.hub-card {
  --card-angle: 0deg;
  --orbit-spread: 0px;
  --hub-card-collapse: 0;
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: var(--card-w);
  height: var(--card-h);
  overflow: visible;
  will-change: transform;
  transform:
    translate(-50%, -50%)
    rotate(var(--card-angle))
    translateY(calc(
      -1 * (var(--orbit-radius) + var(--orbit-spread, 0px))
      * (1 - var(--hub-card-collapse, 0))
      + var(--card-float-y, 0px)
    ))
    rotate(calc(-1 * var(--card-angle)));
  transform-origin: center center;
}

.hub-card__surface {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(8px * var(--layout-scale));
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  cursor: default;
  transition: transform 0.5s var(--ease-apple-out);
}

.hub-card__icon-wrap {
  width: var(--hub-icon-size);
  height: var(--hub-icon-size);
  border-radius: var(--hub-icon-radius);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--hr-icon-bg);
  border: 1px solid var(--hr-icon-border);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--hr-icon-border) 35%, transparent),
    0 8px 22px var(--hr-card-face-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  perspective: calc(280px * var(--layout-scale));
  transition:
    border-color 0.35s var(--ease-apple-out),
    box-shadow 0.35s var(--ease-apple-out),
    transform 0.35s var(--ease-apple-out);
}

.hub-card__surface:hover .hub-card__icon-wrap,
.hub-card__surface:focus-visible .hub-card__icon-wrap {
  border-color: color-mix(in srgb, var(--hr-icon-border) 72%, #FFFFFF);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--hr-icon-border) 55%, transparent),
    0 10px 28px color-mix(in srgb, var(--hr-card-face-glow) 140%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.hub-card__icon-wrap svg {
  width: var(--hub-icon-glyph);
  height: var(--hub-icon-glyph);
  max-width: calc(100% - (24px * var(--layout-scale)));
  max-height: calc(100% - (24px * var(--layout-scale)));
  color: var(--hr-icon-fg);
  stroke: var(--hr-icon-fg);
  fill: none;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--hr-icon-fg) 45%, transparent));
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform;
  animation: hub-icon-flip-x 14s var(--ease-apple-in-out) infinite;
}

.hub-page[data-intro="pending"] .hub-card__icon-wrap svg {
  animation-play-state: paused;
}

.hub-card[data-module="operations"] .hub-card__icon-wrap svg { animation-delay: 0s; }
.hub-card[data-module="wellness"] .hub-card__icon-wrap svg { animation-delay: -2.8s; }
.hub-card[data-module="voice"] .hub-card__icon-wrap svg { animation-delay: -5.6s; }
.hub-card[data-module="maintenance"] .hub-card__icon-wrap svg { animation-delay: -8.4s; }
.hub-card[data-module="guest"] .hub-card__icon-wrap svg { animation-delay: -9.8s; }

@keyframes hub-icon-flip-x {
  0%, 74%, 100% {
    transform: rotateX(0deg);
  }
  86% {
    transform: rotateX(360deg);
  }
}

.hub-card__title {
  font-size: clamp(0.72rem, 1.4vw, 0.8125rem);
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  color: var(--hr-fg);
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

[data-theme="dark"] .hub-card__title {
  color: #F3F7FF;
  font-weight: 700;
  text-shadow: 0 1px 10px rgba(37, 99, 235, 0.32);
}

/* ── Feature pills ── */
.hub-card__pills {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 0;
  height: 0;
  overflow: visible;
  pointer-events: none;
}

.hub-card.is-active {
  z-index: 8;
}

[data-theme="dark"] .hub-card.is-active .hub-card__icon-wrap {
  border-color: rgba(126, 219, 255, 0.62);
  box-shadow:
    0 0 0 1px rgba(126, 219, 255, 0.28),
    0 12px 32px rgba(37, 120, 255, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

[data-theme="dark"] .hub-card.is-active .hub-card__icon-wrap svg {
  color: #A5F3FC;
  stroke: #A5F3FC;
}

.hub-card.is-active .hub-card__pills {
  pointer-events: auto;
}

.hub-page.is-pills-dismissed .hub-card.is-active .hub-card__pills {
  z-index: 3;
}

.hub-page.is-pills-dismissed .hub-card.is-active .feature-pill {
  pointer-events: auto;
}

/* Keep the outgoing (fading-out) card's stacked pill list above idle cards
   during the ambient cross-fade, so it doesn't render underneath the
   incoming card while both are momentarily visible. Compact-only: desktop's
   simultaneous-cluster layout doesn't use these transient classes. */
.hub-compact .hub-card.is-dismissing,
.hub-compact .hub-card.is-ambient-active,
.hero-hub .hub-card.is-dismissing,
.hero-hub .hub-card.is-ambient-active {
  z-index: 7;
}

.hub-compact .hub-page.is-pills-dismissed .hub-card.is-dismissing .hub-card__pills,
.hub-compact .hub-page.is-pills-dismissed .hub-card.is-ambient-active .hub-card__pills,
.hero-hub .hub-page.is-pills-dismissed .hub-card.is-dismissing .hub-card__pills,
.hero-hub .hub-page.is-pills-dismissed .hub-card.is-ambient-active .hub-card__pills {
  z-index: 3;
}

.feature-pill {
  padding: 2px 7px;
  position: absolute;
  left: 50%;
  top: 50%;
  will-change: transform, opacity;
  transform: translate(
    calc(-50% + (var(--px, 0) * var(--pill-enter-r, 1) * var(--layout-scale) * 1px)),
    calc(-50% + (var(--py, 0) * var(--pill-enter-r, 1) * var(--layout-scale) * 1px) + (var(--pill-exit-y, 0) * 1px))
  ) scale(var(--pill-exit-scale, 1));
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--pill-gap);
  box-sizing: border-box;
  border-radius: 100px;
  border: 1px solid var(--hr-pill-border);
  background: var(--hr-pill-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--hr-fg);
  font-family: var(--fb, inherit);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  width: max-content;
  min-width: calc(88px * var(--layout-scale));
  flex-shrink: 0;
  box-shadow: var(--sh-sm);
  opacity: 0;
  visibility: hidden;
  transition: box-shadow 0.45s var(--ease-apple-out), border-color 0.45s var(--ease-apple-out);
}

.feature-pill:hover {
  border-color: var(--brand-bdr);
  box-shadow: var(--sh);
}

.feature-pill__icon {
  width: calc(18px * var(--layout-scale));
  height: calc(18px * var(--layout-scale));
  border-radius: calc(6px * var(--layout-scale));
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  flex-shrink: 0;
}

.feature-pill__icon svg {
  width: calc(11px * var(--layout-scale));
  height: calc(11px * var(--layout-scale));
  stroke: var(--brand);
  fill: none;
}

/* Card-specific pill clusters (unitless offsets × --layout-scale) */
.hub-card[data-module="operations"] .feature-pill:nth-child(1) { --px: -160; --py: -90; }
.hub-card[data-module="operations"] .feature-pill:nth-child(2) { --px: 0;    --py: -138; }
.hub-card[data-module="operations"] .feature-pill:nth-child(3) { --px: 210;  --py: -104; }

.hub-card[data-module="wellness"] .feature-pill:nth-child(1) { --px: 158; --py: -50; --pill-stack-offset: 0; }
.hub-card[data-module="wellness"] .feature-pill:nth-child(2) { --px: 158; --py: -6;  --pill-stack-offset: 2; }
.hub-card[data-module="wellness"] .feature-pill:nth-child(3) { --px: 205; --py: 38;  --pill-stack-offset: 4; }
.hub-card[data-module="wellness"] .feature-pill:nth-child(4) { --px: 205; --py: 82;  --pill-stack-offset: 6; }

.hub-card[data-module="wellness"] .feature-pill {
  transform: translate(
    calc(-50% + (var(--px, 0) * var(--pill-enter-r, 1) * var(--layout-scale) * 1px)),
    calc(-50% + (var(--py, 0) * var(--pill-enter-r, 1) * var(--layout-scale) * 1px) + (var(--pill-stack-offset, 0) * 1px) + (var(--pill-exit-y, 0) * 1px))
  ) scale(var(--pill-exit-scale, 1));
}

.hub-card[data-module="voice"] .feature-pill:nth-child(1) { --px: 152; --py: -46; }
.hub-card[data-module="voice"] .feature-pill:nth-child(2) { --px: 178; --py: 0; }
.hub-card[data-module="voice"] .feature-pill:nth-child(3) { --px: 170; --py: 46; }

.hub-card[data-module="maintenance"] .feature-pill:nth-child(1) { --px: -92; --py: 108; }
.hub-card[data-module="maintenance"] .feature-pill:nth-child(2) { --px: -92; --py: 152; }
.hub-card[data-module="maintenance"] .feature-pill:nth-child(3) { --px: -92; --py: 196; }
.hub-card[data-module="maintenance"] .feature-pill:nth-child(4) { --px: -92; --py: 240; }

.hub-card[data-module="guest"] .feature-pill:nth-child(1) { --px: -158; --py: -46; }
.hub-card[data-module="guest"] .feature-pill:nth-child(2) { --px: -178; --py: 0; }
.hub-card[data-module="guest"] .feature-pill:nth-child(3) { --px: -158; --py: 46; }

/* ── Compact / hero embed: stacked pills on active card only (after intro) ── */
.hub-compact .hub-page.is-intro-complete.is-pills-dismissed .feature-pill,
.hero-hub .hub-page.is-intro-complete.is-pills-dismissed .feature-pill {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hub-compact .hub-card.is-active .hub-card__pills,
.hero-hub .hub-card.is-active .hub-card__pills {
  left: 50%;
  top: calc(50% + (var(--card-h) / 2) + (10px * var(--layout-scale)));
  width: max-content;
  min-width: calc(196px * var(--layout-scale));
  max-width: min(calc(100vw - 48px), 280px);
  height: auto;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--pill-gap);
  pointer-events: auto;
  z-index: 7;
}

.hub-compact .hub-page.is-pills-dismissed .hub-card.is-active .feature-pill,
.hero-hub .hub-page.is-pills-dismissed .hub-card.is-active .feature-pill {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  width: 100%;
  min-width: 0;
  max-width: none;
  flex-shrink: 0;
}

/* Ambient: same absolute --px/--py cluster layout as intro (not stacked) */
.hub-compact .hub-page.is-pills-dismissed .hub-card.is-ambient-active .feature-pill,
.hero-hub .hub-page.is-pills-dismissed .hub-card.is-ambient-active .feature-pill {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hub-compact .hub-page.is-pills-dismissed .hub-card:not(.is-active):not(.is-dismissing):not(.is-ambient-active) .feature-pill,
.hero-hub .hub-page.is-pills-dismissed .hub-card:not(.is-active):not(.is-dismissing):not(.is-ambient-active) .feature-pill {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hub-compact .hub-card__surface {
  padding: calc(10px * var(--layout-scale)) calc(8px * var(--layout-scale));
  gap: calc(6px * var(--layout-scale));
}

.hub-compact .status-badge {
  top: 12px;
  left: 12px;
  padding: 8px 14px;
  gap: 8px;
}

/* ── Embedded in homepage hero ── */
.hero-hub .hub-page__bg {
  background: transparent;
}

.hero-hub .hub-page__overlay {
  background: radial-gradient(ellipse at center, var(--hr-glow) 0%, transparent 68%);
}

.hero-hub .hub-page__grid {
  opacity: 0.45;
}

.hero-hub .hub-page__vignette {
  display: none;
}

.hero-hub .status-badge {
  display: none;
}

.hero-hub .hub-core__halo {
  opacity: 0.95;
}

.hero-hub .hub-core__surface {
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.44),
    inset 0 -10px 28px rgba(0, 32, 96, 0.28),
    inset 0 0 22px rgba(255, 255, 255, 0.08),
    0 0 0 calc(0.5px * var(--layout-scale)) rgba(59, 130, 246, 0.42),
    0 0 calc(26px * var(--layout-scale)) rgba(37, 120, 255, 0.58),
    0 0 calc(52px * var(--layout-scale)) rgba(37, 99, 235, 0.32),
    0 calc(10px * var(--layout-scale)) calc(28px * var(--layout-scale)) rgba(15, 23, 42, 0.1);
}

/* ── Ambient energy flow (post-intro) ── */
@property --card-float-y {
  syntax: '<length>';
  inherits: false;
  initial-value: 0px;
}

.hub-page.is-ambient-live .hub-card {
  animation: hub-card-float var(--card-float-duration, 6s) var(--ease-apple-in-out) infinite;
  animation-delay: var(--card-float-delay, 0s);
}

.hub-card[data-module="operations"] { --card-float-duration: 6.4s; --card-float-delay: 0s; }
.hub-card[data-module="wellness"]   { --card-float-duration: 5.6s; --card-float-delay: 1.2s; }
.hub-card[data-module="voice"]      { --card-float-duration: 7.2s; --card-float-delay: 2.5s; }
.hub-card[data-module="maintenance"] { --card-float-duration: 5.8s; --card-float-delay: 0.8s; }
.hub-card[data-module="guest"]      { --card-float-duration: 6.8s; --card-float-delay: 3.4s; }

@keyframes hub-card-float {
  0%, 100% { --card-float-y: 0px; }
  25%      { --card-float-y: -1.2px; }
  50%      { --card-float-y: -2.5px; }
  75%      { --card-float-y: -1.2px; }
}

.workflow-connector__ambient-wave {
  fill: none;
  stroke: var(--brand, #2563EB);
  stroke-width: calc(var(--connector-stroke, 2.5) * 3.5);
  stroke-linecap: round;
  opacity: 0;
  pointer-events: none;
}

.energy-pulse {
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.energy-pulse__trail {
  fill: rgba(96, 165, 250, 0.22);
}

.energy-pulse__glow {
  fill: rgba(147, 197, 253, 0.48);
  filter: url(#energyPulseGlow);
}

.energy-pulse__core {
  fill: rgba(248, 250, 252, 0.92);
}

.workflow-connector.is-energy-active .workflow-connector__track {
  opacity: 0.38;
  transition: opacity 0.55s var(--ease-apple-out);
}

.workflow-connector.is-energy-active .workflow-connector__flow {
  opacity: 0.9;
  filter: url(#connectorGlow);
  transition: opacity 0.55s var(--ease-apple-out), filter 0.55s var(--ease-apple-out);
}

.hub-core.is-pulse-active .hub-core__halo {
  opacity: 1;
  filter: blur(calc(7px * var(--layout-scale))) brightness(1.04);
  transition: filter 0.32s var(--ease-apple-out), opacity 0.32s var(--ease-apple-out);
}

.hub-core.is-pulse-active .hub-core__surface {
  filter: brightness(1.035);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.44),
    inset 0 -10px 28px rgba(0, 32, 96, 0.28),
    inset 0 0 22px rgba(255, 255, 255, 0.08),
    0 0 0 calc(0.5px * var(--layout-scale)) rgba(59, 130, 246, 0.42),
    0 0 calc(28px * var(--layout-scale)) rgba(37, 120, 255, 0.62),
    0 0 calc(54px * var(--layout-scale)) rgba(37, 99, 235, 0.36),
    0 calc(10px * var(--layout-scale)) calc(28px * var(--layout-scale)) rgba(15, 23, 42, 0.14);
  transition: filter 0.32s var(--ease-apple-out), box-shadow 0.32s var(--ease-apple-out);
}

.hub-card.is-energy-receive .hub-card__icon-wrap {
  border-color: color-mix(in srgb, var(--brand) 52%, var(--hr-icon-border));
  box-shadow:
    0 0 calc(14px * var(--layout-scale)) rgba(37, 99, 235, 0.28),
    var(--sh-xs);
  transition: border-color 0.38s var(--ease-apple-out), box-shadow 0.38s var(--ease-apple-out);
}

.hub-card.is-energy-receive .hub-card__icon-wrap svg {
  filter: drop-shadow(0 0 calc(6px * var(--layout-scale)) rgba(37, 99, 235, 0.35));
  transition: filter 0.38s var(--ease-apple-out);
}

.hub-card.is-energy-receive::after {
  content: '';
  position: absolute;
  inset: calc(-6px * var(--layout-scale));
  border-radius: calc(var(--hub-icon-radius) + (6px * var(--layout-scale)));
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.14) 0%, transparent 72%);
  animation: hub-card-receive-halo 0.42s var(--ease-apple-out) forwards;
}

@keyframes hub-card-receive-halo {
  from { opacity: 0.55; transform: scale(0.96); }
  to   { opacity: 0; transform: scale(1.06); }
}

/* ── Responsive typography tweaks (standalone hub) ── */
@media (max-width: 480px) {
  .hub-card__title {
    font-size: 0.68rem;
  }

  .status-badge__label,
  .status-badge__state {
    font-size: 0.75rem;
  }
}

/* ── Laptop / large desktop: keep hub-core at design size (150px)
   so layout-scale no longer shrinks it in the hero column. */
@media (min-width: 1024px) {
  .radial-hub {
    --hub-size: max(150px, calc(150px * var(--layout-scale)));
  }
}

/* ── Hide scattered pills on mobile + tablet (≤1023px) ── */
@media (max-width: 1023px) {
  .hero-hub .hub-card__pills {
    display: none !important;
  }

  .hero-hub .hub-page.is-intro-complete .feature-pill {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .hero-hub .hub-page {
    min-height: var(--hub-canvas, 280px);
  }
}

/* ── Tablet hero hub: tighter orbit so cards fit the canvas ── */
@media (min-width: 641px) and (max-width: 1023px) {
  .hero-hub .radial-hub {
    --hub-card-gap: 48px;
    --hub-size: 150px;
    --orbit-radius: calc((248px + var(--hub-card-gap)) * var(--layout-scale));
    --card-w: calc(108px * var(--layout-scale));
    --card-h: calc(120px * var(--layout-scale));
    --hub-icon-size: calc(96px * var(--layout-scale));
    --hub-icon-glyph: calc(48px * var(--layout-scale));
    --hub-icon-radius: calc(20px * var(--layout-scale));
  }

  .hero-hub .hub-page {
    padding: 8px 0 12px;
  }

  .hero-hub .hub-core__surface {
    gap: 2px;
    padding: 12px;
    text-align: center;
  }

  .hero-hub .hub-core__logo,
  .hero-hub .hub-core__aira {
    display: block;
    width: 100%;
    max-width: 100%;
    text-align: center;
    margin-inline: auto;
  }

  .hero-hub .hub-core__logo {
    font-size: 26px;
    letter-spacing: -0.04em;
    line-height: 1.05;
    white-space: normal;
    overflow-wrap: normal;
    word-break: keep-all;
  }

  .hero-hub .hub-core__aira {
    font-size: 13px;
    margin-top: 1px;
    line-height: 1.15;
    white-space: nowrap;
    letter-spacing: 0.01em;
  }
}

/* ── Mobile hero hub: proportional tokens, no orbit floors ── */
@media (max-width: 640px) {
  .hero-hub .radial-hub {
    --hub-card-gap: 40px;
    --hub-size: 90px;
    --orbit-radius: calc((228px + var(--hub-card-gap)) * var(--layout-scale));
    --hub-icon-size: calc(96px * var(--layout-scale));
    --hub-icon-glyph: calc(48px * var(--layout-scale));
    --hub-icon-radius: calc(20px * var(--layout-scale));
    --card-w: calc(100px * var(--layout-scale));
    --card-h: calc(112px * var(--layout-scale));
  }

  .hero-hub .hub-page {
    padding: 8px 0 16px;
  }

  .hero-hub .hub-core__logo {
    font-size: 17px;
    letter-spacing: -0.04em;
    white-space: nowrap;
    line-height: 1;
    max-width: 100%;
  }

  .hero-hub .hub-core__aira {
    font-size: 10px;
    margin-top: 1px;
    white-space: nowrap;
    line-height: 1.1;
  }

  .hero-hub .hub-core__surface {
    gap: 1px;
    padding: 10px 6px;
    border-width: calc(2px * var(--layout-scale));
    box-shadow:
      inset 0 1px 1px rgba(255, 255, 255, 0.48),
      inset 0 -10px 28px rgba(0, 32, 96, 0.32),
      inset 0 0 24px rgba(255, 255, 255, 0.1),
      0 0 0 calc(1px * var(--layout-scale)) rgba(96, 165, 255, 0.5),
      0 0 calc(32px * var(--layout-scale)) rgba(59, 130, 246, 0.72),
      0 0 calc(64px * var(--layout-scale)) rgba(37, 99, 235, 0.38),
      0 calc(12px * var(--layout-scale)) calc(32px * var(--layout-scale)) rgba(15, 23, 42, 0.14);
  }

  .hero-hub .hub-card__title {
    font-size: max(0.75rem, calc(0.8125rem * var(--layout-scale)));
    font-weight: 700;
    line-height: 1.2;
    color: var(--hr-fg);
  }

  [data-theme="dark"] .hero-hub .hub-card__title {
    color: #F3F7FF;
    text-shadow: 0 1px 10px rgba(37, 99, 235, 0.32);
  }

  .hero-hub .hub-card__icon-wrap svg {
    stroke-width: 2;
  }

  .hero-hub .hub-core__halo {
    opacity: 1;
    inset: calc(-18px * var(--layout-scale));
  }

  .hub-compact .hero-hub .hub-page.is-pills-dismissed .hub-card:not(.is-active):not(.is-dismissing):not(.is-ambient-active),
  .hero-hub .hub-card {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-page.is-ambient-live .hub-card {
    animation: none;
    --card-float-y: 0px;
  }

  .hub-card.is-energy-receive::after {
    animation: none;
    opacity: 0;
  }

  .hub-core,
  .hub-core::before,
  .hub-core::after {
    animation: none !important;
  }

  .hub-core {
    --hub-core-breathe: 1;
    will-change: auto;
  }

  .hub-core__halo,
  .hub-core__surface,
  .hub-core__surface::before {
    animation: none;
    will-change: auto;
  }

  .hub-core__blend,
  .hub-core__brand-glow,
  .hub-core__ripple {
    transition: none;
    animation: none !important;
  }

  .hub-core__ripples {
    display: none;
  }

  .hub-page.is-core-amber .hub-core__blend,
  .hub-page.is-core-amber .hub-core__brand-glow {
    opacity: 1;
    animation: none !important;
  }

  .hub-page.is-core-amber .hub-core__blend {
    --hub-amber-fill: 100%;
    opacity: 1;
    -webkit-mask-image: none;
    mask-image: none;
    background: linear-gradient(
      to top right,
      #FFD080 0%,
      #FFBF66 28%,
      #E8A838 62%,
      #D97706 100%
    );
  }

  .hub-page.is-core-amber .hub-core__brand-glow {
    --hub-amber-bloom: 1;
    opacity: 1;
    transform: scale(1);
  }

  .hub-page.is-core-amber .hub-core__halo {
    --hub-amber-bloom: 1;
    animation: none !important;
    background: radial-gradient(
      circle at 50% 40%,
      rgba(255, 191, 64, 0.82) 0%,
      rgba(255, 168, 46, 0.52) 48%,
      rgba(232, 168, 56, 0.22) 66%,
      transparent 78%
    );
  }

  .hub-energy-rings,
  .hub-orbit-particles {
    display: none !important;
  }

  .hub-energy-ring {
    animation: none !important;
  }

  .hub-card__icon-wrap svg {
    animation: none;
    will-change: auto;
  }

  .hub-page[data-intro="pending"] .hub-card__surface,
  .hub-page[data-intro="pending"] .feature-pill,
  .hub-page[data-intro="pending"] .radial-hub__svg,
  .hub-page[data-intro="pending"] .radial-hub__connectors {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .hub-page[data-intro="pending"] .hub-core {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(var(--hub-core-scale, 1));
    --hub-core-scale: 1;
  }

  .hub-page[data-intro="pending"] .hub-core__logo,
  .hub-page[data-intro="pending"] .hub-core__aira {
    opacity: 1;
  }
}
