@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600&display=swap");

:root {
  color-scheme: light;
  
  /* Modern HSL based color palette */
  --hue-primary: 182;
  --hue-accent: 25;
  
  --bg: hsl(30, 20%, 98%);
  --bg-alt: hsl(30, 15%, 95%);
  --surface: rgba(255, 255, 255, 0.75);
  --surface-strong: #ffffff;
  --text: hsl(200, 15%, 15%);
  --muted: hsl(200, 10%, 40%);
  
  --primary: hsl(var(--hue-primary), 90%, 25%);
  --primary-strong: hsl(var(--hue-primary), 90%, 15%);
  --primary-light: hsl(var(--hue-primary), 90%, 95%);
  
  --accent: hsl(var(--hue-accent), 90%, 50%);
  --accent-strong: hsl(var(--hue-accent), 90%, 40%);
  
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 24px 50px rgba(0, 0, 0, 0.12);
  
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-full: 9999px;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

body[data-theme="dark"] {
  color-scheme: dark;
  
  --bg: hsl(200, 20%, 4%);
  --bg-alt: hsl(200, 20%, 8%);
  --surface: rgba(20, 25, 30, 0.75);
  --surface-strong: hsl(200, 20%, 12%);
  --text: hsl(0, 0%, 95%);
  --muted: hsl(200, 10%, 65%);
  
  --primary: hsl(var(--hue-primary), 70%, 50%);
  --primary-strong: hsl(var(--hue-primary), 80%, 65%);
  --primary-light: hsl(var(--hue-primary), 70%, 15%);
  
  --accent: hsl(var(--hue-accent), 90%, 60%);
  --accent-strong: hsl(var(--hue-accent), 90%, 75%);
  
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 50px rgba(0, 0, 0, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", sans-serif;
  line-height: 1.6;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

/* Dynamic Animated Background */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(145deg, var(--bg), var(--bg-alt));
}

.page-bg::before,
.page-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  animation: float 20s ease-in-out infinite alternate;
  z-index: -1;
}

.page-bg::before {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

.page-bg::after {
  bottom: -10%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  animation-delay: -10s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(5%, 10%) scale(1.1); }
}

/* Topbar Typography & Glassmorphism */
.topbar {
  position: sticky;
  top: 1rem;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto;
  width: min(1180px, calc(100% - 2rem));
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: transform var(--transition-fast);
}

.brand:hover {
  transform: scale(1.05);
}

.brand-logo {
  display: block;
  width: auto;
  height: 32px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.topnav a {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.95rem;
  position: relative;
  transition: color var(--transition-fast);
}

.topnav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-normal);
  border-radius: 2px;
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--primary);
}

.topnav a:hover::after,
.topnav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.theme-toggle {
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.theme-toggle:active {
  transform: translateY(0);
}

main {
  width: min(1180px, 100% - 2rem);
  margin: 0 auto;
  padding: 2.2rem 0 4rem;
}

section {
  margin-top: 4rem;
  scroll-margin-top: 6rem;
}

/* Hero Section */
.hero {
  padding: 4rem 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.eyebrow {
  margin: 0 0 1rem 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  max-width: 22ch;
  margin: 0 auto;
}

.hero-copy {
  margin: 1.5rem auto 2.5rem;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.6;
}

/* App Download Banner */
.app-download-banner {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}

.app-store-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--text);
  color: var(--bg);
  padding: 1rem 1.75rem;
  border-radius: var(--radius-full);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
  border: 2px solid transparent;
}

body[data-theme="dark"] .app-store-btn {
  background: var(--text);
  color: var(--bg);
}

.app-store-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg);
  color: var(--bg);
}

.app-store-btn:active {
  transform: translateY(0) scale(0.98);
}

.apple-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

h2 {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 800;
}

/* Image Grid */
.image-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.image-card {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.image-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.image-card img {
  width: 100%;
  height: 340px;
  object-fit: contain;
  background: var(--surface-strong);
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  transition: transform var(--transition-slow);
}

.image-card:hover img {
  transform: scale(1.03);
}

.image-card figcaption {
  margin-top: 1.25rem;
  font-weight: 700;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--text);
  text-align: center;
  font-size: 1.1rem;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

.feature-card {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(320px, 40%) 1fr;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.feature-media {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  padding: 1rem;
  transition: transform var(--transition-normal);
}

.feature-card:hover .feature-media {
  transform: scale(1.02);
}

.feature-media img {
  width: 100%;
  height: 380px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  cursor: zoom-in;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  opacity: 0.7;
  transition: opacity var(--transition-normal);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-content h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.feature-content h3::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 24px;
  background-color: var(--primary-light);
  border-radius: 50%;
  border: 4px solid var(--primary);
}

.feature-content ul {
  margin: 0;
  padding-left: 1.5rem;
  color: var(--muted);
  font-size: 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feature-content li::marker {
  color: var(--accent);
}

/* Footer */
.footer {
  width: min(1180px, 100% - 2rem);
  margin: 0 auto 2rem;
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

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

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 1rem;
  opacity: 1;
  transition: opacity var(--transition-normal);
}

.lightbox[hidden] {
  display: none;
  opacity: 0;
}

.lightbox-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: min(96vw, 1400px);
  height: min(94vh, 950px);
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.1) rotate(90deg);
}

/* Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Media Queries */
@media (max-width: 900px) {
  .feature-card {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .feature-media img {
    height: 300px;
  }
  
  .feature-card::before {
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
  }
}

@media (max-width: 680px) {
  .topbar {
    top: 0;
    width: 100%;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
    padding: 1rem;
    flex-wrap: wrap;
  }

  .topnav {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  
  main {
    padding-top: 2rem;
  }

  .hero {
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius-md);
  }

  h1 {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
  }

  .image-card img {
    height: 240px;
  }
  
  .feature-content h3 {
    font-size: 1.25rem;
  }

  .lightbox-frame {
    height: min(92vh, 820px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .reveal {
    opacity: 1;
    transform: none;
  }
  
  .page-bg::before,
  .page-bg::after {
    animation: none;
  }
}
