/*
Title: Radial Navigation Styles
Role: Present floating workspace navigation as expanding circles across desktop and small screens.
Index:
  S01 - Floating launcher
  S02 - Modal surface and heading
  S03 - Radial geometry and destinations
  S04 - Current selection and interactions
  S05 - Small screens and reduced motion
*/

/* [S01] Floating launcher */
.navigation-orb {
  position: fixed;
  right: max(28px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 88px;
  height: 88px;
  padding: 8px;
  border: 1px solid var(--night-line);
  border-radius: 50%;
  background: var(--brand-blue);
  color: var(--night-text);
  box-shadow:
    0 8px 28px #080f2040,
    inset 0 0 0 5px #ffffff0a;
  font:
    600 12px/1.2 "Segoe UI",
    sans-serif;
  cursor: pointer;
  transition:
    background 160ms,
    box-shadow 160ms;
}
.navigation-orb svg {
  width: 29px;
  height: 29px;
}
.navigation-orb:hover {
  background: var(--brand-blue-hover);
  box-shadow: 0 10px 32px #080f2055;
}
body.navigation-is-open {
  overflow: hidden;
}

/* [S02] Modal surface and heading */
.radial-dialog {
  width: min(600px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--night-line);
  border-radius: 32px;
  background: var(--night);
  color: var(--night-text);
  box-shadow: 0 32px 100px #080f2080;
  overflow-x: hidden;
}
.radial-dialog::backdrop {
  background: #080f20b8;
  backdrop-filter: blur(7px);
}
.radial-surface {
  padding: 24px 24px 16px;
  background: radial-gradient(
    ellipse at 50% 55%,
    var(--night-hover) 0%,
    var(--night) 70%
  );
}
.radial-heading {
  text-align: center;
  padding: 0 34px;
}
.radial-heading .brand-mark {
  width: 110px;
  padding: 8px 10px;
  border-radius: 8px;
}
.radial-heading h2 {
  margin: 10px 0 6px;
  font-size: 27px;
  font-weight: 500;
}
.radial-heading p {
  margin: 0;
  min-height: 30px;
  color: var(--night-muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.radial-close {
  position: absolute;
  right: 12px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  color: var(--night-text);
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.radial-close svg {
  width: 22px;
  height: 22px;
}
.radial-close:hover {
  background: #ffffff14;
}
.radial-guidance {
  margin: 10px 0 0;
  text-align: center;
  color: var(--night-muted);
  font-size: 11px;
}

/* [S03] Radial geometry and destinations */
.radial-wheel {
  --orbit: 168px;
  position: relative;
  height: 454px;
  isolation: isolate;
}
.radial-wheel[hidden] {
  display: none;
}
.radial-wheel::before,
.radial-wheel::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--orbit) * 2);
  height: calc(var(--orbit) * 2);
  border: 1px solid #a6c4ff30;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: -1;
}
.radial-wheel::after {
  width: 248px;
  height: 248px;
  border-style: dashed;
  border-color: #a6c4ff18;
}
.radial-node,
.radial-centre {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 114px;
  height: 114px;
  padding: 12px;
  border: 1px solid var(--night-line);
  border-radius: 50%;
  background: var(--night-raised);
  color: var(--night-text);
  text-align: center;
  text-decoration: none;
  font:
    600 13px/1.25 "Segoe UI",
    sans-serif;
  cursor: pointer;
  transition:
    background 160ms,
    border-color 160ms,
    box-shadow 160ms;
}
.radial-node {
  transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--orbit))
    rotate(calc(-1 * var(--angle)));
  animation: radial-reveal 190ms ease-out;
}
.radial-node svg {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
}
.radial-node small {
  color: var(--night-muted);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 400;
}
.radial-centre {
  transform: translate(-50%, -50%);
  width: 108px;
  height: 108px;
  background: var(--night-panel);
  border-color: var(--night-line);
}
.radial-centre svg {
  width: 28px;
  height: 28px;
}
.radial-home {
  background: var(--surface-page);
  color: var(--brand-blue);
  border-color: var(--night-accent);
  box-shadow:
    0 0 0 9px #a6c4ff12,
    0 6px 22px #080f2040;
}

/* [S04] Current selection and interactions */
.radial-node:hover,
.radial-centre:hover {
  background: var(--night-hover);
  border-color: var(--night-accent);
}
.radial-home:hover {
  background: var(--surface);
}
.radial-node.active,
.radial-node.contains-current {
  background: var(--night-selected);
  border-color: var(--surface-page);
  box-shadow: 0 0 0 4px #a6c4ff24;
}
.radial-node.active::after,
.radial-node.contains-current::after {
  content: "";
  position: absolute;
  bottom: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--night-accent);
}
.radial-node:disabled {
  opacity: 0.55;
  cursor: wait;
}
.radial-dialog :focus-visible {
  outline: 3px solid var(--night-focus);
  outline-offset: 4px;
}
@keyframes radial-reveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* [S05] Small screens and reduced motion */
@media (max-width: 560px) {
  .navigation-orb {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    width: 76px;
    height: 76px;
  }
  .radial-dialog {
    border-radius: 24px;
  }
  .radial-surface {
    padding: 26px 6px 18px;
  }
  .radial-heading {
    padding-inline: 32px;
  }
  .radial-heading h2 {
    font-size: 23px;
  }
  .radial-heading p {
    font-size: 12px;
    min-height: 34px;
  }
  .radial-wheel {
    --orbit: clamp(90px, calc((100vw - 132px) / 2), 150px);
    height: calc(var(--orbit) * 2 + 104px);
  }
  .radial-wheel::after {
    width: 160px;
    height: 160px;
  }
  .radial-node {
    width: 92px;
    height: 92px;
    padding: 9px;
    font-size: 11px;
    gap: 4px;
  }
  .radial-node svg {
    width: 22px;
    height: 22px;
  }
  .radial-node small {
    font-size: 9px;
  }
  .radial-centre {
    width: 80px;
    height: 80px;
    font-size: 11px;
    gap: 4px;
    padding: 8px;
  }
  .radial-centre svg {
    width: 22px;
    height: 22px;
  }
  .radial-node.active::after,
  .radial-node.contains-current::after {
    bottom: 4px;
    width: 4px;
    height: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .radial-node {
    animation: none;
  }
  .navigation-orb,
  .radial-node,
  .radial-centre {
    transition: none;
  }
  .radial-dialog::backdrop {
    backdrop-filter: none;
  }
}
