/* ========================================
   Mend Landing Page — styles.css
   ======================================== */

/* --- Custom Properties --- */
:root {
  --bg:         #0f1117;
  --bg-raised:  #161822;
  --bg-card:    #1c1e2b;
  --border:     #2a2d3e;
  --text:       #e4e5eb;
  --text-muted: #8b8fa3;
  --accent:     #FF6B4A;
  --accent-dim: rgba(255, 107, 74, 0.12);
  --green:      #34D399;
  --green-dim:  rgba(52, 211, 153, 0.12);
  --red:        #F87171;
  --red-dim:    rgba(248, 113, 113, 0.12);
  --font:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:       'JetBrains Mono', 'Fira Code', monospace;
  --radius:     12px;
  --radius-sm:  8px;
  --max-width:  1120px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; }

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

/* --- Section Titles --- */
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 40px;
  letter-spacing: -0.02em;
}

/* ========================================
   Nav
   ======================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background 0.3s, backdrop-filter 0.3s, -webkit-backdrop-filter 0.3s;
}
.nav.scrolled {
  background: rgba(15, 17, 23, 0.8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.15s;
}
.nav-link:hover {
  color: var(--text);
}
.nav-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.nav-link svg {
  width: 16px;
  height: 16px;
}

/* ========================================
   Hero
   ======================================== */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 120px 24px 80px;
  position: relative;
  overflow: hidden;
}

.hero-content {
  text-align: center;
  max-width: 720px;
  margin-bottom: 56px;
  position: relative;
  z-index: 2;
}

.hero-headline {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fff 0%, #c0c3d1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(255, 107, 74, 0.35);
}
.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-raised);
  border-color: #3d4156;
  transform: translateY(-1px);
}
.btn-icon {
  flex-shrink: 0;
}

/* ========================================
   Hero Animation — Static Two-Column
   ======================================== */
.hero-animation {
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0;
  position: relative;
  z-index: 1;
}

/* Columns */
.anim-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.anim-col-errors {
  align-items: flex-end;
  padding-right: 12px;
}
.anim-col-issues {
  align-items: flex-start;
  padding-left: 12px;
}
.anim-col-center {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 140px;
  height: 100%;
  min-height: 200px;
}

/* Error cards — always visible */
.error-card, .issue-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  white-space: nowrap;
}

.error-card {
  background: var(--red-dim);
  border: 1px solid rgba(248, 113, 113, 0.2);
  color: var(--red);
  animation: float-card 3.5s ease-in-out infinite;
}
.ec-1 { animation-delay: 0s; }
.ec-2 { animation-delay: 0.8s; }
.ec-3 { animation-delay: 1.6s; }
.ec-4 { animation-delay: 2.4s; }

.error-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

.issue-card {
  background: var(--green-dim);
  border: 1px solid rgba(52, 211, 153, 0.2);
  color: var(--green);
  animation: float-card 3.5s ease-in-out infinite;
}
.ic-1 { animation-delay: 0.4s; }
.ic-2 { animation-delay: 1.2s; }
.ic-3 { animation-delay: 2.0s; }
.ic-4 { animation-delay: 2.8s; }

.issue-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

@keyframes float-card {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* Mend zone */
.mend-zone {
  position: relative;
  width: 80px;
  height: 80px;
  z-index: 5;
  flex-shrink: 0;
}
.mend-glow {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 107, 74, 0.18) 0%, transparent 70%);
  animation: glow-pulse 3s ease-in-out infinite;
}
.mend-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 107, 74, 0.25);
  animation: ring-spin 12s linear infinite;
}
.mend-ring::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}
.mend-logo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--accent);
  background: var(--bg-raised);
  border-radius: 50%;
  border: 1px solid rgba(255, 107, 74, 0.3);
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.15); }
}
@keyframes ring-spin {
  to { transform: rotate(360deg); }
}

/* Connecting paths */
.connect-path {
  position: absolute;
  top: 50%;
  width: 40px;
  height: 2px;
  transform: translateY(-50%);
}
.connect-path-left {
  right: calc(50% + 48px);
  background: linear-gradient(to right, rgba(248, 113, 113, 0.06), rgba(248, 113, 113, 0.2));
}
.connect-path-right {
  left: calc(50% + 48px);
  background: linear-gradient(to left, rgba(52, 211, 153, 0.06), rgba(52, 211, 153, 0.2));
}

