:root {
  color-scheme: dark;
  --paper: #f2eee8;
  --muted: #b9b2ab;
  --line: rgba(242, 238, 232, 0.25);
  --ember: #bc7345;
  --ember-strong: #e09a64;
  --black: #050505;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
  background: var(--black);
  color: var(--paper);
  text-rendering: geometricPrecision;
}

button,
input,
select,
textarea {
  font: inherit;
}

.page {
  min-height: 100vh;
  background: #000;
}

.hero {
  --mouse-x: 50%;
  --mouse-y: 50%;
  --reveal-size: 0px;
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: clamp(24px, 5vw, 56px);
  background: #000;
}

.backdrop {
  position: absolute;
  inset: 0;
  background: #000;
}

.grain {
  position: absolute;
  inset: -18%;
  display: block;
  opacity: 0.16;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 28% 32%, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 64%, rgba(188, 115, 69, 0.09) 0 1px, transparent 1px);
  background-size: 34px 34px, 47px 47px;
  animation: grainDrift 5s steps(7) infinite;
}

.scanline {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.08) 0,
    rgba(255, 255, 255, 0.08) 1px,
    transparent 1px,
    transparent 7px
  );
  mix-blend-mode: screen;
}

.light-sweep {
  position: absolute;
  top: -20%;
  left: -40%;
  width: 70%;
  height: 140%;
  opacity: 0.18;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 12%, rgba(188, 115, 69, 0.12), transparent 58%);
  filter: blur(24px);
  transform: translateX(-60%) skewX(-14deg);
  animation: sweep 7s ease-in-out infinite 1.2s;
}

.flashlight-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.2)),
    url("camp-reveal.png") center / cover no-repeat;
  filter: saturate(0.8) contrast(1.08) brightness(0.92);
  mask-image: radial-gradient(
    circle at var(--mouse-x) var(--mouse-y),
    rgba(0, 0, 0, 1) 0,
    rgba(0, 0, 0, 0.92) calc(var(--reveal-size) * 0.32),
    rgba(0, 0, 0, 0.48) calc(var(--reveal-size) * 0.62),
    transparent var(--reveal-size)
  );
  -webkit-mask-image: radial-gradient(
    circle at var(--mouse-x) var(--mouse-y),
    rgba(0, 0, 0, 1) 0,
    rgba(0, 0, 0, 0.92) calc(var(--reveal-size) * 0.32),
    rgba(0, 0, 0, 0.48) calc(var(--reveal-size) * 0.62),
    transparent var(--reveal-size)
  );
  transition: opacity 180ms ease;
}

.hero.is-lit .flashlight-layer {
  --reveal-size: clamp(120px, 15vw, 210px);
  opacity: 0.9;
}

.content {
  position: relative;
  z-index: 2;
  width: min(100%, 900px);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0;
  animation: contentRise 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.mark {
  display: block;
  width: min(72vw, 560px);
  height: auto;
  margin: 0 auto 10px;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.8));
  animation: logoReveal 1200ms cubic-bezier(0.17, 0.84, 0.44, 1) both, logoTension 5.8s ease-in-out infinite 1.4s;
}

.slogan,
.kicker,
.event-line,
.unit small {
  letter-spacing: 0.28em;
}

.slogan {
  margin: 0 0 clamp(26px, 5vw, 52px);
  color: var(--muted);
  font-size: clamp(12px, 2vw, 17px);
  animation: softReveal 900ms ease both 260ms;
}

.kicker {
  margin: 0 0 24px;
  color: var(--paper);
  font-size: clamp(13px, 2vw, 18px);
  animation: softReveal 900ms ease both 420ms;
}

.countdown {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr 1px 1fr;
  align-items: center;
  gap: clamp(10px, 2.8vw, 30px);
  width: min(100%, 820px);
  margin: 0 auto 26px;
  animation: softReveal 900ms ease both 560ms;
}

.unit {
  min-width: 0;
}

