/* ==========================================================================
   QUORIT — Understanding The Wound Stylesheet (understanding-the-wound.css)
   Aesthetic: Clinical Science | Systematic Wound Assessment Nexus
   Palette:
     Primary Red:       #D3171D
     Deep Red:          #A91F24
     Primary Orange:    #F78545
     Scientific Blue:   #292D76
     Scientific Green:  #10974A
     Soft Orange:       #FDE5D5
     Soft Red:          #FBE4E5
     Warm Off White:    #FCFAF8
     White:             #FFFFFF
     Primary Text:      #252525
     Secondary Text:    #667085
     Border:            #E8E1DC
   ========================================================================== */

/* Custom Micro-interactions & Visual Tokens */
.custom-border {
  border: 1px solid #E8E1DC;
}

.custom-border-orange {
  border: 1px solid rgba(247, 133, 69, 0.32);
}

.custom-border-red {
  border: 1px solid rgba(211, 23, 29, 0.32);
}

.custom-border-blue {
  border: 1px solid rgba(41, 45, 118, 0.25);
}

.custom-border-green {
  border: 1px solid rgba(16, 151, 74, 0.25);
}

.elevation-soft {
  box-shadow: 0 4px 20px -4px rgba(37, 37, 37, 0.05), 0 2px 6px -1px rgba(37, 37, 37, 0.02);
}

.elevation-card {
  box-shadow: 0 8px 30px -6px rgba(37, 37, 37, 0.06), 0 2px 8px -2px rgba(37, 37, 37, 0.03);
}

.elevation-hover {
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease, background-color 0.28s ease;
}

.elevation-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -8px rgba(37, 37, 37, 0.09), 0 6px 12px -2px rgba(37, 37, 37, 0.04);
  border-color: rgba(247, 133, 69, 0.5);
}

/* Central Diagram Geometry & Pulse */
@keyframes centralPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(211, 23, 29, 0.25);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 16px rgba(211, 23, 29, 0);
  }
}

.central-wound-node {
  animation: centralPulse 4s ease-in-out infinite;
}

@keyframes orbitSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.rotating-orbit-slow {
  animation: orbitSpin 60s linear infinite;
  transform-origin: center;
}

.rotating-orbit-reverse {
  animation: orbitSpin 45s linear infinite reverse;
  transform-origin: center;
}

/* Dotted Scientific Geometry Rings */
.scientific-ring-dotted {
  border: 1.5px dashed rgba(211, 23, 29, 0.25);
}

/* Connector Lines & Transitions */
.connector-line {
  transition: stroke 0.3s ease, stroke-width 0.3s ease, opacity 0.3s ease;
}

