:root {
  --sky: #d7e6ef;
  --mist: #eef5f8;
  --foam: #f7fbfd;
  --ink: #1a2f3a;
  --muted: #5a7384;
  --line: rgba(26, 47, 58, 0.12);
  --panel: rgba(255, 255, 255, 0.55);
  --accent: #0e7c86;
  --accent-hot: #d9772f;
  --accent-soft: #3aa8a0;
  --font: "Sora", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  font-family: var(--font);
  background: var(--mist);
  overflow-x: hidden;
}

/* Full-bleed atmosphere */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, #f4fafc 0%, transparent 55%),
    linear-gradient(175deg, #c5dce8 0%, var(--sky) 38%, var(--mist) 72%, #e4f0ed 100%);
  animation: skyShift 18s ease-in-out infinite alternate;
}
@keyframes skyShift {
  from { filter: hue-rotate(0deg) saturate(1); }
  to { filter: hue-rotate(-6deg) saturate(1.05); }
}

.wash {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.55;
  animation: washDrift 14s ease-in-out infinite alternate;
}
.wash-a {
  width: min(72vw, 520px);
  height: min(72vw, 520px);
  top: -12%;
  left: -8%;
  background: #9ec9d8;
}
.wash-b {
  width: min(64vw, 460px);
  height: min(64vw, 460px);
  right: -10%;
  bottom: 8%;
  background: #a8d4c8;
  animation-delay: -5s;
}
@keyframes washDrift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(3vw, -2vh) scale(1.08); }
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(26, 47, 58, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 47, 58, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 40%, black 20%, transparent 78%);
  animation: grainShift 28s linear infinite;
}
@keyframes grainShift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 48px 24px, -24px 48px; }
}

.app {
  position: relative;
  z-index: 1;
  max-width: 400px;
  margin: 0 auto;
  min-height: 100%;
  min-height: 100dvh;
  padding: 1.75rem 1.15rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero {
  text-align: center;
  padding: 0 0 1.15rem;
  animation: fadeUp 0.7s cubic-bezier(0.22, 0.9, 0.28, 1) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.brand {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.75rem, 11vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.95;
  background: linear-gradient(125deg, #163542 10%, var(--accent) 52%, var(--accent-hot));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.headline {
  margin: 0.85rem 0 0;
  font-family: var(--display);
  font-size: clamp(1.15rem, 3.5vw, 1.35rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
}

.lede {
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.45;
}

.gate {
  padding: 1rem 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 18px 48px rgba(26, 47, 58, 0.08);
  animation: fadeUp 0.85s cubic-bezier(0.22, 0.9, 0.28, 1) 0.12s both;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.95rem;
  padding: 0.28rem;
  border-radius: 12px;
  background: rgba(26, 47, 58, 0.05);
}

.tab {
  border: 0;
  border-radius: 9px;
  padding: 0.5rem 0.55rem;
  background: transparent;
  color: var(--muted);
  font: 600 0.72rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.tab:hover { color: var(--ink); }
.tab.on {
  color: #fff;
  background: linear-gradient(125deg, var(--accent), #15949e);
  box-shadow: 0 6px 16px rgba(14, 124, 134, 0.28);
}

.gate-form { display: grid; gap: 0.55rem; }

.gate-form label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.gate-form input[type="text"],
.gate-form input[type="email"],
.gate-form input[type="password"],
.gate-form input:not([type]) {
  width: 100%;
  padding: 0.58rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: 0.95rem/1.3 var(--font);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.gate-form input:focus {
  outline: none;
  border-color: rgba(14, 124, 134, 0.55);
  box-shadow: 0 0 0 3px rgba(14, 124, 134, 0.14);
}

.gate-form .check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  grid-template-columns: none;
  font-size: 0.82rem;
  line-height: 1.35;
}
.gate-form .check input { margin-top: 0.2rem; accent-color: var(--accent); }
.gate-form a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.gate-form a:hover { color: var(--accent-hot); }

.gate-form button {
  border: 0;
  border-radius: 11px;
  padding: 0.7rem 1rem;
  margin-top: 0.2rem;
  font: 600 0.78rem var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(125deg, var(--accent) 0%, #15949e 55%, var(--accent-soft));
  box-shadow: 0 10px 24px rgba(14, 124, 134, 0.28);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.gate-form button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(14, 124, 134, 0.34);
}
.gate-form button:disabled { opacity: 0.6; cursor: wait; }

.err {
  color: #b5472e;
  font-size: 0.84rem;
  margin: 0;
  line-height: 1.35;
}

[hidden] { display: none !important; }

@media (max-width: 480px) {
  .app {
    max-width: 100%;
    padding:
      max(1.25rem, env(safe-area-inset-top))
      max(0.9rem, env(safe-area-inset-right))
      max(1.25rem, env(safe-area-inset-bottom))
      max(0.9rem, env(safe-area-inset-left));
  }
  .gate { padding: 0.9rem 0.85rem 1rem; border-radius: 16px; }
  input, button { min-height: 2.65rem; font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .sky, .wash, .grain, .hero, .gate { animation: none; }
}
