/* ==========================================================================
   CoCentric wheel - one goal, six parts, the tools inside them (section "wheel").
   Semantic tokens from css/tokens.css only; light + dark follow the page theme.
   >= 1360px: wheel + a fan of tool pills + the card.  1100-1359: wheel + card.  < 1100: wheel, then card.
   ========================================================================== */

#nh-wheel.nhw-mounted, #nh-wheel[data-mounted] { min-height: 0; }

.nhw { padding-block: clamp(3rem, 2rem + 5vw, 6.5rem); color: var(--nh-text); }
.nhw *, .nhw *::before, .nhw *::after { box-sizing: border-box; }

/* ---------------------------------------------------------------- head */
.nhw-head { text-align: center; max-width: 52rem; margin: 0 auto var(--nh-space-7); }
.nhw-eyebrow {
  margin: 0 0 var(--nh-space-4);
  font-family: var(--nh-font-display); font-size: var(--nh-fs-xs); font-weight: var(--nh-weight-medium);
  letter-spacing: var(--nh-tracking-eyebrow); text-transform: uppercase; color: var(--nh-accent);
}
.nhw-title {
  margin: 0 0 var(--nh-space-4);
  font-family: var(--nh-font-display); font-size: var(--nh-fs-3xl); font-weight: var(--nh-weight-semibold);
  line-height: var(--nh-lh-heading); letter-spacing: var(--nh-tracking-display); color: var(--nh-heading);
  text-wrap: balance;
}
.nhw-lede { margin: 0 auto; max-width: 40rem; font-size: var(--nh-fs-lg); line-height: 1.55; color: var(--nh-text-muted); }

/* ---------------------------------------------------------------- board */
.nhw-board { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--nh-space-5); }
@media (min-width: 1100px) {
  .nhw-board { grid-template-columns: minmax(0, 1fr) 440px; align-items: stretch; }
}

.nhw-stage {
  /* clip, not hidden: a hidden box can still be scrolled by focus()/scrollIntoView, and the wide sweep behind the ring
     gave it 148px of room - the wheel slid left out of its card on a phone */
  position: relative; overflow: hidden; overflow: clip; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--nh-space-4);
  padding: clamp(0.75rem, 2vw, 1.5rem);
  border: 1px solid var(--nh-border); border-radius: var(--nh-radius-lg);
  background: var(--nh-surface); box-shadow: var(--nh-shadow-2);
}
/* a slow sweep of light behind the ring */
.nhw-stage::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: 130%; aspect-ratio: 1;
  transform: translate(-50%, -50%); pointer-events: none; opacity: 0.8;
  background: conic-gradient(from 0deg, transparent 0deg, var(--nh-accent-soft) 45deg, transparent 130deg, transparent 230deg, var(--nh-accent-soft) 300deg, transparent 360deg);
  filter: blur(36px); animation: nhw-sweep 26s linear infinite;
}
@keyframes nhw-sweep { to { transform: translate(-50%, -50%) rotate(360deg); } }

.nhw-wheelbox { position: relative; width: min(470px, 100%); aspect-ratio: 1; flex: none; }
.nhw-wheel { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; --nhw-turn: 0deg; }
@media (min-width: 1360px) {
  .nhw-stage { align-items: flex-start; padding-left: clamp(1rem, 3vw, 2.75rem); }
  .nhw-goalcap { align-self: flex-start; }
}

