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

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #18181b;
  --text-secondary: #71717a;
  --border: #e4e4e7;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.08), 0 8px 40px rgba(0, 0, 0, 0.04);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* === Header === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 250, 0.8);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width var(--transition);
}

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

.nav-links a:hover::after {
  width: 100%;
}

/* === Hero === */
.hero {
  padding: 120px 24px 96px;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero h1 span {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 40%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto;
}

/* === Section Title === */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
  padding: 0 24px;
}

/* === Products Grid === */
.products {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 100px;
}

.products-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* === Product Card — glass card style === */
.card {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 32px 36px;
  border-radius: 24px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--surface);
  border: 1px solid transparent;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Subtle gradient glow behind card */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 80% 50%, var(--card-color, var(--accent))08, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 24px;
  border: 1px solid var(--border);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-2px);
}

.card:hover::before {
  opacity: 1;
}

.card:hover::after {
  border-color: var(--card-color, var(--accent))40;
  box-shadow: 0 0 40px -8px var(--card-color, var(--accent))20,
              0 4px 24px rgba(0,0,0,0.06);
}

/* Card icon — large with soft glow */
.card-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  color: white;
  font-weight: 800;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 24px -4px var(--card-color, var(--accent))40;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.4s ease;
}

.card:hover .card-icon {
  transform: scale(1.05);
  box-shadow: 0 12px 32px -6px var(--card-color, var(--accent))50;
}

.card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Icon decorative ring */
.card-icon::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 23px;
  border: 2px solid var(--card-color, var(--accent))20;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover .card-icon::after {
  opacity: 1;
}

/* Card content */
.card-body {
  flex: 1;
  min-width: 0;
}

.card-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.card-developer {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card meta */
.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.card-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--card-color, var(--accent))10;
  color: var(--card-color, var(--accent));
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.3s ease;
}

.card:hover .card-badge {
  background: var(--card-color, var(--accent))18;
}

.card-platforms {
  display: flex;
  gap: 6px;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 500;
  background: var(--bg);
  color: var(--text-secondary);
}

.platform-badge svg {
  width: 12px;
  height: 12px;
  opacity: 0.6;
}

/* Card arrow */
.card-arrow {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-arrow svg {
  width: 18px;
  height: 18px;
  transition: transform 0.35s ease;
}

.card:hover .card-arrow {
  background: var(--card-color, var(--accent));
  color: white;
  box-shadow: 0 4px 16px var(--card-color, var(--accent))30;
}

.card:hover .card-arrow svg {
  transform: translateX(3px);
}

/* === Reveal Animation === */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }

/* === Product Detail Page === */
.product-detail {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 100px;
  transition: all var(--transition);
  margin-bottom: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.detail-back:hover {
  color: var(--text);
  background: var(--bg);
}

.detail-back svg {
  width: 16px;
  height: 16px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 48px;
}

.detail-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
  font-weight: 800;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.detail-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-header-info h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.detail-developer {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.detail-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.detail-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.detail-meta-item {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.detail-meta-item::before {
  content: "·";
  color: var(--border);
}

.detail-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Screenshots — horizontal scroll */
.detail-screenshots {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 48px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.detail-screenshots::-webkit-scrollbar {
  height: 6px;
}

.detail-screenshots::-webkit-scrollbar-track {
  background: transparent;
}

.detail-screenshots::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.detail-screenshot {
  flex-shrink: 0;
  width: 260px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  scroll-snap-align: start;
  transition: transform var(--transition), box-shadow var(--transition);
}

.detail-screenshot:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.detail-screenshot img {
  width: 100%;
  height: auto;
  display: block;
}

.screenshot-empty {
  flex-shrink: 0;
  width: 260px;
  min-height: 460px;
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  text-align: center;
  line-height: 1.4;
  padding: 16px;
  scroll-snap-align: start;
}

/* Description */
.detail-description {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 40px;
  max-width: 680px;
}

/* Section labels */
.detail-section-label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Features */
.features {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 40px;
}

.features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text);
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.features li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* Store Buttons */
.store-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.store-btn:hover {
  background: var(--text);
  color: white;
  border-color: var(--text);
}

.store-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Policy Links */
.policy-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.policy-links a {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.policy-links a:hover {
  color: var(--accent);
}

/* === Footer === */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 80px 24px;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

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

  .detail-header {
    flex-direction: column;
    gap: 20px;
  }

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

  .detail-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
  }

  .detail-header-info h1 {
    font-size: 1.5rem;
  }

  .detail-screenshot {
    width: 220px;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 64px 24px 48px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .card {
    padding: 20px 24px;
    gap: 18px;
  }

  .card-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
  }

  .card-body h3 {
    font-size: 1rem;
  }

  .card-arrow {
    width: 36px;
    height: 36px;
  }

  .store-buttons {
    flex-direction: column;
  }

  .store-btn {
    justify-content: center;
  }

  .nav-links {
    gap: 16px;
  }

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

  .detail-header {
    gap: 16px;
  }

  .detail-screenshot {
    width: 200px;
  }

  .screenshot-empty {
    width: 200px;
    min-height: 360px;
  }

  .detail-meta-row {
    gap: 10px;
  }
}
