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

:root {
  --bg: #FAFAF8;
  --bg-warm: #F5F3EF;
  --bg-card: #FFFFFF;
  --text: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-light: #9B9B9B;
  --accent: #5B6CF0;
  --accent-hover: #4A5AD4;
  --accent-light: #EEF0FF;
  --green: #34A853;
  --green-light: #E8F5EB;
  --border: #E8E8E5;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
  scroll-behavior: smooth;
}

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

h1, h2, h3 {
  line-height: 1.2;
  font-weight: 700;
}

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

/* === Nav === */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250, 250, 248, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo-icon {
  font-size: 22px;
}

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

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s;
}

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

.nav-docs {
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--bg-warm);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-weight: 600;
  font-size: 15px;
  border-radius: 10px;
  padding: 10px 22px;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
}

.btn-sm {
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 8px;
}

.btn-lg {
  font-size: 17px;
  padding: 14px 32px;
  border-radius: 12px;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(91, 108, 240, 0.3);
}

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

.btn-secondary:hover {
  background: var(--bg-warm);
  border-color: #D0D0CC;
}

/* === Sections === */
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

h2 {
  font-size: 40px;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.section-sub {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 48px;
}

/* === Hero === */
.hero {
  padding: 140px 24px 80px;
  text-align: center;
}

.hero-inner {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 52px;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text) 0%, #444 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 20px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.5;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 60px;
}

/* Hero Demo */
.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-demo {
  position: relative;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.hero-monitor {
  background: #1a1a1a;
  border-radius: 12px 12px 0 0;
  padding: 8px 8px 0 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.hero-monitor-dots {
  display: flex;
  gap: 6px;
  padding: 6px 8px 8px;
}

.hero-monitor-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.hero-monitor-dots .dot-r { background: #FF5F57; }
.hero-monitor-dots .dot-y { background: #FFBD2E; }
.hero-monitor-dots .dot-g { background: #28C840; }

.hero-gif {
  width: 100%;
  display: block;
  border-radius: 0 0 4px 4px;
}

.hero-stand {
  width: 120px;
  height: 40px;
  background: linear-gradient(180deg, #c0c0c0, #a0a0a0);
  margin: 0 auto;
  border-radius: 0 0 4px 4px;
}

.hero-base {
  width: 200px;
  height: 8px;
  background: linear-gradient(180deg, #b0b0b0, #909090);
  margin: 0 auto;
  border-radius: 0 0 6px 6px;
}

.hero-caption {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  letter-spacing: 0.05em;
  margin-top: 12px;
}

.demo-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--bg-warm);
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background: #FF5F57; }
.dot.yellow { background: #FFBD2E; }
.dot.green { background: #28C840; }

.demo-title {
  margin-left: 8px;
  font-size: 13px;
  color: var(--text-light);
  font-weight: 500;
}

.demo-content {
  padding: 24px;
  min-height: 200px;
  position: relative;
}

.demo-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.demo-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--bg);
  opacity: 0.4;
  transform: translateX(-8px);
  transition: all 0.4s ease;
  font-size: 15px;
}

.demo-step.active {
  opacity: 1;
  transform: translateX(0);
  background: var(--accent-light);
}

.demo-step.done {
  opacity: 1;
  transform: translateX(0);
  background: var(--green-light);
}

.step-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
}

.ghost-cursor {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.6;
  filter: blur(2px);
  animation: ghostFloat 4s ease-in-out infinite;
  pointer-events: none;
  bottom: 30px;
  right: 40px;
}

/* Demo carousel */
.demo-carousel {
  position: relative;
  min-height: 220px;
}

.demo-workflow {
  display: none;
}

.demo-workflow.active {
  display: block;
  animation: fadeSlide 0.4s ease;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.workflow-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 14px;
}

.demo-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.demo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.demo-dot.active {
  background: var(--accent);
  width: 24px;
  border-radius: 4px;
}

@keyframes ghostFloat {
  0%, 100% { transform: translate(0, 0); opacity: 0.6; }
  25% { transform: translate(-60px, -30px); opacity: 0.8; }
  50% { transform: translate(-120px, -60px); opacity: 0.4; }
  75% { transform: translate(-40px, -80px); opacity: 0.7; }
}

/* === Promise Cards === */
.promise {
  padding: 80px 0;
}

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

.card.card-subtle {
  margin-top: 24px;
  background: var(--bg-warm);
  border: 1px solid white;
  box-shadow: none;
}


.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card.card-subtle:hover {
  transform: none;
  box-shadow: none;
  background: var(--bg-warm);
}

.card-icon-inline {
  font-size: 24px;
  margin-left: 8px;
  vertical-align: middle;
}

.card-icon {
  font-size: 36px;
  margin-bottom: 16px;
}

.card h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.card p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* === How It Works === */
.how-it-works {
  padding: 100px 0;
  background: var(--bg-warm);
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.step {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-content h3 {
  font-size: 24px;
  margin-bottom: 8px;
}

.step-content p {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
}

.step-content em {
  color: var(--text);
  font-style: italic;
}

.step-detail {
  margin-top: 20px;
}

.detail-compare {
  display: flex;
  gap: 16px;
}

.detail-bad, .detail-good {
  flex: 1;
  padding: 16px;
  border-radius: var(--radius);
  font-size: 14px;
}

.detail-bad {
  background: #FEF2F2;
  border: 1px solid #FECACA;
}

.detail-good {
  background: var(--green-light);
  border: 1px solid #A7F3D0;
}

.detail-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  color: var(--text-light);
}

.detail-bad code, .detail-good code {
  font-size: 14px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text);
}

.compare-status {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 8px;
  color: #d24a4a;
}

.compare-status.success {
  color: var(--green);
}

/* Resilience demo */
.resilience-demo {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.mini-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  width: 120px;
  transition: all 0.4s ease;
}

.mini-field {
  height: 14px;
  background: var(--border);
  border-radius: 4px;
  transition: all 0.4s ease;
}

.mini-btn {
  height: 22px;
  background: var(--accent);
  color: white;
  border-radius: 4px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: all 0.4s ease;
}

.mini-form.morphed .mini-btn {
  order: -1;
}

.mini-form.morphed .mini-field:first-child {
  width: 60%;
}

.layout-label {
  font-size: 11px;
  color: var(--text-light);
  text-align: center;
  display: block;
  margin-top: 4px;
}

#resilienceResult {
  font-size: 18px;
  font-weight: 700;
  color: var(--green);
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

#resilienceResult.show {
  opacity: 1;
}

/* === Stories === */
.stories {
  padding: 100px 0;
}

.story-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.story-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.story-arrow:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.story-carousel {
  position: relative;
  flex: 1;
  min-height: 280px;
}

.story-carousel .story {
  display: none;
}

.story-carousel .story.active {
  display: flex;
  animation: fadeSlide 0.4s ease;
}

.story-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.story-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.story-dot.active {
  background: var(--accent);
  width: 24px;
  border-radius: 4px;
}

.story {
  background: var(--bg-card);
  border-left: 4px solid var(--accent);
  border-top: none;
  border-right: none;
  border-bottom: none;
  border-radius: 4px var(--radius-lg) var(--radius-lg) 4px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.story-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 16px;
  align-self: flex-start;
}

.story h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.story p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  flex-grow: 1;
  font-style: italic;
}

.story-author {
  font-size: 14px;
  color: var(--text-light);
  margin-top: 16px;
  font-weight: 500;
}

/* === What Makes It Different === */
.different {
  padding: 100px 0;
  background: var(--bg-warm);
}

.not-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 48px;
}

.not-grid .diff-item {
  padding: 24px 32px;
}

.not-grid .diff-item h3 {
  margin-bottom: 12px;
}

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

.diff-dark {
  background: #1A1A1A;
}

.diff-dark h2 {
  color: #FFFFFF;
}

.diff-dark .diff-item {
  background: #FFFFFF;
  border-color: var(--border);
  transition: border-color 0.2s;
}

.diff-dark .diff-item:hover {
  border: 2px solid var(--accent);
  box-shadow: 0 0 16px rgba(91, 108, 240, 0.3);
}

.diff-dark .diff-item h3 {
  color: var(--text);
}

.diff-dark .diff-item p {
  color: var(--text-secondary);
}

.diff-dark .diff-item em {
  color: var(--text);
}

.diff-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.diff-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
}

.diff-item h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.diff-item p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.diff-item em {
  color: var(--text);
}

/* === Explore Mode === */
.explore {
  padding: 100px 0;
}

.explore-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.explore-text h2 {
  font-size: 36px;
}

.explore-text p {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 16px 0 24px;
  line-height: 1.6;
}

.explore-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.explore-list li {
  font-size: 15px;
  color: var(--text-secondary);
  padding-left: 24px;
  position: relative;
}

.explore-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

/* Explore timeline */
.explore-visual {
  position: relative;
}

.explore-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 20px;
  border-left: 2px solid var(--border);
}

