:root {
  color-scheme: light;
  --color-background: #fafafc;
  --color-foreground: #18181b;
  --color-input-bg: #ffffff;
  --color-input-border: #e4e4e7;
  --color-button-bg: #5b4cdb;
  --color-button-text: #ffffff;
  --color-muted: #71717a;
  --color-link: #5b4cdb;
  --color-surface: #ffffff;
  --color-panel: #f4f4f8;
  --color-nav-active: #e9e9ef;
  --color-badge: #f4f4f8;
  --color-avatar: #e4e4e7;
  --color-avatar-foreground: #0891b2;
  --color-border: var(--color-input-border);
  --color-accent: var(--color-button-bg);
  --color-cyan: #0891b2;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-background: #09090b;
  --color-foreground: #f4f4f5;
  --color-input-bg: #111116;
  --color-input-border: #27272f;
  --color-button-bg: #8075f5;
  --color-button-text: #09090b;
  --color-muted: #a1a1aa;
  --color-link: #8075f5;
  --color-surface: #111116;
  --color-panel: #18181f;
  --color-nav-active: #27272f;
  --color-badge: #18181f;
  --color-avatar: #27272f;
  --color-avatar-foreground: #22d3ee;
  --color-cyan: #22d3ee;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-foreground);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.site-shell {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: var(--color-background);
}

.site-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 4rem 1.5rem;
}

.hero {
  position: relative;
  isolation: isolate;
  width: min(100%, 660px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-orb {
  position: relative;
  width: min(78vw, 360px);
  aspect-ratio: 1;
  margin-bottom: 2.25rem;
  border-radius: 50%;
  pointer-events: none;
}

.hero-orb-light {
  position: absolute;
  inset: -4px;
  z-index: 0;
  border-radius: 50%;
  background: conic-gradient(
    from -100deg,
    transparent 0deg,
    rgba(128, 117, 245, 0.08) 28deg,
    #8075f5 84deg,
    #22d3ee 168deg,
    rgba(34, 211, 238, 0.08) 220deg,
    transparent 245deg
  );
  animation: orb-light-sweep 10s ease-in-out infinite alternate;
}

.hero-orb-light::before {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  background: inherit;
  filter: blur(20px);
  opacity: 0.72;
}

.hero-orb-disc {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 27%, #12121a, #0b0b0f 67%, var(--color-background));
  box-shadow: inset 0 1px 0 rgba(244, 244, 245, 0.04);
}

@keyframes orb-light-sweep {
  from { transform: rotate(-18deg); }
  to { transform: rotate(18deg); }
}

h1 {
  position: relative;
  margin: 0;
  color: #f4f4f5;
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  font-weight: 750;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.signup-form, .signup-success {
  width: min(100%, 400px);
  margin-top: 2.5rem;
  min-height: 6.3rem;
}

.signup-success {
  color: var(--color-foreground);
  font-size: 0.9rem;
  line-height: 44px;
}

.signup-controls {
  display: flex;
  gap: 0.5rem;
}

.signup-controls input {
  min-width: 0;
  flex: 1;
  height: 44px;
  padding: 0 0.9rem;
  border: 1px solid var(--color-input-border);
  border-radius: 8px;
  outline: none;
  background: var(--color-input-bg);
  color: var(--color-foreground);
  font: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.signup-controls input::placeholder { color: var(--color-muted); }
.signup-controls input:hover { border-color: #52525b; }
.signup-controls input:focus-visible {
  border-color: #71717a;
  box-shadow: 0 0 0 3px rgba(113, 113, 122, 0.18);
}

.signup-controls input:-webkit-autofill {
  -webkit-text-fill-color: var(--color-foreground);
  box-shadow: 0 0 0 1000px var(--color-input-bg) inset;
}

.signup-controls input:-webkit-autofill:focus-visible {
  box-shadow: 0 0 0 1000px var(--color-input-bg) inset, 0 0 0 3px rgba(113, 113, 122, 0.18);
}

.signup-controls button {
  height: 44px;
  padding: 0 1rem;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(110deg, #8075f5 0%, #22d3ee 50%, #8075f5 100%);
  background-size: 200% 100%;
  color: #09090b;
  font: inherit;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.18), 0 4px 16px rgba(34, 211, 238, 0.1);
  animation: signup-gradient 8s ease-in-out infinite alternate;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.signup-controls button:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.24), 0 7px 20px rgba(34, 211, 238, 0.18);
}
.signup-controls button:focus-visible { outline: 3px solid rgba(128, 117, 245, 0.5); outline-offset: 2px; }

@keyframes signup-gradient {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

.signup-message {
  margin: 0.85rem 0 0;
  min-height: 2.7rem;
  color: #86efac;
  font-size: 0.9rem;
  line-height: 1.35rem;
}

.signup-message-error { color: #fda4af; }

.signup-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.preferences {
  width: min(100%, 500px);
  padding: 2.5rem;
  border: 1px solid var(--color-input-border);
  border-radius: 16px;
  background: var(--color-surface);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.14);
}

.preferences-eyebrow {
  color: var(--color-cyan);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.preferences h1 { margin-top: 1.25rem; font-size: clamp(2rem, 5vw, 3rem); }
.preferences-copy { margin: 1.25rem 0 0; color: var(--color-muted); line-height: 1.6; }
.preferences-message { margin: 1rem 0 0; color: #86efac; line-height: 1.5; }
.preferences-message-error { color: #fda4af; }

.preferences-button {
  margin-top: 2rem;
  padding: 0.8rem 1rem;
  border: 1px solid #52525b;
  border-radius: 8px;
  background: var(--color-panel);
  color: var(--color-foreground);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}
.preferences-button:hover { background: #25252d; border-color: #71717a; }
.preferences-button:focus-visible, .preferences-home:focus-visible { outline: 2px solid var(--color-cyan); outline-offset: 3px; }
.preferences-home { display: block; width: fit-content; margin-top: 2rem; color: var(--color-muted); font-size: 0.875rem; }
.preferences-home:hover { color: var(--color-foreground); }

@media (prefers-reduced-motion: reduce) {
  .hero-orb-light { animation: none; }
  .signup-controls input { transition: none; }
  .signup-controls button { animation: none; transition: none; }
  .signup-controls button:hover { transform: none; }
  .preferences-button { transition: none; }
}

@media (max-width: 560px) {
  .site-main { padding: 3rem 1rem; }
  .hero-orb { margin-bottom: 1.75rem; }
  .signup-form, .signup-success { margin-top: 2rem; }
  .preferences { padding: 2rem 1.5rem; }
}

@media (max-width: 380px) {
  .signup-controls { flex-direction: column; }
  .signup-controls button { width: 100%; }
  .signup-form, .signup-success { min-height: 9.55rem; }
}
