/* ============================================================
   FlAI Homepage Styles
   ============================================================ */

/* --- Hero Split Layout ------------------------------------- */
.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  padding: 100px 0 80px;
}

.hero-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.hero-version {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-muted);
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid rgba(129, 140, 248, 0.2);
}

.hero-badge-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--fg-subtle);
}

.hero-badge-text {
  font-size: 12px;
  color: var(--fg-subtle);
}

.hero-h1 {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  color: var(--fg);
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 16px;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 440px;
}

/* Hero terminal */
.hero-terminal {
  background: #0A0A0C;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 28px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.hero-term-line {
  display: flex;
  gap: 10px;
  line-height: 1.8;
}

.hero-term-prompt {
  color: var(--accent);
  user-select: none;
}

.hero-term-cmd {
  color: #d4d4d8;
}

/* Hero actions */
.hero-actions {
  display: flex;
  gap: 12px;
}

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

.hero-phone {
  width: 300px;
  background: #111113;
  border: 1px solid #27272A;
  border-radius: 28px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 24px 80px rgba(0,0,0,0.5),
    0 8px 24px rgba(0,0,0,0.3);
}

.hero-phone-notch {
  width: 100px;
  height: 24px;
  background: #09090B;
  margin: 0 auto;
  border-radius: 0 0 14px 14px;
}

.hero-chat {
  padding: 0;
}

.hero-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid #1F1F23;
}

.hero-chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.hero-chat-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}

.hero-chat-model {
  font-size: 11px;
  color: var(--fg-subtle);
}

.hero-chat-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
}

.hb {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 85%;
}

.hb-user {
  align-self: flex-end;
  background: #6366F1;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.hb-ai {
  align-self: flex-start;
  background: #1A1A1E;
  color: #d4d4d8;
  border-bottom-left-radius: 4px;
}

.hb-cursor {
  display: inline-block;
  width: 2px;
  height: 14px;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: hb-blink 1s infinite;
}

@keyframes hb-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.hero-chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin: 0 14px 14px;
  background: #18181B;
  border: 1px solid #27272A;
  border-radius: 12px;
}

.hero-chat-plus {
  color: var(--fg-subtle);
  font-size: 18px;
  line-height: 1;
}

.hero-chat-placeholder {
  flex: 1;
  color: #52525B;
  font-size: 13px;
}

.hero-chat-send {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #6366F1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- How It Works ------------------------------------------ */
.how-section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.how-header, .gallery-header, .themes-header,
.code-section-header, .compare-header, .providers-header {
  margin-bottom: 40px;
}

.section-label {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--fg);
  margin-bottom: 8px;
  border: none;
  padding: 0;
  margin-top: 0;
}

.section-desc {
  font-size: 16px;
  color: var(--fg-muted);
  margin: 0;
}

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

.how-step {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.how-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-muted);
  border: 1px solid rgba(129, 140, 248, 0.2);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.how-step h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 6px;
}

.how-step p {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.5;
  margin: 0;
}

.how-step code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: rgba(129, 140, 248, 0.08);
  color: #c4b5fd;
  padding: 1px 5px;
  border-radius: 3px;
}

/* --- Component Gallery ------------------------------------- */
.gallery-section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

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

.gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.15s;
}

.gallery-card:hover {
  border-color: #3F3F46;
  transform: translateY(-2px);
}

.gallery-card-wide {
  grid-column: span 2;
}

.gallery-card-preview {
  padding: 20px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
}

.gallery-card-preview.gc-center {
  align-items: center;
  justify-content: center;
}

.gallery-card-label {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.gallery-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}

.gallery-card-desc {
  font-size: 11px;
  color: var(--fg-subtle);
  margin-top: 1px;
}

/* Gallery card mini components */
.gc-chat {
  font-size: 12px;
}

.gc-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1F1F23;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--fg);
}

.gc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.gc-msg {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.4;
  max-width: 85%;
}

.gc-msg-user {
  align-self: flex-end;
  background: #6366F1;
  color: #fff;
  border-bottom-right-radius: 3px;
}

.gc-msg-ai {
  align-self: flex-start;
  background: #1A1A1E;
  color: #d4d4d8;
  border-bottom-left-radius: 3px;
}

.gc-cursor {
  display: inline-block;
  width: 1.5px;
  height: 12px;
  background: var(--accent);
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: hb-blink 1s infinite;
}