.unit span {
  display: block;
  min-height: 0.9em;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(48px, 11vw, 122px);
  line-height: 0.9;
  color: var(--paper);
  text-shadow: 0 0 22px rgba(255, 255, 255, 0.08);
  transform-origin: 50% 58%;
  transition: color 180ms ease, text-shadow 180ms ease;
}

.unit span.is-ticking {
  animation: digitHit 260ms ease;
  color: #fff9ef;
  text-shadow: 0 0 30px rgba(224, 154, 100, 0.2), 0 0 10px rgba(255, 255, 255, 0.1);
}

.unit small {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-size: clamp(10px, 1.7vw, 15px);
}

.divider {
  width: 1px;
  height: clamp(58px, 10vw, 100px);
  background: var(--line);
  animation: dividerPulse 2.4s ease-in-out infinite;
}

.event-line {
  margin: 0 0 44px;
  color: var(--muted);
  font-size: clamp(12px, 2vw, 16px);
  animation: softReveal 900ms ease both 700ms;
}

.event-line strong {
  color: var(--paper);
  font-weight: 700;
  white-space: nowrap;
}

.join-link,
.submit {
  min-height: 62px;
  border: 1px solid var(--ember);
  background: rgba(0, 0, 0, 0.38);
  color: var(--paper);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.join-link {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  width: min(100%, 450px);
  padding: 0 26px;
  font-size: clamp(16px, 2.5vw, 26px);
  font-weight: 800;
  overflow: hidden;
  animation: buttonReveal 900ms ease both 840ms;
}

.join-link::before,
.submit::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, transparent, rgba(224, 154, 100, 0.22), transparent);
  transform: translateX(-110%);
  transition: transform 520ms ease;
}

.join-link:hover::before,
.submit:hover::before {
  transform: translateX(110%);
}

.join-link:hover,
.submit:hover {
  transform: translateY(-2px);
  border-color: var(--ember-strong);
  background: rgba(188, 115, 69, 0.16);
  box-shadow: 0 0 34px rgba(188, 115, 69, 0.16);
}

.join-link:active,
.submit:active {
  transform: translateY(1px) scale(0.99);
}

.arrow {
  display: inline-block;
  transition: transform 180ms ease;
}

.join-link:hover .arrow {
  transform: translateX(8px);
}

.signup {
  position: fixed;
  z-index: 3;
  left: 50%;
  bottom: clamp(16px, 4vw, 44px);
  display: grid;
  width: min(calc(100vw - 32px), 520px);
  max-height: calc(100vh - 32px);
  gap: 16px;
  padding: 26px;
  overflow: auto;
  border: 1px solid rgba(242, 238, 232, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 35%),
    rgba(5, 5, 5, 0.9);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translate(-50%, 42px) scale(0.96);
  pointer-events: none;
  transition: opacity 360ms cubic-bezier(0.2, 0.9, 0.2, 1), transform 360ms cubic-bezier(0.2, 0.9, 0.2, 1);
  backdrop-filter: blur(18px);
}

.signup.is-open {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
}

.signup.is-open label,
.signup.is-open .consents,
.signup.is-open .submit {
  animation: formItemRise 420ms ease both;
}

.signup.is-open label:nth-of-type(1) {
  animation-delay: 40ms;
}

.signup.is-open label:nth-of-type(2) {
  animation-delay: 80ms;
}

.signup.is-open label:nth-of-type(3) {
  animation-delay: 120ms;
}

.signup.is-open label:nth-of-type(4) {
  animation-delay: 160ms;
}

.signup.is-open .consents {
  animation-delay: 200ms;
}

.signup.is-open .submit {
  animation-delay: 240ms;
}

.signup h1 {
  margin: 0 34px 4px 0;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 34px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.close:hover {
  border-color: var(--ember-strong);
  background: rgba(188, 115, 69, 0.12);
  transform: rotate(90deg);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(242, 238, 232, 0.22);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--paper);
  outline: none;
  padding: 13px 14px;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ember-strong);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(188, 115, 69, 0.12);
}

.hint {
  color: #d79975;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: none;
}

