/* =============================
   Base Theme Variables
   ============================= */
:root {
  --bg: #020617;
  --text: #e5e7eb;
  --card: #0a0f1f;
  --cardBorder: rgba(255,255,255,0.15);
  --accent1: #2563eb;
  --accent2: #ec4899;
  --accent3: #22c55e;
  --danger: #dc2626;
}

/* Light mode overrides */
body.light {
  --bg: #f7f7f9;
  --text: #1a1a1a;
  --card: #ffffff;
  --cardBorder: rgba(0,0,0,0.12);
  --accent1: #3b82f6;
  --accent2: #ec4899;
  --accent3: #10b981;
  --danger: #dc2626;
  background: #f7f7f9;
  color: var(--text);
}

/* =============================
   Global Styles
   ============================= */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Global image sanity */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =============================
   Header + Navigation
   ============================= */
header {
  padding: 16px 20px 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 20;
}

.header-inner {
  max-width: 960px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Logo */
.logo {
  font-size: 2.3rem;
  font-weight: 900;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
  margin-bottom: 6px;
}

/* Top nav for desktop */
.top-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.top-nav a {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  opacity: 0.9;
  cursor: pointer;
  transition: 0.15s ease;
}

.top-nav a:hover {
  opacity: 1;
  border-color: var(--accent1);
}

.top-nav a.active {
  border-color: var(--accent1);
  background: rgba(255,255,255,0.08);
}

/* Theme toggle */
.toggle {
  background: var(--card);
  border: 1px solid var(--cardBorder);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  position: absolute;
  right: 20px;
  top: 18px;
}

/* Hamburger for mobile */
.hamburger {
  position: absolute;
  left: 20px;
  top: 18px;
  width: 28px;
  height: 24px;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: none;
}

.hamburger span {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: var(--text);
  margin-bottom: 5px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Hamburger animation when open */
body.nav-open .hamburger span:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}
body.nav-open .hamburger span:nth-child(2) {
  opacity: 0;
}
body.nav-open .hamburger span:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
}

/* Mobile nav dropdown */
@media (max-width: 900px) {
  .hamburger {
    display: block;
    z-index: 50;
  }

  .top-nav {
    display: none;
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    background: var(--card);
    padding: 12px 0 14px;
    border-radius: 0 0 16px 16px;
    border-top: 1px solid var(--cardBorder);
    flex-direction: column;
    align-items: center;
    z-index: 40;
  }

  body.nav-open .top-nav {
    display: flex;
  }
}

/* =============================
   Hero
   ============================= */
.hero {
  max-width: 900px;
  margin: 32px auto 24px;
  padding: 0 20px;
  text-align: left;
}

.hero h1 {
  font-size: 2.1rem;
  margin: 0 0 10px;
}

.highlight {
  background: linear-gradient(90deg, var(--accent1), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1rem;
  line-height: 1.6;
  margin: 4px 0;
}

.hero-sub {
  margin-top: 6px;
  font-size: 0.92rem;
  opacity: 0.9;
}

/* =============================
   Sections + Layout
   ============================= */
.section {
  max-width: 960px;
  margin: 24px auto;
  padding: 0 20px;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 20px 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

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

.section-card,
.card,
.info-card,
.value-card,
.team-card {
  background: var(--card);
  border: 1px solid var(--cardBorder);
  border-radius: 16px;
  padding: 20px;
}

.section-card h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  opacity: 0.75;
  margin-top: 0;
}

.section-card h1 {
  font-size: 1.4rem;
  margin: 4px 0 8px;
}

.section-card ul {
  margin-left: 18px;
  font-size: 0.9rem;
}

/* =============================
   Buttons
   ============================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s ease, transform 0.08s ease,
              box-shadow 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-primary {
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  color: white;
  box-shadow: 0 10px 24px rgba(0,0,0,0.5);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.7);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--cardBorder);
}

.btn-secondary:hover {
  border-color: var(--accent1);
  background: rgba(255,255,255,0.05);
}

/* =============================
   Figures + Images
   ============================= */
figure {
  text-align: center;
  margin: 22px auto;
}

figure img {
  width: 40%;
  max-width: 520px;
  max-height: 520px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.15);
}

body.light figure img {
  border-color: rgba(0,0,0,0.15);
}

/* =============================
   App Preview Cards
   ============================= */
.image-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
}

.mockup-card {
  background: var(--card);
  border: 1px solid var(--cardBorder);
  border-radius: 16px;
  padding: 12px;
  max-width: 260px;
  text-align: center;
}

.mockup-card img {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 360px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
}