.gc-input, .gc-input-demo {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  margin-top: 6px;
  background: #18181B;
  border: 1px solid #27272A;
  border-radius: 8px;
  font-size: 10px;
}

.gc-input-text {
  flex: 1;
  color: #52525B;
  font-size: 11px;
}

.gc-plus {
  color: #52525B;
  font-size: 14px;
}

.gc-send-dot {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #6366F1;
  flex-shrink: 0;
}

/* Typing dots */
.gc-typing {
  display: flex;
  gap: 3px;
  padding: 8px 12px;
  background: #1A1A1E;
  border-radius: 10px;
  border-bottom-left-radius: 3px;
  align-self: flex-start;
}

.gc-tdot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #52525B;
  animation: gc-bounce 1.2s infinite;
}

.gc-tdot:nth-child(2) { animation-delay: 0.2s; }
.gc-tdot:nth-child(3) { animation-delay: 0.4s; }

@keyframes gc-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* Tool call mini */
.gc-tool {
  background: #18181B;
  border: 1px solid #27272A;
  border-radius: 8px;
  overflow: hidden;
  font-size: 11px;
}

.gc-tool-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-bottom: 1px solid #27272A;
  color: #A1A1AA;
}

.gc-tool-head code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #c4b5fd;
  background: none;
  border: none;
  padding: 0;
}

.gc-check {
  margin-left: auto;
  color: #4ade80;
  font-size: 10px;
}

.gc-tool-body {
  padding: 6px 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
}

.gc-tool-body code {
  background: none;
  border: none;
  padding: 0;
  font-size: 10px;
}

/* Code block mini */
.gc-code {
  background: #0C0C0E;
  border: 1px solid #27272A;
  border-radius: 8px;
  overflow: hidden;
  font-size: 11px;
}

.gc-code-head {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  border-bottom: 1px solid #27272A;
  color: #52525B;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
}

.gc-code-body {
  padding: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #d4d4d8;
}

/* Thinking mini */
.gc-thinking {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #18181B;
  border: 1px solid #27272A;
  border-radius: 8px;
  font-size: 11px;
}

/* Citation mini */
.gc-citation {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background: rgba(129, 140, 248, 0.06);
  border: 1px solid rgba(129, 140, 248, 0.12);
  border-radius: 5px;
  font-size: 10px;
  color: #818CF8;
}

/* Image mini */
.gc-img {
  width: 56px;
  height: 42px;
  border-radius: 6px;
  background: #27272A;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* Conversation list mini */
.gc-convlist {
  font-size: 11px;
}

.gc-conv {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  color: #A1A1AA;
  border-bottom: 1px solid #1F1F23;
}

.gc-conv:last-child { border-bottom: none; }

.gc-conv-sel {
  background: rgba(129, 140, 248, 0.06);
  color: var(--fg);
}

.gc-conv-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #52525B;
  flex-shrink: 0;
}

.gc-conv-sel .gc-conv-dot { background: var(--accent); }

.gc-conv-time {
  margin-left: auto;
  font-size: 10px;
  color: #52525B;
  flex-shrink: 0;
}

/* Model button mini */
.gc-model-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #18181B;
  border: 1px solid #27272A;
  border-radius: 8px;
  font-size: 12px;
  color: var(--fg);
}

/* Token mini */
.gc-tokens {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: #A1A1AA;
  font-family: 'JetBrains Mono', monospace;
}

.gc-tokens strong {
  color: var(--fg);
  font-weight: 600;
}

