/* ── SKY: sun chain, wobble wave, OSC box ─────────────────────────────────────
   All three draw into an SVG whose viewBox unit is ~0.1cqw, so stroke and text sizes
   below are in viewBox units and scale with the board. */

:is(#sunchain, #wave, #osc) .sky-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  touch-action: none;
}
/* The octave arrow pokes up out of the box, so the OSC drawing extends above its zone. */
#osc .sky-osc-svg {
  top: -45%;
  height: 145%;
}

:is(#sunchain, #wave, #osc) .sky-ink {
  fill: none;
  stroke: var(--line);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
:is(#sunchain, #wave, #osc) .sky-thin {
  stroke-width: 1.4;
}
:is(#sunchain, #wave, #osc) .sky-label {
  font-family: var(--font-marker);
  font-size: 9px;
  fill: var(--ink);
  letter-spacing: 0.04em;
}
:is(#sunchain, #wave, #osc) .sky-hand {
  font-family: var(--font-hand);
  font-size: 10px;
  font-weight: 700;
  fill: var(--ink-soft);
}
:is(#sunchain, #wave, #osc) .sky-hit {
  fill: transparent;
  stroke: none;
}
:is(#sunchain, #wave, #osc) .sky-ctl {
  cursor: pointer;
  outline: none;
}
:is(#sunchain, #wave, #osc) .sky-focus {
  fill: none;
  stroke: var(--sky);
  stroke-width: 1.4;
  stroke-dasharray: 3 3;
  opacity: 0;
  pointer-events: none;
}
:is(#sunchain, #wave, #osc) .sky-ctl:focus-visible .sky-focus {
  opacity: 1;
}
:is(#sunchain, #wave, #osc) .sky-ctl[role='button']:hover > :not(.sky-hit, .sky-focus) {
  translate: -0.5px -0.8px;
}

/* ── Sun chain ── */
#sunchain .sky-sun-body {
  fill: var(--paper);
  transition: fill 0.4s;
}
#sunchain.is-awake .sky-sun-body {
  fill: var(--processor);
}
#sunchain .sky-sun-rays {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0.45;
  transition: opacity 0.3s;
}
#sunchain.is-awake .sky-sun-rays {
  animation: sky-spin 14s linear infinite;
}
#sunchain.is-awake .sky-sun-rays .sky-ink {
  stroke: var(--processor);
}
#sunchain.is-awake .sky-zzz {
  opacity: 0;
}
#sunchain .sky-zzz {
  transition: opacity 0.3s;
  animation: sky-doze 2.4s ease-in-out infinite;
}

#sunchain .sky-dot {
  fill: var(--ink);
  transition: fill 0.2s;
}
#sunchain .sky-dot.is-passed {
  fill: var(--sky);
}
#sunchain .sky-star {
  fill: var(--paper);
  transform-box: fill-box;
  transform-origin: center;
}
#sunchain.is-awake .sky-star {
  fill: color-mix(in srgb, var(--sky) 30%, var(--paper));
}
#sunchain .sky-scribble {
  stroke-width: 1.1;
}
#sunchain.is-awake .sky-scribble {
  stroke: var(--creator);
}

#sunchain .sky-spark {
  cursor: grab;
}
#sunchain .sky-spark-halo {
  fill: var(--glow);
  opacity: 0;
  transition: opacity 0.3s;
}
#sunchain.is-awake .sky-spark-halo {
  opacity: 1;
  animation: sky-pulse 1.6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
#sunchain .sky-spark-core {
  fill: var(--paper);
  stroke: var(--line);
  stroke-width: 1.4;
}
#sunchain.is-awake .sky-spark-core {
  fill: var(--creator);
}

#sunchain .sky-drift[aria-pressed='true'] .sky-drift-box {
  fill: var(--sky);
}
#sunchain .sky-drift[aria-pressed='true'] .sky-label {
  fill: var(--paper);
}
#sunchain .sky-vol-knob {
  fill: var(--paper);
  stroke: var(--line);
  stroke-width: 1.6;
  cursor: ew-resize;
}

/* ── Wobble wave ── */
#wave .sky-wave-pad {
  cursor: crosshair;
}
#wave .sky-wave-seg {
  stroke-width: 2.2;
  transition: stroke 0.2s, opacity 0.2s;
}
#wave .sky-wave-seg.is-sel {
  stroke: var(--processor);
  stroke-width: 3;
}
#wave.is-bypassed .sky-wave-seg {
  opacity: 0.55;
}
#wave .sky-tick {
  stroke: var(--ink-soft);
}
#wave .sky-tick.is-sel {
  stroke: var(--processor);
  stroke-width: 2.2;
}
#wave .sky-wave-dot {
  fill: var(--processor);
  stroke: var(--line);
  stroke-width: 1.3;
}
#wave.is-bypassed .sky-wave-dot {
  fill: var(--paper);
}
#wave .sky-rate {
  font-size: 10px;
  fill: var(--processor);
}
#wave .sky-wave-title {
  font-size: 7px;
  fill: var(--ink-soft);
  pointer-events: none;
}

/* ── OSC drone ── */
#osc .sky-osc-pad {
  cursor: crosshair;
}
#osc .sky-osc-fill {
  fill: color-mix(in srgb, var(--sky) var(--sky-tint, 10%), transparent);
}
#osc .sky-puck {
  fill: var(--paper);
  transition: fill 0.3s;
}
#osc.is-on .sky-puck {
  fill: color-mix(in srgb, var(--creator) 25%, var(--paper));
}
#osc .sky-puck-halo {
  fill: none;
  stroke: var(--creator);
  stroke-width: 1.2;
  stroke-dasharray: 2 3;
  opacity: 0;
  transition: opacity 0.3s;
}
#osc.is-on .sky-puck-halo {
  opacity: 1;
}
#osc .sky-glyph {
  stroke: var(--ink-soft);
  pointer-events: none;
}
#osc.is-on .sky-glyph {
  stroke: var(--creator);
}
#osc .sky-arrow-shape {
  transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}
#osc .sky-oct {
  fill: var(--sky);
}
#osc .sky-tag-body {
  fill: var(--paper);
  transition: fill 0.3s;
}
#osc .sky-tag[aria-pressed='true'] .sky-tag-body {
  fill: var(--creator);
}
#osc .sky-tag[aria-pressed='true'] .sky-tag-text {
  fill: var(--paper);
}
#osc .sky-tag-text {
  font-size: 12px;
}
#osc .sky-tag[aria-pressed='true'] .sky-tag-scribble {
  stroke: var(--paper);
}

@keyframes sky-spin {
  to {
    rotate: 360deg;
  }
}
@keyframes sky-pulse {
  50% {
    scale: 1.35;
    opacity: 0.6;
  }
}
@keyframes sky-doze {
  50% {
    translate: 1px -2px;
    opacity: 0.5;
  }
}
