/**
 * perch.training lander — product dark surface, staging.perch.pro energy
 */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
@import "./tokens.css";

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

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--grey-900);
  color: var(--ink-title);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Soft atmospheric field */
.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% 28%, rgba(120, 188, 230, 0.12), transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(120, 188, 230, 0.04), transparent 50%),
    var(--grey-900);
}
.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 40px;
}

/* Brand block */
.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 36px;
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mark-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 22px;
}
.mark-wrap::before {
  content: "";
  position: absolute;
  inset: -28px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 188, 230, 0.28), transparent 68%);
  animation: breathe 5.5s ease-in-out infinite;
}
.mark-wrap img {
  position: relative;
  width: 72px;
  height: 72px;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(120, 188, 230, 0.25));
}

.wordmark {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-title);
}
.wordmark span {
  font-weight: 500;
  color: var(--ink-subtle);
  margin-left: 7px;
}

.eyebrow {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.9;
}

/* Perplexity-style rotating line */
.tone {
  width: min(520px, 100%);
  min-height: 3.4em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 40px;
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.tone-line {
  font-size: clamp(20px, 3.4vw, 28px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.35;
  color: var(--ink-strong);
  max-width: 18em;
}
.tone-line em {
  font-style: normal;
  color: var(--ink-title);
  font-weight: 600;
}

.tone-line.is-enter {
  animation: lineIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.tone-line.is-exit {
  animation: lineOut 0.35s ease forwards;
}

/* Gate card */
.gate {
  width: min(400px, 100%);
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}

.gate-label {
  font-size: 13px;
  color: var(--ink-caption);
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.45;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field {
  position: relative;
}
.field input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(41, 43, 45, 0.85);
  color: var(--ink-title);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset;
}
.field input::placeholder {
  color: var(--ink-subtle);
  font-weight: 400;
}
.field input:hover {
  border-color: rgba(255,255,255,0.18);
}
.field input:focus {
  border-color: rgba(120, 188, 230, 0.55);
  box-shadow:
    0 0 0 3px rgba(120, 188, 230, 0.14),
    0 1px 0 rgba(255,255,255,0.04) inset;
  background: var(--grey-800);
}
.field input.is-invalid {
  border-color: rgba(196, 106, 106, 0.65);
}

.btn {
  height: 48px;
  border: none;
  border-radius: 12px;
  background: var(--perch-blue);
  color: var(--grey-900);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.12s, background 0.12s, box-shadow 0.12s;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 8px 24px rgba(120, 188, 230, 0.18);
}
.btn:hover {
  background: #8ac6ea;
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.gate-hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-subtle);
  text-align: center;
  line-height: 1.45;
}
.gate-hint strong {
  color: var(--ink-caption);
  font-weight: 500;
}
.gate-error {
  margin-top: 10px;
  font-size: 12px;
  color: var(--perch-error);
  text-align: center;
  min-height: 1.2em;
}

.foot {
  position: absolute;
  bottom: 20px;
  left: 0; right: 0;
  text-align: center;
  font-size: 11px;
  color: var(--ink-subtle);
  letter-spacing: 0.02em;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.55; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.04); }
}
@keyframes lineIn {
  from { opacity: 0; transform: translateY(10px); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes lineOut {
  from { opacity: 1; transform: translateY(0); filter: blur(0); }
  to { opacity: 0; transform: translateY(-8px); filter: blur(3px); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-block, .tone, .gate { animation: none; }
  .mark-wrap::before { animation: none; }
  .tone-line.is-enter, .tone-line.is-exit { animation: none; }
}

@media (max-width: 480px) {
  .mark-wrap, .mark-wrap img { width: 64px; height: 64px; }
  .tone { margin-bottom: 32px; }
}
