/* ========================================
   HERO
   ======================================== */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 100svh;
  padding: 200px 24px 48px;
  text-align: center;
  display: flex;
  align-items: center;
  background: #0a1128;
}

.hero-bg-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Score lines and soft atmosphere */
.hero-bg-shapes::before,
.hero-bg-shapes::after {
  content: '';
  position: absolute;
}

.hero-bg-shapes::before {
  display: block;
  inset: 0;
  background: url('../Media/hero-background.webp') center center / cover no-repeat;
}

.hero-bg-shapes::after {
  display: block;
  inset: 0;
  background: linear-gradient(180deg, rgb(10, 17, 40, 0.2) 0%, rgb(10, 17, 40, 0.28) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-copy {
  text-align: left;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
  color: var(--white);
  text-shadow:
    0 6px 16px rgb(10, 17, 40, 0.42),
    0 18px 42px rgb(10, 17, 40, 0.36),
    0 0 2px rgb(10, 17, 40, 0.22);
}

.hero-subtext {
  max-width: 640px;
  margin: 0 0 40px;
  font-size: 1.125rem;
  font-weight: 700;
  color: rgb(255, 255, 255, 0.92);
  text-shadow:
    0 4px 12px rgb(10, 17, 40, 0.36),
    0 12px 28px rgb(10, 17, 40, 0.24),
    0 0 1px rgb(10, 17, 40, 0.18);
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.hero-trust {
  margin-top: 18px;
  font-size: 0.82rem;
  color: rgb(255, 255, 255, 0.9);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-shadow:
    0 3px 10px rgb(10, 17, 40, 0.32),
    0 10px 22px rgb(10, 17, 40, 0.18);
}

.hero .btn-outline {
  border-color: rgb(255, 255, 255, 0.92);
  color: var(--white);
  background: rgb(255, 255, 255, 0.06);
}

.hero .btn-outline:hover {
  background: rgb(255, 255, 255, 0.14);
}

/* ========================================
   HERO ANIMATION WIDGET
   ======================================== */
.hero-anim {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.hero-anim-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 24px;
  background: linear-gradient(145deg, rgb(255, 255, 255, 0.96), rgb(240, 244, 255, 0.92));
  box-shadow:
    0 24px 60px rgb(22, 93, 252, 0.12),
    0 0 0 1px rgb(225, 231, 245, 0.6);
  overflow: hidden;
}

/* -- Frames -- */
.ha-frame {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
  transform: translateX(40px);
  padding: 16px;
}

.ha-frame.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.ha-frame.is-exiting {
  opacity: 0;
  transform: translateX(-40px);
}

/* -- Top Bar -- */
.ha-topbar {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.ha-topbar-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-heading);
}

/* -- Library grids (unused in animation, kept for markup) -- */
.ha-grid,
.ha-grid-3x3,
.ha-grid-2x2 {
  display: none;
}

.ha-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}

.ha-card-clickable {
  cursor: pointer;
}

.ha-card-img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3 !important;
  border-radius: 0;
  background: #e0e5f0;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  min-height: 0;
}

.ha-card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2px 4px;
  font-size: 0.44rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(transparent, rgb(0, 0, 0, 0.6));
}

.ha-card-instructor {
  font-size: 0.44rem;
  font-weight: 500;
  color: var(--text-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ha-card-info {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  min-width: 0;
  min-height: 34px;
}

.ha-card-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.ha-card-text {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
  min-height: 100%;
  text-align: left;
}

/* Click expand */
.ha-card-clickable.is-expanding {
  animation: haCardExpand 0.55s cubic-bezier(0.34, 1.12, 0.64, 1) forwards;
  z-index: 5;
  position: relative;
}

.ha-grid:has(.is-expanding) {
  overflow: visible;
}

.ha-frame:has(.is-expanding) {
  overflow: visible;
}

@keyframes haCardExpand {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.12);
    opacity: 1;
  }

  100% {
    transform: scale(1.12);
    opacity: 0;
  }
}

/* -- Player -- */
.ha-player {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 18px;
  overflow: hidden;
}

.ha-player-centered {
  justify-content: center;
}

.ha-player-bg {
  position: absolute;
  inset: 0;
  background: url('../Media/GRIT.webp') center / cover no-repeat;
}

