/* =====================================================================
   OneFamily — Shared Landing Page Styles
   ===================================================================== */

:root {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-tint: #EFF4FF;
  --accent: #10B981;
  --gradient-from: #2563EB;
  --gradient-to: #1E40AF;
  --bg: #FFFFFF;
  --bg-alt: #F8FAFC;
  --surface: #FFFFFF;
  --border: #E5E7EB;
  --text: #111827;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-lg: 24px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F172A;
    --bg-alt: #1E293B;
    --surface: #1E293B;
    --border: #334155;
    --text: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}

img, svg {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  backdrop-saturate: 1.5;
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  transition: var(--transition);
}

.header.scrolled {
  border-bottom-color: rgba(0, 0, 0, 0.08);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
}

.logo img {
  height: 32px;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

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

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

.nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.2s ease;
  transform-origin: right;
}

.nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
  will-change: transform, box-shadow;
}

.btn-primary {
  background: var(--gradient-from, var(--primary));
  color: white;
  border-color: var(--gradient-from, var(--primary));
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  border-color: var(--primary-hover);
}

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

.btn-secondary:hover {
  background: var(--bg-alt);
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1.05rem;
}

/* Hero */
.hero {
  padding: 120px 0 80px;
  background: linear-gradient(135deg, var(--gradient-from, var(--primary)) 0%, var(--gradient-to, var(--primary)) 100%);
  color: white;
  text-align: center;
}

.hero .logo img {
  height: 48px;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.hero .tagline {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  opacity: 0.9;
  margin-bottom: 2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero .cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.hero .trust {
  margin-top: 3rem;
  opacity: 0.8;
  font-size: 0.9rem;
}

/* Section */
.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.section-title p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto;
}

/* Features Grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  animation: card-enter 0.5s ease both;
  animation-fill-mode: both;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-tint);
}

.feature-card .feature-icon {
  width: 56px;
  height: 56px;
  background: var(--primary-tint);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--primary);
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

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

/* How it works */
.how-it-works {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.how-step {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 2rem;
  align-items: start;
}

.how-step.reverse {
  grid-template-areas: '. content';
  grid-template-columns: 1fr 60px;
}

.how-step .step-number {
  grid-area: auto;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.how-step .step-content {
  grid-area: content;
}

.how-step.reverse .step-number {
  grid-area: content;
  text-align: right;
}

.how-step.reverse .step-content {
  grid-area: auto;
}

.step-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.step-content p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Pricing */
.pricing {
  text-align: center;
}

.pricing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  font-size: 1rem;
}

.plan-toggle {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 32px;
}

.plan-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.plan-toggle .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 32px;
  transition: var(--transition);
}

.plan-toggle .slider::before {
  content: '';
  position: absolute;
  content: '';
  height: 24px;
  width: 24px;
  left: 4px;
  bottom: 4px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}

.plan-toggle input:checked + .slider {
  background: var(--primary);
}

.plan-toggle input:checked + .slider::before {
  transform: translateX(24px);
}

.yearly-discount {
  display: inline-block;
  background: #DCFCE7;
  color: #166534;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-left: 0.5rem;
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.pricing-card.popular {
  border-color: var(--primary);
  position: relative;
}

.pricing-card.popular::before {
  content: 'Most Popular';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 0.25rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pricing-card .price {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 1.5rem 0;
}

.pricing-card .price .period {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.pricing-card ul {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.pricing-card ul li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
}

.pricing-card ul li:last-child {
  border-bottom: none;
}

.price-monthly, .price-yearly {
  display: block;
}

/* Screenshots */
.screenshot-showcase {
  text-align: center;
}

.screenshot-container {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  margin-top: 2rem;
  animation: screenshot-enter 0.6s ease 0.2s both;
}

@keyframes screenshot-enter {
  from { opacity: 0; transform: scale(0.98) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.screenshot-container img {
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 100%;
  margin: 0 auto;
  display: block;
}

/* FAQ */
.faq {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  padding: 1.25rem 0;
  background: none;
  border: none;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.faq-question:hover {
  color: var(--primary);
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.faq-item.open .faq-question::after {
  content: '−';
  color: var(--primary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer p {
  padding: 0.75rem 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Footer */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Animations */
@keyframes card-enter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-enter {
  opacity: 0;
}

.card-enter.in-view {
  animation: card-enter 0.5s ease forwards;
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.in-view {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.stagger-children.in-view > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.25s; }

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 1rem;
  }

  .hero {
    padding: 100px 0 60px;
  }

  .how-step {
    grid-template-columns: 50px 1fr;
    gap: 1.5rem;
  }

  .hero .cta-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }

  .nav {
    display: none;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 60px 0;
  }

  .pricing-card {
    padding: 2rem;
  }

  .pricing-card .price {
    font-size: 2rem;
  }
}
