/* ============================================
   RobotX – Shared Stylesheet
   ============================================ */

/* --- Custom Properties --- */
:root {
  --bg-dark: #0a0a0f;
  --bg-dark-secondary: #12121a;
  --bg-dark-tertiary: #1a1a2e;
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-secondary: #22d3ee;
  --accent-gradient: linear-gradient(135deg, #6366f1, #22d3ee);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --border: rgba(255, 255, 255, 0.08);
  --success: #22c55e;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-secondary);
}

img {
  max-width: 100%;
  display: block;
}

/* --- Typography --- */
h1, h2, h3 {
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.25rem; }

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo a {
  color: var(--text-primary);
}

.logo a:hover {
  color: var(--text-primary);
}

.logo .logo-accent {
  color: var(--accent-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 80px 0;
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  pointer-events: none;
}

.hero::before {
  width: 600px;
  height: 600px;
  background: var(--accent-primary);
  top: -200px;
  right: -100px;
}

.hero::after {
  width: 500px;
  height: 500px;
  background: var(--accent-secondary);
  bottom: -150px;
  left: -100px;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.hero h1 {
  margin-bottom: 24px;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.25rem;
  margin-bottom: 40px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* --- Features --- */
.features {
  background: var(--bg-dark-secondary);
}

.features .section-header {
  text-align: center;
  margin-bottom: 64px;
}

.features .section-header h2 {
  margin-bottom: 16px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform 0.25s, border-color 0.25s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.3);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.1);
  margin-bottom: 20px;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent-primary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-card h3 {
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- Invite Section --- */
.invite {
  text-align: center;
}

.invite .section-header {
  margin-bottom: 48px;
}

.invite .section-header h2 {
  margin-bottom: 16px;
}

.invite-form-wrapper {
  max-width: 480px;
  margin: 0 auto;
}

.invite-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-dark-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-tertiary);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.invite-form .btn {
  width: 100%;
  margin-top: 8px;
}

.form-success {
  display: none;
  text-align: center;
  padding: 40px 24px;
}

.form-success.visible {
  display: block;
}

.form-success .success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.form-success .success-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--success);
  fill: none;
  stroke-width: 2;
}

.form-success h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.form-success p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

/* --- Legal Pages --- */
.legal-content {
  padding-top: 48px;
  padding-bottom: 96px;
}

.legal-content h1 {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.legal-content .last-updated {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  margin-bottom: 48px;
}

.legal-content h2 {
  font-size: 1.375rem;
  margin-top: 40px;
  margin-bottom: 16px;
}

.legal-content p,
.legal-content li {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 16px;
}

.legal-content ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

.legal-content li {
  margin-bottom: 8px;
}

.legal-content a {
  color: var(--accent-primary);
}

/* --- 404 Page --- */
.error-page {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
}

.error-page .error-code {
  font-size: 8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 24px;
}

.error-page h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.error-page p {
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Scroll Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.75rem; }

  .section { padding: 64px 0; }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(12px);
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .site-footer .container {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 2rem; }

  .hero { min-height: auto; padding: 60px 0; }
  .hero p { font-size: 1.05rem; }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    padding: 24px;
  }
}
