/*
 * Hero timer responsive scale (cleaned by breakpoints)
 * Desktop >=1100, tablet 761-1099, mobile <=760
 */

.hero {
  overflow-x: clip;
  overflow-y: visible;
}

.hero-phone-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  width: min(100%, 350px);
  min-width: 0;
  min-height: 500px;
  isolation: isolate;
}

.real-phone {
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .13);
  border-radius: 46px;
  background: linear-gradient(145deg, #050506 0%, #242428 46%, #070708 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, .04),
    inset 0 0 26px rgba(255, 255, 255, .05),
    0 34px 80px rgba(0, 0, 0, .58);
  aspect-ratio: 9 / 17.4;
}

.real-phone-primary {
  width: min(100%, 294px);
  transform: none;
}

.hero-live-phone {
  display: flex;
  container-type: inline-size;
  overflow: hidden;
  padding: clamp(10px, 3.1cqw, 14px);
  background: linear-gradient(160deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03));
}

.hero-live-phone::after {
  position: absolute;
  top: 42%;
  right: -5px;
  width: 5px;
  height: 56px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 130, 0, .45), #ff8200, rgba(11, 10, 9, .88));
  content: "";
  opacity: .9;
  z-index: 1;
}

#heroTimer .hero-live-screen {
  --phase-progress-scale: 0;
  --phase-base: #79bcb4;
  --phase-elapsed: #2f867d;
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: clamp(16px, 4.6cqw, 24px);
  padding:
    clamp(34px, 10.2cqw, 48px)
    clamp(14px, 4.5cqw, 22px)
    clamp(16px, 4.8cqw, 24px);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .06), transparent 34%),
    linear-gradient(90deg, #06070a 0%, #181a20 100%);
}

#heroTimer .hero-live-screen[data-state="rest"] {
  --phase-base: #de4f51;
  --phase-elapsed: #c20201;
}

#heroTimer .hero-live-screen[data-state="go"] {
  --phase-base: #79bcb4;
  --phase-elapsed: #2f867d;
}

#heroTimer .hero-live-screen[data-state="ready"] {
  --phase-base: #514a43;
  --phase-elapsed: #3a342f;
}

#heroTimer .hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  color: rgba(246, 241, 234, .72);
}

#heroTimer .hero-metrics div {
  min-width: 0;
  padding-inline: clamp(7px, 2.4cqw, 14px);
  text-align: center;
}

#heroTimer .hero-metrics span {
  display: block;
  margin-bottom: clamp(6px, 1.5cqw, 9px);
  color: rgba(246, 241, 234, .66);
  font-size: clamp(8px, 2.3cqw, 11px);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

#heroTimer .hero-metrics strong,
#heroTimerCircuits,
#heroTimerRemain,
#heroTimerInterval {
  display: block;
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif !important;
  font-size: clamp(22px, 6.5cqw, 30px);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
}

#heroTimer .hero-exercise-card {
  position: relative;
  display: grid;
  min-height: 0;
  overflow: hidden;
  grid-template-rows: minmax(26px, auto) minmax(36px, auto) minmax(0, 1fr) minmax(92px, auto);
  gap: clamp(4px, 1.4cqw, 8px);
  align-content: stretch;
  justify-items: center;
  padding:
    clamp(20px, 6.2cqw, 32px)
    clamp(13px, 4cqw, 18px)
    clamp(24px, 7.2cqw, 36px);
  border: 0;
  border-radius: clamp(18px, 5.6cqw, 28px);
  background: linear-gradient(90deg, var(--phase-elapsed) 0%, var(--phase-base) 100%);
  color: #fff;
  text-align: center;
  isolation: isolate;
}

#heroTimer .hero-exercise-card > * {
  position: relative;
  z-index: 1;
}

#heroTimer .hero-exercise-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--phase-progress-scale) * 100%);
  background: var(--phase-elapsed);
  content: "";
  pointer-events: none;
  transition: width .08s linear;
  z-index: 0;
}

#heroTimer .hero-live-screen[data-state="ready"] .hero-exercise-card::before {
  width: 0;
}

#heroTimer .hero-card-phase {
  align-self: end;
  color: rgba(255, 255, 255, .34);
  font-size: clamp(22px, 6.9cqw, 34px);
  font-weight: 300;
  line-height: 1;
}

#heroTimer .hero-exercise-card h2 {
  align-self: start;
  margin: 0;
  max-width: 96%;
  font-size: clamp(22px, 6.5cqw, 32px);
  font-weight: 300;
  line-height: 1.08;
  text-wrap: balance;
}

#heroTimer .hero-card-icon {
  width: clamp(84px, 26cqw, 130px);
  align-self: center;
  justify-self: center;
}

