/* ============================================
   NOSTRIGA — A Guide to the Nostr Protocol
   Custom Styles
   ============================================ */

/* --- CSS Variables --- */
:root {
  --color-bg-dark: #0a0612;
  --color-bg-card: #130e1f;
  --color-bg-card-hover: #1a1230;
  --color-purple: #8B5CF6;
  --color-purple-light: #a78bfa;
  --color-purple-glow: rgba(139, 92, 246, 0.15);
  --color-pink: #EC4899;
  --color-pink-light: #f9a8d4;
  --color-cyan: #06B6D4;
  --color-cyan-light: #67e8f9;
  --color-amber: #F59E0B;
  --color-green: #10B981;
  --color-text: #e8e0f0;
  --color-text-muted: #9587ab;
  --color-border: rgba(139, 92, 246, 0.15);
  --font-display: 'Outfit', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Global Resets & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  background-color: var(--color-bg-dark);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--color-purple);
  color: #fff;
}

/* --- Background Grain Texture --- */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.font-mono {
  font-family: var(--font-mono);
}

.text-gradient {
  background: linear-gradient(135deg, var(--color-purple) 0%, var(--color-pink) 50%, var(--color-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-alt {
  background: linear-gradient(135deg, var(--color-purple-light), var(--color-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Navigation --- */
.navbar-custom {
  background: rgba(10, 6, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 0;
  transition: var(--transition-smooth);
}

.navbar-custom .navbar-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.navbar-custom .nav-link {
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 1rem !important;
  transition: color var(--transition-smooth);
  position: relative;
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
  color: var(--color-purple-light);
}

.navbar-custom .nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: linear-gradient(90deg, var(--color-purple), var(--color-pink));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--transition-smooth);
  border-radius: 1px;
}

.navbar-custom .nav-link:hover::after,
.navbar-custom .nav-link.active::after {
  transform: scaleX(1);
}

.navbar-toggler {
  border: 1px solid var(--color-border) !important;
  padding: 0.35rem 0.6rem;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(167,139,250,0.8)' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
}

.btn-get-started {
  background: linear-gradient(135deg, var(--color-purple), var(--color-pink));
  color: #fff !important;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.45rem 1.3rem;
  border: none;
  border-radius: 50px;
  transition: all var(--transition-smooth);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.btn-get-started:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
  color: #fff !important;
}

/* --- Hero Section --- */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 80px;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -30%;
  left: -20%;
  width: 70%;
  height: 70%;
  background: radial-gradient(ellipse, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -15%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(236, 72, 153, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: var(--color-purple-light);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  margin-bottom: 1.5rem;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--color-green);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero-title {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 800;
  margin-bottom: 1.2rem;
  color: #fff;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--color-text-muted);
  max-width: 520px;
  margin-bottom: 2rem;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-hero-primary {
  background: linear-gradient(135deg, var(--color-purple), var(--color-pink));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  transition: all var(--transition-smooth);
  box-shadow: 0 4px 25px rgba(139, 92, 246, 0.3);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 35px rgba(139, 92, 246, 0.45);
  color: #fff;
}

.btn-hero-secondary {
  background: rgba(139, 92, 246, 0.1);
  color: var(--color-purple-light);
  font-family: var(--font-display);
  font-weight: 600;
  padding: 0.8rem 2rem;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  font-size: 1rem;
  transition: all var(--transition-smooth);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-hero-secondary:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.5);
  color: #fff;
  transform: translateY(-2px);
}

.hero-network-img {
  width: 100%;
  max-width: 700px;
  height: auto;
  filter: drop-shadow(0 0 40px rgba(139, 92, 246, 0.15));
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.hero-stat-item {
  text-align: left;
}

.hero-stat-number {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

/* --- Sections Common --- */
.section-padding {
  padding: 6rem 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-purple);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 1rem;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 600px;
  line-height: 1.8;
}

/* --- What Is Nostr Section --- */
.what-section {
  position: relative;
}

.what-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}

/* --- Feature Cards --- */
.feature-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 2rem;
  height: 100%;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-purple), var(--color-pink));
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.feature-card:hover {
  background: var(--color-bg-card-hover);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 1.2rem;
}

.feature-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.6rem;
}

.feature-text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* --- How It Works Section --- */
.how-section {
  position: relative;
  background: linear-gradient(180deg, var(--color-bg-dark) 0%, rgba(19, 14, 31, 0.5) 50%, var(--color-bg-dark) 100%);
}

.how-diagram {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: block;
}

/* --- Quote Card --- */
.quote-section {
  position: relative;
}

.quote-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(236, 72, 153, 0.05));
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 20px;
  padding: 2.5rem 3rem;
  position: relative;
}

.quote-card::before {
  content: '"';
  font-family: var(--font-display);
  font-size: 6rem;
  color: var(--color-purple);
  opacity: 0.15;
  position: absolute;
  top: 0.5rem;
  left: 1.5rem;
  line-height: 1;
}

.quote-text {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 500;
  color: var(--color-text);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.quote-author {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-purple-light);
}

/* --- Apps & Resources Section --- */
.apps-section {
  position: relative;
}

.app-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 1.5rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition-smooth);
  height: 100%;
}

