/* ============================================================
   Nordic Frost Design System — eventpipe.dev
   Light theme, Scandinavian minimalism, blue accents
   ============================================================ */

/* 1. Font Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* 2. CSS Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: #f8f9fb;
  color: #5a6170;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
ul, ol { list-style: none; }

/* 3. CSS Custom Properties */
:root {
  --bg-primary: #f8f9fb;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f2f5;
  --bg-card: #ffffff;
  --text-primary: #1a1d23;
  --text-secondary: #5a6170;
  --text-muted: #8b919e;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: rgba(37, 99, 235, 0.08);
  --accent-border: rgba(37, 99, 235, 0.2);
  --success: #059669;
  --warning: #d97706;
  --error: #dc2626;
  --border: #e2e5eb;
  --tint: #eef2ff;
  --max-width: 1200px;
  --nav-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 4. Typography */
h1 {
  font-family: 'Inter', sans-serif;
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

h2 {
  font-family: 'Inter', sans-serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h3 {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

p {
  margin-bottom: 16px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

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

code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--text-primary);
}

small {
  font-size: 14px;
  color: var(--text-muted);
}

/* 5. Utility Classes */
.container {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

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

/* 6. Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(248, 249, 251, 0.85);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

.navbar-inner {
  display: flex;
  align-items: center;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px;
  width: 100%;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 18px;
}

.navbar-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.navbar-links {
  display: flex;
  gap: 32px;
  margin-left: 48px;
}

.navbar-links a {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

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

.navbar-actions {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

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

.navbar-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.2s;
}

.navbar-mobile {
  display: none;
  flex-direction: column;
  position: absolute;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  gap: 12px;
  z-index: 999;
}

.navbar-mobile.active {
  display: flex;
}

.navbar-mobile a {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 0;
  transition: color 0.2s;
}

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

/* 7. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  color: white;
}

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

.btn-secondary:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

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

.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-full {
  width: 100%;
}

/* 8. Hero */
.hero {
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
}

.hero-subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 20px auto 32px;
  line-height: 1.6;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-badge {
  margin-bottom: 20px;
}

/* 9. Trust Pills */
.trust-pills {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 40px;
  justify-content: center;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* 10. Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.badge-accent {
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

/* 11. Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-subtle);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 24px;
  flex-shrink: 0;
}

/* 12. Feature Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* 13. Pricing Grid + Pricing Cards */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 40px 32px;
  box-shadow: var(--shadow-sm);
}

.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(37, 99, 235, 0.12);
  position: relative;
}

.pricing-card .plan-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.pricing-card .price {
  font-size: 48px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.pricing-card .price span {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
}

.pricing-card .price-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 24px;
}

.pricing-card .feature-list {
  margin: 24px 0;
}

.pricing-card .feature-list li {
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text-secondary);
}

.pricing-card .feature-list li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
}

.pricing-card .feature-list li.disabled {
  color: var(--text-muted);
}

.pricing-card .feature-list li.disabled::before {
  content: '—';
  color: var(--text-muted);
}

.featured-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* 14. Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

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

.form-error {
  color: var(--error);
  font-size: 13px;
  margin-top: 4px;
}

.form-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b919e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* 15. Auth Pages */
.auth-page {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.auth-card h2 {
  font-size: 28px;
  text-align: center;
  margin-bottom: 8px;
}

.auth-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 15px;
}

.auth-links {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-muted);
}

.code-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 24px 0;
}

.code-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.code-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.auth-success {
  text-align: center;
  padding: 20px 0;
}

.auth-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--accent);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

/* 16. Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 17. Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s;
  z-index: 9999;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

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

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px;
}

.footer-column h4 {
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  margin-bottom: 16px;
  font-size: 15px;
}

.footer-column a {
  display: block;
  color: var(--text-muted);
  font-size: 14px;
  padding: 4px 0;
  transition: color 0.2s;
  text-decoration: none;
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding: 24px 24px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}

/* 19. API Docs */
.api-section {
  margin-bottom: 48px;
}

.api-nav {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 40px;
}

.api-nav a {
  display: block;
  padding: 6px 0;
  color: var(--text-secondary);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s;
}

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

.endpoint-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  overflow: hidden;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-tertiary);
}

.method-badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.method-badge.get {
  background: #dcfce7;
  color: #166534;
}

.method-badge.post {
  background: #dbeafe;
  color: #1e40af;
}

.method-badge.delete {
  background: #fee2e2;
  color: #991b1b;
}

.method-badge.put {
  background: #fef3c7;
  color: #92400e;
}

.endpoint-path {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.endpoint-body {
  padding: 24px;
}

.endpoint-desc {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  margin: 16px 0;
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.param-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.param-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.param-name {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  font-weight: 500;
}

.param-type {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  font-size: 13px;
}

.param-required {
  color: var(--error);
  font-size: 12px;
  font-weight: 600;
}

/* 20. Steps (How it works) */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.step {
  text-align: center;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-subtle);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  margin-bottom: 16px;
  border: 2px solid var(--accent-border);
}

/* 21. Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: center;
  padding: 48px 0;
}

.stat-value {
  font-size: 40px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 22. Contact Page */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

/* 23. Legal Pages */
.legal-content {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding: 60px 24px;
}

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

.legal-content .last-updated {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 40px;
}

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

.legal-content h3 {
  font-size: 18px;
  margin-top: 24px;
  margin-bottom: 12px;
}

.legal-content p,
.legal-content li {
  color: var(--text-secondary);
  line-height: 1.7;
}

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

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

/* 24. Team Grid */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.team-member {
  text-align: center;
}

.team-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

.team-member h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.team-member p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* 25. FAQ (details/summary) */
details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 15px;
  list-style: none;
  transition: background 0.2s;
}

summary:hover {
  background: var(--bg-tertiary);
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  float: right;
  color: var(--text-muted);
  font-weight: 400;
}

details[open] summary::after {
  content: '−';
}

details .faq-answer {
  padding: 0 20px 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 26. CTA Section */
.cta-section {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 80px 0;
  text-align: center;
}

.cta-section h2 {
  margin-bottom: 12px;
}

.cta-section p {
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 24px;
}

/* 27. Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header p {
  max-width: 600px;
  margin: 8px auto 0;
}

/* 28. Responsive */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

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

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

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

@media (max-width: 768px) {
  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 28px;
  }

  .section {
    padding: 48px 0;
  }

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

  .navbar-links,
  .navbar-actions {
    display: none;
  }

  .navbar-burger {
    display: flex;
    margin-left: auto;
  }

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

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

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

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

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

  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }
}
