@use '../variables' as v;
@use '../mixins' as m;

// ─────────────────────────────────────────────
// Home / Landing page
// ─────────────────────────────────────────────

.home-page {
  font-family: v.$font-family;
  background: var(--bg-surface);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;

  // ── Nav ──────────────────────────────────
  .home-nav {
    @include m.flex-between;
    padding: 18px 48px;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-brand {
    @include m.flex-start;
    gap: 10px;
    text-decoration: none;

    &-icon { width: 32px; height: 32px; }

    &-name {
      font-size: v.$font-size-xl;
      font-weight: 700;
      color: var(--text-primary);
      letter-spacing: -0.02em;
    }
  }

  .nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    background: v.$primary;
    color: v.$white;
    border-radius: v.$radius;
    font-size: v.$font-size-base;
    font-weight: 600;
    text-decoration: none;
    transition: background v.$transition-base;

    &:hover { background: v.$primary-hover; }
  }

  // ── Hero ─────────────────────────────────
  .hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 24px 60px;

    &-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: var(--active-bg);
      color: var(--active-text);
      font-size: v.$font-size-xs;
      font-weight: 600;
      padding: 5px 14px;
      border-radius: v.$radius-full;
      margin-bottom: 28px;
      letter-spacing: 0.02em;

      &-dot {
        width: 6px;
        height: 6px;
        background: var(--active-text);
        border-radius: 50%;
      }
    }

    &-title {
      font-size: clamp(v.$font-size-4xl, 6vw, 64px);
      font-weight: 800;
      line-height: 1.1;
      letter-spacing: -0.03em;
      color: var(--text-primary);
      max-width: 720px;
      margin-bottom: 20px;

      span {
        background: linear-gradient(135deg, v.$primary 0%, v.$accent 40%, v.$warning 70%, v.$success 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
      }
    }

    &-sub {
      font-size: v.$font-size-xl;
      color: var(--text-secondary);
      max-width: 520px;
      line-height: 1.6;
      margin-bottom: 40px;
      font-weight: 400;
    }

    &-actions {
      display: flex;
      align-items: center;
      gap: 14px;
      flex-wrap: wrap;
      justify-content: center;
    }
  }

  // ── CTA button ───────────────────────────
  .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: v.$primary;
    color: v.$white;
    border-radius: v.$radius-md;
    font-size: v.$font-size-md;
    font-weight: 600;
    
    text-decoration: none;
    transition: background v.$transition-base, transform 100ms ease, box-shadow v.$transition-base;
    box-shadow: 0 2px 12px rgba(66, 133, 244, 0.35);

    svg { width: 18px; height: 18px; }

    &:hover {
      background: v.$primary-hover;
      transform: translateY(-1px);
      box-shadow: 0 6px 20px rgba(66, 133, 244, 0.40);
    }

    &:active { transform: translateY(0); }
  }

  // ── Color chips ──────────────────────────
  .color-chips {
    display: flex;
    gap: 10px;
    margin-top: 56px;
    justify-content: center;
  }

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

  // ── Feature strip ────────────────────────
  .features {
    display: flex;
    justify-content: center;
    gap: 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
  }

  .feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 32px;
    font-size: v.$font-size-sm;
    font-weight: 500;
    color: var(--text-secondary);
    border-right: 1px solid var(--border-color);

    &:last-child { border-right: none; }
  }

  .feature-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  // ── Footer ───────────────────────────────
  .home-footer {
    text-align: center;
    padding: 20px;
    font-size: v.$font-size-xs;
    color: var(--text-muted);
  }

  // ── Responsive ───────────────────────────
  @include m.max-sm {
    .home-nav { padding: 14px 20px; }
    .feature-item { padding: 14px 18px; font-size: v.$font-size-2xs; }
    .hero { padding: 60px 20px 40px; }
  }

  // ── Error page overrides ─────────────────
  .error-hero {
    gap: 16px;
  }

  .error-code {
    font-size: clamp(80px, 18vw, 160px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, v.$primary 0%, v.$accent 50%, v.$warning 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
  }

  .error-title {
    font-size: clamp(22px, 4vw, 36px) !important;
    margin-bottom: 12px;
  }

  .error-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: v.$font-size-base;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color v.$transition-base;

    &:hover { color: var(--text-primary); }
  }
}
