<script setup lang="ts">
import AppCard from './components/AppCard.vue'
import { apps } from './apps'
</script>

<template>
  <main class="page">
    <header class="hero">
      <div class="logo">
        <svg viewBox="0 0 64 64" aria-hidden="true">
          <defs>
            <linearGradient id="g" x1="0" y1="0" x2="1" y2="1">
              <stop offset="0%" stop-color="#7c3aed" />
              <stop offset="100%" stop-color="#06b6d4" />
            </linearGradient>
          </defs>
          <rect x="8" y="8" width="48" height="48" rx="10" fill="url(#g)" />
          <path
            d="M20 20 L44 20 L44 44 L20 44 Z M20 20 L32 14 L56 14 L44 20 M44 20 L56 14 L56 38 L44 44"
            fill="none" stroke="white" stroke-width="2.4" stroke-linejoin="round"
          />
        </svg>
      </div>
      <h1>cube</h1>
      <p class="tagline">Fam 的小 app 平台 · <code>*.famzheng.me</code></p>
    </header>

    <section class="grid">
      <AppCard v-for="app in apps" :key="app.slug" :app="app" />
    </section>

    <footer class="foot">
      <span>cube · monorepo at</span>
      <a href="https://famzheng.me/gitea/fam/cube" target="_blank" rel="noopener">famzheng.me/gitea/fam/cube</a>
    </footer>
  </main>
</template>

<style scoped>
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
}

.hero {
  text-align: center;
  margin-bottom: 3rem;
}

.logo {
  width: 88px;
  height: 88px;
  margin: 0 auto 1.25rem;
  filter: drop-shadow(0 8px 24px rgba(124, 58, 237, 0.35));
}
.logo svg { width: 100%; height: 100%; }

h1 {
  font-size: 3.25rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #fff 0%, #b8c0d6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  margin-top: 0.5rem;
  color: var(--fg-dim);
  font-size: 1rem;
}
.tagline code {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  font-size: 0.9em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.foot {
  text-align: center;
  color: var(--fg-dim);
  font-size: 0.85rem;
}
.foot a {
  color: var(--accent-2);
  margin-left: 0.35rem;
}
.foot a:hover { text-decoration: underline; }
</style>
