/* ============================================
   MarkDownload — Light SaaS Analytics Style
   Glassmorphism + Flat Design (Light)
   ============================================ */

/* --- Design Tokens --- */
:root {
  --bg-base: #fafafa;
  --bg-surface: #ffffff;
  --bg-elevated: #f5f5f7;
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-medium: rgba(0, 0, 0, 0.1);
  --text-primary: #1a1a2e;
  --text-secondary: #5c5c7a;
  --text-muted: #9a9ab0;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-dark: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.12);
  --accent-teal: #14b8a6;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-sky: #0ea5e9;
  --accent-violet: #8b5cf6;
  --gradient-accent: linear-gradient(135deg, #6366f1, #818cf8);
  --gradient-hero: linear-gradient(180deg, rgba(99, 102, 241, 0.06) 0%, transparent 60%);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Fira Code', 'SF Mono', 'Consolas', monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.08);
  --transition: 0.2s ease;
  --container-max: 1200px;
  --header-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dark); }
ul { list-style: none; }

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 1000;
  transition: top var(--transition);
}
.skip-link:focus { top: 16px; }

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

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
  color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}
.btn-ghost:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm { padding: 6px 14px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* --- Glass Card --- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

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

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}
.nav-brand:hover { color: var(--text-primary); }

.nav-logo { border-radius: 6px; }

.nav-brand-text {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.active { color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* --- Hero --- */
.hero {
  padding: 140px 0 80px;
  position: relative;
  overflow: hidden;
}

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

.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 20px;
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.hero-title {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.hero-stats {
  display: flex;
  gap: 32px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
}
.hero-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}
.hero-stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.hero-visual { position: relative; }

.hero-preview {
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.preview-header {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}
.preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-medium);
}

.preview-code {
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.8;
  color: var(--text-secondary);
  overflow-x: auto;
  background: var(--bg-surface);
}

.code-heading { color: var(--text-primary); font-weight: 600; }
.code-meta { color: var(--text-muted); }
.code-key { color: var(--accent); }
.code-string { color: var(--accent-teal); }
.code-bold { color: var(--text-primary); font-weight: 600; }

.hero-glow {
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08), transparent 70%);
  pointer-events: none;
}

/* --- Trust Bar --- */
.trust-bar {
  padding: 40px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.trust-label {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.trust-badges {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.trust-badge svg { color: var(--accent); }

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

.section-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

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

/* --- Features Grid --- */
.features { padding: 80px 0; }

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

.feature-card {
  padding: 32px;
  border-radius: var(--radius-lg);
}

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

.feature-icon--indigo { background: rgba(99, 102, 241, 0.1); color: #6366f1; }
.feature-icon--teal { background: rgba(20, 184, 166, 0.1); color: #14b8a6; }
.feature-icon--amber { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.feature-icon--rose { background: rgba(244, 63, 94, 0.1); color: #f43f5e; }
.feature-icon--sky { background: rgba(14, 165, 233, 0.1); color: #0ea5e9; }
.feature-icon--violet { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

.feature-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- Formats Grid --- */
.formats { padding: 80px 0; background: var(--bg-surface); }

.formats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.format-card {
  padding: 24px;
  text-align: center;
  border-radius: var(--radius-lg);
}

.format-ext {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 12px;
}

.format-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

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

/* --- Workflow --- */
.workflow { padding: 80px 0; }

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

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

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

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

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

.workflow-connector {
  width: 48px;
  height: 2px;
  background: var(--border-medium);
  margin-top: 24px;
  flex-shrink: 0;
}

/* --- CTA --- */
.cta { padding: 80px 0; }

.cta-inner {
  padding: 64px;
  text-align: center;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(129, 140, 248, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.1);
}

.cta-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}

.cta-subtitle {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.cta-actions { margin-bottom: 20px; }

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

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

.footer-inner { display: grid; gap: 40px; }

.footer-brand { max-width: 300px; }

.footer-tagline {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

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

.footer-col a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: block;
  padding: 4px 0;
}
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-email a { color: var(--text-muted); }
.footer-email a:hover { color: var(--accent); }

/* --- Page Hero (sub-pages) --- */
.page-hero {
  padding: 120px 0 60px;
  text-align: center;
  background: var(--gradient-hero);
}

.page-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.page-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --- Content Sections --- */
.content-section { padding: 80px 0; }

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

.content-card {
  padding: 32px;
  border-radius: var(--radius-lg);
}

.content-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
}

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

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

.content-card code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

/* --- Legal Pages --- */
.legal-content { max-width: 800px; }

.legal-card {
  padding: 48px;
  border-radius: var(--radius-lg);
}

.legal-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.legal-card h2:first-child { margin-top: 0; }

.legal-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal-card p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

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

.legal-card code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.legal-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 16px;
}

.legal-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.legal-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}

/* --- Contact Page --- */
.contact-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: start;
}

.contact-form-wrapper {
  padding: 40px;
  border-radius: var(--radius-lg);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

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

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%235c5c7a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

select.form-input option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-info .content-card { padding: 24px; }
.contact-info .content-card h3 { margin-top: 12px; }

.contact-email {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
  word-break: break-all;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .formats-grid { grid-template-columns: repeat(2, 1fr); }
  .workflow-steps { flex-direction: column; align-items: center; }
  .workflow-connector { width: 2px; height: 32px; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    padding: 16px 24px;
    gap: 12px;
  }
  .nav-links.active { display: flex; }
  .nav-toggle { display: flex; }
  .site-header .btn { display: none; }
  .hero { padding: 110px 0 60px; }
  .features-grid { grid-template-columns: 1fr; }
  .formats-grid { grid-template-columns: 1fr 1fr; }
  .cta-inner { padding: 40px 24px; }
  .footer-links { grid-template-columns: 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .legal-card { padding: 24px; }
  .contact-form-wrapper { padding: 24px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .formats-grid { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: 1fr; gap: 24px; }
  .trust-badges { gap: 20px; }
}

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

.hero-content { animation: fadeInUp 0.6s ease-out; }
.hero-visual { animation: fadeInUp 0.6s ease-out 0.15s both; }
.trust-bar { animation: fadeInUp 0.6s ease-out 0.3s both; }

.feature-card,
.format-card,
.workflow-step,
.content-card {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.feature-card.visible,
.format-card.visible,
.workflow-step.visible,
.content-card.visible {
  opacity: 1;
  transform: translateY(0);
}

::selection {
  background: rgba(99, 102, 241, 0.2);
  color: var(--text-primary);
}