/* the ring: real buttons (role=button on the <g>) */
.nhw-rotor {
  transform-origin: 300px 300px; transform: rotate(var(--nhw-turn));
  transition: transform 1.2s cubic-bezier(0.33, 0.02, 0.16, 1);
}
.nhw-part { cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.nhw-part__band {
  fill: var(--nh-surface-2); stroke: var(--nh-border-strong); stroke-width: 1.4;
  transition: fill 0.3s ease, stroke 0.3s ease, filter 0.3s ease;
}
.nhw-part:hover .nhw-part__band { fill: var(--nh-accent-soft); stroke: var(--nh-accent-strong); }
.nhw-part--lit .nhw-part__band, .nhw-part--lit:hover .nhw-part__band {
  fill: var(--nh-btn-primary-bg); stroke: var(--nh-btn-primary-bg); filter: drop-shadow(0 0 14px var(--nh-accent-glow));
}
.nhw-part:focus-visible .nhw-part__band { stroke: var(--nh-focus); stroke-width: 5; filter: drop-shadow(0 0 8px var(--nh-focus-halo)); }
/* labels stay upright: they turn back by exactly what the ring turned, with the same easing */
.nhw-part__t {
  font-family: var(--nh-font-display); font-size: 24px; font-weight: 600; letter-spacing: 0;
  fill: var(--nh-text); pointer-events: none; user-select: none;
  transform-box: fill-box; transform-origin: center;
  transform: rotate(calc(-1 * var(--nhw-turn)));
  transition: transform 1.2s cubic-bezier(0.33, 0.02, 0.16, 1), fill 0.3s ease;
}
.nhw-part--lit .nhw-part__t { fill: var(--nh-btn-primary-text); font-weight: 700; }

.nhw-hub__disc { fill: var(--nh-bg); stroke: var(--nh-border-strong); stroke-width: 1.4; }
.nhw-hub__ring {
  fill: none; stroke: var(--nh-accent-strong); stroke-opacity: 0.7; stroke-width: 2; stroke-dasharray: 3 8; stroke-linecap: round;
  transform-origin: 300px 300px; animation: nhw-spin 60s linear infinite;
}
@keyframes nhw-spin { to { transform: rotate(360deg); } }
.nhw-hub__t { font-family: var(--nh-font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.01em; fill: var(--nh-heading); }
.nhw-runner { fill: var(--nh-accent); opacity: 0; transition: opacity 0.5s ease 0.6s; filter: drop-shadow(0 0 6px var(--nh-accent-glow)); }
.nhw-runner.is-on { opacity: 1; }

.nhw-goalcap {
  margin: 0; min-height: 28px; display: inline-flex; align-items: center; gap: 8px; text-align: center; justify-content: center;
  font-size: var(--nh-fs-sm); color: var(--nh-text-subtle);
}
.nhw-goalcap.has-goal { color: var(--nh-accent); font-weight: var(--nh-weight-medium); }
.nhw-goalcap .nh-icon { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- the fan */
.nhw-fan { display: none; }
@media (min-width: 1360px) {
  .nhw-fan { display: block; position: absolute; left: 100%; top: 0; height: 100%; width: 300px; pointer-events: none; }
  .nhw-fan__lines { position: absolute; left: 0; top: 0; overflow: visible; }
}
.nhw-link {
  fill: none; stroke: var(--nh-accent-strong); stroke-opacity: 0.6; stroke-width: 1.5;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: nhw-draw 0.6s cubic-bezier(0.3, 0.7, 0.2, 1) forwards;
}
@keyframes nhw-draw { to { stroke-dashoffset: 0; } }
.nhw-pill {
  position: absolute; transform: translateY(-50%); pointer-events: auto; cursor: pointer;
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 18px 6px 14px; white-space: nowrap;
  border-radius: var(--nh-radius-pill); border: 1px solid var(--nh-border-strong);
  background: var(--nh-surface); color: var(--nh-text); box-shadow: var(--nh-shadow-1);
  font-size: var(--nh-fs-sm); font-weight: var(--nh-weight-medium); opacity: 0;
  animation: nhw-pill-in 0.45s var(--nh-ease-out) forwards;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.nhw-pill .nh-icon { width: 20px; height: 20px; color: var(--nh-accent); }
.nhw-pill:hover { border-color: var(--nh-accent-strong); background: var(--nh-accent-soft); }
.nhw-pill.is-on { border-color: var(--nh-accent); background: var(--nh-accent-soft); box-shadow: var(--nh-shadow-glow); }
@keyframes nhw-pill-in {
  from { opacity: 0; transform: translateY(-50%) translateX(-14px) scale(0.96); }
  to { opacity: 1; transform: translateY(-50%) translateX(0) scale(1); }
}

/* ---------------------------------------------------------------- the card */
.nhw-card {
  position: relative; display: flex; flex-direction: column; align-items: stretch;
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  border: 1px solid var(--nh-border); border-radius: var(--nh-radius-lg);
  background: var(--nh-surface); box-shadow: var(--nh-shadow-2);
  min-width: 0;
}
@media (min-width: 1100px) { .nhw-card { min-height: 560px; } }
.nhw-card.is-in > * { animation: nhw-fade 0.35s var(--nh-ease-out) both; }
@keyframes nhw-fade { from { opacity: 0; } to { opacity: 1; } }
.nhw-card__k {
  margin: 0 0 var(--nh-space-3); font-size: var(--nh-fs-xs); font-weight: var(--nh-weight-medium);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--nh-accent);
}
.nhw-card__t {
  margin: 0 0 var(--nh-space-2); font-family: var(--nh-font-display); font-size: var(--nh-fs-xl); font-weight: var(--nh-weight-semibold);
  line-height: var(--nh-lh-snug); letter-spacing: var(--nh-tracking-heading); color: var(--nh-heading); outline: none;
}
.nhw-card__s { margin: 0 0 var(--nh-space-4); font-size: var(--nh-fs-sm); line-height: 1.55; color: var(--nh-text-muted); }
.nhw-card__foot {
  margin: auto 0 0; padding-top: var(--nh-space-4); border-top: 1px solid var(--nh-divider);
  font-size: var(--nh-fs-2xs); line-height: 1.5; color: var(--nh-text-subtle);
}
.nhw-card__s + .nhw-card__foot { margin-top: var(--nh-space-5); }

.nhw-list { list-style: none; margin: 0 0 var(--nh-space-4); padding: 0; display: grid; gap: 6px; }
.nhw-tool {
  appearance: none; width: 100%; min-height: 64px; margin: 0; padding: 10px 12px; text-align: left; cursor: pointer;
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 24px; align-items: center; gap: 12px;
  border: 1px solid var(--nh-border); border-radius: var(--nh-radius-md);
  background: var(--nh-surface-2); color: var(--nh-text); font: inherit;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.nhw-tool:hover { border-color: var(--nh-accent-strong); background: var(--nh-accent-soft); }
.nhw-tool:hover .nhw-tool__go { transform: translateX(3px); color: var(--nh-accent); }
.nhw-tool__ico {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--nh-radius-round);
  border: 1px solid var(--nh-border-strong); color: var(--nh-accent);
}
.nhw-tool__tx { display: grid; gap: 2px; min-width: 0; }
.nhw-tool__tx b { font-size: var(--nh-fs-sm); font-weight: var(--nh-weight-semibold); color: var(--nh-heading); }
.nhw-tool__tx span { font-size: var(--nh-fs-xs); line-height: 1.4; color: var(--nh-text-muted); }
.nhw-tool__tx i { font-style: normal; font-size: var(--nh-fs-2xs); font-weight: var(--nh-weight-medium); letter-spacing: 0.06em; text-transform: uppercase; color: var(--nh-accent); }
.nhw-tool__go { color: var(--nh-text-subtle); transition: transform 0.2s ease, color 0.2s ease; display: grid; place-items: center; }

.nhw-back {
  appearance: none; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  margin: -6px 0 var(--nh-space-2) -10px; padding: 0 14px 0 8px; cursor: pointer;
  border: 0; border-radius: var(--nh-radius-pill); background: transparent; color: var(--nh-accent);
  font: inherit; font-size: var(--nh-fs-sm); font-weight: var(--nh-weight-medium);
}
.nhw-back:hover { background: var(--nh-accent-soft); }

/* the tool's real capture */
.nhw-shot {
  position: relative; margin: 0 0 var(--nh-space-4); width: 100%; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: var(--nh-radius-md); border: 1px solid var(--nh-border); background: var(--nh-surface-2);
}
.nhw-shot img, .nhw-shot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--nhw-focal, 50% 50%); display: block; }
.nhw-shot__video { opacity: 0; transition: opacity 0.4s ease; }
.nhw-shot.is-live .nhw-shot__video { opacity: 1; }
.nhw-shot__toggle {
  appearance: none; position: absolute; right: 10px; bottom: 10px; width: 44px; height: 44px; padding: 0; cursor: pointer;
  display: grid; place-items: center; border-radius: var(--nh-radius-round);
  border: 1px solid rgba(255, 255, 255, 0.4); background: rgba(5, 8, 8, 0.66); color: #fff;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.nhw-shot__toggle:hover { background: rgba(5, 8, 8, 0.85); }
.nhw-nofilm {
  display: grid; justify-items: center; gap: var(--nh-space-3); margin: 0 0 var(--nh-space-4); padding: var(--nh-space-6) var(--nh-space-4);
  text-align: center; border: 1px dashed var(--nh-border-strong); border-radius: var(--nh-radius-md); color: var(--nh-text-muted);
}
.nhw-nofilm p { margin: 0; font-size: var(--nh-fs-xs); max-width: 28ch; }
.nhw-nofilm__ico { display: grid; place-items: center; width: 84px; height: 84px; border-radius: var(--nh-radius-round); background: var(--nh-accent-soft); color: var(--nh-accent); }

.nhw-see { align-self: flex-start; margin-bottom: var(--nh-space-4); }
.nhw-others { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: var(--nh-space-4); border-top: 1px solid var(--nh-divider); }
.nhw-chip {
  appearance: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; cursor: pointer;
  border-radius: var(--nh-radius-pill); border: 1px solid var(--nh-border-strong); background: transparent; color: var(--nh-text);
  font: inherit; font-size: var(--nh-fs-xs); font-weight: var(--nh-weight-medium);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.nhw-chip .nh-icon { color: var(--nh-accent); }
.nhw-chip:hover { border-color: var(--nh-accent-strong); background: var(--nh-accent-soft); }
.nhw-chip[aria-pressed="true"] { border-color: var(--nh-accent); background: var(--nh-accent-soft); }

/* ---------------------------------------------------------------- goals */
.nhw-goals { margin-top: var(--nh-space-6); text-align: center; }
.nhw-goals__t { margin: 0 0 var(--nh-space-4); font-size: var(--nh-fs-sm); color: var(--nh-text-muted); }
.nhw-goals__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.nhw-goal {
  appearance: none; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; cursor: pointer; text-align: left;
  border-radius: var(--nh-radius-pill); border: 1px solid var(--nh-border-strong); background: var(--nh-surface); color: var(--nh-text);
  font: inherit; font-size: var(--nh-fs-sm); font-weight: var(--nh-weight-medium);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.nhw-goal .nh-icon { width: 20px; height: 20px; flex: none; color: var(--nh-accent); }
.nhw-goal:hover { border-color: var(--nh-accent-strong); transform: translateY(-2px); box-shadow: var(--nh-shadow-1); }
.nhw-goal[aria-pressed="true"] { border-color: var(--nh-accent); background: var(--nh-accent-soft); box-shadow: var(--nh-shadow-glow); }

/* focus: visible on every real control here */
.nhw-tool:focus-visible, .nhw-back:focus-visible, .nhw-chip:focus-visible, .nhw-goal:focus-visible, .nhw-shot__toggle:focus-visible {
  outline: 3px solid var(--nh-focus); outline-offset: 2px;
}
.nhw .nh-btn:focus-visible { outline: 3px solid var(--nh-focus); outline-offset: 3px; }

/* phone: the ring shrinks, labels grow a little, the card carries the list */
@media (max-width: 640px) {
  .nhw-part__t { font-size: 28px; }
  .nhw-hub__t { font-size: 32px; }
  .nhw-goal { padding: 0 16px; }
  .nhw-goals__row { gap: 8px; }
  .nhw-card { min-height: 0; }
}

/* reduced motion: movement becomes a fade */
@media (prefers-reduced-motion: reduce) {
  .nhw-stage::before, .nhw-hub__ring { animation: none; }
  .nhw-rotor, .nhw-part__t { transition: none; }
  .nhw-link { animation: none; stroke-dashoffset: 0; }
  .nhw-pill { animation: nhw-fade 0.3s ease forwards; transform: translateY(-50%); }
  .nhw-goal:hover { transform: none; }
  .nhw-tool:hover .nhw-tool__go { transform: none; }
}
