:root {
  color-scheme: dark;
  --bg: #050505;
  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.62);
  --line: #27272a;
  --green: #22c55e;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.shader-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

.shader-grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 50%, black, transparent 78%);
}

.shader-page {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(18px, 4vw, 56px);
}

.shader-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 820px);
  min-width: 0;
}

.shader-panel {
  width: min(100%, 768px);
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.08);
  box-shadow: 0 28px 120px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(8px);
}

.shader-panel-inner {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 340px;
  padding: clamp(46px, 7vw, 76px) clamp(18px, 5vw, 52px);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08), transparent 42%),
    rgba(0, 0, 0, 0.16);
  text-align: center;
}

.shader-panel-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 30%, rgba(255,255,255,0.03));
  mix-blend-mode: screen;
}

.shader-kicker {
  position: relative;
  max-width: 100%;
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.shader-panel h1 {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin: 0 auto 16px;
  color: #ffffff;
  font-size: clamp(46px, 9vw, 112px);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.88;
  text-wrap: balance;
}

.shader-copy {
  position: relative;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(13px, 1.8vw, 18px);
  line-height: 1.6;
}

.shader-status {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 30px auto 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.shader-status p {
  margin: 0;
}

.shader-pulse {
  position: relative;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
}

.shader-pulse::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.72;
  animation: ping 1.35s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.shader-pulse i {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.liquid-button {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 52px;
  margin: 32px auto 0;
  margin-inline: auto;
  padding: 0 34px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 260ms ease, border-color 260ms ease, box-shadow 260ms ease;
  box-shadow:
    0 0 8px rgba(0, 0, 0, 0.03),
    0 2px 8px rgba(0, 0, 0, 0.18),
    inset 3px 3px 0.5px -3px rgba(255, 255, 255, 0.64),
    inset -3px -3px 0.5px -3px rgba(255, 255, 255, 0.82),
    inset 0 0 7px 7px rgba(255, 255, 255, 0.11),
    0 0 18px rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px) saturate(1.45);
}

.liquid-button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.34), transparent 26%),
    linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.02));
  filter: url("#container-glass");
}

.liquid-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 0 28%, rgba(255, 255, 255, 0.24) 48%, transparent 66% 100%);
  opacity: 0;
  transform: translateX(-42%);
  transition: opacity 220ms ease, transform 320ms ease;
}

.liquid-button:hover {
  border-color: rgba(255, 255, 255, 0.58);
  box-shadow:
    0 12px 44px rgba(0, 0, 0, 0.34),
    inset 0 0 12px 8px rgba(255, 255, 255, 0.13),
    0 0 26px rgba(255, 255, 255, 0.2);
  transform: translateY(-2px) scale(1.035);
}

.liquid-button:hover::after {
  opacity: 1;
  transform: translateX(38%);
}

.liquid-button span {
  position: relative;
  z-index: 1;
}

.shader-close {
  position: fixed;
  right: clamp(18px, 4vw, 48px);
  top: clamp(18px, 4vw, 42px);
  z-index: 5;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
  transition: transform 180ms ease, border-color 180ms ease;
}

.shader-close:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

.shader-close span {
  position: absolute;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.shader-close span:first-child {
  transform: rotate(45deg);
}

.shader-close span:last-child {
  transform: rotate(-45deg);
}

@keyframes ping {
  75%,
  100% {
    opacity: 0;
    transform: scale(2.1);
  }
}

@media (max-width: 640px) {
  .shader-page {
    padding: 14px;
  }

  .shader-panel {
    width: min(100%, calc(100vw - 36px));
    padding: 6px;
  }

  .shader-panel-inner {
    min-height: 410px;
    padding: 46px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .shader-kicker {
    width: 100%;
    font-size: 9px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .shader-panel h1 {
    max-width: 320px;
    font-size: clamp(36px, 10vw, 44px);
    letter-spacing: -0.035em;
    line-height: 0.94;
  }

  .shader-copy {
    max-width: 290px;
    font-size: 13px;
    overflow-wrap: break-word;
  }

  .shader-status {
    flex-wrap: wrap;
    display: flex;
    max-width: 280px;
    margin-top: 28px;
  }

  .shader-status + .liquid-button {
    margin-top: 22px;
  }

  .liquid-button {
    min-height: 48px;
    padding: 0 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
