/* CSS Custom Properties */
:root {
  --bg: #0f172a;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --accent-1: #10b981;
  --accent-2: #059669;
  --success: #4ade80;
  --error: #f87171;
  --border: #334155;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body.matrix-body {
  background: #000000;
  position: relative;
}

.matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.matrix-content {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Main Content */
.main {
  flex: 1;
  padding: 3rem 0;
}

/* Hero Section */
.hero {
  position: relative;
  text-align: center;
  margin-bottom: 3rem;
  padding: 4rem 0;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: -100px;
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(129, 140, 248, 0.05));
  border-radius: 50%;
  filter: blur(60px);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -80px;
  right: -100px;
  width: 250px;
  height: 250px;
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.1), rgba(56, 189, 248, 0.05));
  border-radius: 50%;
  filter: blur(60px);
}

.hero-content {
  position: relative;
  z-index: 1;
}

/* Matrix Text Component */
.matrix-text {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  display: block;
  font-family: 'Monaco', 'Courier New', monospace;
  letter-spacing: 0.02em;
}

.matrix-letter {
  display: inline-block;
  width: 1ch;
  text-align: center;
  overflow: hidden;
  color: var(--text);
  transition: color 0.1s ease;
}

.matrix-letter.matrix-space {
  width: 1ch;
}

.matrix-letter.matrix-active {
  color: #00ff00;
  text-shadow: 0 2px 4px rgba(0, 255, 0, 0.5);
  font-weight: 900;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 100%;
  margin: 0 auto;
}

/* Form Section */
.form-section {
  margin-bottom: 3rem;
}

/* CTA Card */
.cta-card {
  max-width: 500px;
  margin: 0 auto;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.cta-card:hover {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.cta-card-light {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border);
}

.cta-card-dark {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(30, 41, 59, 0.8);
}

.cta-card-gradient {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
}

.cta-card-content {
  padding: 2rem;
}

.cta-card-badge {
  display: inline-block;
  margin-bottom: 1rem;
}

.badge-text {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-1);
}

.cta-card-light .badge-text {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-1);
}

.cta-card-dark .badge-text {
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-1);
}

.cta-card-gradient .badge-text {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.cta-card-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.cta-card-icon {
  font-size: 1.5rem;
  margin-right: 0.75rem;
  padding: 0.5rem;
  background: rgba(56, 189, 248, 0.2);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta-card-dark .cta-card-icon {
  background: rgba(56, 189, 248, 0.15);
}

.cta-card-gradient .cta-card-icon {
  background: rgba(255, 255, 255, 0.2);
}

.cta-card-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-1);
}

.cta-card-gradient .cta-card-label {
  color: white;
}

.cta-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
  line-height: 1.3;
}

.cta-card-gradient .cta-card-title {
  color: white;
}

.cta-card-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.cta-card-gradient .cta-card-description {
  color: rgba(255, 255, 255, 0.9);
}

.form-container {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 2rem;
}

.cta-input {
  background: rgba(15, 23, 42, 0.5) !important;
  border-color: var(--border) !important;
}

.cta-input:focus {
  border-color: var(--accent-1) !important;
}

.form-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#email-input {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: rgba(15, 23, 42, 0.5);
  color: var(--text);
  font-size: 1rem;
  transition: all 0.2s ease;
}

#email-input:focus {
  outline: none;
  border-color: var(--accent-1);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

#email-input::placeholder {
  color: var(--text-secondary);
}

#email-input.error {
  border-color: var(--error);
}

.form-message {
  min-height: 1.25rem;
  font-size: 0.875rem;
  color: var(--error);
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-0.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-0.25rem);
  }
  75% {
    transform: translateX(0.25rem);
  }
}

#email-input.shake {
  animation: shake 0.4s ease;
}

.cta-button {
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 0.375rem;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: var(--bg);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cta-button:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(56, 189, 248, 0.3);
}

.cta-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Success Message */
.success-message {
  text-align: center;
  padding: 2rem;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid var(--success);
  border-radius: 0.5rem;
  animation: slideIn 0.3s ease;
}

.success-message h3 {
  font-size: 1.3rem;
  color: var(--success);
  margin-bottom: 0.5rem;
}

.success-message p {
  color: var(--text-secondary);
}

/* Benefits Section */
.benefits {
  margin-top: 3rem;
}

.benefits-title {
  font-size: 1.3rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 2rem;
}

.benefits-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.benefit-item {
  padding: 1.5rem;
  background: rgba(30, 41, 59, 0.3);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  text-align: center;
}

.benefit-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.benefit-item h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.benefit-item p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 3rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Tablet and Desktop - 640px and up */
@media (min-width: 640px) {
  .container {
    padding: 0 2rem;
  }

  .matrix-text {
    font-size: 3rem;
  }

  .hero-subtitle {
    font-size: 1.15rem;
  }

  .form-container {
    padding: 2.5rem;
  }

  .signup-form {
    flex-direction: row;
    gap: 0.75rem;
  }

  .form-group {
    flex: 1;
    margin-bottom: 0;
  }

  #email-input {
    padding: 0.875rem;
  }

  .cta-button {
    padding: 0.875rem 2rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .benefits-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  .benefit-item {
    padding: 2rem 1.5rem;
  }
}

/* Large Desktop - 1024px and up */
@media (min-width: 1024px) {
  .matrix-text {
    font-size: 3.5rem;
  }

  .hero-subtitle {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
  }

  .form-container {
    max-width: 500px;
    margin: 0 auto;
  }

  .signup-form {
    flex-direction: column;
  }

  .form-group {
    width: 100%;
  }
}

/* Scramble Text Effects */
[data-scramble] {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  display: block;
  font-family: 'Monaco', 'Courier New', monospace;
  letter-spacing: -0.01em;
  word-spacing: -0.1em;
  color: var(--text);
}

#scrambled-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  display: block;
  font-family: 'Monaco', 'Courier New', monospace;
  letter-spacing: -0.01em;
  word-spacing: -0.1em;
  color: var(--text);
  min-height: 3.5rem;
}

.dud {
  color: #00ff00;
  text-shadow: 0 2px 4px rgba(0, 255, 0, 0.5);
  font-weight: 900;
  animation: flicker 0.15s;
}

@keyframes flicker {
  0%, 18%, 22%, 25%, 54%, 57%, 100% {
    text-shadow:
      0 0 5px rgba(0, 255, 0, 0.5),
      0 0 10px rgba(0, 255, 0, 0.3);
  }
  20%, 24%, 55% {
    text-shadow: none;
  }
}

@media (min-width: 640px) {
  [data-scramble],
  #scrambled-title {
    font-size: 3rem;
  }

  #scrambled-title {
    min-height: 4rem;
  }
}

@media (min-width: 1024px) {
  [data-scramble],
  #scrambled-title {
    font-size: 3.5rem;
  }

  #scrambled-title {
    min-height: 4.5rem;
  }
}
