/* ============================================================
   DESIGN SYSTEM — App Showcase
   Aesthetic: Dark editorial, precise geometry, ink-on-paper
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:         #0b0b0f;
  --surface:    #111118;
  --surface-2:  #18181f;
  --border:     rgba(255,255,255,0.07);
  --border-2:   rgba(255,255,255,0.13);
  --text:       #e8e8ee;
  --text-2:     #8888a0;
  --text-3:     #555566;
  --accent:     #bf00ff;
  --accent-2:   #df80ff;
  --danger:     #ff5757;
  --accent-glow: rgba(191,0,255,0.35);

  --font-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --radius-sm:  6px;
  --radius:     12px;
  --radius-lg:  20px;
  --radius-xl:  32px;

  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow:     0 8px 40px rgba(0,0,0,0.5);
  --shadow-sm:  0 2px 12px rgba(0,0,0,0.3);

  --nav-h: 68px;
  --max-w: 1200px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul, ol { list-style: none; }

/* ── Navigation ─────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(11,11,15,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}
.nav-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.nav-logo .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(191,0,255,0.9), 0 0 16px rgba(191,0,255,0.5);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  background: var(--surface-2);
}
.nav-links a.active { color: var(--accent); }

/* ── Page wrapper ───────────────────────────────────────────── */
.page-wrap {
  padding-top: var(--nav-h);
  min-height: 100vh;
}

/* ── Section helpers ────────────────────────────────────────── */
.section {
  padding: 96px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.section-sm { padding: 64px 24px; max-width: var(--max-w); margin: 0 auto; }

.section-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  text-shadow: 0 0 12px rgba(191,0,255,0.7);
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}
.section-sub {
  font-size: 1.05rem;
  color: var(--text-2);
  margin-top: 16px;
  max-width: 560px;
  line-height: 1.7;
}

/* ── Divider ────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ── Badge / tag ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--border-2);
  color: var(--text-2);
  background: var(--surface-2);
}
.badge.accent { color: var(--accent); border-color: rgba(191,0,255,0.25); background: rgba(191,0,255,0.06); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(191,0,255,0.4);
}
.btn-primary:hover { background: #d020ff; transform: translateY(-1px); box-shadow: 0 4px 24px rgba(191,0,255,0.6); }
.btn-ghost {
  border: 1px solid var(--border-2);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--border-2); background: var(--surface-2); }

/* ── App card ───────────────────────────────────────────────── */
.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  /* fixed width — carousel controls visibility */
  flex: 0 0 300px;
  width: 300px;
  margin-top: 20px;
}
.app-card:hover {
  transform: translateY(-4px);
  border-color: rgba(191,0,255,0.4);
  box-shadow: 0 8px 32px rgba(191,0,255,0.15);
}
.app-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.app-icon-wrap {
  width: 52px; height: 52px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-2);
  flex-shrink: 0;
  background: var(--surface-2);
}
.app-icon-wrap img { width: 100%; height: 100%; object-fit: cover; }
.app-card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}
.app-card-info { flex: 1; min-width: 0; }
.app-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-card-tagline { font-size: 0.78rem; color: var(--text-2); }
.app-card-desc { font-size: 0.85rem; color: var(--text-2); line-height: 1.65; }
.app-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  background: var(--surface-2);
  transition: all var(--transition);
}
.store-btn:hover { color: var(--text); border-color: var(--border-2); background: var(--surface); }
.store-btn svg { flex-shrink: 0; }
.store-btn--circle {
  padding: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  justify-content: center;
  margin-left: auto;
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-2);
}
.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 0.85rem;
  color: var(--text-3);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--text-2); }
.footer-copy { font-size: 0.8rem; color: var(--text-3); }

/* ── Prose (Privacy, Contact) ───────────────────────────────── */
.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 24px;
  padding-top: calc(var(--nav-h) + 60px);
}
.prose h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.prose .last-updated { font-size: 0.85rem; color: var(--text-3); margin-bottom: 48px; }
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 12px;
  color: var(--text);
}
.prose p, .prose li {
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 12px;
}
.prose ul { padding-left: 20px; list-style: disc; }
.prose a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.6s ease both; }
.fade-up-1 { animation-delay: 0.1s; }
.fade-up-2 { animation-delay: 0.2s; }
.fade-up-3 { animation-delay: 0.3s; }
.fade-up-4 { animation-delay: 0.4s; }

/* ── App detail page ────────────────────────────────────────── */
.app-hero {
  padding-top: calc(var(--nav-h) + 64px);
  padding-bottom: 64px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: start;
}
.app-hero-icon {
  width: 100px; height: 100px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border-2);
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
.app-hero-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-hero-name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 12px;
}
.app-hero-desc { color: var(--text-2); font-size: 1.05rem; max-width: 540px; }
.app-hero-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.screenshots-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.screenshots-scroll::-webkit-scrollbar { display: none; }
.screenshots-track {
  display: flex;
  gap: 16px;
  padding: 0 24px;
  width: max-content;
}
.screenshot-item {
  width: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.screenshot-item img { width: 100%; height: 420px; object-fit: cover; }

/* ── Grid (kept for potential reuse) ───────────────────────── */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

/* ── Carousel ───────────────────────────────────────────────── */
.carousel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 48px;
}
.carousel-viewport {
  overflow: hidden;
  flex: 1;
}
.carousel-track {
  display: flex;
  gap: 20px;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.carousel-btn {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  cursor: pointer;
}
.carousel-btn:hover:not(:disabled) {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(191,0,255,0.35);
}
.carousel-btn:disabled { opacity: 0.25; cursor: default; }
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}
.carousel-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border-2);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}
.carousel-dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(191,0,255,0.7);
}
@media (max-width: 639px) {
  .carousel-btn { width: 36px; height: 36px; }
  .app-card { flex: 0 0 260px; width: 260px; }
}

/* ── Contact form ───────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.form-input, .form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  transition: border-color var(--transition);
  outline: none;
  resize: none;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(191,0,255,0.15), 0 0 12px rgba(191,0,255,0.2);
}
.form-textarea { min-height: 140px; }
::placeholder { color: var(--text-3); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .app-hero { grid-template-columns: 1fr; }
  .app-hero-icon { width: 76px; height: 76px; border-radius: 18px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
}