/* ============================================
   Hopfinity — Website Stylesheet
   ============================================ */

/* --- Custom Properties --- */
:root {
  --cyan: #00D5FF;
  --magenta: #FF00FF;
  --purple: #9933FF;
  --neon-green: #33FF66;
  --hot-pink: #FF3399;
  --bg-dark: #0D0519;
  --bg-darker: #080311;
  --text: #E8E0F0;
  --text-muted: #A099B0;
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --max-width: 1200px;
  --header-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--magenta); }
ul { list-style: none; }

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.1;
}

/* --- Canvas Background --- */
#starfield {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

/* --- Perspective Grid --- */
body::before,
body::after {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  height: 45vh;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0, 213, 255, 0.06) 0px,
      transparent 1px,
      transparent 80px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(0, 213, 255, 0.06) 0px,
      transparent 1px,
      transparent 60px
    );
  mask-image: linear-gradient(to bottom, transparent, rgba(0,0,0,0.5) 40%, rgba(0,0,0,0.8));
  -webkit-mask-image: linear-gradient(to bottom, transparent, rgba(0,0,0,0.5) 40%, rgba(0,0,0,0.8));
  animation: gridPulse 3.5s ease-in-out infinite alternate;
}

body::before {
  bottom: 0;
  transform: perspective(400px) rotateX(45deg);
  transform-origin: bottom center;
}

body::after {
  top: 0;
  transform: perspective(400px) rotateX(-45deg);
  transform-origin: top center;
}

@keyframes gridPulse {
  0%   { opacity: 0.4; }
  100% { opacity: 0.8; }
}

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(13, 5, 25, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}

.logo {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.2s;
}

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

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .hamburger { display: flex; }

  .nav-links {
    position: fixed;
    inset: var(--header-height) 0 0 0;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 48px;
    gap: 24px;
    background: rgba(13, 5, 25, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateX(100%);
    transition: transform 0.35s ease;
  }

  .nav-links.is-open {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 1.2rem;
  }
}

/* --- Layout --- */
main {
  padding-top: var(--header-height);
}

.section {
  padding: 80px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  text-align: center;
  margin-bottom: 16px;
  color: #fff;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 48px;
}

/* --- Hero --- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - var(--header-height));
  padding: 60px 24px 80px;
  position: relative;
}

#hero-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  pointer-events: none;
  z-index: 0;
  width: 420px;
  height: 420px;
}

@media (max-width: 480px) {
  #hero-canvas {
    width: 300px;
    height: 300px;
  }
}

.hero-icon {
  position: relative;
  z-index: 1;
  width: 140px;
  height: 140px;
  border-radius: 32px;
  animation: iconFloat 6s ease-in-out infinite;
  box-shadow:
    0 0 40px rgba(0, 213, 255, 0.3),
    0 0 80px rgba(153, 51, 255, 0.15);
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.hero-title {
  font-size: clamp(3rem, 8vw, 5rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  margin-top: 28px;
  position: relative;
  z-index: 1;
  animation: neonGlow 3s ease-in-out infinite alternate;
}

@keyframes neonGlow {
  0% {
    text-shadow:
      0 0 10px rgba(0, 213, 255, 0.5),
      0 0 30px rgba(0, 213, 255, 0.3),
      0 0 60px rgba(0, 213, 255, 0.15);
  }
  100% {
    text-shadow:
      0 0 10px rgba(255, 0, 255, 0.5),
      0 0 30px rgba(0, 213, 255, 0.4),
      0 0 60px rgba(255, 0, 255, 0.2),
      0 0 100px rgba(0, 213, 255, 0.1);
  }
}

.hero-subtitle {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--cyan);
  margin-top: 12px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.hero-desc {
  max-width: 520px;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 1.05rem;
  position: relative;
  z-index: 1;
}

.hero-cta {
  margin-top: 36px;
  position: relative;
  z-index: 1;
}

.app-store-badge {
  height: 52px;
  display: inline-block;
  transition: transform 0.2s, filter 0.2s;
}

.app-store-badge:hover {
  transform: scale(1.05);
  filter: brightness(1.15);
}

/* --- Glass Card --- */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: transform 0.25s, border-color 0.25s;
}

.glass-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 213, 255, 0.2);
}

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .features-grid { grid-template-columns: 1fr; }
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  display: block;
}

.feature-title {
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 8px;
}

.feature-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* --- Preview --- */
.preview-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

@media (max-width: 768px) {
  .preview-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.preview-frame {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow:
    0 0 40px rgba(0, 213, 255, 0.1),
    0 20px 60px rgba(0, 0, 0, 0.4);
}

.preview-frame img {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.preview-bullets {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.preview-bullet {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.preview-bullet-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0, 213, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.preview-bullet-text h4 {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 4px;
}

.preview-bullet-text p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Download CTA --- */
.cta-section {
  text-align: center;
  padding: 80px 24px 100px;
}

.cta-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: #fff;
  margin-bottom: 12px;
}

.cta-subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 1.05rem;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--glass-border);
  padding: 40px 24px;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

.footer-email {
  color: var(--cyan);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.8rem;
  opacity: 0.7;
}

/* --- Prose (Terms / Privacy / Support) --- */
.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.prose h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 8px;
  color: #fff;
}

.prose .last-updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 40px;
}

.prose h2 {
  font-size: 1.4rem;
  color: var(--cyan);
  margin-top: 40px;
  margin-bottom: 12px;
}

.prose p {
  margin-bottom: 16px;
  color: var(--text);
  line-height: 1.7;
}

.prose ul {
  margin-bottom: 16px;
  padding-left: 20px;
}

.prose li {
  list-style: disc;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.6;
}

.prose a {
  color: var(--cyan);
}

/* --- FAQ Accordion --- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

details.faq-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s;
}

details.faq-item[open] {
  border-color: rgba(0, 213, 255, 0.2);
}

details.faq-item summary {
  padding: 18px 20px;
  cursor: pointer;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}

details.faq-item summary::-webkit-details-marker { display: none; }

details.faq-item summary::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--cyan);
  font-weight: 300;
  transition: transform 0.2s;
}

details.faq-item[open] summary::after {
  transform: rotate(45deg);
}

details.faq-item .faq-answer {
  padding: 0 20px 18px;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* --- Contact Card --- */
.contact-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  max-width: 480px;
  margin: 0 auto 48px;
}

.contact-card h3 {
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 8px;
}

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

.contact-card a {
  color: var(--cyan);
  font-weight: 600;
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1;
    transform: none;
  }

  body::before,
  body::after {
    animation: none;
    opacity: 0.6;
  }
}
