/* ============================================
   Apple-Inspired Design System
   ============================================ */

:root {
  --bg-color: #f5f5f7;
  --text-color: #1d1d1f;
  --accent-color: #0071e3;
  --white: #ffffff;
  --max-width: 980px;
  --section-spacing: 80px;
  --tile-bg: rgba(0, 0, 0, 0.03);
  --tile-face: #ffffff;
  --chrome-bg: rgba(255, 255, 255, 0.8);
  --chrome-border: rgba(0, 0, 0, 0.05);
  --veil-r: 255;
  --veil-g: 255;
  --veil-b: 255;
  --veil-a0: 0.00;
  --veil-a1: 0.00;
  --veil-a2: 0.55;
  --veil-a3: 0.95;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Varela Round", sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Tile Grid Styles
   ============================================ */

.grid {
  position: fixed;
  inset: 0;
  display: grid;
  gap: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(120deg,
    #ff0066, #ff3300, #ffcc00, #00ff66, #00ccff, #0066ff, #cc00ff);
  background-size: 200% 200%;
  animation: bgShift 10s ease-in-out infinite;
}

@keyframes bgShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.fadeveil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  /* Defaults; JS will update --mx/--my and --fadeR */
  --mx: 50vw;
  --my: 50vh;
  --fadeR: 240px;

  /* Transparent in center, fades to theme color at edge + outside */
  background: radial-gradient(
    circle var(--fadeR) at var(--mx) var(--my),
    rgba(var(--veil-r), var(--veil-g), var(--veil-b), var(--veil-a0)) 0%,
    rgba(var(--veil-r), var(--veil-g), var(--veil-b), var(--veil-a1)) 65%,
    rgba(var(--veil-r), var(--veil-g), var(--veil-b), var(--veil-a2)) 90%,
    rgba(var(--veil-r), var(--veil-g), var(--veil-b), var(--veil-a3)) 100%
  );

  /* Make the transition feel softer */
  filter: blur(4px);
  opacity: 1;
}

.tile {
  position: relative;
  background: transparent;
  --pad: 0px;
}

.tile::before {
  content: "";
  position: absolute;
  inset: var(--pad, 0px);
  background: var(--tile-face);
  border-radius: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: inset 120ms linear;
}

/* ============================================
   Layout & Container
   ============================================ */

.container {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--chrome-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--chrome-border);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-color);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo-vibe {
  display: inline-block;
  isolation: isolate;
  will-change: background-position;

  background: -webkit-linear-gradient(135deg,
    #ff0066, #ff3300, #ffcc00, #00ff66, #00ccff, #0066ff, #cc00ff, #ff0066);
  background: linear-gradient(135deg,
    #ff0066, #ff3300, #ffcc00, #00ff66, #00ccff, #0066ff, #cc00ff, #ff0066);

  background-size: 300% 300%;

  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;

  animation: rainbowShift 6s ease-in-out infinite alternate;
}

@keyframes rainbowShift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 17px;
  transition: color 0.2s ease;
}

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

.theme-toggle {
  border: 1px solid var(--chrome-border);
  background: rgba(255, 255, 255, 0.0);
  color: var(--text-color);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s ease;
}

.theme-toggle:hover {
  background: rgba(127, 127, 127, 0.12);
}

main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: var(--section-spacing) 40px;
}

footer {
  background: var(--chrome-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--chrome-border);
  padding: 40px 20px;
  margin-top: auto;
  position: relative;
  z-index: 1;
  text-align: center;
}

.footer-content {
  display: block;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 30px;
  list-style: none;
}

.footer-links a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 14px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.footer-links a:hover {
  opacity: 1;
}

.copyright {
  font-size: 14px;
  opacity: 0.6;
  margin: 0;
  width: auto;
}

/* ============================================
   Homepage Styles
   ============================================ */

.hero {
  text-align: center;
  margin-bottom: var(--section-spacing);
}

.hero h1 {
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -1px;
  margin-bottom: 20px;
  line-height: 1.1;
}

.hero p {
  font-size: 21px;
  opacity: 0.8;
  margin-bottom: 60px;
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  margin-bottom: var(--section-spacing);
  background: #000;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.social-section {
  margin-bottom: var(--section-spacing);
}

.social-section h2 {
  font-size: 32px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 40px;
  letter-spacing: -0.5px;
}

.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
  list-style: none;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--white);
  color: var(--text-color);
  text-decoration: none;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.social-links a:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  color: var(--accent-color);
}

.app-store-section {
  text-align: center;
  margin-bottom: var(--section-spacing);
}

.app-store-link {
  display: inline-block;
  text-decoration: none;
  transition: all 0.3s ease;
}

.app-store-badge {
  height: 60px;
  width: auto;
  display: block;
  transition: all 0.3s ease;
}

.app-store-link:hover .app-store-badge {
  transform: translateY(-2px);
  opacity: 0.85;
}

/* ============================================
   Content Pages (Privacy, Contact)
   ============================================ */

.content-page {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 18px;
  padding: 60px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
}

.content-page h1 {
  font-size: 48px;
  font-weight: 600;
  margin-bottom: 30px;
  letter-spacing: -1px;
}

.content-page h2 {
  font-size: 28px;
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.content-page p {
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: 20px;
  opacity: 0.9;
}

.content-page ul {
  margin-left: 30px;
  margin-bottom: 20px;
}

.content-page li {
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: 10px;
  opacity: 0.9;
}

.contact-info {
  font-size: 17px;
  line-height: 1.8;
}

.contact-info a {
  color: var(--accent-color);
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

/* ============================================
   Dark Mode
   ============================================ */

html.dark {
  --bg-color: #0b0b0f;
  --text-color: #f5f5f7;
  --tile-face: #0b0b0f;
  --accent-color: #0a84ff;
  --chrome-bg: rgba(10, 10, 14, 0.65);
  --chrome-border: rgba(255, 255, 255, 0.12);
  --veil-r: 0;
  --veil-g: 0;
  --veil-b: 0;
  --veil-a2: 0.35;
  --veil-a3: 0.70;
}

html.dark .content-page {
  background: rgba(10, 10, 14, 0.60);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

html.dark .tile::before {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
  :root {
    --section-spacing: 50px;
  }

  nav {
    padding: 0 20px;
    flex-direction: column;
    gap: 20px;
  }

  .nav-links {
    gap: 20px;
  }

  main {
    padding: var(--section-spacing) 20px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero p {
    font-size: 18px;
  }

  .content-page {
    padding: 40px 30px;
  }

  .content-page h1 {
    font-size: 36px;
  }

  .content-page h2 {
    font-size: 24px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    padding: 0 20px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 32px;
  }

  .social-links {
    gap: 20px;
  }

  .social-links a {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .content-page {
    padding: 30px 20px;
  }
}
