:root {
  --ink: #1b1630;
  --muted: #706a82;
  --paper: #f7f4f0;
  --purple: #5a2ee6;
  --purple-dark: #4220bb;
  --coral: #ff654d;
  --yellow: #ffd15a;
  --green: #207a55;
  --red: #bd3f34;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.gate-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(480px, 0.98fr);
  overflow: hidden;
}

.gate-story {
  position: relative;
  min-height: 100svh;
  padding: clamp(28px, 4.5vw, 68px);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 86% 16%, rgba(255, 255, 255, 0.17), transparent 25%),
    radial-gradient(circle at 18% 78%, rgba(255, 101, 77, 0.42), transparent 28%),
    linear-gradient(145deg, #4822c7 0%, #6339ec 52%, #7a55ef 100%);
}

.gate-story::after {
  position: absolute;
  top: -16vw;
  right: -15vw;
  width: 48vw;
  height: 48vw;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  box-shadow:
    0 0 0 4vw rgba(255, 255, 255, 0.025),
    0 0 0 8vw rgba(255, 255, 255, 0.025);
  content: "";
}

.story-topline {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--purple-dark);
  background: var(--yellow);
  border-radius: 10px;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.04em;
  transform: rotate(-6deg);
}

.story-copy {
  position: relative;
  z-index: 3;
  max-width: 620px;
  margin-top: clamp(90px, 14vh, 168px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 26px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--coral);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(255, 101, 77, 0.18);
}

.story-copy h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(62px, 7.6vw, 126px);
  font-weight: 830;
  letter-spacing: -0.07em;
  line-height: 0.86;
}

.story-copy > p:last-child {
  max-width: 460px;
  margin: 34px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.55;
}

.story-footnote {
  position: absolute;
  z-index: 3;
  left: clamp(28px, 4.5vw, 68px);
  bottom: clamp(26px, 4vw, 56px);
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.05em;
}

.story-footnote span:first-child {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  font-size: 9px;
}

.wheel-art {
  position: absolute;
  z-index: 2;
  right: clamp(-200px, -11vw, -82px);
  bottom: clamp(-235px, -14vw, -130px);
  width: clamp(430px, 40vw, 690px);
  height: clamp(430px, 40vw, 690px);
}

.wheel-ring {
  position: absolute;
  inset: 7%;
  display: grid;
  place-items: center;
  border: clamp(12px, 1.1vw, 20px) solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 22%, #fff 22.5% 24%, transparent 24.5%),
    conic-gradient(
      from -15deg,
      var(--yellow) 0 45deg,
      var(--coral) 45deg 90deg,
      #e9ddff 90deg 135deg,
      var(--yellow) 135deg 180deg,
      var(--coral) 180deg 225deg,
      #e9ddff 225deg 270deg,
      var(--yellow) 270deg 315deg,
      var(--coral) 315deg 360deg
    );
  box-shadow:
    0 30px 80px rgba(32, 10, 102, 0.35),
    inset 0 0 0 2px rgba(64, 34, 174, 0.25);
}

.wheel-ring::after {
  position: absolute;
  inset: -4.5%;
  border: 3px dotted rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  content: "";
}

.wheel-center {
  display: grid;
  width: 22%;
  height: 22%;
  place-items: center;
  color: var(--purple);
  background: #fff;
  border: 7px solid var(--purple);
  border-radius: 50%;
  font-size: clamp(28px, 3vw, 50px);
  box-shadow: 0 10px 30px rgba(44, 18, 132, 0.24);
}

.wheel-pointer {
  position: absolute;
  z-index: 4;
  top: 1.5%;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 58px solid #fff;
  border-right: 26px solid transparent;
  border-left: 26px solid transparent;
  filter: drop-shadow(0 8px 10px rgba(50, 22, 135, 0.28));
  transform: translateX(-50%);
}

.spark {
  position: absolute;
  color: var(--yellow);
  font-size: 34px;
}

.spark-one {
  top: 6%;
  left: 9%;
  transform: rotate(18deg);
}

.spark-two {
  top: 28%;
  left: 0;
  color: #fff;
  font-size: 23px;
}

.spark-three {
  top: 17%;
  right: 0;
  color: var(--coral);
  font-size: 64px;
}

.gate-panel {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: clamp(28px, 6vw, 96px);
  background:
    radial-gradient(circle at 92% 7%, rgba(90, 46, 230, 0.08), transparent 28%),
    var(--paper);
}

.access-card {
  width: min(100%, 520px);
}

.step-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 34px;
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.step-label::after {
  width: 52px;
  height: 1px;
  background: rgba(90, 46, 230, 0.32);
  content: "";
}