.app-card:hover {
  background: var(--color-bg-card-hover);
  border-color: rgba(139, 92, 246, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  text-decoration: none;
}

.app-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.3rem;
}

.app-icon-wrapper.purple { background: rgba(139, 92, 246, 0.15); }
.app-icon-wrapper.pink { background: rgba(236, 72, 153, 0.15); }
.app-icon-wrapper.cyan { background: rgba(6, 182, 212, 0.15); }
.app-icon-wrapper.amber { background: rgba(245, 158, 11, 0.15); }
.app-icon-wrapper.green { background: rgba(16, 185, 129, 0.15); }

.app-info {
  flex: 1;
  min-width: 0;
}

.app-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  margin-bottom: 0.15rem;
}

.app-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.app-platform {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-purple);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

.app-arrow {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  transition: all var(--transition-smooth);
  flex-shrink: 0;
}

.app-card:hover .app-arrow {
  color: var(--color-purple-light);
  transform: translateX(3px);
}

/* --- Event JSON Preview --- */
.json-block {
  background: rgba(10, 6, 18, 0.8);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 1.5rem;
  overflow-x: auto;
  position: relative;
}

.json-block pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--color-text-muted);
}

.json-block .json-key { color: var(--color-purple-light); }
.json-block .json-string { color: var(--color-cyan-light); }
.json-block .json-number { color: var(--color-amber); }
.json-block .json-label {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.5;
}

/* --- FAQ Section --- */
.faq-section .accordion-item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px !important;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-section .accordion-button {
  background: transparent;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  padding: 1.2rem 1.5rem;
  box-shadow: none !important;
  border: none;
}

.faq-section .accordion-button::after {
  filter: brightness(0) invert(0.6);
}

.faq-section .accordion-button:not(.collapsed) {
  background: rgba(139, 92, 246, 0.05);
  color: var(--color-purple-light);
}

.faq-section .accordion-button:not(.collapsed)::after {
  filter: brightness(0) invert(0.7) sepia(1) hue-rotate(220deg);
}

.faq-section .accordion-body {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  padding: 0 1.5rem 1.2rem;
  line-height: 1.8;
}

/* --- CTA Section --- */
.cta-section {
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.1) 0%, transparent 65%);
  pointer-events: none;
}

.cta-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(236, 72, 153, 0.08));
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 24px;
  padding: 3.5rem;
  text-align: center;
  position: relative;
}

.cta-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 1rem;
}

.cta-text {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 500px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

/* --- Footer --- */
.footer-section {
  border-top: 1px solid var(--color-border);
  padding: 3rem 0 2rem;
  background: rgba(10, 6, 18, 0.5);
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color var(--transition-smooth);
  display: block;
  margin-bottom: 0.5rem;
}

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

.footer-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

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

.footer-bottom a {
  color: var(--color-purple-light);
  text-decoration: none;
}

/* --- Animations --- */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

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

/* Staggered delays */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-dark);
}

::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.5);
}

/* --- Responsive Tweaks --- */
@media (max-width: 991.98px) {
  .hero-section {
    text-align: center;
    padding-top: 100px;
  }

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

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

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

  .hero-network-img {
    margin-top: 2rem;
  }

  .section-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .quote-card {
    padding: 2rem;
  }

  .cta-card {
    padding: 2.5rem 1.5rem;
  }
}

@media (max-width: 575.98px) {
  .hero-stats {
    gap: 1.5rem;
  }

  .section-padding {
    padding: 4rem 0;
  }

  .feature-card {
    padding: 1.5rem;
  }

  .quote-card::before {
    font-size: 4rem;
  }
}

/* --- Divider --- */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  margin: 0;
  border: none;
}
