:root {
  --bg: #080808;
  --bg-elevated: rgba(12, 12, 12, 0.7);
  --accent: #a8b8c8;
  --accent-strong: #c0ceda;
  --accent-muted: rgba(138, 155, 174, 0.35);
  --accent-btn: #f0ede8;
  --text: #f2efe8;
  --text-strong: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.62);
  --text-faint: rgba(255, 255, 255, 0.3);
  --line: rgba(255, 255, 255, 0.12);
  --font: "M PLUS Rounded 1c", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 50px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Full-bleed photo background ── */

.bg-photo {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.bg-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: brightness(0.52) contrast(1.06) saturate(0.32);
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(8, 10, 14, 0.28);
}

@media (max-width: 640px) {
  .bg-img {
    object-position: 38% 15%;
    filter: brightness(0.46) contrast(1.08) saturate(0.28);
  }

  .bg-overlay {
    background-color: rgba(6, 8, 12, 0.26);
  }
}

/* ── Stars canvas (soft blend — not gritty overlay) ── */

.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
  mix-blend-mode: screen;
  opacity: 0.78;
  filter: blur(0.4px);
}

/* ── Layout ── */

.wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(2.5rem, 8vw, 5rem) clamp(1.25rem, 5vw, 2.5rem);
  max-width: 40rem;
  margin: 0 auto;
  text-align: center;
}

/* ── Brand logo (small, above headline) ── */

.brand-logo {
  display: block;
  width: min(176px, 44vw);
  height: auto;
  margin: 0 auto clamp(1.75rem, 5vw, 2.75rem);
  opacity: 0.95;
}

/* ── Hero ── */

.hero {
  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
}

.headline {
  margin: 0 0 clamp(0.75rem, 2vw, 1rem);
  font-size: clamp(2.25rem, 8vw, 3.75rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text-strong);
}

.headline-accent {
  font-style: italic;
  font-weight: 800;
  color: var(--text-strong);
}

.sub {
  margin: 0;
  font-size: clamp(0.9rem, 2.8vw, 1.125rem);
  font-weight: 300;
  letter-spacing: 0.01em;
  line-height: 1.6;
  color: var(--text-soft);
}

.sub-em {
  font-weight: 700;
  color: var(--text);
}

.coming {
  margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ── Form ── */

.signup {
  width: 100%;
  max-width: 28rem;
}

.signup-panel {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background-color: var(--bg-elevated);
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.35s var(--ease-out);
}

.signup-panel:focus-within {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Success celebration layer (hidden until .is-success) */
.signup-fx {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
}

.signup-panel.is-success .signup-fx {
  opacity: 1;
  visibility: visible;
}

.success-icon {
  color: var(--accent-strong);
  filter: drop-shadow(0 0 12px rgba(200, 218, 235, 0.45));
}

.success-icon-ring {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-dasharray: 210;
  stroke-dashoffset: 210;
}

.success-icon-check {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.5;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
}

.signup-panel.is-success .success-icon-ring {
  animation: ringDraw 0.55s cubic-bezier(0.45, 0, 0.2, 1) forwards;
}

.signup-panel.is-success .success-icon-check {
  animation: checkDraw 0.45s cubic-bezier(0.45, 0, 0.2, 1) 0.35s forwards;
}

@keyframes ringDraw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes checkDraw {
  to {
    stroke-dashoffset: 0;
  }
}

.success-spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(200, 220, 240, 0.4) 45%,
    transparent 70%
  );
  opacity: 0;
  transform: scale(0);
}