.ha-player-content {
  position: relative;
  z-index: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ha-player-content-centered {
  align-items: stretch;
  text-align: left;
  justify-content: space-between;
  flex: 1;
  gap: 12px;
}

.ha-player-content-centered .ha-transcript {
  place-content: flex-start flex-start;
  flex: 1;
}

.ha-player-content-centered .ha-player-title {
  flex-shrink: 0;
  text-align: left;
}

.ha-player-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

/* Progress bar styled like native player */
.ha-player-bar-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
}

.ha-player-bar-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-blue);
  flex-shrink: 0;
  position: absolute;
  left: 0;
  z-index: 2;
  box-shadow: 0 0 4px rgb(22, 93, 252, 0.5);
  margin-left: -6px;
  transition: margin-left 0.3s linear;
}

.ha-player-bar-track {
  flex: 1;
  height: 5px;
  background: rgb(255, 255, 255, 0.35);
  border-radius: 3px;
  overflow: hidden;
}

.ha-player-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-blue);
  border-radius: 3px;
  transition: width 0.3s linear;
}

.ha-player-times {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.55rem;
  font-weight: 500;
  color: rgb(255, 255, 255, 0.6);
}

/* Pause button */
.ha-player-pause {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex-shrink: 0;
}

.ha-player-pause-icon {
  display: flex;
  gap: 3px;
}

.ha-player-pause-icon span {
  display: block;
  width: 3px;
  height: 10px;
  border-radius: 1.5px;
  background: var(--text-heading);
}

/* -- Transcript -- */
.ha-transcript {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding: 6px 0;
}

.ha-word {
  --reveal: 0%;

  font-size: 0.84rem;
  font-weight: 500;
  display: inline-block;
  color: transparent;
  background: linear-gradient(
    90deg,
    #fff 0%,
    #fff var(--reveal),
    rgb(255, 255, 255, 0.4) var(--reveal),
    rgb(255, 255, 255, 0.4) 100%
  );
  background-clip: text;
  transition:
    filter 0.2s ease,
    text-shadow 0.2s ease;
}

.ha-word.is-active {
  filter: brightness(1.08);
  text-shadow: 0 0 10px rgb(255, 255, 255, 0.22);
}

.ha-word.is-spoken {
  filter: none;
}

/* -- Breathwork -- */
.ha-breath {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ha-breath-donut {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 160px;
}

.ha-breath-donut-blue {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--primary-blue);
  transition: transform 3s ease-in-out;
  transform: scale(0.5);
}

.ha-breath-donut-center {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.ha-breath-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-blue);
}

.ha-breath-timer {
  font-size: 0.55rem;
  font-weight: 500;
  color: #9ca3af;
}

/* Breathwork scale phases — only blue ring scales, white center stays fixed */
.ha-breath.is-inhale .ha-breath-donut-blue {
  transform: scale(1.3);
}

.ha-breath.is-hold-1 .ha-breath-donut-blue {
  transform: scale(1.3);
}

.ha-breath.is-exhale .ha-breath-donut-blue {
  transform: scale(0.5);
}

.ha-breath.is-hold-2 .ha-breath-donut-blue {
  transform: scale(0.5);
}

/* -- Brain Game -- */

/* -- Brain Scoreboard -- */
.ha-brain-top {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.ha-brain-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 500;
}

.ha-brain-stat-correct {
  background: rgb(34, 197, 94, 0.08);
}

.ha-brain-stat-wrong {
  background: rgb(239, 68, 68, 0.08);
}

.ha-brain-stat-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ha-brain-stat-icon-correct {
  border: 2px solid #0bb980;
  color: #0bb980;
}

.ha-brain-stat-icon-wrong {
  border: 2px solid #ef4444;
  color: #ef4444;
}

.ha-brain-stat-label {
  color: var(--text-heading);
}

.ha-brain-stat-val {
  font-weight: 700;
  font-size: 0.85rem;
}

.ha-brain-stat-correct .ha-brain-stat-val {
  color: #0bb980;
}

.ha-brain-stat-wrong .ha-brain-stat-val {
  color: #ef4444;
}

.ha-brain-field {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

.ha-brain-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-blue);
  transition: background 0.3s ease;
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -18px;
  margin-top: -18px;
}

