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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-hover: #222636;
  --border: #2a2d3d;
  --accent: #5b8dee;
  --accent-dim: #3a5fa0;
  --text: #e2e4ef;
  --text-muted: #8b8fa8;
  --tag-bg: #1e2235;
  --tag-text: #7b9cda;
  --radius: 12px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* Header */
header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  margin-bottom: 60px;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

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

/* Hero */
.hero {
  margin-bottom: 64px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

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

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 580px;
}

/* Section heading */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* App cards grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
  margin-bottom: 80px;
}

@media (max-width: 600px) {
  .apps-grid {
    grid-template-columns: 1fr;
  }
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.app-card-image {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.app-card:hover {
  background: var(--surface-hover);
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}

.app-card-icon {
  font-size: 2rem;
  line-height: 1;
}

.app-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.app-card-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

.app-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

.app-card-link {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.app-card-link::after {
  content: '→';
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- App detail page --- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 40px;
  transition: color 0.15s;
}

.back-link::before {
  content: '←';
}

.back-link:hover {
  color: var(--accent);
}

.app-header {
  margin-bottom: 48px;
}

.app-header-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.app-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.app-header .subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 620px;
}

.app-header .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.app-hero-image {
  width: 100%;
  max-width: 520px;
  display: block;
  margin-top: 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* Content sections */
.content-section {
  margin-bottom: 48px;
}

.content-section h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.content-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  margin-top: 20px;
}

.content-section p {
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.75;
}

.content-section ul,
.content-section ol {
  color: var(--text-muted);
  padding-left: 20px;
  margin-bottom: 12px;
}

.content-section li {
  margin-bottom: 6px;
  line-height: 1.65;
}

/* Feature list */
.feature-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-muted);
}

.feature-list li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Info box */
.info-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.info-box p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.info-box a {
  color: var(--accent);
}

/* Code snippet */
code {
  background: var(--tag-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.85em;
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  color: var(--tag-text);
}

/* Divider */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* CTA box */
.cta-box {
  background: var(--surface);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 32px 28px;
  margin-top: 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.cta-box p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  padding: 13px 28px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover {
  background: #4a7de0;
  transform: translateY(-1px);
}

.privacy-link-wrap {
  margin-top: -4px;
}

.privacy-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: underline;
}

.privacy-link:hover {
  color: var(--accent);
}
