/* ============================================
   Büns Mobile Apps - Design System
   Flat Dark Theme with Light/Dark Mode Support
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  /* Light Mode (default for prefers-color-scheme: light) */
  --bg-primary: #F3F4F6;
  --bg-surface: #FFFFFF;
  --bg-surface-hover: #E5E7EB;
  --border-color: #D1D5DB;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --accent-primary: #2563EB;
  --accent-primary-hover: #1D4ED8;
  --accent-cta: #F97316;
  --accent-cta-hover: #EA580C;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

  /* Color scheme indicator */
  color-scheme: light dark;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg-primary: #0F172A;
  --bg-surface: #1E293B;
  --bg-surface-hover: #334155;
  --border-color: #334155;
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --accent-primary: #3B82F6;
  --accent-primary-hover: #60A5FA;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
}

/* OS Preference Detection */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-primary: #0F172A;
    --bg-surface: #1E293B;
    --bg-surface-hover: #334155;
    --border-color: #334155;
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --accent-primary: #3B82F6;
    --accent-primary-hover: #60A5FA;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  }
}

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

/* ---------- Typography ---------- */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-y: scroll;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

p {
  color: var(--text-secondary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-primary);
}

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

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

.section {
  padding: 80px 0;
}

@media (max-width: 768px) {
  .section {
    padding: 48px 0;
  }
}

/* ---------- Navigation ---------- */
.navbar {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 1200px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

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

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

.nav-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Dropdown Menu */
.nav-dropdown-wrapper {
  position: relative;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 0;
  min-width: 160px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.nav-dropdown-wrapper:hover .nav-dropdown,
.nav-dropdown-wrapper:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown a {
  display: block;
  padding: 8px 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.nav-dropdown a:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.theme-toggle:hover {
  background: var(--border-color);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--text-primary);
}

.theme-toggle .icon-sun,
[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }

  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.lang-option {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-option:hover {
  color: var(--text-primary);
}

.lang-option.active {
  background: var(--accent-primary);
  color: #fff;
}

/* Mobile Navigation */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    background: var(--bg-surface);
    padding: 16px;
    border-top: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    gap: 16px;
    align-items: flex-start;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-dropdown-wrapper {
    width: 100%;
  }

  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding-left: 16px;
    display: none;
  }

  .nav-dropdown-wrapper:hover .nav-dropdown,
  .nav-dropdown-wrapper:focus-within .nav-dropdown {
    display: block;
  }
}

/* ---------- Hero Section ---------- */
.hero {
  padding-top: 140px;
  padding-bottom: 80px;
  text-align: center;
}

.hero h1 {
  margin-bottom: 16px;
}

.hero p {
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto 32px;
  color: var(--text-muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  color: #fff;
}

.btn-cta {
  background: var(--accent-cta);
  color: #fff;
}

.btn-cta:hover {
  background: var(--accent-cta-hover);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-surface-hover);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.card-text {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  /* margin-bottom: 12px; removed to let gap handle it or keep if needed, but flex gap is usually enough */
  align-self: flex-start;
}

.app-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

/* Card Icon (positioned top right) */
.card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
  margin-left: 16px;
}

.card-icon svg {
  width: 22px;
  height: 22px;
  color: var(--text-muted);
}



/* App Card */
.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
}

.app-card:hover {
  border-color: var(--accent-primary);
}

.app-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-icon svg {
  width: 24px;
  height: 24px;
  color: #fff;
}

/* Feature List */
.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.feature-list svg {
  width: 18px;
  height: 18px;
  color: var(--accent-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ---------- Section Headers ---------- */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.section-title {
  margin-bottom: 16px;
}

.section-description {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-muted);
}

/* ---------- Store Badges ---------- */
.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  min-width: 200px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.store-badge:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.store-icon {
  width: 32px;
  height: 32px;
}

.store-icon svg {
  width: 100%;
  height: 100%;
}

.badge-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.badge-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.badge-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---------- Screenshots Carousel ---------- */
.screenshot-scroller {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 16px 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.screenshot-scroller::-webkit-scrollbar {
  height: 8px;
}

.screenshot-scroller::-webkit-scrollbar-track {
  background: var(--bg-surface);
  border-radius: 4px;
}

.screenshot-scroller::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.screenshot-card {
  flex: 0 0 320px;
  scroll-snap-align: start;
}

.device-frame {
  background: #000;
  border-radius: 24px;
  padding: 8px;
  box-shadow: var(--shadow-lg);
}

.device-frame img {
  border-radius: 18px;
  width: 100%;
}

/* ---------- Privacy Policy ---------- */
.privacy-content {
  max-width: 800px;
  margin: 0 auto;
}

.privacy-content h1 {
  margin-bottom: 24px;
}

.privacy-content h2 {
  margin: 32px 0 16px;
  font-size: 1.25rem;
}

.privacy-content p {
  margin-bottom: 16px;
}

.privacy-content ul {
  margin-left: 24px;
  margin-bottom: 16px;
}

.privacy-content li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.privacy-content a {
  color: var(--accent-primary);
}

.privacy-content a:hover {
  text-decoration: underline;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  text-align: center;
}

.footer p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ---------- Contact CTA ---------- */
.contact-cta {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 48px;
  text-align: center;
}

.contact-cta h3 {
  margin-bottom: 12px;
}

.contact-cta p {
  margin-bottom: 24px;
  color: var(--text-muted);
}

/* ---------- Utilities ---------- */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-muted {
  color: var(--text-muted);
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.mt-32 {
  margin-top: 32px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-24 {
  margin-bottom: 24px;
}

.mb-32 {
  margin-bottom: 32px;
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}