#heroTimer .hero-card-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

#heroTimer #heroTimerTime {
  align-self: end;
  margin: 0;
  font-family: "Roboto", Arial, sans-serif !important;
  font-size: clamp(108px, 37cqw, 168px);
  line-height: .78;
  font-weight: 400 !important;
  letter-spacing: -.035em;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  color: #fff;
}

#heroTimer .hero-exercise-card p {
  display: none;
}

#heroTimer .hero-live-controls {
  align-self: center;
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  align-items: center;
  gap: clamp(11px, 3.8cqw, 18px);
  padding-inline: clamp(18px, 5.5cqw, 30px);
}

#heroTimer .hero-transport-button {
  min-height: clamp(38px, 10.8cqw, 52px);
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, .94);
  font-size: clamp(22px, 6.9cqw, 34px);
  font-weight: 700;
}

#heroTimer .hero-transport-main {
  min-height: clamp(52px, 14.2cqw, 70px);
  font-size: clamp(38px, 11.2cqw, 58px);
  line-height: 1;
}

#heroTimer .hero-utility-row {
  align-self: center;
  margin-top: clamp(-6px, -1cqw, -2px);
  opacity: .62;
  transform: scale(.88);
  transform-origin: center;
}

#heroTimer .hero-utility-row button {
  min-height: 24px;
  padding-inline: clamp(8px, 2.2cqw, 11px);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  color: rgba(255, 255, 255, .76);
  font-size: clamp(7px, 1.8cqw, 9px);
  font-weight: 800;
  line-height: 1;
}

#heroTimer .hero-utility-row button[aria-pressed="true"] {
  border-color: rgba(255, 255, 255, .28);
  background: rgba(255, 130, 0, .18);
  color: #fff;
}

.hero-demo-config {
  position: absolute;
  inset: 12px;
  z-index: 6;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 20px;
  background: rgba(12, 13, 16, .96);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .45);
  backdrop-filter: blur(12px);
}

.hero-demo-config[hidden] {
  display: none;
}

.hero-demo-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hero-demo-config-header strong {
  color: #fff;
  font-size: 16px;
}

.hero-demo-config-header button {
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.hero-demo-config p {
  margin: 0;
  color: rgba(255, 255, 255, .68);
  font-size: 11px;
  line-height: 1.25;
}

.hero-demo-setting {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 12px;
}

.hero-demo-setting span {
  color: rgba(255, 255, 255, .74);
}

.hero-demo-setting button,
.hero-demo-options button,
.hero-demo-select select {
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.hero-demo-options {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hero-demo-options button.is-active {
  border-color: rgba(255, 130, 0, .75);
  background: rgba(255, 130, 0, .18);
  color: #fff;
}

.hero-demo-select {
  grid-template-columns: 1fr;
}

.hero-demo-select select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 10px;
}

.hero-demo-apply {
  width: 100%;
  min-height: 34px;
  margin-top: 2px;
  font-size: 12px;
}

/* Tablet / intermediate layout */
@media (min-width: 761px) and (max-width: 1099px) {
  .hero-phone-wrap {
    justify-self: center;
    width: min(100%, 330px);
    min-height: 470px;
    margin-top: 6px;
  }

  .real-phone-primary {
    width: min(100%, 278px);
  }

  #heroTimer .hero-live-screen {
    gap: clamp(15px, 4.4cqw, 22px);
    padding:
      clamp(32px, 9.6cqw, 42px)
      clamp(14px, 4.2cqw, 20px)
      clamp(15px, 4.4cqw, 22px);
  }

  #heroTimer #heroTimerTime {
    font-size: clamp(100px, 35cqw, 154px);
  }
}

