:root {
  --bg: #f7f7f8;
  --panel: rgba(255, 255, 255, 0.72);
  --line: rgba(0, 0, 0, 0.08);
  --text: #171717;
  --muted: #666;
  --ok: #0070f3;
  --danger: #e00;
  --pad: clamp(28px, 4.5vw, 80px);
  --font: "Geist Sans", "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
[hidden] { display: none !important; }

body {
  color: var(--text);
  font-family: var(--font);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}

.fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(360px, 1.08fr);
}

.hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px var(--pad) clamp(48px, 8vh, 80px);
  animation: enter 0.5s ease both;
  min-height: 100dvh;
}

.brand {
  color: #000;
  text-decoration: none;
  font-weight: 650;
  font-size: 16px;
  letter-spacing: -0.04em;
  width: fit-content;
  transition: opacity 0.2s ease;
}
.brand:hover { opacity: 0.5; }

.hero-copy {
  padding-bottom: clamp(8px, 4vh, 40px);
}

.hero h1 {
  margin: 0;
  font-size: clamp(36px, 4.8vw, 56px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.15;
  white-space: nowrap;
}

.sub {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  max-width: 28em;
}

.steps {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 240px;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: #111;
  font-weight: 500;
}
.steps span {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 500;
  color: #999;
  letter-spacing: 0.04em;
  min-width: 1.6em;
}

.work {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(96px, 14vh, 140px) var(--pad) clamp(48px, 8vh, 96px);
  animation: enter 0.55s ease 0.05s both;
  width: 100%;
}

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

.tabs {
  position: relative;
  display: flex;
  gap: 28px;
  margin: 0 0 28px;
  border-bottom: 1px solid var(--line);
}
.tab {
  border: 0;
  background: none;
  padding: 0 0 14px;
  color: var(--muted);
  font: 500 15px var(--font);
  cursor: pointer;
  transition: color 0.15s ease;
}
.tab:hover,
.tab.active { color: #000; }
.tab-ink {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 56px;
  background: #000;
  transition: transform 0.28s cubic-bezier(0.23, 1, 0.32, 1), width 0.28s ease;
}

.form {
  display: none;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  animation: rise 0.28s ease both;
}
.form.active { display: flex; }
@keyframes rise {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 16px;
  width: 100%;
}
.span2 { grid-column: 1 / -1; }

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.field span {
  font-size: 13px;
  font-weight: 500;
  color: #000;
}
.field em {
  font-style: normal;
  color: var(--muted);
  font-weight: 400;
}

input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  font: 400 15px var(--font);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:hover { border-color: rgba(0, 0, 0, 0.28); }
input:focus {
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}
input::placeholder { color: #999; }

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.submit {
  align-self: stretch;
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 8px;
  background: #000;
  color: #fff;
  font: 500 15px var(--font);
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, transform 0.15s ease;
}
.submit:hover { background: #222; }
.submit:active { transform: scale(0.99); }
.submit.ghost {
  background: rgba(255, 255, 255, 0.7);
  color: #000;
  box-shadow: inset 0 0 0 1px var(--line);
}
.submit.ghost:hover { background: #fff; }
.submit.loading { pointer-events: none; opacity: 0.65; }
.submit.loading span { opacity: 0; }
.submit.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: spin 0.6s linear infinite;
}
.submit.ghost.loading::after {
  border-color: rgba(0, 0, 0, 0.12);
  border-top-color: #000;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.4;
  animation: rise 0.2s ease;
}
.toast.ok { color: var(--ok); }
.toast.err { color: var(--danger); }

.result {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  animation: rise 0.25s ease;
}
.result strong {
  display: block;
  color: #000;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}
.result-id {
  display: block;
  margin-top: 4px;
}
.result-id code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #000;
  font-weight: 600;
}

@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; }
  .hero {
    min-height: auto;
    padding: 28px var(--pad) 20px;
    gap: 36px;
  }
  .hero h1 {
    white-space: normal;
    font-size: clamp(32px, 9vw, 44px);
  }
  .steps {
    margin-top: 28px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px 20px;
    max-width: none;
  }
  .work {
    padding: 12px var(--pad) 48px;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .tabs { gap: 18px; }
}
