/* ============================================================
   Services hub (services.html): a 3D ring of service cards that wraps the viewer.
   Wheel, drag and touch spin it; a card slows the spin, tilts toward the pointer and shows its label; a click opens the
   service page. Built from real links, so Google and keyboards see the same seven services (scripts/hub-ring.js).
   No scrolling on this page: the wheel belongs to the ring.
   ============================================================ */
html.hub-page, html.hub-page body { overflow: hidden; overscroll-behavior: none; height: 100%; }
.hub { position: relative; z-index: 1; height: 100svh; overflow: hidden; }

/* Heading: the page's one piece of text, centered above the ring */
.hub-head { position: absolute; z-index: 6; left: 0; right: 0; top: clamp(72px, 9svh, 110px); text-align: center; padding: 0 24px; pointer-events: none; }
.hub-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 6px 13px 6px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-family: var(--font-mono); font-size: 11px; line-height: 1; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.hub-kicker i { width: 6px; height: 6px; border-radius: 50%; background: #0E9F6E; }
.hub-h1 { font-family: var(--font-hero, 'Instrument Sans', var(--font-display)); font-weight: 500; font-size: clamp(2.5rem, min(4.7vw, 7.6svh), 4.5rem); line-height: 1.02; letter-spacing: -0.045em; margin: 0; color: var(--ink); }
.hub-h1-a, .hub-h1-b { display: block; }
.hub-h1 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 1.1em; letter-spacing: -0.02em; }
.hub-sub { margin: 18px auto 0; max-width: 27em; font-size: clamp(.95rem, 1.15vw, 1.0625rem); line-height: 1.6; color: var(--ink-soft); text-wrap: balance; }
.hub-h1 .w { display: inline-block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; vertical-align: top; }
.hub-h1 .w > span { display: inline-block; }
.hub-kicker, .hub-sub, .hub-hint { transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.hub.hub-pre .hub-h1 .w > span { transform: translateY(110%); }
.hub.hub-pre .hub-kicker, .hub.hub-pre .hub-sub, .hub.hub-pre .hub-hint { opacity: 0; transform: translateY(12px); }
.hub-h1 .w > span { transition: transform .9s var(--ease-out); transition-delay: calc(var(--i, 0) * .06s); }

/* The wall fills the screen; the lens carries the perspective; the ring is a zero-size centre the cards sit around */
.hub-wall { position: absolute; inset: 0; z-index: 2; cursor: grab; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.hub-wall.is-dragging { cursor: grabbing; }
.hub-lens { position: absolute; inset: -100vh 0; perspective: 1000px; }
.hub-ring { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; will-change: transform; }

.hub-card { will-change: transform; position: absolute; top: -100px; left: calc(var(--w) / -2); width: var(--w); height: 200px; display: block; transform-style: preserve-3d; color: inherit; -webkit-tap-highlight-color: transparent; }
.hub-card.is-hidden { visibility: hidden; pointer-events: none; }
.hub-tilt { position: absolute; inset: 0; transform-style: preserve-3d; }
.hub-frame { position: absolute; inset: -9px; border: 3px solid var(--ink); border-radius: 24px; box-shadow: 0 40px 80px -30px rgba(20, 19, 17, .35); clip-path: inset(0 100% 0 0 round 24px); transition: clip-path .55s var(--ease-out); pointer-events: none; }
.hub-face { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #2a2a2b; opacity: 0;
  box-shadow: 0 2px 4px rgba(20, 19, 17, .06), 0 18px 36px -20px rgba(20, 19, 17, .5);
 }
/* the reflection is a real mirrored copy (not box-reflect, which flickers on 3D cards while they fly in); it fades in once the ring has settled */
.hub-face img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; user-drag: none; pointer-events: none; }
.hub-card.is-flipped .hub-face { transform: rotateY(180deg); }

/* Chip: number and name, always visible, so every card says what it is */
.hub-chip { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); white-space: nowrap; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px; background: rgba(20, 19, 17, .62); color: #fff; font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; transition: opacity .3s; }
.hub-chip i { font-style: normal; opacity: .6; }
.hub-card:hover .hub-chip, .hub-card:focus-visible .hub-chip { opacity: 0; }

/* Label bar: revealed on hover and keyboard focus */
.hub-bar { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 11px 14px; border-radius: 12px; background: var(--ink); color: #fff; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; clip-path: inset(0 100% 0 0 round 12px); transition: clip-path .5s var(--ease-out) .05s; }
.hub-bar b { font-family: var(--font-hero, 'Instrument Sans', var(--font-display)); font-weight: 500; font-size: 17px; line-height: 1.12; letter-spacing: -.02em; }
.hub-bar small { grid-column: 1; font-size: 11.5px; line-height: 1.35; color: rgba(255, 255, 255, .66); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hub-bar svg { grid-row: 1 / span 2; grid-column: 2; width: 18px; height: 18px; transform: translate(-6px, 6px); transition: transform .5s cubic-bezier(.34, 1.56, .64, 1) .15s; }
.hub-card:hover .hub-frame, .hub-card:focus-visible .hub-frame { clip-path: inset(0 0 0 0 round 24px); }
.hub-card:hover .hub-bar, .hub-card:focus-visible .hub-bar { clip-path: inset(0 0 0 0 round 12px); }
.hub-card:hover .hub-bar svg, .hub-card:focus-visible .hub-bar svg { transform: none; }
.hub-card:focus-visible { outline: none; }

/* Small hint and the legal links, kept out of the way */
.hub-hint { position: absolute; z-index: 6; left: 0; right: 0; bottom: 64px; text-align: center; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); pointer-events: none; }
.hub-legal { position: absolute; z-index: 6; left: 0; right: 0; bottom: 22px; display: flex; justify-content: center; gap: 22px; font-size: 12px; color: var(--muted); }
.hub-legal a { color: inherit; transition: color .2s; }
.hub-legal a:hover { color: var(--ink); }

@media (max-width: 820px) { .hub-head { top: 84px; } .hub-hint { bottom: 54px; } }
@media (prefers-reduced-motion: reduce) {
  .hub-h1 .w > span, .hub-kicker, .hub-sub, .hub-hint, .hub-frame, .hub-bar, .hub-bar svg { transition: none; }
}

/* coming back from a service page: the ring is already formed, so it simply fades in after the page transition */
@keyframes hub-return { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.hub.hub-return .hub-lens { animation: hub-return 1s var(--ease-out) both; }
@media (prefers-reduced-motion: reduce) { .hub-pill { transition: none; } .hub.hub-return .hub-lens { animation: none; } }

/* the heading is hidden while the ring forms and eases in when it is almost in place */
.hub-h1-a, .hub-h1-b { transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.hub-h1-b { transition-delay: .08s; }
.hub.hub-pre .hub-h1-a, .hub.hub-pre .hub-h1-b { opacity: 0; transform: translateY(14px); }
@media (prefers-reduced-motion: reduce) { .hub-h1-a, .hub-h1-b { transition: none; } }
