/* The live sphere section: the app's dock, with its space name above,
   the ball, its mode word below, the timer and pause beside it while
   recording, and the tools spiralling out on a hold. */

.dock-block { padding-top: calc(var(--section) * 0.5); }
.dock-grid { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 64px; align-items: center; }

.dock {
  --ball: clamp(150px, 17vw, 200px);
  /* The app's dock type and spacing (sphere_dock.dart, space_header.dart),
     a little larger here than on a phone. */
  --k: 1.15;
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; align-items: center;
  padding: 44px 24px 36px; border-radius: var(--radius-lg);
  background: radial-gradient(120% 80% at 50% 0%, #151517, #0a0a0b 70%);
  border: 1px solid var(--line);
  min-height: 560px; justify-content: space-between;
  overflow: hidden;
}
.dock::before { /* the recording glow, off until a take starts */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.6s;
  background: radial-gradient(closest-side at 50% 58%, rgba(229, 72, 77, 0.22), transparent 70%);
}
.dock.rec::before { opacity: 1; }
.dock.paused::before { opacity: 0; }
.dock.menu::before { opacity: 1; background: radial-gradient(closest-side at 50% 58%, rgba(245, 124, 31, 0.2), transparent 70%); }

.dock-head { text-align: center; }
.dock-title {
  font-size: calc(20px * var(--k)); line-height: 1.25; margin: 0 0 2px;
  text-transform: uppercase; letter-spacing: calc(1.2px * var(--k));
  transition: opacity 0.14s, transform 0.14s;
}
.dock-title.swap { opacity: 0; transform: translateY(-6px); }
.dock-meta { margin: 0; color: var(--muted); font-size: calc(12px * var(--k)); font-weight: 500; line-height: 1.2; }

.dock-stage { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; margin: 24px 0 0; }
.dock-ball-wrap { position: relative; width: calc(var(--ball) * 1.3); height: calc(var(--ball) * 1.3); }
.dock-ball {
  display: block; width: 100%; height: 100%;
  cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  border-radius: 50%; transition: transform 0.15s var(--ease-out);
}
.dock.down .dock-ball { transform: scale(0.96); }
.dock.rec .dock-ball { cursor: pointer; }
.dock-ball:active { cursor: grabbing; }
.dock-ball:focus-visible { outline-offset: -12%; border-radius: 50%; }

/* Recording: the timer to the ball's left, pause and × to its right, as
   in the app (the canvas is padded by 15% of the ball on each side). */
.dock-timer, .dock-side { opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.dock.rec .dock-timer, .dock.rec .dock-side { opacity: 1; pointer-events: auto; }
.dock-timer {
  justify-self: end; margin-right: max(0px, calc(34px * var(--k) - var(--ball) * 0.15));
  font-size: calc(16px * var(--k)); font-weight: 500; line-height: 1.4; font-variant-numeric: tabular-nums;
  color: #ff6369;
}
.dock.paused .dock-timer { color: var(--muted); }
.dock-side { justify-self: start; display: flex; margin-left: max(0px, calc(16px * var(--k) - var(--ball) * 0.15)); }
.dock-icon {
  width: calc(48px * var(--k)); height: calc(48px * var(--k)); padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: none; color: var(--text); cursor: pointer;
}
.dock-icon:hover { background: rgba(255, 255, 255, 0.06); }
.dock-icon i, .dock-icon svg { width: calc(24px * var(--k)); height: calc(24px * var(--k)); display: block; }
.dock-x { color: var(--muted); }
.dock-x i, .dock-x svg { width: calc(30px * var(--k)); height: calc(30px * var(--k)); }

/* What a tap does, just under the ball: small, grey, in Yatra One. Only
   while the ball is idle. */
.dock-mode {
  margin: calc(4px * var(--k) - var(--ball) * 0.15) 0 0; height: calc(24px * var(--k));
  font-size: calc(12px * var(--k)); line-height: 1.6; color: var(--muted);
  transition: opacity 0.2s;
}
.dock.rec .dock-mode, .dock.menu .dock-mode { opacity: 0; }
.dock-status { margin: 22px 0 0; min-height: 2.8em; max-width: 30em; text-align: center; font-size: 15px; color: var(--faint); }
.dock.rec .dock-status, .dock.menu .dock-status { color: var(--muted); }

/* The tools: small steel balls fanned over the top of the ball. */
.dock-menu { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.tool {
  position: absolute; left: 0; top: 0; padding: 0; border: 0; background: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer;
  transform: translate(-50%, -50%) scale(0.3) rotate(-90deg); opacity: 0; pointer-events: none;
  transition: transform 0.45s var(--ease-out), opacity 0.3s;
  transition-delay: calc((4 - var(--i)) * 25ms);
}
.tool canvas { width: calc(var(--ball) * 0.36); height: calc(var(--ball) * 0.36); display: block; }
.tool span { font-size: 11px; font-weight: 600; white-space: nowrap; margin-top: -4px; }
.dock.menu .tool {
  transform: translate(-50%, -50%) translate(var(--x), var(--y)) scale(1) rotate(0);
  opacity: 1; pointer-events: auto; transition-delay: calc(var(--i) * 45ms);
}
.tool:hover span, .tool:focus-visible span { color: var(--text); }

@media (max-width: 900px) {
  .dock-grid { grid-template-columns: 1fr; gap: 40px; }
  .dock { order: -1; min-height: 520px; }
}
@media (max-width: 734px) {
  .dock { --ball: 120px; --k: 1; padding: 32px 8px 28px; min-height: 470px; }
  .dock-icon { width: 44px; height: 44px; }
}
/* With the tools out, the space name steps back (the app doesn't dim). */
.dock-head { transition: opacity 0.3s; }
.dock.menu .dock-head { opacity: 0.12; }