.mockup-caption {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 8px;
}

/* =============================
   Timeline
   ============================= */
.timeline {
  display: grid;
  gap: 16px;
  margin-top: 10px;
}

.timeline-item {
  padding-bottom: 6px;
}

.timeline-label {
  font-size: 0.82rem;
  opacity: 0.7;
  text-transform: uppercase;
}

.timeline-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 3px 0;
}

/* =============================
   Access Section
   ============================= */
.access-section {
  max-width: 960px;
  margin: 26px auto;
  padding: 14px 20px 20px;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--cardBorder);
}

/* =============================
   About Page
   ============================= */
.about-section {
  max-width: 960px;
  margin: 24px auto;
  padding: 0 20px;
}

.values-grid,
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

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

/* =============================
   Partner Strip + HyperHQ Logo Size Fix
   ============================= */
.partner-strip {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  opacity: 0.9;
}

.partner-strip img.hyperhq-logo {
  height: 52px;
  width: auto;
  display: inline-block;
  margin-top: -2px;
}

/* =============================
   Footer
   ============================= */
footer {
  text-align: center;
  padding: 24px 10px 30px;
  margin-top: 30px;
  font-size: 0.85rem;
  opacity: 0.85;
}

.footer-nav a {
  margin: 0 6px;
}

/* =============================
   Mobile Tweaks
   ============================= */
@media (max-width: 900px) {
  .hero {
    padding: 0 16px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  figure img {
    width: 100%;
    max-width: 520px;
    max-height: 55vh;
    object-fit: cover;
    margin: 0 auto;
  }

  .image-row {
    flex-direction: column;
    align-items: stretch;
  }

  .mockup-card {
    max-width: 520px;
    margin: 0 auto;
  }

  .mockup-card img {
    max-height: 45vh;
  }
}

/* =============================
   POPUP MODALS FOR SIGNUP / FORMS
   ============================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-box {
  background: var(--card);
  border: 1px solid var(--cardBorder);
  border-radius: 16px;
  width: 95%;
  max-width: 640px;
  padding: 20px;
  position: relative;
  animation: fadeIn 0.25s ease;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* =============================
   Mobile stability + image sizing fixes
   ============================= */

/* Ensure content never sits hard against the footer */
section,
.section,
.access-section,
.about-section,
.container {
  padding-bottom: 4rem;
}

/* Figure images, constrain aggressively so they never blow out the viewport */
figure img {
  width: 100%;
  max-width: 520px;
  max-height: 55vh;
  object-fit: contain;
}

/* Placeholder images should never render huge */
img.is-placeholder {
  width: 100%;
  max-width: 420px;
  max-height: 320px;
  object-fit: contain;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.95;
}

/* App preview images, contain works better for placeholders and prevents weird cropping */
.mockup-card img {
  object-fit: contain;
}

/* Prevent mobile 100vh resize jitter */
.hero,
.section,
.access-section,
.about-section {
  min-height: auto;
}

/* =============================
   Modal improvements
   ============================= */
.modal-overlay.active {
  display: flex;
}

body.modal-open {
  overflow: hidden;
  touch-action: none;
}

.modal-box {
  max-height: 90vh;
  overflow: hidden;
}

.modal-box iframe {
  width: 100%;
  height: 80vh;
  border: 0;
  border-radius: 12px;
  background: #fff;
}


/* =============================
   JS / no-JS safety
   ============================= */
html.no-js .hamburger { display: none; }
html.no-js body.nav-open .top-nav { display: flex; } /* harmless fallback */

/* On mobile, only hide the top nav when JS is available, otherwise keep links visible */
@media (max-width: 900px) {
  html.no-js .top-nav {
    display: flex !important;
    position: static;
    background: transparent;
    padding: 0;
    border-radius: 0;
    border-top: 0;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  html.no-js .top-nav a { padding: 10px 16px; }
}

/* Social icons + email support (ADDED) */
.footer-socials {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 10px 0;
}

.footer-socials a {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--cardBorder);
  font-size: 1.1rem;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.footer-socials a:hover {
  transform: translateY(-1px);
  border-color: var(--accent1);
}

.footer-email {
  margin-top: 6px;
  font-size: 0.85rem;
}

/* =============================
   Social icon images (cropped)
   ============================= */

.footer-socials img {
  width: 18px;
  height: 18px;
  object-fit: cover;
  border-radius: 50%;
}

/* Optional: slightly larger tap target */
.footer-socials a {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Subtle hover polish */
.footer-socials a:hover img {
  transform: scale(1.05);
}
