/* HD Labs home page: hero wordmark, the experimental "Labs" word and the wall (the player dock is in dock.css).
   Motion rules of thumb (short, purposeful, cheap): transform and opacity only, no layout work,
   long pauses between loops, and everything off in calm mode / prefers-reduced-motion
   (that switch is in herodrop.css). */

/* A registered custom property lets the browser animate a gradient angle smoothly (progressive
   enhancement: where @property is missing, "Labs" simply keeps a static gradient). */
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --bass { syntax: "<number>"; inherits: true; initial-value: 0; }

.hd-hero { padding: 3.2rem 0 1.4rem; position: relative; }
.hd-hero .lede { margin-top: 1.7rem; }
/* ---- the logo: appears once, small, in this header only. The same image restyled with CSS layers: the original
   purple but darker, red patches in places, grit, and silver shine plus a soft glow on the lettering. ---- */
.logo { position: relative; flex: none; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; isolation: isolate;
  /* red patches live UNDER the image and tint it by multiplying, so they colour the purple but not the lettering */
  background:
    radial-gradient(circle at 8% 92%, #ff6a6a, transparent 50%),
    radial-gradient(circle at 95% 10%, #ff7a7a, transparent 40%),
    radial-gradient(circle at 70% 96%, #f0505a, transparent 34%), #fff;
  box-shadow: 0 0 0 1px rgba(205, 185, 255, 0.4), 0 0 14px rgba(150, 70, 255, 0.6), 0 0 24px rgba(224, 38, 43, 0.22); }
.logo img { display: block; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; filter: brightness(0.7) saturate(1.15) contrast(1.15); }
/* silver, shiny lettering: a grey copy thresholded so only the lightest pixels (the letters) survive, screened back on */
.logo::before, .logo i { content: ""; position: absolute; inset: 0; background: url("herodrop-logo.png") center / cover; mix-blend-mode: screen; }
.logo::before { filter: grayscale(1) contrast(3.4) brightness(0.54); }
/* glow: the same lettering, blurred and tinted a cool lavender */
.logo i { filter: grayscale(1) contrast(3.4) brightness(0.6) blur(1.7px) sepia(1) hue-rotate(228deg) saturate(1.7); opacity: 0.85; }
/* grit and one soft diagonal sheen across the metal */
.logo::after { content: ""; position: absolute; inset: 0; mix-blend-mode: overlay;
  background:
    linear-gradient(115deg, transparent 24%, rgba(255, 255, 255, 0.7) 42%, rgba(205, 212, 235, 0.35) 52%, transparent 66%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='90' height='90'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.1 -.15'/></filter><rect width='90' height='90' filter='url(%23n)'/></svg>") 0 0 / 30px 30px; }

/* ---- HD (white, Hero Drop style) + Labs (experimental) ---- */
.hd-hero .wordmark { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0.16em; margin-top: 1.2rem; }
.wordmark .hd { color: #fff; text-shadow: 0 0 0.3em rgba(224, 38, 43, 0.6), 0 0.04em 0 rgba(0, 0, 0, 0.7); }

.labs {
  position: relative; display: inline-block; padding: 0 0.04em;
  color: transparent;
  /* oklch hues across crimson, ember and a touch of violet; the angle slowly turns */
  background: conic-gradient(from var(--a) at 50% 62%, #ff4a3d, #c25bff 24%, #e0262b 46%, #ff9a5a 70%, #ff4a3d);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-stroke: 1px rgba(255, 170, 140, 0.55);
  letter-spacing: 0.035em;
  animation: labs-spin 16s linear infinite;
  /* bass shake: --bass (0..1) is written by the player while music is playing */
  transform: translate(calc(var(--bass) * 0.05em), calc(var(--bass) * -0.035em)) scale(calc(1 + var(--bass) * 0.028));
  will-change: transform;
}
@supports (background: oklch(60% 0.2 25)) {
  .labs { background-image: conic-gradient(from var(--a) at 50% 62%, oklch(70% 0.23 27), oklch(66% 0.26 312) 24%, oklch(58% 0.24 27) 46%, oklch(78% 0.17 48) 70%, oklch(70% 0.23 27)); }
}
@keyframes labs-spin { to { --a: 360deg; } }

/* wet-paint glow (a blurred copy; only its opacity changes, so it stays cheap) */
.labs::before {
  content: attr(data-text); content: attr(data-text) / "";
  position: absolute; inset: 0; z-index: -1; padding: 0 0.04em;
  color: #ff2a2a; -webkit-text-stroke: 0; filter: blur(0.26em);
  opacity: calc(0.45 + var(--bass) * 0.45);
}
/* a brief chromatic glitch every so often, and once whenever Play is pressed */
.labs::after {
  content: attr(data-text); content: attr(data-text) / "";
  position: absolute; inset: 0; padding: 0 0.04em; color: #8b3dff; -webkit-text-stroke: 0; opacity: 0; mix-blend-mode: screen;
  animation: labs-glitch 9s steps(1, end) infinite;
}
@keyframes labs-glitch {
  0%, 92% { opacity: 0; transform: none; }
  93% { opacity: .85; transform: translate(-0.035em, 0.01em); clip-path: inset(18% 0 56% 0); }
  95% { opacity: .85; transform: translate(0.035em, -0.01em); clip-path: inset(58% 0 14% 0); }
  97%, 100% { opacity: 0; transform: none; clip-path: none; }
}
.hd-ignite .labs::after { animation: labs-glitch-once 0.5s steps(1, end); }
@keyframes labs-glitch-once {
  0% { opacity: .9; transform: translate(-0.04em, 0); clip-path: inset(10% 0 60% 0); }
  35% { opacity: .9; transform: translate(0.04em, 0.01em); clip-path: inset(50% 0 20% 0); }
  70% { opacity: .7; transform: translate(-0.02em, 0); clip-path: inset(30% 0 40% 0); }
  100% { opacity: 0; transform: none; clip-path: none; }
}

/* drips hanging from the word; in browsers with scroll-driven animations they stretch as you scroll */
.stalactites { position: absolute; left: 0; right: 0; bottom: 0.1em; height: 0; pointer-events: none; }
.stalactites i { position: absolute; top: 0; width: 0.075em; height: 0.34em; transform-origin: top; border-radius: 0 0 0.1em 0.1em / 0 0 0.3em 0.3em;
  background: linear-gradient(180deg, #e0262b, #690000); box-shadow: 0 0 0.25em rgba(224, 38, 43, 0.6); }
.stalactites i::after { content: ""; position: absolute; left: 50%; bottom: -0.05em; width: 0.12em; height: 0.12em; margin-left: -0.06em; border-radius: 50%; background: #8a0a0a; }
.stalactites i:nth-child(1) { left: 16%; height: 0.17em; }
.stalactites i:nth-child(2) { left: 49%; height: 0.26em; }
.stalactites i:nth-child(3) { left: 82%; height: 0.14em; }
@supports (animation-timeline: scroll()) {
  .stalactites i { animation: drip-stretch linear both; animation-timeline: scroll(root); animation-range: 0 340px; }
}
@keyframes drip-stretch { to { transform: scaleY(1.7); } }

/* a droplet that forms, falls past the tagline and lands on the Patreon button, every ~11 s */
.drop { position: absolute; left: 49%; top: 100%; width: 0.11em; height: 0.17em; margin-left: -0.055em; opacity: 0; pointer-events: none;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: linear-gradient(180deg, #ff3b30, #690000);
  animation: drop-fall 11s cubic-bezier(.5, 0, .9, .4) infinite; }
@keyframes drop-fall {
  0% { opacity: 0; transform: translateY(0) scale(.2); }
  6% { opacity: 1; transform: translateY(0) scale(1); }
  8% { opacity: 1; transform: translateY(0) scale(1); }
  24% { opacity: 1; transform: translateY(var(--fall, 8rem)) scale(.9, 1.25); }
  25%, 100% { opacity: 0; transform: translateY(var(--fall, 8rem)) scale(1.6, .4); }
}
.hd-hero { --fall: clamp(8.2rem, 24vw, 11rem); }
.hd-hero .cta-row .btn-primary { animation: splat 11s ease-out infinite; }
@keyframes splat {
  0%, 23% { transform: none; filter: none; }
  25% { transform: scale(1.04); filter: brightness(1.35) drop-shadow(0 0 14px rgba(255, 60, 40, .8)); }
  32%, 100% { transform: none; filter: none; }
}

/* ---- the wall: weathered concrete, a work light, a hazard stripe ---- */
.wall {
  /* wider than the text column so the lettering has room; the SVG sets the proportions */
  position: relative; left: 50%; transform: translateX(-50%); width: min(62rem, calc(100vw - 2rem)); aspect-ratio: 1400 / 410;
  margin: 1.6rem 0; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line-hot);
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 205, 170, 0.18), transparent 62%),
    linear-gradient(rgba(0, 0, 0, 0.30) 2px, transparent 2px) 0 0 / 100% 56px,
    linear-gradient(90deg, rgba(0, 0, 0, 0.22) 2px, transparent 2px) 0 0 / 150px 100%,
    linear-gradient(170deg, #3f3a3c, #28232a 70%, #1c1820);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.75), 0 0 40px -12px rgba(139, 61, 255, 0.35), 0 0 40px -16px rgba(224, 38, 43, 0.45);
}
.wall::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 9px; opacity: 0.9;
  background: repeating-linear-gradient(135deg, var(--warn) 0 10px, #17090a 10px 20px); }
.wall[data-state="loading"]::before { content: ""; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  border: 3px solid rgba(224, 38, 43, 0.25); border-top-color: var(--red); animation: wall-spin .8s linear infinite; }
@keyframes wall-spin { to { transform: rotate(360deg); } }
.wall[data-state="failed"] { display: grid; place-items: center; font: 900 clamp(2rem, 9vw, 4rem)/1 system-ui, sans-serif; font-style: italic; color: var(--crimson); text-shadow: 0 0 0 #e8d6cc, 0 0 2px #e8d6cc; }
.wall-fallback { margin: 0; text-align: center; padding-top: 12%; font: 900 clamp(2rem, 9vw, 4rem)/1 system-ui, sans-serif; font-style: italic; color: var(--crimson); }

@media (max-width: 30rem) {
  /* on phones the logo stands for the brand, so the text next to it is hidden visually (still read aloud) */
  .brand .logo + .name { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
  .hd-hero { padding-top: 2.2rem; }
}