/* Mobile layout */
@media (max-width: 760px) {
  .hero-phone-wrap::before {
    position: absolute;
    left: 50%;
    top: 54%;
    width: min(90vw, 400px);
    height: min(78vw, 350px);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    content: "";
    background:
      radial-gradient(circle at 50% 50%, rgba(255, 130, 0, .16) 0%, rgba(255, 130, 0, .09) 34%, rgba(255, 130, 0, .035) 54%, rgba(255, 130, 0, 0) 72%);
    filter: blur(10px);
    z-index: 0;
  }

  .hero-phone-wrap::after {
    position: absolute;
    left: 50%;
    bottom: 3%;
    width: min(100vw, 480px);
    height: min(35vw, 168px);
    transform: translateX(-50%);
    border-radius: 50%;
    pointer-events: none;
    content: "";
    background:
      radial-gradient(120% 90% at 50% 100%, rgba(255, 130, 0, .10) 0%, rgba(255, 130, 0, .04) 52%, rgba(255, 130, 0, 0) 82%),
      repeating-radial-gradient(circle at 50% 100%, rgba(255, 130, 0, .11) 0 1px, rgba(255, 130, 0, 0) 1px 16px);
    opacity: .48;
    mask-image: radial-gradient(ellipse at center, #000 58%, transparent 100%);
    z-index: 0;
  }

  .hero-audio-wave,
  .hero-phone-glow {
    display: block;
  }

  .hero-phone-wrap {
    width: min(100%, 294px);
    min-height: 525px;
    margin-top: 2px;
    justify-self: center;
  }

  .real-phone-primary {
    width: min(73vw, 282px);
    position: relative;
    z-index: 2;
  }

  .hero-phone-glow {
    position: absolute;
    left: 50%;
    bottom: clamp(10px, 3.2vw, 17px);
    width: min(74vw, 286px);
    height: clamp(82px, 24vw, 118px);
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(255, 130, 0, .24), rgba(255, 130, 0, .085) 48%, rgba(255, 130, 0, 0) 74%);
    filter: blur(12px);
    opacity: .6;
    z-index: 1;
  }

  .hero-audio-wave {
    position: absolute;
    inset: auto 50% 2%;
    width: min(94vw, 440px);
    height: clamp(70px, 19vw, 104px);
    transform: translateX(-50%);
    border-radius: 50%;
    opacity: .28;
    pointer-events: none;
    background:
      radial-gradient(92% 78% at 50% 80%, rgba(255, 130, 0, .18) 0%, rgba(255, 130, 0, .055) 44%, rgba(255, 130, 0, 0) 76%),
      repeating-radial-gradient(circle at 50% 100%, rgba(255, 130, 0, .09) 0 1px, rgba(255, 130, 0, 0) 1px 13px);
    mask-image: radial-gradient(ellipse at center, #000 58%, transparent 100%);
    z-index: 1;
  }

  #heroTimer .hero-live-screen {
    gap: clamp(10px, 3cqw, 14px);
    padding:
      clamp(30px, 8.3cqw, 38px)
      clamp(14px, 4.1cqw, 19px)
      clamp(14px, 4.1cqw, 19px);
  }

  #heroTimer .hero-metrics span {
    font-size: clamp(8px, 2.2cqw, 10px);
  }

  #heroTimer .hero-metrics strong {
    font-size: clamp(20px, 6.2cqw, 26px);
  }

  #heroTimer .hero-exercise-card {
    grid-template-rows: minmax(22px, auto) minmax(32px, auto) minmax(0, 1fr) minmax(82px, auto);
    gap: clamp(4px, 1.2cqw, 7px);
    padding:
      clamp(18px, 5.1cqw, 26px)
      clamp(12px, 3.6cqw, 18px)
      clamp(20px, 5.8cqw, 28px);
  }

  #heroTimer .hero-card-phase {
    font-size: clamp(20px, 6cqw, 28px);
  }

  #heroTimer .hero-exercise-card h2 {
    font-size: clamp(21px, 6.4cqw, 30px);
  }

  #heroTimer .hero-card-icon {
    width: clamp(76px, 22cqw, 112px);
  }

  #heroTimer #heroTimerTime {
    font-size: clamp(96px, 33cqw, 146px);
    line-height: .78;
  }

  #heroTimer .hero-live-controls {
    gap: clamp(10px, 3.6cqw, 16px);
    padding-inline: clamp(15px, 4.6cqw, 24px);
  }

  #heroTimer .hero-transport-button {
    min-height: clamp(34px, 9.4cqw, 44px);
    font-size: clamp(19px, 5.9cqw, 28px);
  }

  #heroTimer .hero-transport-main {
    min-height: clamp(45px, 12.2cqw, 58px);
    font-size: clamp(34px, 10cqw, 50px);
  }

  #heroTimer .hero-utility-row {
    opacity: .6;
    transform: scale(.84);
    margin-top: clamp(-4px, -.8cqw, 0);
  }
}

@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .hero-phone-wrap::before,
  .hero-phone-wrap::after,
  .hero-audio-wave,
  .hero-phone-glow {
    filter: none;
  }
}

@media (max-width: 420px) {
  .hero-phone-wrap {
    width: min(100%, 282px);
    min-height: 506px;
  }

  .real-phone-primary {
    width: min(72vw, 268px);
  }
}

@media (max-width: 760px) and (max-height: 760px) {
  .hero-phone-wrap {
    min-height: 470px;
  }

  .real-phone-primary {
    width: min(70vw, 258px);
  }

  #heroTimer #heroTimerTime {
    font-size: clamp(86px, 31cqw, 128px);
  }
}
