:root {
  --primary: #7c3aed;
  --primary-light: #a78bfa;
  --primary-glow: rgba(124, 58, 237, 0.15);
  --bg: #0f0f0f;
  --bg-card: #1a1a1a;
  --bg-tag: #252525;
  --text: #e5e5e5;
  --text-muted: #9ca3af;
  --border: #2d2d2d;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

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

a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Header */
.site-header {
  text-align: center;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.site-header-lang {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.language-switch {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  font-size: 14px;
}

.language-switch a {
  margin: 0 8px;
}

.highlight {
  color: var(--primary-light);
}

/* Hero */
.hero-avatar {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  margin: 0 auto 20px;
  overflow: hidden;
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-logo {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-light);
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.hero-tagline {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 500px;
  margin: 0 auto 20px;
}

.hero-bio {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 520px;
  margin: 0 auto 20px;
  line-height: 1.8;
}

.hero-social {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.hero-social a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 13px;
  transition: border-color 0.2s, color 0.2s;
}

.hero-social a:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  text-decoration: none;
}

.hero-social svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Section */
.section-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 24px;
}

/* App card grid */
.app-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}

.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  color: inherit;
}

.app-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
  text-decoration: none;
}

.app-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.app-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  flex-shrink: 0;
  overflow: hidden;
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.app-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.app-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.app-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
  flex-grow: 1;
}

/* Feature tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tag {
  background: var(--bg-tag);
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Platform badges */
.platforms {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.platform {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--primary-glow);
  color: var(--primary-light);
  border: 1px solid rgba(124, 58, 237, 0.3);
}

/* ========== Detail page styles ========== */

/* Back link */
.back-link {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 14px;
}

/* Detail hero */
.detail-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

.detail-icon {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  flex-shrink: 0;
  overflow: hidden;
}

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

.detail-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.detail-subtitle {
  font-size: 15px;
  color: var(--text-muted);
}

/* Store buttons */
.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 36px;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.2s, background 0.2s;
}

.store-btn:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
  text-decoration: none;
}

.store-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Feature sections on detail page */
.detail-section {
  margin-bottom: 32px;
}

.detail-section h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.feature-list {
  list-style: none;
  padding: 0;
}

.feature-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 15px;
}

.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-light);
}

/* Info grid (detail page metadata) */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.info-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.info-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.info-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* Product rows (homepage) */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 48px;
}

.product-row {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.product-row:hover {
  border-color: var(--primary);
  box-shadow: 0 0 24px var(--primary-glow);
  text-decoration: none;
}

.product-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  flex-shrink: 0;
  overflow: hidden;
}

.product-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

.product-info {
  flex: 1;
  min-width: 0;
}

.product-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.product-oneliner {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 8px;
}

.product-link {
  font-size: 13px;
  color: var(--primary-light);
}

.product-thumbs {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.product-thumbs img {
  height: 120px;
  width: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

@media (max-width: 640px) {
  .product-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .product-thumbs {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .product-thumbs img {
    height: 100px;
    flex-shrink: 0;
  }
}

/* Screenshot gallery */
.screenshot-gallery {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.screenshot-gallery img {
  height: 420px;
  width: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  scroll-snap-align: start;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .screenshot-gallery img {
    height: 320px;
  }
}

/* Footer */
footer {
  text-align: center;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary-light);
  text-decoration: none;
}

.footer-links svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 20px 15px;
  }

  .hero-logo {
    font-size: 28px;
  }

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

  .section-title {
    font-size: 20px;
  }

  .detail-hero {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .detail-title {
    font-size: 24px;
  }

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

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