.nexus-node {
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.nexus-node:hover {
  transform: translateY(-5px);
  border-color: #D3171D;
  box-shadow: 0 14px 28px -6px rgba(211, 23, 29, 0.12);
}

/* Node Active/Hover states synced with diagram */
.nexus-node.is-active,
.nexus-node.is-hovered {
  border-color: #D3171D;
  background-color: #FFFFFF;
  box-shadow: 0 16px 32px -8px rgba(211, 23, 29, 0.18);
}

/* Section 7 Progression Pills */
.progression-step {
  position: relative;
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.progression-step:hover {
  transform: translateY(-2px);
}

/* Intersection Observer Scroll Reveal */
.reveal-init {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-init.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.delay-100 { transition-delay: 100ms; }
.delay-150 { transition-delay: 150ms; }
.delay-200 { transition-delay: 200ms; }
.delay-250 { transition-delay: 250ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }

/* Sticky Header Scrolled State */
header.header-scrolled {
  background-color: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px -2px rgba(37, 37, 37, 0.05);
  border-bottom: 1px solid #E8E1DC;
}

/* Mobile Drawer Navigation */
#mobile-drawer {
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

#mobile-drawer.drawer-closed {
  transform: translateX(100%);
  pointer-events: none;
}

#mobile-drawer.drawer-open {
  transform: translateX(0);
  pointer-events: auto;
}

/* Accessible focus styling */
a:focus-visible, button:focus-visible {
  outline: 2px solid #D3171D;
  outline-offset: 3px;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-init {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ==========================================================================
   Hero "solar system": THE WOUND at the centre, 3 parameters on 3 orbits
   (explicit border-radius: the Tailwind config maps rounded-full to 0.75rem)
   ========================================================================== */
.wound-solar {
  position: relative;
  width: min(100%, 460px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}
.ws-glow {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, #FBE4E5 0%, #FDE5D5 45%, rgba(252, 250, 248, 0) 72%);
  filter: blur(18px);
  pointer-events: none;
}
.ws-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  border-radius: 50%;
  transform: rotate(var(--a, 0deg));
  animation: wsOrbit var(--d, 30s) linear infinite;
  pointer-events: none;
}
.ws-orbit-1 { --s: 52%; border: 1.5px dashed rgba(211, 23, 29, 0.35); }
.ws-orbit-2 { --s: 73%; border: 1.5px dashed rgba(247, 133, 69, 0.45); }
.ws-orbit-3 { --s: 94%; border: 1.5px dashed rgba(41, 45, 118, 0.30); }
.ws-pos {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
}
.ws-planet {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid #E8E1DC;
  box-shadow: 0 6px 16px -6px rgba(37, 37, 37, 0.18);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #252525;
  white-space: nowrap;
  text-decoration: none;
  pointer-events: auto;
  transform: rotate(calc(-1 * var(--a, 0deg)));
  animation: wsCounter var(--d, 30s) linear infinite;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ws-planet:hover, .ws-planet:focus-visible {
  border-color: #D3171D;
  box-shadow: 0 8px 20px -6px rgba(211, 23, 29, 0.35);
}
.ws-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.ws-sun {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30%;
  aspect-ratio: 1 / 1;
  margin: -15% 0 0 -15%;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #D3171D;
  box-shadow: 0 16px 36px -12px rgba(211, 23, 29, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem;
  z-index: 2;
}
.ws-sun-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: #FBE4E5;
  color: #D3171D;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.3rem;
}
.ws-orbit { z-index: 3; }
/* Pause the whole system while the user hovers or tabs into it */
.wound-solar:hover .ws-orbit,
.wound-solar:hover .ws-planet,
.wound-solar:focus-within .ws-orbit,
.wound-solar:focus-within .ws-planet {
  animation-play-state: paused;
}
@keyframes wsOrbit {
  from { transform: rotate(var(--a, 0deg)); }
  to   { transform: rotate(calc(var(--a, 0deg) + 360deg)); }
}
@keyframes wsCounter {
  from { transform: rotate(calc(-1 * var(--a, 0deg))); }
  to   { transform: rotate(calc(-1 * var(--a, 0deg) - 360deg)); }
}
@media (max-width: 640px) {
  .wound-solar { width: min(100%, 300px); }
  .ws-orbit-1 { --s: 52%; }
  .ws-orbit-2 { --s: 71%; }
  .ws-orbit-3 { --s: 90%; }
  .ws-planet { font-size: 8px; padding: 0.28rem 0.5rem; gap: 0.3rem; letter-spacing: 0.04em; }
  .ws-dot { width: 6px; height: 6px; }
  .ws-sun { width: 34%; margin: -17% 0 0 -17%; padding: 0.25rem; }
  .ws-sun-icon { width: 1.5rem; height: 1.5rem; margin-bottom: 0.1rem; }
  .ws-sun-icon .material-symbols-outlined { font-size: 16px !important; }
  .ws-sun span.font-label-caps { font-size: 8px; }
  .ws-sun h3 { font-size: 0.8rem; }
  .ws-sun h3 + span { display: none; }
}
}
@media (prefers-reduced-motion: reduce) {
  .ws-orbit, .ws-planet { animation: none !important; }
  .ws-sun { animation: none !important; }
}
