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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1a1a2e;
  background: #fafafa;
  line-height: 1.7;
}

a { color: #8B5CF6; text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ===== Nav ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e5e5e5;
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: #1a1a2e;
  text-decoration: none;
}

.nav-logo img,
.footer-brand img {
  border-radius: 6px;
  object-fit: contain;
}

.nav-links {
  flex: 1;
  display: flex;
  gap: 24px;
  font-size: 14px;
  font-weight: 500;
}

.nav-links a {
  color: #555;
  text-decoration: none;
  transition: color 0.15s;
}

.nav-links a:hover { color: #1a1a2e; }

.nav-cta {
  font-size: 14px;
  font-weight: 600;
  background: #8B5CF6;
  color: #fff !important;
  padding: 8px 20px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
}

.nav-cta:hover { background: #6D3FD7; text-decoration: none; }

/* Nav toggle (hamburger) — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #1a1a2e;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Mask system ===== */
/*
  .mask-ltr : gradient from left (solid) → right (transparent)
            text on the LEFT, image fully visible on the RIGHT
  .mask-rtl : gradient from right (solid) → left (transparent)
            text on the RIGHT, image fully visible on the LEFT
  .mask-btt : gradient from bottom (solid) → top (transparent)
            text on the BOTTOM, image fully visible on the TOP
*/

.mask-ltr,
.mask-rtl,
.mask-btt,
.mask-hero {
  position: relative;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.mask-ltr::before,
.mask-rtl::before,
.mask-btt::before,
.mask-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Left-to-right: solid on left, transparent on right */
.mask-ltr::before {
  background: linear-gradient(to right,
    #fafafa 0%,
    #fafafa 30%,
    rgba(250,250,250,0.95) 40%,
    rgba(250,250,250,0.7) 50%,
    rgba(250,250,250,0.2) 62%,
    transparent 74%
  );
}

/* Right-to-left: solid on right, transparent on left */
.mask-rtl::before {
  background: linear-gradient(to left,
    #fafafa 0%,
    #fafafa 30%,
    rgba(250,250,250,0.95) 40%,
    rgba(250,250,250,0.7) 50%,
    rgba(250,250,250,0.2) 62%,
    transparent 74%
  );
}

/* Hero: solid on left (gentler than mask-ltr) → transparent on right */
.mask-hero::before {
  background: linear-gradient(to right,
    rgba(250,250,250,0.9) 0%,
    rgba(250,250,250,0.85) 20%,
    rgba(250,250,250,0.6) 35%,
    rgba(250,250,250,0.3) 50%,
    rgba(250,250,250,0.1) 65%,
    transparent 80%
  );
}

/* Bottom-to-top: solid at bottom, transparent at top */
.mask-btt::before {
  background: linear-gradient(to top,
    #fafafa 0%,
    #fafafa 25%,
    rgba(250,250,250,0.95) 36%,
    rgba(250,250,250,0.7) 48%,
    rgba(250,250,250,0.2) 60%,
    transparent 74%
  );
}

/* CTA section uses warm bg */
.cta-section .mask-rtl::before {
  background: linear-gradient(to left,
    #f3f1ee 0%,
    #f3f1ee 30%,
    rgba(243,241,238,0.95) 40%,
    rgba(243,241,238,0.7) 50%,
    rgba(243,241,238,0.2) 62%,
    transparent 74%
  );
}

.cta-section .mask-ltr::before {
  background: linear-gradient(to right,
    #f3f1ee 0%,
    #f3f1ee 30%,
    rgba(243,241,238,0.95) 40%,
    rgba(243,241,238,0.7) 50%,
    rgba(243,241,238,0.2) 62%,
    transparent 74%
  );
}

/* ===== Hero ===== */
.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-content {
  max-width: 520px;
}

.hero-content h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: #0f0f23;
  margin-bottom: 24px;
}

.hero-quote {
  font-size: 17px;
  color: #555;
  line-height: 1.8;
  margin-bottom: 32px;
  padding-left: 20px;
  border-left: 3px solid #8B5CF6;
}

.hero-actions {
  display: flex;
  gap: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-primary {
  background: #8B5CF6;
  color: #fff;
  box-shadow: 0 1px 3px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover { background: #6D3FD7; text-decoration: none; }

.btn-secondary {
  background: #fff;
  color: #1a1a2e;
  border: 1px solid #d4d4d4;
}

.btn-secondary:hover { background: #f5f5f5; text-decoration: none; }

.btn-register {
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(235, 247, 255, 0.96), rgba(247, 243, 255, 0.92)),
    #fff;
  color: rgb(22, 55, 104);
  border: 1px solid rgba(91, 141, 198, 0.42);
  box-shadow:
    0 10px 24px rgba(22, 55, 104, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.78);
  position: relative;
}

.btn-register::after {
  content: "";
  position: absolute;
  top: -45%;
  right: -12%;
  width: 82px;
  height: 82px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(159, 184, 216, 0.42), transparent 64%);
  pointer-events: none;
  z-index: -1;
}

.btn-register:hover {
  background:
    linear-gradient(135deg, rgba(225, 240, 255, 0.98), rgba(242, 237, 255, 0.95)),
    #fff;
  text-decoration: none;
}

.btn-login {
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(235, 247, 255, 0.96), rgba(247, 243, 255, 0.92)),
    #fff;
  color: rgb(22, 55, 104);
  border: 1px solid rgba(91, 141, 198, 0.42);
  box-shadow:
    0 10px 24px rgba(22, 55, 104, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.78);
  position: relative;
}

.btn-login::after {
  content: "";
  position: absolute;
  top: -45%;
  right: -12%;
  width: 82px;
  height: 82px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(159, 184, 216, 0.42), transparent 64%);
  pointer-events: none;
  z-index: -1;
}

.btn-login:hover {
  background:
    linear-gradient(135deg, rgba(225, 240, 255, 0.98), rgba(242, 237, 255, 0.95)),
    #fff;
  text-decoration: none;
}

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

.section-header h2 {
  font-family: 'Noto Serif SC', serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f0f23;
  margin-bottom: 12px;
}

.section-header p {
  font-size: 16px;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Features (background image + gradient mask) ===== */
.features-section {
  padding: 80px 0;
}

.feature-row {
  min-height: 380px;
  border-radius: 20px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
}

.feature-row:last-child { margin-bottom: 0; }

/* Text sits on the solid/masked side */
.feature-text {
  position: relative;
  z-index: 2;
  padding: 48px;
  max-width: 48%;
}

.mask-ltr .feature-text {
  /* text on the left */
}

.mask-rtl .feature-text {
  /* text on the right */
  margin-left: auto;
}

.feature-text h3 {
  font-family: 'Noto Serif SC', serif;
  font-size: 26px;
  font-weight: 700;
  color: #0f0f23;
  margin-bottom: 12px;
}

.feature-text p {
  font-size: 15px;
  color: #555;
  line-height: 1.75;
  margin-bottom: 20px;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin-bottom: 20px;
}

.feature-list li {
  font-size: 14px;
  color: #333;
  padding: 6px 0;
  padding-left: 24px;
  position: relative;
}

.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8B5CF6;
}

/* Inline demo cards */
.feature-demo { margin-top: 8px; }

.demo-chat {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demo-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.demo-author {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.demo-author.human { background: #F0F0F0; color: #555; }
.demo-author.agent-c { background: #D97706; color: #fff; }
.demo-author.agent-k { background: #6366F1; color: #fff; }

.demo-text {
  font-size: 13px;
  color: #333;
  line-height: 1.5;
}

/* Screenshot with vignette shadow */
.feature-screenshot {
  text-align: center;
  margin: 0 auto 48px;
  max-width: 900px;
}

.screenshot-img {
  width: 100%;
  border-radius: 16px;
  display: block;
}

.screenshot-img.vignette {
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.04),
    0 4px 12px rgba(0,0,0,0.08),
    0 16px 48px rgba(0,0,0,0.12),
    0 32px 80px rgba(0,0,0,0.06);
}

.feature-screenshot-row {
  display: flex;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto 48px;
  justify-content: center;
}

.feature-screenshot-row .screenshot-img {
  flex: 1;
  min-width: 0;
  object-fit: cover;
  max-height: 260px;
}

.demo-code {
  background: #1a1a2e;
  border-radius: 10px;
  padding: 14px 18px;
}

.demo-code code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: #e0e0e0;
  line-height: 1.7;
}

/* ===== Agents ===== */
.agents-section {
  padding: 80px 0;
  background: #f3f1ee;
}

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

.agent-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  padding: 20px;
  transition: box-shadow 0.2s;
}

.agent-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.agent-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.avatar-claude { background: #D97706; }
.avatar-codex { background: #10A37F; }
.avatar-gemini { background: #4285F4; }
.avatar-kimi { background: #6366F1; }
.avatar-qwen { background: #6B46C1; }
.avatar-copilot { background: #000; }
.avatar-droid { background: #2563EB; }
.avatar-kilo { background: #0EA5E9; }
.avatar-pi { background: #8B5CF6; }
.avatar-trae { background: #F59E0B; }
.avatar-openclaw { background: #EF4444; }
.avatar-agent { background: #1E293B; }
.avatar-qoder { background: #14B8A6; }
.avatar-opencode { background: #3B82F6; }
.avatar-ducc { background: #D97706; }
.avatar-hermes { background: #7C3AED; }

.agent-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: #0f0f23;
  margin-bottom: 2px;
}

.agent-cmd {
  font-size: 11px;
  font-family: 'SF Mono', monospace;
  color: #999;
  display: block;
  margin-bottom: 6px;
}

.agent-info p {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

.agents-note {
  text-align: center;
  font-size: 14px;
  color: #888;
}

.agents-note code {
  background: #e8e8e8;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  color: #555;
}

/* ===== Steps (mask-btt cards) ===== */
.steps-section {
  padding: 80px 0;
}

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

.step-card {
  min-height: 420px;
  border-radius: 20px;
  display: flex;
  align-items: flex-end;
}

.step-content {
  position: relative;
  z-index: 2;
  padding: 36px;
  width: 100%;
}

.step-number {
  font-size: 48px;
  font-weight: 800;
  color: rgba(139, 92, 246, 0.15);
  line-height: 1;
  margin-bottom: 12px;
}

.step-content h3 {
  font-family: 'Noto Serif SC', serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #0f0f23;
}

.step-content p {
  font-size: 14px;
  color: #555;
  line-height: 1.65;
  margin-bottom: 16px;
}

.step-code {
  background: rgba(26,26,46,0.9);
  border-radius: 10px;
  padding: 14px 18px;
  display: inline-block;
}

.step-code code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: #e0e0e0;
  line-height: 1.5;
}

/* ===== CTA Section ===== */
.cta-section {
  padding: 80px 0;
  background: #f3f1ee;
}

.cta-inner {
  min-height: 440px;
  border-radius: 20px;
  display: flex;
  align-items: center;
}

.cta-content {
  position: relative;
  z-index: 2;
  padding: 48px;
  max-width: 50%;
  margin-left: auto;
}

.cta-content h2 {
  font-family: 'Noto Serif SC', serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f0f23;
  margin-bottom: 12px;
}

.cta-content > p {
  font-size: 15px;
  color: #888;
  margin-bottom: 36px;
}

.cta-install {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.install-box {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 20px 24px;
  text-align: left;
}

.install-label {
  font-size: 13px;
  font-weight: 600;
  color: #8B5CF6;
  display: block;
  margin-bottom: 10px;
}

.install-desc {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
}

.install-code {
  background: #1a1a2e;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.install-code code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: #e0e0e0;
  flex: 1;
  word-break: break-all;
}

.copy-btn {
  font-size: 12px;
  font-weight: 500;
  background: rgba(255,255,255,0.1);
  color: #aaa;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.copy-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

.cta-note {
  font-size: 14px;
  color: #888;
}

.cta-note a { color: #8B5CF6; }

/* ===== Footer ===== */
.footer {
  border-top: 1px solid #e5e5e5;
  padding: 32px 0;
}

/* Section dividers */
.section-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, #b8a9c8, transparent);
  margin: 0 auto;
  max-width: 680px;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: #333;
}

.footer-links {
  flex: 1;
  display: flex;
  gap: 20px;
  font-size: 14px;
}

.footer-links a { color: #888; }
.footer-links a:hover { color: #333; }

.footer-copy {
  font-size: 13px;
  color: #aaa;
}

/* ===== Usage Steps (full-width alternating rows) ===== */
.usage-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.usage-step {
  min-height: 380px;
  border-radius: 20px;
  display: flex;
  align-items: center;
}

.usage-step-content {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 32px;
  align-items: flex-start;
  padding: 48px;
  max-width: 52%;
}

.mask-ltr .usage-step-content {
  /* text on the left */
}

.mask-rtl .usage-step-content {
  /* text on the right */
  margin-left: auto;
}

.usage-step-number {
  font-size: 72px;
  font-weight: 800;
  color: rgba(139, 92, 246, 0.12);
  line-height: 1;
  flex-shrink: 0;
  width: 80px;
}

.usage-step-body {
  flex: 1;
  min-width: 0;
}

.usage-step-body h3 {
  font-family: 'Noto Serif SC', serif;
  font-size: 26px;
  font-weight: 700;
  color: #0f0f23;
  margin-bottom: 12px;
}

.usage-step-body > p {
  font-size: 15px;
  color: #555;
  line-height: 1.75;
  margin-bottom: 20px;
}

.usage-step-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.usage-step-detail .install-box {
  max-width: 560px;
}

.usage-step-detail .feature-list li {
  color: #444;
}

.cta-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .usage-step {
    min-height: auto;
  }

  .usage-step-content {
    flex-direction: column;
    padding: 32px;
    max-width: 100%;
    gap: 8px;
  }

  .mask-rtl .usage-step-content {
    margin-left: 0;
  }

  .usage-step-number {
    font-size: 48px;
    width: auto;
  }

  .mask-rtl .usage-step-body {
    /* no margin-left needed in stack layout */
  }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero { min-height: auto; padding: 48px 0; }
  .hero-content { max-width: 100%; }
  .hero-content h1 { font-size: 32px; }

  .feature-row { min-height: 300px; }

  .feature-text {
    max-width: 100%;
    padding: 32px;
  }

  .mask-rtl .feature-text { margin-left: 0; }

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

  .steps { grid-template-columns: 1fr; }
  .step-card { min-height: 340px; }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(250, 250, 250, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e5e5e5;
    padding: 16px 24px;
    gap: 0;
    z-index: 200;
  }

  .nav-links.nav-open { display: flex; }

  .nav-links a {
    padding: 12px 0;
    font-size: 15px;
    border-bottom: 1px solid #f0f0f0;
  }

  .nav-links a:last-child { border-bottom: none; }

  .nav-toggle { display: flex; }

  .cta-content {
    max-width: 100%;
    padding: 32px;
    margin-left: 0;
  }

  .cta-inner { min-height: auto; }

  .cta-content h2 { font-size: 28px; }
}

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

  /* On small screens, increase overlay for readability */
  .mask-ltr::before {
    background: linear-gradient(to right,
      #fafafa 0%, #fafafa 42%,
      rgba(250,250,250,0.95) 56%,
      rgba(250,250,250,0.4) 72%,
      transparent 88%
    );
  }
  .mask-rtl::before {
    background: linear-gradient(to left,
      #fafafa 0%, #fafafa 42%,
      rgba(250,250,250,0.95) 56%,
      rgba(250,250,250,0.4) 72%,
      transparent 88%
    );
  }
  .mask-btt::before {
    background: linear-gradient(to top,
      #fafafa 0%, #fafafa 38%,
      rgba(250,250,250,0.95) 52%,
      rgba(250,250,250,0.4) 68%,
      transparent 84%
    );
  }
}