.ha-brain-dot.is-moving {
  animation: haDotMove 4s ease-in-out infinite;
}

@keyframes haDotMove {
  0% {
    left: 50%;
    top: 50%;
  }

  8% {
    left: 92%;
    top: 8%;
  }

  18% {
    left: 8%;
    top: 65%;
  }

  28% {
    left: 88%;
    top: 85%;
  }

  40% {
    left: 12%;
    top: 10%;
  }

  52% {
    left: 90%;
    top: 45%;
  }

  62% {
    left: 6%;
    top: 80%;
  }

  74% {
    left: 75%;
    top: 6%;
  }

  86% {
    left: 25%;
    top: 70%;
  }

  100% {
    left: 50%;
    top: 50%;
  }
}

.ha-brain-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.ha-brain-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
  border: none;
  padding: 0;
  cursor: pointer;
}

.ha-brain-btn-red {
  background: #ef4444;
}

.ha-brain-btn-blue {
  background: var(--primary-blue);
}

.ha-brain-btn-green {
  background: #0bb980;
}

.ha-brain-btn-yellow {
  background: #eab308;
}

.ha-brain-btn.is-pressed {
  animation: haBtnPress 0.3s ease;
}

@keyframes haBtnPress {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.18);
  }

  100% {
    transform: scale(1);
  }
}

/* -- Scoring Cards -- */
.ha-frame-scoring {
  justify-content: center;
  align-items: stretch;
  padding: 10px 8px;
  overflow-y: auto;
}

.ha-score-cards {
  display: flex;
  gap: 6px;
  width: 100%;
  align-self: center;
}

.ha-score-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 14px;
  background: rgb(255, 255, 255, 0.9);
  box-shadow: 0 4px 16px rgb(0, 0, 0, 0.06);
  flex: 1;
  opacity: 0;
  transform: translateY(20px);
}

.ha-frame-scoring.is-active .ha-score-card {
  animation: haScoreCardIn 0.5s ease forwards;
}

.ha-frame-scoring.is-active .ha-score-card:nth-child(1) {
  animation-delay: 0.1s;
}

.ha-frame-scoring.is-active .ha-score-card:nth-child(2) {
  animation-delay: 0.25s;
}

.ha-frame-scoring.is-active .ha-score-card:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes haScoreCardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ha-ring-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
}

.ha-score-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ha-ring-bg {
  fill: none;
  stroke: #eef0f5;
  stroke-width: 7;
}

.ha-ring-fill {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 1.4s ease-out;
}

.ha-ring-fill-med {
  stroke: #b266e4;
}

.ha-ring-fill-bw {
  stroke: #165dfc;
}

.ha-ring-fill-brain {
  stroke: #0bb980;
}

.ha-score-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1;
}

.ha-score-label {
  font-size: 0.5rem;
  font-weight: 500;
  color: var(--text-body);
  margin-bottom: 4px;
}

/* Metric rows under each score card */
.ha-metric-rows {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
}

.ha-metric {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  text-align: left;
}

