:root {
  --bg: #050505;
  --text: #e9e9e9;
  --muted: rgba(233, 233, 233, 0.68);
  --ring: rgba(255, 255, 255, 0.16);
  --btn: rgba(255, 255, 255, 0.08);
  --btn-border: rgba(255, 255, 255, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.05), transparent 46%),
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.035), transparent 52%),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
}

.hero {
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%27180%27%20height%3D%27180%27%20viewBox%3D%270%200%20180%20180%27%3E%3Cfilter%20id%3D%27n%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%270.8%27%20numOctaves%3D%273%27%20stitchTiles%3D%27stitch%27/%3E%3C/filter%3E%3Crect%20width%3D%27180%27%20height%3D%27180%27%20filter%3D%27url(%23n)%27%20opacity%3D%270.45%27/%3E%3C/svg%3E");
  background-size: 220px 220px;
  transform: translate3d(0, 0, 0);
  animation: grainDrift 8s linear infinite;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 6vw clamp(70px, 12vh, 100px);
  gap: 18px;
}

.xtownhall-logo {
  width: min(860px, 84vw);
  height: auto;
  display: block;
  margin-top: -10vh; /* Pull up to remove visible top gap */
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.55));
  opacity: 0;
  animation: logoFloat 7s ease-in-out infinite, fadeIn 900ms ease forwards;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 3.9vw, 56px);
  letter-spacing: -0.02em;
  font-weight: 760;
  opacity: 0;
  animation: riseIn 900ms ease forwards;
  animation-delay: 120ms;
}

.subtext {
  margin: 0;
  color: var(--muted);
  font-size: clamp(14px, 1.8vw, 18px);
  opacity: 0;
  animation: riseIn 900ms ease forwards;
  animation-delay: 240ms;
}

.primary-btn {
  margin-top: 10px;
  text-decoration: none;
  color: var(--text);
  padding: 14px 26px;
  border-radius: 14px;
  border: 1px solid var(--btn-border);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.05));
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.0), 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: box-shadow 160ms ease, border-color 160ms ease, transform 140ms ease;
  font-weight: 650;
  opacity: 0;
  animation: riseIn 900ms ease forwards, buttonGlow 3.8s ease-in-out infinite;
  animation-delay: 360ms, 0ms;
}

.primary-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.30);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.05), 0 14px 44px rgba(0, 0, 0, 0.45);
}

.primary-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.10);
}

.attribution {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  padding: 0 18px;
  opacity: 0;
  animation: fadeIn 900ms ease forwards;
  animation-delay: 520ms;
}

.attribution-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: rgba(233, 233, 233, 0.78);
  font-size: 12px;
  opacity: 0.92;
}

.attention-logo {
  height: 16px;
  width: auto;
  display: block;
}

.attribution-text {
  white-space: nowrap;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logoFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px) scale(1.01);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes buttonGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.0), 0 10px 30px rgba(0, 0, 0, 0.35);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.05), 0 18px 44px rgba(0, 0, 0, 0.45);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.0), 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

@keyframes grainDrift {
  0% {
    transform: translate3d(-2%, -2%, 0);
  }
  50% {
    transform: translate3d(2%, 3%, 0);
  }
  100% {
    transform: translate3d(-2%, -2%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    display: none;
  }

  * {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 560px) {
  .hero {
    padding: 0 5vw clamp(62px, 10vh, 84px);
    gap: 14px;
  }

  .xtownhall-logo {
    width: min(520px, 92vw);
    margin-top: -7vh; /* Prevent cropping on smaller screens */
  }

  h1 {
    font-size: clamp(26px, 8vw, 42px);
  }

  .subtext {
    font-size: clamp(13px, 3.9vw, 16px);
  }

  .primary-btn {
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
  }

  .attribution {
    bottom: calc(10px + env(safe-area-inset-bottom));
    padding: 0 14px;
  }

  .attribution-link {
    font-size: 11px;
  }

  .attention-logo {
    height: 14px;
  }
}

@media (max-height: 650px) {
  .hero {
    padding-bottom: 60px;
    gap: 14px;
  }

  .xtownhall-logo {
    margin-top: -6vh;
  }
}

