/* The heating Boost button with the glass that warms up. One rounded box of dark cool glass (.hb__glass, moved only
   by GSAP) with layers inside: the cool base, the warmth (two blurred embers that GSAP grows from the press point),
   the heat haze (an SVG redrawn every frame), the frosted pane with grain, a warm rim, the pointer light and the
   reflection; the flame, the words and the rolling temperature sit on top. */
:root {
  --page: #0a0a0c;             /* the page */
  --cool: #8db4ff;             /* the cool light at rest */
  --amber: #ffb35c;            /* the warm light */
  --ember: #ff5f3a;            /* the deep warm colour */
  --ink: #f4f1ec;              /* the words */
  --muted: rgba(244, 241, 236, 0.66); /* the small line */
  --glass: #15171d;            /* the glass at rest */
  --edge: rgba(255, 255, 255, 0.11);  /* the edge at rest */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* the page: near black with a faint light from above and a fine grain */
.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  background: radial-gradient(70% 55% at 50% 38%, rgba(141, 180, 255, 0.07), transparent 70%), var(--page);
}

.stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.hb {
  position: relative;
  display: grid;
  place-items: center;
}

/* the light the button throws on the floor: cool at rest, warm while it heats */
.hb__spill {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 116%;
  height: 44px;
  margin: -16px 0 0 -58%;
  border-radius: 50%;
  filter: blur(16px);
  pointer-events: none;
}

.hb__spill--cool {
  background: radial-gradient(closest-side, rgba(141, 180, 255, 0.4), transparent);
  opacity: 0.4;
}

.hb__spill--warm {
  background: radial-gradient(closest-side, color-mix(in srgb, var(--amber) 80%, transparent), color-mix(in srgb, var(--ember) 30%, transparent) 55%, transparent);
  opacity: 0;
}

.hb__btn {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}

.hb__btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--amber) 70%, white);
  outline-offset: 5px;
}

.hb__glass {
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: block;
  width: min(84vw, 300px);
  height: 60px;
  border-radius: 999px;
  isolation: isolate;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.8),
    0 8px 18px -10px rgba(0, 0, 0, 0.9),
    0 26px 50px -26px rgba(0, 0, 0, 1);
}

.hb__base,
.hb__heat,
.hb__frost,
.hb__rim,
.hb__shine,
.hb__sweep {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

.hb__base {
  background:
    radial-gradient(120% 140% at 18% 0%, rgba(141, 180, 255, 0.16), transparent 60%),
    linear-gradient(180deg, #1b1e26, var(--glass) 60%, #0f1015);
}

/* the warmth: two blurred embers, GSAP places them under the press point and grows them */
.hb__ember {
  position: absolute;
  left: 0;
  top: 0;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--amber) 85%, var(--ember)), color-mix(in srgb, var(--ember) 80%, transparent) 55%, transparent);
  filter: blur(10px);
  opacity: 0;
}

.hb__ember--b {
  width: 110px;
  height: 110px;
  margin: -55px 0 0 -55px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--amber) 90%, #fff), color-mix(in srgb, var(--amber) 50%, transparent) 60%, transparent);
  mix-blend-mode: screen;
}

.hb__haze {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
}

.hb__haze path {
  fill: none;
  stroke: rgba(255, 236, 214, 0.5);
  stroke-width: 1;
  stroke-linecap: round;
}

/* the frosted pane: a light top, a 1px edge, a dark bottom and grain */
.hb__frost {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.2 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.015) 50%, rgba(0, 0, 0, 0.28));
  background-size: 120px 120px, 100% 100%;
  box-shadow:
    inset 0 0 0 1px var(--edge),
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    inset 0 -12px 20px -14px rgba(0, 0, 0, 0.7);
}

.hb__frost::after {
  content: '';
  position: absolute;
  left: 7%;
  right: 7%;
  top: 1px;
  height: 44%;
  border-radius: 999px 999px 40% 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0));
}

/* the edge once the glass is warm */
.hb__rim--warm {
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--amber) 55%, transparent),
    inset 0 1px 0 rgba(255, 230, 200, 0.6),
    inset 0 0 16px -4px color-mix(in srgb, var(--ember) 60%, transparent);
  opacity: 0;
}

.hb__shine {
  background: radial-gradient(90px 64px at var(--mx) var(--my), rgba(255, 244, 230, 0.16), rgba(255, 244, 230, 0.04) 50%, transparent 72%);
  opacity: 0;
}

.hb__sweep-band {
  position: absolute;
  top: -30%;
  left: 0;
  width: 34%;
  height: 160%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 245, 230, 0.05) 30%, rgba(255, 245, 230, 0.32) 50%, rgba(255, 245, 230, 0.05) 70%, transparent 100%);
  transform: translateX(-140%) skewX(-16deg);
}

.hb__row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 18px 0 18px;
  gap: 12px;
}

.hb__icon {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
}

.hb__icon svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hb__flame-fill {
  fill: url(#hb-flame);
  opacity: 0;
}

.hb__flame-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.hb__flame-core {
  fill: #fff1d6;
  opacity: 0;
}

.hb__text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
  text-align: left;
}

.hb__stack {
  display: grid;
}

.hb__title,
.hb__sub {
  grid-area: 1 / 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hb__title {
  font-size: 15px;
  font-weight: 580;
  font-variation-settings: 'wdth' 104;
  line-height: 1.2;
  letter-spacing: 0.005em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}

.hb__sub {
  font-size: 11.5px;
  font-weight: 460;
  font-variation-settings: 'wdth' 96;
  line-height: 1.25;
  color: var(--muted);
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

/* the temperature: three rolling digit strips */
.hb__temp {
  flex: none;
  display: flex;
  align-items: flex-start;
  font-size: 24px;
  font-weight: 380;
  font-variation-settings: 'wdth' 100;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.hb__digit {
  display: inline-block;
  height: 1em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}

.hb__strip {
  display: flex;
  flex-direction: column;
}

.hb__strip span {
  display: block;
  height: 1em;
  text-align: center;
}

.hb__dot {
  width: 0.26em;
  text-align: center;
}

.hb__deg {
  font-size: 0.62em;
  margin: 0.04em 0 0 0.04em;
  color: var(--muted);
}

/* before the script runs, only the rest state shows */
.hb__title + .hb__title,
.hb__sub + .hb__sub {
  opacity: 0;
}
