/* Three.js hero studies: shared layout. The canvas fills the hero; copy sits on the 12-column grid above it. */

.h3d {
  position: relative;
  height: calc(100svh - var(--header-h, 72px));
  min-height: 600px;
  overflow: hidden;
  isolation: isolate;
}
.h3d canvas.stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; touch-action: pan-y; }
.h3d .h3d-ui { position: relative; z-index: 1; height: 100%; pointer-events: none; }
.h3d .h3d-ui .wrap { height: 100%; }
.h3d .h3d-ui a, .h3d .h3d-ui button { pointer-events: auto; }
.h3d .h3d-grid { height: 100%; align-content: space-between; padding-block: clamp(28px, 6vh, 72px) clamp(20px, 4vh, 44px); }
.h3d .h3d-copy { grid-column: 1 / span 6; display: grid; gap: clamp(16px, 2.6vh, 26px); align-content: start; }
.h3d .display { font-size: clamp(2.4rem, min(5.4vw, 9.6vh), 6.6rem); }
.h3d .display span { display: block; white-space: nowrap; }
.h3d .lede { max-width: 44ch; font-size: clamp(1rem, min(1.25vw, 2.2vh), 1.3rem); }
.h3d .h3d-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.h3d .h3d-hint { color: var(--mute); }
.h3d.on-graphite .h3d-hint { color: var(--on-graphite-mute); }
.h3d .readout-card {
  pointer-events: auto;
  min-width: min(360px, 100%);
  padding: 18px 20px; border-radius: var(--radius-lg);
  background: rgba(239, 241, 239, 0.72); border: 1px solid rgba(157, 164, 161, 0.5);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 24px 48px -32px rgba(20, 24, 23, 0.4);
}
.h3d.on-graphite .readout-card { background: rgba(25, 29, 28, 0.66); border-color: var(--graphite-line); }
.readout-card .rc-top { display: flex; justify-content: space-between; color: var(--mute); margin-bottom: 8px; }
.h3d.on-graphite .readout-card .rc-top { color: var(--on-graphite-mute); }
.readout-card .rc-big { font-variation-settings: "wdth" 125; font-weight: 640; letter-spacing: -0.035em; font-size: 2rem; line-height: 1; margin: 0; font-feature-settings: "tnum" 1; }
.readout-card .rc-text { margin: 8px 0 0; color: var(--ink-2); font-size: 0.95rem; max-width: 38ch; }
.h3d.on-graphite .readout-card .rc-text { color: var(--on-graphite-mute); }

.pin-label {
  position: absolute; z-index: 1; left: 0; top: 0; pointer-events: none;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(25, 29, 28, 0.86); color: var(--on-graphite);
  font-size: 0.82rem; font-weight: 560; font-variation-settings: "wdth" 96;
  box-shadow: 0 10px 24px -12px rgba(10, 14, 13, 0.6);
  transform: translate(-50%, calc(-100% - 14px));
  transition: opacity 0.4s var(--ease);
}
.pin-label i { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
.pin-label small { color: var(--on-graphite-mute); font-weight: 450; }

.h3d .fallback { position: absolute; inset: 0; z-index: 0; display: none; }
.h3d.no-webgl .fallback { display: block; }

@media (max-width: 860px) {
  .h3d .h3d-copy { grid-column: 1 / -1; }
  .h3d .h3d-foot { flex-direction: column; align-items: stretch; }
  .h3d .h3d-hint { display: none; }
  .h3d .readout-card { min-width: 0; }
}

/* Study switcher shown on each hero page */
.study-switch {
  position: fixed; right: 16px; top: calc(var(--header-h, 72px) + 12px); z-index: 70;
  display: flex; gap: 4px; padding: 4px; border-radius: 999px;
  background: rgba(25, 29, 28, 0.88); box-shadow: 0 12px 30px -14px rgba(10, 14, 13, 0.6);
}
.study-switch a { color: var(--on-graphite-mute); text-decoration: none; font-size: 0.82rem; font-weight: 560; padding: 8px 14px; border-radius: 999px; }
.study-switch a[aria-current="page"] { background: var(--signal); color: var(--signal-ink); }

body.study .legend { display: none; }

@media (max-width: 860px) {
  .h3d .display, .glass-hero .glass-copy .display, .dial-hero .dial-copy .display { font-size: clamp(1.9rem, 8.4vw, 2.8rem); }
  .h3d .display span { white-space: normal; }
  .h3d .h3d-grid { padding-bottom: 76px; }
  .h3d .readout-card { padding: 12px 14px; }
  .h3d .readout-card .rc-text { display: none; }
  .h3d .readout-card .rc-big { font-size: 1.5rem; }
  .h3d .hero-actions { flex-wrap: nowrap; gap: 8px; }
  .h3d .hero-actions .btn { --h: 46px; padding: 0 16px; font-size: 0.92rem; white-space: nowrap; }
  .h3d .hero-actions .btn-primary { flex: 1; }
  .study-switch { top: auto; bottom: 12px; right: 50%; transform: translateX(50%); }
}
