/* MasterMD Marketing Site */

:root {
  --bg: #0a0e14;
  --bg-alt: #0f1419;
  --surface: #161b22;
  --surface-2: #1c2333;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8eef4;
  --text-muted: #8b9cb3;
  --accent: #4a9eff;
  --accent-glow: rgba(74, 158, 255, 0.25);
  --accent-2: #7c5cbf;
  --gradient: linear-gradient(135deg, #4a9eff 0%, #7c5cbf 100%);
  --radius: 12px;
  --radius-lg: 20px;
  --font: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface);
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--accent);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 28px; font-size: 1.05rem; }

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 14, 20, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.site-nav-top {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0.55rem 24px 0;
}

.back-home {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  transition: color 0.2s;
}

.back-home:hover {
  color: var(--text);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

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

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-links a:focus-visible,
.logo:focus-visible,
.back-home:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
}

/* Hero */
.hero {
  position: relative;
  padding: 4rem 0 3.75rem;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(74, 158, 255, 0.12);
  border: 1px solid rgba(74, 158, 255, 0.25);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.hero-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* App window mockup */
.hero-preview {
  margin-top: 3rem;
  position: relative;
}

.app-window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 24px 80px rgba(0, 0, 0, 0.5),
    0 0 120px var(--accent-glow);
}

.window-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.traffic-lights {
  display: flex;
  gap: 7px;
}

.traffic-lights span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.traffic-lights span:nth-child(1) { background: #ff5f57; }
.traffic-lights span:nth-child(2) { background: #febc2e; }
.traffic-lights span:nth-child(3) { background: #28c840; }

.window-title {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.window-toolbar {
  display: flex;
  gap: 6px;
}

.toolbar-pill {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.toolbar-pill.active {
  background: rgba(74, 158, 255, 0.2);
  color: var(--accent);
}

.window-body {
  display: grid;
  grid-template-columns: 180px 1fr 1fr;
  min-height: 280px;
}

.panel {
  border-right: 1px solid var(--border);
  padding: 12px;
  overflow: hidden;
}

.panel:last-child { border-right: none; }

.panel-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
  opacity: 0.7;
}

.insert-item {
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.75rem;
}

.insert-item.active {
  background: rgba(74, 158, 255, 0.12);
  border: 1px solid rgba(74, 158, 255, 0.2);
}

.insert-title {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}

.insert-item code {
  font-size: 0.7rem;
  background: transparent;
  padding: 0;
  color: var(--text-muted);
}

.editor-code {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.65;
  white-space: pre-wrap;
  color: var(--text-muted);
}

.tok-heading { color: #4a9eff; font-weight: 600; }
.tok-bold { color: #f0c674; }
.tok-italic { color: #c5c8c6; font-style: italic; }
.tok-link { color: #4a9eff; text-decoration: underline; }
.tok-code { color: #b5bd68; }
.tok-muted { color: #6a737d; }

.preview-content h1 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.preview-content p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.preview-content .muted { opacity: 0.7; }
.preview-content a { color: var(--accent); }
.preview-content em { font-style: italic; }
.preview-content strong { color: var(--text); }

.mini-diagram {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.diagram-node {
  padding: 5px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 600;
}

.diagram-node.accent {
  background: rgba(74, 158, 255, 0.15);
  border-color: rgba(74, 158, 255, 0.3);
  color: var(--accent);
}

.diagram-arrow {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.window-status {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .window-body {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .insert-panel { display: none; }
}

/* Stats bar */
.stats-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 40px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

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

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

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: rgba(74, 158, 255, 0.3);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 1.6rem;
  margin-bottom: 14px;
}

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

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

/* Split sections */
.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.split-section.reverse {
  direction: rtl;
}

.split-section.reverse > * {
  direction: ltr;
}

.split-copy h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.split-copy > p {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 1.05rem;
}

.check-list {
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.check-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.code-showcase {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.code-showcase pre {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

@media (max-width: 768px) {
  .split-section {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .split-section.reverse { direction: ltr; }
}

/* Themes */
.theme-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.theme-tab {
  padding: 10px 24px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.theme-tab.active {
  background: rgba(74, 158, 255, 0.15);
  border-color: rgba(74, 158, 255, 0.35);
  color: var(--accent);
}

.theme-panel { display: none; }
.theme-panel.active { display: block; }

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.theme-swatch {
  position: relative;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--c1) 60%, var(--c2) 100%);
  cursor: default;
  transition: transform 0.2s;
}

.theme-swatch:hover { transform: scale(1.03); }

.theme-swatch span {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c3);
}

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

.export-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  position: relative;
}

.export-format {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.export-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.export-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.shortcut-badge {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .export-grid { grid-template-columns: 1fr; }
}

/* Native card */
.native-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
}

.native-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  color: var(--accent);
}

.native-icon svg { width: 100%; height: 100%; }

.native-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.native-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.native-tags {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.native-tags span {
  padding: 5px 12px;
  background: rgba(74, 158, 255, 0.1);
  border: 1px solid rgba(74, 158, 255, 0.2);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}

/* Shortcuts */
.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.shortcut {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.shortcut kbd {
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 5px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--accent);
  white-space: nowrap;
}

.shortcut span {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* CTA */
.cta {
  padding: 100px 0;
  background:
    radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 60%),
    var(--bg);
}

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

.cta h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 14px;
}

.cta p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 32px;
}

.cta-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  background: var(--bg-alt);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
}

.footer-brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.footer-brand strong {
  display: block;
  font-size: 1rem;
}

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

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

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

.footer-copy {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.6;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { flex-wrap: wrap; gap: 16px; }
}
