/* ==========================================================================
   Tapestry — Marketing Site Styles
   ========================================================================== */

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

:root {
  --bg: #09090b;
  --bg-raised: #18181b;
  --bg-elevated: #27272a;
  --border: #3f3f46;
  --border-subtle: #27272a;
  --text: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --indigo: #6366f1;
  --indigo-light: #818cf8;
  --indigo-dim: #4338ca;
  --teal: #14b8a6;
  --teal-light: #2dd4bf;
  --rose: #f43f5e;
  --rose-light: #fb7185;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nav-height: 64px;
  --container: 1120px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul { list-style: none; }
img { max-width: 100%; display: block; }

/* --- Container --- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--indigo-light);
  border-color: var(--indigo-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.3);
}

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

.btn-outline:hover {
  border-color: var(--text-secondary);
  background: var(--bg-raised);
}

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

.btn-ghost:hover {
  color: var(--text);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: var(--radius);
}

.btn-block {
  width: 100%;
}

.btn-nav {
  padding: 8px 18px;
  font-size: 0.875rem;
}

.arrow {
  transition: transform 0.2s;
}

.btn-ghost:hover .arrow {
  transform: translateY(2px);
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  background: transparent;
}

.nav-scrolled {
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-logo-icon {
  flex-shrink: 0;
}

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

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

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s;
  border-radius: 1px;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-height) + 40px) 0 80px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.12) 0%, rgba(20, 184, 166, 0.05) 40%, transparent 70%);
  pointer-events: none;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--indigo-light);
  padding: 6px 14px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 100px;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-title-accent {
  display: block;
  background: linear-gradient(135deg, var(--indigo-light), var(--teal-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

#hero-network {
  width: 100%;
  max-width: 560px;
  height: auto;
  filter: drop-shadow(0 0 60px rgba(99, 102, 241, 0.15));
}

.node-pulse {
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { r: 12; opacity: 1; }
  50% { r: 15; opacity: 0.8; }
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section {
  padding: 120px 0;
}

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

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 16px;
}

.section-sub {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
}

/* --- Problem --- */
.section-problem {
  border-top: 1px solid var(--border-subtle);
}

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

.stat-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s;
}

.stat-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--indigo-light), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.stat-source {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.problem-text {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.problem-text strong {
  color: var(--text);
}

/* --- Features --- */
.section-features {
  border-top: 1px solid var(--border-subtle);
}

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

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

.feature-card:hover {
  border-color: var(--border);
  transform: translateY(-3px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
}

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

/* --- How It Works --- */
.section-how {
  border-top: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, var(--bg) 0%, rgba(99, 102, 241, 0.03) 50%, var(--bg) 100%);
}

.steps-grid {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  max-width: 900px;
  margin: 0 auto;
}

.step {
  flex: 1;
  text-align: center;
  padding: 0 24px;
}

.step-number {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 700;
  background: var(--indigo);
  color: #fff;
  border-radius: 50%;
  margin-bottom: 20px;
}

.step h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
}

.step p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.step-connector {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--indigo), var(--teal));
  margin-top: 23px;
  flex-shrink: 0;
  opacity: 0.4;
}

/* --- Pricing --- */
.section-pricing {
  border-top: 1px solid var(--border-subtle);
}

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

.pricing-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px;
  position: relative;
  transition: border-color 0.3s, transform 0.3s;
}

.pricing-card:hover {
  transform: translateY(-3px);
}

.pricing-card-featured {
  border-color: var(--indigo);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, var(--bg-raised) 100%);
}

.pricing-card-featured:hover {
  border-color: var(--indigo-light);
}

