* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #0b0911;
}

body {
  min-height: 100vh;
}

.no-webgl {
  background:
    radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.32), transparent 0 16%, transparent 40%),
    radial-gradient(ellipse at 43% 48%, rgba(124, 58, 237, 0.30), transparent 0 18%, transparent 42%),
    radial-gradient(ellipse at 57% 45%, rgba(249, 115, 22, 0.28), transparent 0 16%, transparent 40%),
    linear-gradient(135deg, #07060b, #100c16 52%, #08070d);
}

#shader {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  text-align: center;
  pointer-events: none;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(clamp(-100px, -8vw, -68px));
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 51%, rgba(255, 255, 255, 0.035), transparent 0 18%, transparent 42%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.28));
  z-index: -1;
}

.eyebrow {
  position: absolute;
  top: calc(50% - clamp(180px, 19vw, 220px));
  left: 50%;
  width: min(86vw, 760px);
  margin: 0;
  transform: translateX(-50%);
  color: rgba(234, 238, 246, 0.46);
  font-size: clamp(0.72rem, 1.35vw, 0.95rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  position: relative;
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(14px, 2.8vw, 34px);
  color: #f8fbff;
  font-size: clamp(4.2rem, 15vw, 12.5rem);
  font-weight: 800;
  line-height: 0.82;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    0 0 18px rgba(255, 255, 255, 0.20),
    0 0 46px rgba(124, 58, 237, 0.22),
    0 20px 64px rgba(0, 0, 0, 0.64);
}

h1::before {
  content: "";
  position: absolute;
  inset: -0.24em -0.18em -0.20em;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.54), rgba(0, 0, 0, 0.18) 42%, transparent 70%);
  filter: blur(10px);
}

h1::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: clamp(-28px, -3vw, -18px);
  width: min(78vw, 720px);
  height: 2px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.50), rgba(249, 115, 22, 0.38), transparent);
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.36);
}

h1 span:first-child {
  position: relative;
  background: linear-gradient(105deg, #ffffff 4%, #d9f9ff 42%, #fbd3b4 76%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h1 span:last-child {
  position: relative;
  color: rgba(244, 249, 252, 0.78);
  font-size: 0.54em;
  font-weight: 700;
}

.telegram-link {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 4;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: rgba(235, 248, 255, 0.76);
  background: rgba(12, 10, 18, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.24),
    0 0 20px rgba(6, 182, 212, 0.06);
  text-decoration: none;
  backdrop-filter: blur(14px);
  transition:
    transform 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.telegram-link:hover {
  transform: translateY(-1px);
  color: rgba(255, 255, 255, 0.94);
  background: rgba(20, 17, 28, 0.52);
  border-color: rgba(103, 232, 249, 0.28);
}

.telegram-link svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: currentColor;
}

.controls {
  position: fixed;
  left: 28px;
  right: 28px;
  bottom: 24px;
  z-index: 3;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px;
  color: rgba(246, 248, 252, 0.92);
  background: rgba(18, 15, 26, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(18px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.controls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
}

.controls h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.controls-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-button,
.preset-button,
.show-controls {
  height: 32px;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.panel-button:hover,
.preset-button:hover,
.show-controls:hover {
  background: rgba(255, 255, 255, 0.12);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.preset-button {
  height: 30px;
  color: rgba(238, 240, 246, 0.70);
  font-weight: 700;
}

.preset-button.is-active {
  color: #ffffff;
  background: rgba(124, 58, 237, 0.30);
  border-color: rgba(168, 132, 255, 0.48);
  box-shadow: 0 0 22px rgba(124, 58, 237, 0.22);
}

.show-controls {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 4;
  transform: translateX(-50%);
  background: rgba(18, 15, 26, 0.82);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(16px);
}

.show-controls:hover {
  transform: translate(-50%, -1px);
}

.controls-hidden .controls {
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.control {
  min-width: 0;
  min-height: 40px;
  display: grid;
  grid-template-columns: 82px minmax(90px, 1fr) 42px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: rgba(238, 240, 246, 0.68);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 0.78rem;
}

.control span {
  white-space: nowrap;
}

.control output {
  color: rgba(255, 255, 255, 0.90);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.color-control {
  grid-template-columns: 1fr 52px;
}

.color-control input {
  justify-self: end;
}

input[type="range"] {
  width: 100%;
  min-width: 0;
  height: 4px;
  margin: 0;
  accent-color: #7c3aed;
}

input[type="color"] {
  width: 36px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

@media (max-width: 640px) {
  .hero {
    padding: 22px;
  }

  .eyebrow {
    top: calc(50% - 170px);
  }

  h1 {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    line-height: 0.9;
  }

  h1 span:last-child {
    font-size: 0.58em;
  }

  .hero-content {
    transform: translateY(-98px);
  }

  .telegram-link {
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
  }

  .controls {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-height: 42vh;
    padding: 14px;
    overflow: auto;
  }

  .controls h2 {
    font-size: 1rem;
  }

  .control-grid {
    grid-template-columns: 1fr;
  }

  .control {
    grid-template-columns: 76px minmax(80px, 1fr) 38px;
  }
}