/* Particles */
.particle {
  position: absolute;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  transform: translateY(-50%);
}
.connect-path-left .particle {
  background: var(--red);
  animation: particle-left 2.5s ease-in-out infinite;
}
.connect-path-right .particle {
  background: var(--green);
  animation: particle-right 2.5s ease-in-out infinite;
}
.p-l1, .p-r1 { animation-delay: 0s; }
.p-l2, .p-r2 { animation-delay: 0.8s; }
.p-l3, .p-r3 { animation-delay: 1.6s; }

@keyframes particle-left {
  0%   { left: 0; opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.8; }
  100% { left: 100%; opacity: 0; }
}
@keyframes particle-right {
  0%   { left: 0; opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.8; }
  100% { left: 100%; opacity: 0; }
}


/* ========================================
   How It Works
   ======================================== */
.how-it-works {
  padding: 80px 0;
}
.steps-wrapper {
  position: relative;
}
.steps-line {
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 1px;
  border-top: 2px dashed var(--border);
  transform: translateY(-50%);
  z-index: 0;
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  position: relative;
  z-index: 1;
}
.step {
  text-align: center;
  padding: 28px 20px;
  background: var(--bg);
}
.step-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  color: var(--accent);
}
.step-icon svg {
  width: 100%;
  height: 100%;
}
.step-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.step-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 300px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ========================================
   Features
   ======================================== */
.features {
  padding: 28px 0 80px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, border-left-color 0.2s;
  border-left: 3px solid transparent;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: #3d4156;
  border-left-color: var(--accent);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
.feature-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.feature-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ========================================
   Quick Start
   ======================================== */
.quickstart {
  padding: 80px 0;
}
.setup-steps {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.setup-step {
  position: relative;
}
.setup-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.setup-step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 107, 74, 0.2);
  flex-shrink: 0;
}
.setup-step-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Code blocks */
.code-block {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}
.code-lang {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.code-copy {
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.code-copy:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.code-copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.code-copy.copied {
  color: var(--green);
}

.code-block pre {
  padding: 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
}
.code-block code {
  font-family: inherit;
}

/* Syntax tokens */
.token-keyword { color: #c792ea; }
.token-string  { color: #c3e88d; }
.token-comment { color: #5c6370; }
.token-name    { color: #82aaff; }
.token-attr    { color: #ffcb6b; }

/* ========================================
   Footer
   ======================================== */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.footer-inner a {
  transition: color 0.15s;
}
.footer-inner a:hover {
  color: var(--text);
}
.footer-inner a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ========================================
   Reveal Animations
   ======================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ========================================
   Responsive
   ======================================== */

/* Tablet */
@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .steps {
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 420px;
    margin: 0 auto;
  }
  .steps-line {
    display: none;
  }
  .hero-animation {
    max-width: 700px;
  }
  .error-card, .issue-card {
    font-size: 0.65rem;
    padding: 8px 10px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .hero {
    padding: 80px 20px 48px;
  }
  .hero-content {
    margin-bottom: 40px;
  }

  /* Stack animation vertically */
  .hero-animation {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 16px;
    max-width: 340px;
    margin: 0 auto;
  }
  .anim-col-errors {
    align-items: center;
    padding-right: 0;
    order: 1;
  }
  .anim-col-center {
    order: 2;
    width: 100%;
    min-height: 100px;
    justify-content: center;
  }
  .anim-col-issues {
    align-items: center;
    padding-left: 0;
    order: 3;
  }
  .connect-path {
    display: none;
  }

  .mend-zone {
    width: 64px;
    height: 64px;
  }
  .mend-logo { font-size: 1.25rem; }
  .mend-glow { inset: -20px; }
  .mend-ring { inset: -6px; }

  .error-card, .issue-card {
    font-size: 0.62rem;
    padding: 6px 10px;
    gap: 6px;
  }

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

  .how-it-works, .features, .quickstart {
    padding: 56px 0;
  }
  .features {
    padding-top: 20px;
  }
}

/* Small mobile */
@media (max-width: 420px) {
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .btn {
    justify-content: center;
  }
  .error-text, .issue-text {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