.pricing-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
  background: rgba(20, 184, 166, 0.1);
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.pricing-tier {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.pricing-price {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.pricing-price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pricing-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.pricing-features {
  margin-bottom: 32px;
}

.pricing-features li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-features li::before {
  content: '';
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.3 4.3L6 11.6L2.7 8.3' stroke='%2314b8a6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

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

/* --- Waitlist --- */
.section-waitlist {
  border-top: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, var(--bg) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.waitlist-inner {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.waitlist-form {
  margin-top: 40px;
}

.form-row {
  display: flex;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}

.form-row input[type="email"] {
  flex: 1;
  padding: 14px 18px;
  font-family: var(--font);
  font-size: 0.9375rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.form-row input[type="email"]::placeholder {
  color: var(--text-muted);
}

.form-row input[type="email"]:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 16px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 64px 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand .nav-logo {
  margin-bottom: 12px;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 280px;
}

.footer-links h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-links a {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 6px 0;
  transition: color 0.2s;
}

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

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
}

.footer-bottom p {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Blog
   ========================================================================== */
.section-blog {
  padding-top: calc(var(--nav-height) + 60px);
  min-height: 70vh;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.blog-card {
  display: block;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.3s, transform 0.3s;
}

.blog-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
}

.blog-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.blog-title {
  font-size: 1.25rem;
  margin: 8px 0;
}

.blog-excerpt {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.blog-empty {
  text-align: center;
  padding: 80px 0;
}

.blog-empty p {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ==========================================================================
   Privacy / Prose
   ========================================================================== */
.section-privacy {
  padding-top: calc(var(--nav-height) + 60px);
}

.prose {
  max-width: 720px;
  margin: 0 auto;
}

.prose h1 {
  font-size: 2.25rem;
  margin-bottom: 8px;
}

.privacy-updated {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 40px;
}

.prose h2 {
  font-size: 1.375rem;
  margin-top: 48px;
  margin-bottom: 16px;
}

.prose h3 {
  font-size: 1.1rem;
  margin-top: 32px;
  margin-bottom: 12px;
}

.prose p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.7;
}

.prose a {
  color: var(--indigo-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--indigo);
}

.prose ul {
  margin-bottom: 16px;
  padding-left: 0;
}

.prose li {
  color: var(--text-secondary);
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
  line-height: 1.7;
}

.prose li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--indigo);
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

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

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

/* Stagger feature cards */
.features-grid .feature-card:nth-child(2) { transition-delay: 0.1s; }
.features-grid .feature-card:nth-child(3) { transition-delay: 0.2s; }
.features-grid .feature-card:nth-child(4) { transition-delay: 0.3s; }
.features-grid .feature-card:nth-child(5) { transition-delay: 0.4s; }
.features-grid .feature-card:nth-child(6) { transition-delay: 0.5s; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-sub {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-ctas {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
    max-width: 400px;
    margin: 0 auto;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 48px;
  }

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

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

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

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(9, 9, 11, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 24px;
    flex-direction: column;
    gap: 16px;
    border-bottom: 1px solid var(--border-subtle);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a:not(.btn) {
    font-size: 1rem;
    padding: 8px 0;
  }

  .nav-links .btn-nav {
    width: 100%;
    text-align: center;
    padding: 12px;
    margin-top: 8px;
  }

  .hero {
    min-height: auto;
    padding: calc(var(--nav-height) + 40px) 0 60px;
  }

  .hero-title {
    font-size: 2rem;
  }

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

  .steps-grid {
    flex-direction: column;
    align-items: center;
    gap: 32px;
  }

  .step-connector {
    width: 2px;
    height: 32px;
    margin-top: 0;
  }

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

  .form-row .btn {
    width: 100%;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

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

  .hero-title {
    font-size: 1.75rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .stat-number {
    font-size: 2.5rem;
  }

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

/* Trust Section */
.section-trust {
  padding: 5rem 0;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.03) 0%, transparent 100%);
}

.trust-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.trust-badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #818cf8;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
}

.trust-headline {
  font-size: 2rem;
  font-weight: 700;
  color: #f4f4f5;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.trust-sub {
  font-size: 1.05rem;
  color: #a1a1aa;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.trust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  text-align: left;
}

.trust-item {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: rgba(24, 24, 27, 0.6);
  border: 1px solid rgba(63, 63, 70, 0.3);
}

.trust-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.trust-text strong {
  display: block;
  color: #e4e4e7;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.trust-text span {
  color: #71717a;
  font-size: 0.8rem;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .trust-grid {
    grid-template-columns: 1fr;
  }
  .trust-headline {
    font-size: 1.5rem;
  }
}
