/* 1. Reset & Design Tokens */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --header-bg: rgba(248, 250, 252, 0.88);
  --nav-bg: rgba(255, 255, 255, 0.94);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --pill-active-bg: #0f172a;
  --pill-active-text: #ffffff;
  --radius-lg: 20px;
  --radius-md: 14px;
  --nav-height: 68px;
  --shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  --max-width: 1120px;
}

/* Dark Mode Color Tokens */
[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #1e293b;
  --header-bg: rgba(11, 17, 32, 0.88);
  --nav-bg: rgba(15, 23, 42, 0.94);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #818cf8;
  --primary-hover: #6366f1;
  --primary-soft: rgba(129, 140, 248, 0.16);
  --border: #334155;
  --border-hover: #475569;
  --pill-active-bg: #f8fafc;
  --pill-active-text: #0f172a;
  --shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100dvh;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* 2. Responsive App Shell */
.app-shell {
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* 3. Sticky Top Header */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.top-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  height: 28px;
  width: auto;
  display: block;
  object-fit: contain;
  border-radius: 6px; /* Optional: remove if using a transparent SVG or PNG icon */
}

/* Desktop Top Links (Hidden on Mobile) */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 28px;
}

.desktop-link {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.15s ease;
  padding: 6px 0;
  position: relative;
}

.desktop-link:hover,
.desktop-link.active {
  color: var(--primary);
}

.desktop-link.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--primary);
}

.theme-toggle:active {
  transform: scale(0.94);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* Toggle Sun/Moon Icon Visibility */
.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

.header-cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.header-cta:hover {
  background: var(--primary);
  color: #ffffff;
}

/* 4. Main Content & Multi-Page Views */
main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 20px calc(var(--nav-height) + 32px);
}

.page {
  display: none;
  animation: fadeUp 0.25s ease-out;
}

.page.active {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 5. Hero & Typography */
.hero-card {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
  box-shadow: 0 12px 24px -6px rgba(79, 70, 229, 0.35);
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.page-subtitle {
  color: var(--text-muted);
  margin-bottom: 18px;
}

.hero-card p {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 20px;
  max-width: 540px;
}

/* 6. Touch & Click-Friendly Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-white {
  background: #ffffff;
  color: #4f46e5;
}

.btn-white:hover {
  background: #f8fafc;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

/* 7. Responsive Card Grids */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.2s ease;
}

.card:hover {
  border-color: var(--border-hover);
}

a.card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

a.card:active {
  transform: scale(0.985);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-title {
  font-weight: 700;
  font-size: 1.08rem;
}

.card-arrow {
  color: var(--primary);
  font-weight: 700;
}

.price-tag {
  font-weight: 800;
  color: var(--primary);
  font-size: 1.2rem;
}

.card-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.card-desc-spaced {
  margin-bottom: 20px;
}

/* 8. Horizontal Swipeable Pills (Explore Page) */
.pill-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 18px;
  scrollbar-width: none;
}

.pill-row::-webkit-scrollbar {
  display: none;
}

.pill {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill:hover {
  border-color: var(--text-main);
  color: var(--text-main);
}

.pill.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-text);
  border-color: var(--pill-active-bg);
}

/* 9. Contact Form & PC Split Layout */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

input,
textarea {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  font-size: 1rem; /* Prevents iOS auto-zoom on focus */
  font-family: inherit;
  color: var(--text-main);
  transition: border-color 0.15s ease, background-color 0.2s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-status {
  margin-top: 12px;
  font-size: 0.9rem;
  color: #22c55e;
  font-weight: 600;
  display: none;
}

.form-status.visible {
  display: block;
}

/* 10. Thumb-Friendly Bottom Navigation Bar (Mobile Only) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 30;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.nav-link svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.nav-link.active {
  color: var(--primary);
}
/* 11. Direct Email Link & Tap-to-Copy Button */
.email-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.email-link {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
  word-break: break-all;
}

.email-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.copy-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.copy-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.copy-btn.copied {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}


/* 12. Tablet & PC Breakpoints (>= 768px) */
@media (min-width: 768px) {
  .bottom-nav {
    display: none;
  }

  .desktop-nav {
    display: flex;
  }

  .top-bar-inner {
    padding: 16px 32px;
  }

  main {
    padding: 36px 32px 64px;
  }

  .hero-card {
    padding: 48px;
  }

  h1 {
    font-size: 2.5rem;
  }

  .hero-card .btn {
    width: auto;
    min-width: 190px;
  }

  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

.contact-layout {
grid-template-columns: 1fr 1.4fr;
align-items: start;
}
}