.tl-item {
  position: relative;
  padding: 16px 0 16px 28px;
}

.tl-dot {
  position: absolute;
  left: -9px;
  top: 22px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--border);
  border: 3px solid var(--bg);
}

.tl-item.done .tl-dot {
  background: var(--green);
}

.tl-content strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

.tl-content span {
  font-size: 13px;
  color: var(--text-light);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.explore-story {
  margin-top: 48px;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

.download.diff-dark h2 {
  color: #FFFFFF;
}

.download.diff-dark .section-sub {
  color: #A0A0A0;
}

.download.diff-dark .btn-secondary {
  background: #252525;
  color: #FFFFFF;
  border-color: #444;
}

.download.diff-dark .btn-secondary:hover {
  background: #333;
  border-color: #555;
}

.download.diff-dark .start-num {
  background: rgba(91, 108, 240, 0.2);
}

.download.diff-dark .start-step p {
  color: #A0A0A0;
}

/* === Download === */
.download {
  padding: 100px 0;
  text-align: center;
}

.download:not(.diff-dark) {
  background: var(--bg-warm);
}

.start-steps {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 48px 0;
}

.start-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 180px;
}

.start-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

.start-step p {
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
}

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

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

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-tagline {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 400;
  margin-left: 16px;
}

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

.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
}

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

/* === Scroll Animations === */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Responsive === */
@media (max-width: 900px) {
  .hero h1 {
    font-size: 36px;
  }

  .hero-sub {
    font-size: 17px;
  }

  .cards,
  .story-grid {
    grid-template-columns: 1fr;
  }

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

  .explore-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .detail-compare {
    flex-direction: column;
  }

  .resilience-demo {
    flex-wrap: wrap;
    justify-content: center;
  }

  .start-steps {
    flex-direction: column;
    align-items: center;
  }

  .nav-links a:not(.btn) {
    display: none;
  }

  .demo-window {
    width: 100%;
    max-width: 400px;
  }

  h2 {
    font-size: 32px;
  }

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

  .download-cta {
    flex-direction: column;
    align-items: center;
  }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .footer-tagline {
    margin-left: 0;
    display: block;
    margin-top: 4px;
  }
}