.signup-panel.is-success .success-spark {
  animation: sparkPop 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.success-spark--1 {
  top: 18%;
  left: 22%;
  animation-delay: 0.2s !important;
}

.success-spark--2 {
  top: 24%;
  right: 18%;
  animation-delay: 0.28s !important;
}

.success-spark--3 {
  bottom: 28%;
  left: 14%;
  animation-delay: 0.36s !important;
}

.success-spark--4 {
  bottom: 20%;
  right: 22%;
  animation-delay: 0.32s !important;
}

.success-spark--5 {
  top: 42%;
  left: 8%;
  animation-delay: 0.4s !important;
}

.success-spark--6 {
  top: 38%;
  right: 10%;
  animation-delay: 0.44s !important;
}

@keyframes sparkPop {
  0% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  45% {
    opacity: 1;
    transform: scale(1.15) rotate(180deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.35) rotate(260deg);
  }
}

.signup-panel.is-success {
  border-color: rgba(180, 200, 218, 0.45);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 48px rgba(160, 190, 220, 0.22),
    0 12px 40px rgba(0, 0, 0, 0.35);
  animation: panelCelebrate 0.85s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
}

.signup-panel.is-success .field-row {
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.25s ease,
    transform 0.35s var(--ease-out);
  pointer-events: none;
}

@keyframes panelCelebrate {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.035);
  }
  65% {
    transform: scale(1.01);
  }
  100% {
    transform: scale(1);
  }
}

.field-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  position: relative;
  z-index: 1;
  transition:
    opacity 0.3s ease,
    transform 0.35s var(--ease-out);
}

.field-row input {
  flex: 1;
  min-width: 0;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  padding: 0.9rem 1.35rem;
  border: none;
  border-radius: 0;
  background-color: transparent;
  color: var(--text);
  outline: none;
}

.field-row input::placeholder {
  color: var(--text-faint);
  font-weight: 400;
}

.field-row input:focus {
  background-color: rgba(255, 255, 255, 0.03);
}

.btn {
  flex-shrink: 0;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: calc(var(--radius) - 1px);
  margin: 4px;
  cursor: pointer;
  color: #0a0a0a;
  background-color: var(--accent-btn);
  transition:
    background-color 0.2s ease,
    transform 0.15s var(--ease-out);
}

.btn:hover:not(:disabled) {
  background-color: #ffffff;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Form hints ── */

.form-hint {
  min-height: 1.25rem;
  margin: 0.85rem 0 0;
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--text-soft);
}

.form-hint.success {
  font-weight: 700;
  color: var(--accent-strong);
}

.form-hint.error {
  color: #d4a89e;
}

/* ── Footer ── */

.foot {
  margin-top: clamp(3rem, 10vw, 5rem);
}

.rights {
  margin: 0;
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.2);
}

/* ── Utility ── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Mobile: stack email + button (avoid cramped row) ── */

@media (max-width: 640px) {
  .field-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.65rem;
  }

  .field-row input {
    width: 100%;
    text-align: center;
    padding: 0.95rem 1rem;
    border-radius: calc(var(--radius) - 6px);
  }

  .btn {
    width: 100%;
    margin: 0;
    border-radius: calc(var(--radius) - 6px);
    padding: 0.95rem 1rem;
    font-size: 0.8125rem;
  }
}

@media (max-width: 479px) {
  .wrap {
    padding-top: clamp(3.5rem, 14vw, 6rem);
    padding-bottom: clamp(2rem, 8vw, 3rem);
  }

  .brand-logo {
    width: min(148px, 40vw);
    margin-bottom: clamp(1.25rem, 4vw, 2rem);
  }

  .headline {
    font-size: clamp(2rem, 10vw, 3rem);
  }
}

/* Success state: keep stacked layout visible area for icon */
@media (max-width: 640px) {
  .signup-panel.is-success {
    min-height: 8.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .signup-panel.is-success {
    animation: none;
  }

  .signup-panel.is-success .success-icon-ring,
  .signup-panel.is-success .success-icon-check {
    animation: none;
    stroke-dashoffset: 0;
  }

  .signup-panel.is-success .success-spark {
    animation: none;
    opacity: 0;
  }

  .signup-panel.is-success .field-row {
    opacity: 1;
    transform: none;
  }

  .signup-fx {
    display: none;
  }
}