.error {
  min-height: 18px;
  margin: 0;
  color: #ffb08d;
  font-size: 14px;
}

.consents {
  display: grid;
  gap: 10px;
}

.check {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.04em;
  text-transform: none;
}

.check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--ember);
}

.text-link {
  min-height: auto;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  text-decoration: underline;
}

.legal-modal {
  position: fixed;
  z-index: 5;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
  backdrop-filter: blur(8px);
}

.legal-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.legal-panel {
  position: relative;
  width: min(100%, 680px);
  max-height: min(760px, calc(100dvh - 36px));
  overflow: auto;
  border: 1px solid rgba(242, 238, 232, 0.2);
  background: rgba(5, 5, 5, 0.96);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.75);
  padding: 28px;
  transform: translateY(16px) scale(0.98);
  transition: transform 260ms ease;
}

.legal-modal.is-open .legal-panel {
  transform: translateY(0) scale(1);
}

.legal-panel h2 {
  margin: 0 44px 18px 0;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 30px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal-copy {
  display: grid;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.58;
}

.legal-copy h3 {
  margin: 12px 0 0;
  color: var(--paper);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-copy p {
  margin: 0;
}

.submit {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  font-weight: 800;
  font-size: 17px;
}

.submit.is-sending {
  color: rgba(242, 238, 232, 0.72);
  pointer-events: none;
}

.submit.is-sending::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 10px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ember-strong), transparent);
  animation: sendingLine 900ms ease-in-out infinite;
}

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

@keyframes logoReveal {
  0% {
    opacity: 0;
    transform: scale(0.94);
    filter: blur(10px) drop-shadow(0 12px 28px rgba(0, 0, 0, 0.8));
  }
  65% {
    filter: blur(0) drop-shadow(0 12px 28px rgba(0, 0, 0, 0.8));
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes logoTension {
  0%,
  92%,
  100% {
    transform: translateX(0);
  }
  93% {
    transform: translateX(-1px);
  }
  94% {
    transform: translateX(2px);
  }
  95% {
    transform: translateX(-1px);
  }
}

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

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

@keyframes digitHit {
  0% {
    transform: translateY(-4px) scaleY(0.96);
    opacity: 0.82;
  }
  55% {
    transform: translateY(1px) scaleY(1.04);
  }
  100% {
    transform: translateY(0) scaleY(1);
    opacity: 1;
  }
}

@keyframes dividerPulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.9;
  }
}

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

@keyframes grainDrift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-2%, 1%);
  }
  50% {
    transform: translate(1%, -2%);
  }
  75% {
    transform: translate(2%, 2%);
  }
}

@keyframes sweep {
  0%,
  36% {
    transform: translateX(-70%) skewX(-14deg);
  }
  62% {
    transform: translateX(260%) skewX(-14deg);
  }
  100% {
    transform: translateX(260%) skewX(-14deg);
  }
}

@keyframes sendingLine {
  0% {
    transform: translateX(-45%);
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(45%);
    opacity: 0.2;
  }
}

@media (max-width: 680px) {
  .hero {
    align-content: center;
    padding: 24px 14px;
    overflow-y: auto;
  }

  .mark {
    width: min(86vw, 420px);
    margin-bottom: 8px;
  }

  .slogan {
    margin-bottom: 30px;
  }

  .countdown {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 20px;
  }

  .divider {
    display: none;
  }

  .unit span {
    font-size: clamp(42px, 15vw, 70px);
  }

  .unit small {
    margin-top: 10px;
  }

  .unit small {
    letter-spacing: 0.12em;
  }

  .event-line {
    letter-spacing: 0.12em;
  }

  .join-link,
  .submit {
    letter-spacing: 0.12em;
  }

  .signup {
    bottom: 10px;
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    padding: 22px 18px;
  }

  .signup h1 {
    font-size: 30px;
  }

  .legal-panel {
    padding: 22px 18px;
  }

  .legal-panel h2 {
    font-size: 26px;
  }

  .hero.is-lit .flashlight-layer {
    --reveal-size: 132px;
  }
}

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