.access-card h2 {
  margin: 0;
  font-size: clamp(38px, 4vw, 58px);
  font-weight: 790;
  letter-spacing: -0.055em;
  line-height: 1;
}

.form-intro {
  max-width: 450px;
  margin: 20px 0 38px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.access-form {
  display: grid;
  gap: 23px;
}

.field-group {
  display: grid;
  gap: 9px;
}

.field-row {
  display: flex;
  min-height: 20px;
  align-items: center;
  justify-content: space-between;
}

.field-row label {
  font-size: 13px;
  font-weight: 740;
}

.field-hint {
  color: #9690a1;
  font-size: 11px;
}

.input-wrap input {
  width: 100%;
  height: 58px;
  padding: 0 17px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #dcd6e2;
  border-radius: 15px;
  outline: none;
  font-size: 15px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.input-wrap input::placeholder {
  color: #aaa4b2;
}

.input-wrap input:focus {
  background: #fff;
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(90, 46, 230, 0.1);
}

.input-wrap input[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(189, 63, 52, 0.08);
}

.phrase-state {
  min-height: 18px;
  margin: -2px 0 0;
  font-size: 12px;
  line-height: 1.4;
}

.phrase-state.checking {
  color: var(--muted);
}

.phrase-state.valid {
  color: var(--green);
}

.phrase-state.invalid {
  color: var(--red);
}

.form-message {
  display: flex;
  gap: 11px;
  margin: 0;
  padding: 13px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.form-message[hidden] {
  display: none;
}

.form-message::before {
  display: grid;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  place-items: center;
  margin-top: 1px;
  color: #fff;
  background: var(--red);
  border-radius: 50%;
  content: "!";
  font-size: 11px;
  font-weight: 900;
}

.form-message.error {
  color: var(--red);
  background: rgba(189, 63, 52, 0.08);
}

.form-message.used {
  color: #9b5b16;
  background: rgba(255, 184, 76, 0.13);
}

.form-message.used::before {
  background: #9b5b16;
}

.submit-button {
  position: relative;
  display: flex;
  width: 100%;
  height: 60px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 2px;
  overflow: hidden;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 760;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 28px rgba(27, 22, 48, 0.16);
  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.submit-button::after {
  content: "→";
  font-size: 20px;
  line-height: 1;
  transition: transform 160ms ease;
}

.submit-button:hover:not(:disabled) {
  background: var(--purple);
  box-shadow: 0 16px 32px rgba(90, 46, 230, 0.22);
  transform: translateY(-1px);
}

.submit-button:focus-visible {
  outline: 3px solid rgba(90, 46, 230, 0.28);
  outline-offset: 3px;
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.66;
}

.submit-button.loading::after {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  animation: spin 700ms linear infinite;
}

.privacy-note {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 0;
  color: #8f8998;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.privacy-note::before {
  color: var(--green);
  content: "●";
  font-size: 8px;
  line-height: 1.8;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1040px) {
  .gate-shell {
    grid-template-columns: minmax(0, 0.85fr) minmax(440px, 1.15fr);
  }

  .story-copy h1 {
    font-size: clamp(58px, 8vw, 88px);
  }

  .wheel-art {
    right: -190px;
    bottom: -170px;
  }
}

@media (max-width: 800px) {
  .gate-shell {
    display: flex;
    min-height: 100svh;
    flex-direction: column;
    overflow: visible;
  }

  .gate-story {
    min-height: 390px;
    padding: 27px 24px 36px;
  }

  .story-copy {
    margin-top: 58px;
  }

  .story-copy h1 {
    font-size: clamp(54px, 16vw, 78px);
    line-height: 0.89;
  }

  .story-copy > p:last-child {
    max-width: 70%;
    margin-top: 23px;
    font-size: 14px;
  }

  .wheel-art {
    right: -165px;
    bottom: -170px;
    width: 390px;
    height: 390px;
  }

  .story-footnote {
    display: none;
  }

  .gate-panel {
    min-height: auto;
    padding: 50px 24px 62px;
  }

  .access-card {
    width: min(100%, 560px);
  }
}

@media (max-width: 520px) {
  .gate-story {
    min-height: 360px;
  }

  .story-topline {
    font-size: 10px;
  }

  .story-copy {
    margin-top: 48px;
  }

  .story-copy h1 {
    font-size: 54px;
  }

  .story-copy > p:last-child {
    max-width: 78%;
  }

  .wheel-art {
    right: -190px;
    bottom: -165px;
    width: 370px;
    height: 370px;
  }

  .step-label {
    margin-bottom: 25px;
  }

  .access-card h2 {
    font-size: 39px;
  }

  .form-intro {
    margin: 17px 0 31px;
  }

  .input-wrap input {
    height: 56px;
  }
}

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