/* Apple-inspired minimal style with glass effect */

html {
  scroll-behavior: smooth; /* optional: smooth scroll for anchor links */
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  background: linear-gradient(135deg, #f5f5f7, #e0e0e5);
  color: #1d1d1f;
  padding: 0 1rem; /* Horizontal padding for narrow screens */
}

header {
  position: sticky;
  top: 1rem;
  z-index: 1000;

  /* wider than sections: 800px + 3rem */
  width: 100%;
  max-width: calc(800px + 3rem);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  box-sizing: border-box;

  /* pill look */
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 9999px; /* pill shape */
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

/* Header nav layout */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem; /* small gap to avoid crowding */
}

header h1 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.5rem;   /* match section header font */
  font-weight: 700;
  margin: 0;
  color: #111;
}

/* Navigation links */
nav ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;           /* wrap on narrow screens */
}

nav li {
  display: inline-flex;
}

nav a {
  text-decoration: none;
  font-weight: 500;
  color: #111;
  transition: color 0.2s ease, opacity 0.2s ease;
}

nav a:hover {
  color: #007aff; /* iOS blue accent */
}

/* Global link styles */
a {
  color: inherit;              /* same color as surrounding text */
  text-decoration: underline;  /* underline for clarity */
}

a:hover {
  opacity: 0.85;               /* subtle feedback on hover */
}

/* Section cards */
h1, h2, h3 {
  font-weight: 600;
}

section {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1.5rem;
  backdrop-filter: blur(20px) saturate(180%);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

/* Carousel */
.carousel {
  position: relative;
  overflow: hidden;
}

.carousel-container {
  display: flex;
  gap: 1rem;
  overflow-x: auto;              /* enable horizontal scrolling */
  scroll-snap-type: x mandatory; /* snap to slides */
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;        /* avoid scrollbar overlap */
}

.slide {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.slide img {
  display: block;
  height: auto;
  max-height: 400px;
  border-radius: 12px;
}

/* Navigation buttons */
.carousel button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.carousel .prev { left: 10px; }
.carousel .next { right: 10px; }

.carousel button:hover {
  background: rgba(255, 255, 255, 0.9);
}

.carousel button span {
  display: block;
  transform: translateY(-2px); /* nudge arrow up slightly */
}

/* Hide scrollbar for WebKit */
.carousel-container::-webkit-scrollbar {
  height: 0;
}

/* App Store button */
.appstore-link {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: #0071e3;
  color: white;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 500;
}

.appstore-link:hover {
  background: #005bb5;
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  color: #6e6e73;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, #1c1c1e, #2c2c2e);
    color: #f2f2f7;
  }

  header {
    background: rgba(44, 44, 46, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  }

  header h1 {
    color: #f2f2f7;
  }

  nav a {
    color: #f2f2f7;
  }

  nav a:hover {
    color: #0a84ff; /* iOS dark blue accent */
  }

  section {
    background: rgba(44, 44, 46, 0.55);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  }

  .carousel button {
    background: rgba(44, 44, 46, 0.7);
    color: #f2f2f7; /* ensure arrows are light */
  }

  .carousel button:hover {
    background: rgba(44, 44, 46, 0.9);
    color: #ffffff; /* arrows stay bright on hover */
  }

  .appstore-link {
    background: #0a84ff;
  }

  .appstore-link:hover {
    background: #0060df;
  }

  footer {
    color: #a1a1a6;
  }
}

/* Responsive tweaks */
@media (max-width: 860px) {
  /* Keep header pill breathing on smaller screens */
  header {
    padding: 0.65rem 1.25rem;
  }

  /* Make nav wrap nicely */
  nav {
    gap: 0.75rem;
  }

  nav ul {
    gap: 0.9rem;
  }
}

@media (max-width: 540px) {
  /* Stack title above nav links for very small screens */
  nav {
    flex-direction: column;
    align-items: stretch;
  }

  header h1 {
    text-align: center;
    margin-bottom: 0.5rem;
  }

  nav ul {
    justify-content: center;
  }
}