/* --- Themes Section ---------------------------------------- */
.themes-section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.themes-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.theme-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.theme-preview {
  padding: 16px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tp-header {
  font-size: 11px;
  font-weight: 600;
  padding-bottom: 8px;
  margin-bottom: 6px;
}

.tp-bubble {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.4;
  max-width: 80%;
}

/* Light theme */
.theme-light {
  background: #FAFAFA;
  color: #18181B;
}

.theme-light .tp-header { border-bottom: 1px solid #E4E4E7; color: #18181B; }
.theme-light .tp-user { align-self: flex-end; background: #6366F1; color: #fff; border-bottom-right-radius: 3px; }
.theme-light .tp-ai { align-self: flex-start; background: #F4F4F5; color: #18181B; border-bottom-left-radius: 3px; }

/* Dark theme */
.theme-dark {
  background: #09090B;
  color: #FAFAFA;
}

.theme-dark .tp-header { border-bottom: 1px solid #27272A; color: #FAFAFA; }
.theme-dark .tp-user { align-self: flex-end; background: #6366F1; color: #fff; border-bottom-right-radius: 3px; }
.theme-dark .tp-ai { align-self: flex-start; background: #1E1E22; color: #d4d4d8; border-bottom-left-radius: 3px; }

/* iOS theme */
.theme-ios {
  background: #F2F2F7;
  color: #1C1C1E;
}

.theme-ios .tp-header { border-bottom: 1px solid #D1D1D6; color: #1C1C1E; }
.theme-ios .tp-user { align-self: flex-end; background: #007AFF; color: #fff; border-radius: 18px; border-bottom-right-radius: 4px; }
.theme-ios .tp-ai { align-self: flex-start; background: #E5E5EA; color: #1C1C1E; border-radius: 18px; border-bottom-left-radius: 4px; }

/* Premium theme */
.theme-premium {
  background: #0C0A1A;
  color: #E8E5F0;
}

.theme-premium .tp-header { border-bottom: 1px solid #1E1A2E; color: #E8E5F0; }
.theme-premium .tp-user { align-self: flex-end; background: linear-gradient(135deg, #6366F1, #8B5CF6); color: #fff; border-bottom-right-radius: 3px; }
.theme-premium .tp-ai { align-self: flex-start; background: #1A1628; color: #C4B5FD; border-bottom-left-radius: 3px; }

.theme-label {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
  border-top: 1px solid var(--border);
  text-align: center;
}

/* --- Code Reveal ------------------------------------------- */
.code-section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.code-reveal {
  background: #0A0A0C;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.code-reveal-header {
  padding: 10px 18px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}

.code-reveal-file {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--fg-subtle);
}

.code-reveal pre {
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
}

/* --- Compare Section --------------------------------------- */
.compare-section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.compare-card {
  padding: 28px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.compare-card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 18px;
}

.compare-old {
  background: rgba(248, 113, 113, 0.03);
  border-color: rgba(248, 113, 113, 0.1);
}

.compare-old .compare-card-title { color: #f87171; }

.compare-new {
  background: rgba(74, 222, 128, 0.03);
  border-color: rgba(74, 222, 128, 0.1);
}

.compare-new .compare-card-title { color: #4ade80; }

.compare-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-muted);
  padding: 6px 0;
}

.compare-x {
  color: #f87171;
  font-size: 12px;
  font-weight: 700;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.compare-check {
  color: #4ade80;
  font-size: 12px;
  font-weight: 700;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* --- Providers Section ------------------------------------- */
.providers-section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.providers-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.provider-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color 0.2s;
}

.provider-card:hover {
  border-color: #3F3F46;
}

.provider-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 4px;
}

.provider-models {
  font-size: 13px;
  color: var(--fg-muted);
  margin-bottom: 14px;
}

.provider-caps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pcap {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  background: #27272A;
  color: #A1A1AA;
}

.pcap-special {
  background: var(--accent-muted);
  color: var(--accent);
  border: 1px solid rgba(129, 140, 248, 0.2);
}

/* --- Footer ------------------------------------------------ */
.hp-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--fg-subtle);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  font-weight: 700;
  font-size: 14px;
  color: var(--fg-muted);
}

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

.footer-links a {
  color: var(--fg-subtle);
  font-size: 12px;
}

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

/* --- Responsive -------------------------------------------- */
@media (max-width: 1024px) {
  .hero-split {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 80px 0 60px;
  }

  .hero-right {
    order: -1;
  }

  .hero-phone {
    width: 260px;
  }

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

  .gallery-card-wide {
    grid-column: span 2;
  }

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

@media (max-width: 640px) {
  .hero-h1 {
    font-size: 32px;
  }

  .how-steps {
    grid-template-columns: 1fr;
  }

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

  .gallery-card-wide {
    grid-column: span 1;
  }

  .themes-row {
    grid-template-columns: 1fr 1fr;
  }

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

  .providers-row {
    grid-template-columns: 1fr;
  }

  .hp-footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .hero-actions {
    flex-direction: column;
  }

  .homepage-container {
    padding: 0 20px;
  }
}
