/* The render loader with the light rays from behind: the render panel of an AI video tool, frosted dark glass on a near
   black page, with a warm light behind it. The panel's body is a layer of its own (.panel::before); over it the WebGL
   canvas adds the light (wider than the panel, so the rays can spread over the page); the words and the button sit on
   top. Without WebGL a soft CSS glow behind the panel and a CSS fill in the slit take its place. */
:root {
  --page: #09080a;          /* the page */
  --glass: #141216;         /* the body of the panel */
  --glass-top: #1c191e;     /* the top of the panel, where it catches a little more light */
  --edge: rgba(255, 255, 255, 0.075); /* its edge at rest */
  --ink: #f1ede8;           /* the words */
  --muted: #8f8a90;         /* the small words */
  --accent: #ffa463;        /* the colour of the light */
  --accent-2: #9a6bff;      /* the colour far out in the haze */
  --button: #f5f1ec;        /* the button when the render is ready */
  --button-ink: #0b0a0c;    /* the words on it */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

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

body {
  min-height: 100svh;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 164, 99, 0.05), transparent 60%),
    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;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(28px, 9vh, 72px) 16px 16px;
  overflow: hidden;
}

.panel {
  position: relative;
  width: min(86vw, 336px);
  border-radius: 22px;
  opacity: 0;
}

/* the body of the panel, under the light: frosted glass with a one pixel edge and soft shadows in layers */
.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  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='.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 .05 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--glass-top), var(--glass) 46%);
  box-shadow:
    inset 0 0 0 1px var(--edge),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 12px 24px -10px rgba(0, 0, 0, 0.7),
    0 40px 80px -30px rgba(0, 0, 0, 0.9);
  z-index: 0;
}

.panel__rays {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  pointer-events: none;
}

/* the light without WebGL: a soft glow peeking out behind the top edge */
.panel__glow {
  position: absolute;
  left: 50%;
  top: 0;
  width: 70%;
  height: 120px;
  margin: -60px 0 0 -35%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 70%, #ffffff), color-mix(in srgb, var(--accent) 40%, transparent) 45%, transparent);
  filter: blur(14px);
  z-index: -1;
  pointer-events: none;
  display: none;
}

.no-gl .panel__glow {
  display: block;
}

.panel__card {
  position: relative;
  z-index: 2;
  padding: clamp(16px, 4.4vh, 24px) clamp(18px, 5.6vw, 24px) clamp(16px, 4vh, 22px);
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 560;
  font-variation-settings: 'wdth' 104;
  color: var(--ink);
}

.panel__mark {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linecap: round;
}

.panel__mark rect {
  stroke: rgba(255, 255, 255, 0.16);
  fill: rgba(255, 255, 255, 0.03);
}

.panel__chip {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  padding: 4px 9px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.panel__title {
  margin: clamp(14px, 3.8vh, 22px) 0 0;
  font-size: clamp(19px, min(5.8vw, 5.4vh), 22px);
  line-height: 1.2;
  font-weight: 620;
  font-variation-settings: 'wdth' 100;
  letter-spacing: -0.015em;
}

.panel__title span {
  display: inline-block;
}

.panel__prompt {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 32ch;
}

/* the progress is a slit cut through the glass: the light behind shows through as far as the render has gone */
.panel__slit {
  position: relative;
  height: 3px;
  margin: clamp(16px, 4.2vh, 24px) 0 0;
  border-radius: 3px;
  background: #050406;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.panel__fill {
  position: absolute;
  inset: 0;
  transform-origin: 0 50%;
  transform: scaleX(0);
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, #2a1608), var(--accent) 70%, #fff4e8);
}

.panel__stats {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.panel__num {
  color: var(--ink);
  font-weight: 560;
}



.panel__pct .panel__num {
  display: inline-block;
  min-width: 2.2em;
  text-align: right;
}

.panel__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(14px, 3.6vh, 20px);
}

.panel__eta {
  font-size: 12.5px;
  color: var(--muted);
}

/* GSAP scales the button, the face inside carries the colours */
.panel__btn {
  position: relative;
  height: 48px;
  min-width: 124px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.panel__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.panel__btn-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: background-color 0.5s ease, box-shadow 0.5s ease, color 0.5s ease;
}

.ready .panel__btn-face {
  background: var(--button);
  color: var(--button-ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 8px 24px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}

.panel__btn-words {
  font-size: 14px;
  font-weight: 600;
  font-variation-settings: 'wdth' 100;
  white-space: nowrap;
  transition: font-variation-settings 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (hover: hover) {
  .panel__btn:hover .panel__btn-words {
    font-variation-settings: 'wdth' 112;
  }

  .panel__btn:hover .panel__btn-face {
    background: rgba(255, 255, 255, 0.09);
  }

  .ready .panel__btn:hover .panel__btn-face {
    background: #ffffff;
  }
}

.panel__btn-icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.panel__play {
  opacity: 0;
}

.panel__check {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.panel__frames .panel__num {
  display: inline-block;
  min-width: 1.95em;
}