.ha-metric-name {
  font-size: 0.42rem;
  font-weight: 500;
  color: var(--text-body);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.ha-metric-val {
  font-size: 0.42rem;
  font-weight: 700;
  color: var(--text-heading);
  text-align: right;
}

.ha-metric-bar {
  width: 100%;
  height: 3px;
  background: rgb(0, 0, 0, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.ha-metric-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 1.4s ease-out 0.6s;
}

.ha-metric-bar-med {
  background: #b266e4;
}

.ha-metric-bar-bw {
  background: #165dfc;
}

.ha-metric-bar-brain {
  background: #0bb980;
}

/* -- Graph -- */
.ha-frame-graph {
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.ha-graph-wrap {
  width: 100%;
  background: rgb(255, 255, 255, 0.9);
  border-radius: 18px;
  padding: 14px 14px 8px;
  box-shadow: 0 4px 16px rgb(0, 0, 0, 0.06);
}

.ha-graph-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.ha-graph-body {
  display: flex;
  gap: 6px;
}

.ha-graph-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.44rem;
  font-weight: 500;
  color: var(--text-body);
  padding: 0 0 16px;
}

.ha-graph-chart {
  flex: 1;
  position: relative;
  min-width: 0;
}

.ha-graph-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.ha-graph-grid {
  stroke: rgb(28, 31, 53, 0.06);
  stroke-width: 0.5;
}

.ha-graph-area {
  fill: rgb(178, 102, 228, 0.12);
  opacity: 0;
}

.ha-frame-graph.is-blue .ha-graph-area {
  fill: rgb(22, 93, 252, 0.12);
}

.ha-frame-graph.is-green .ha-graph-area {
  fill: rgb(11, 185, 128, 0.12);
}

.ha-frame-graph.is-active .ha-graph-area {
  animation: haGraphAreaIn 0.8s ease 0.6s forwards;
}

@keyframes haGraphAreaIn {
  to {
    opacity: 1;
  }
}

.ha-graph-line {
  fill: none;
  stroke: #b266e4;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.ha-frame-graph.is-blue .ha-graph-line {
  stroke: #165dfc;
}

.ha-frame-graph.is-green .ha-graph-line {
  stroke: #0bb980;
}

.ha-frame-graph.is-active .ha-graph-line {
  animation: haGraphDraw 1.2s cubic-bezier(0.33, 1, 0.68, 1) 0.2s forwards;
}

@keyframes haGraphDraw {
  to {
    stroke-dashoffset: 0;
  }
}

.ha-graph-dot {
  fill: #b266e4;
  stroke: #fff;
  stroke-width: 2.5;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.ha-frame-graph.is-blue .ha-graph-dot {
  fill: #165dfc;
}

.ha-frame-graph.is-green .ha-graph-dot {
  fill: #0bb980;
}

.ha-frame-graph.is-active .ha-graph-dot {
  animation: haGraphDotIn 0.25s ease forwards;
}

.ha-frame-graph.is-active .ha-graph-dot-1 {
  animation-delay: 0.3s;
}

.ha-frame-graph.is-active .ha-graph-dot-2 {
  animation-delay: 0.45s;
}

.ha-frame-graph.is-active .ha-graph-dot-3 {
  animation-delay: 0.6s;
}

.ha-frame-graph.is-active .ha-graph-dot-4 {
  animation-delay: 0.75s;
}

.ha-frame-graph.is-active .ha-graph-dot-5 {
  animation-delay: 0.9s;
}

.ha-frame-graph.is-active .ha-graph-dot-6 {
  animation-delay: 1.1s;
}

.ha-frame-graph.is-active .ha-graph-dot-7 {
  animation-delay: 1.3s;
}

@keyframes haGraphDotIn {
  from {
    opacity: 0;
    transform: scale(0.3);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.ha-graph-tooltip {
  position: absolute;
  top: 2px;
  right: 20%;
  background: #fff;
  border: 1px solid rgb(0, 0, 0, 0.08);
  border-radius: 6px;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 2px 8px rgb(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(4px);
}

.ha-frame-graph.is-active .ha-graph-tooltip {
  animation: haTooltipIn 0.3s ease 1.1s forwards;
}

@keyframes haTooltipIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ha-graph-tooltip-date {
  font-size: 0.44rem;
  font-weight: 700;
  color: var(--text-heading);
}

.ha-graph-tooltip-score {
  font-size: 0.4rem;
  font-weight: 500;
  color: var(--text-body);
}

.ha-graph-x-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.42rem;
  font-weight: 500;
  color: var(--text-body);
  padding-top: 4px;
}

/* -- Navigation Bar -- */
.ha-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 0 0 1px rgb(225, 231, 245, 0.6);
}

.ha-nav + .hero-anim-viewport {
  border-radius: 0 0 24px 24px;
}

.ha-nav-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgb(0 0 0 / 0.1);
  background: transparent;
  color: rgb(0 0 0 / 0.4);
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s;
}

.ha-nav-btn:hover {
  border-color: rgb(0 0 0 / 0.25);
  color: rgb(0 0 0 / 0.7);
}

.ha-nav-center {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.ha-nav-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 2px;
}

.ha-nav-body {
  display: inline;
}

.ha-nav-label {
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-body);
}

.ha-nav-link {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--primary-blue);
  text-decoration: none;
  margin-left: 2px;
  transition: text-decoration-color 0.2s;
}

.ha-nav-link:hover {
  text-decoration: underline;
}
