/* ============================================
   Upkeep Home — Global Styles
   ============================================
   PLACEHOLDER: Update brand colors, fonts,
   and app name references when reusing.
   ============================================ */

:root {
  /* Brand */
  --color-primary: #3478F6;
  --color-primary-light: #EBF2FF;
  --color-primary-hover: #2A63D4;
  --color-text: #1D1D1F;
  --color-text-secondary: #6E6E73;
  --color-text-tertiary: #86868B;
  --color-bg: #FFFFFF;
  --color-bg-secondary: #F5F5F7;
  --color-bg-card: #FFFFFF;
  --color-border: #E5E5EA;
  --color-border-light: #F0F0F5;
  --color-shadow-md: rgba(0, 0, 0, 0.08);

  /* Typography */
  --font-display: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-body: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  /* Layout */
  --container-max: 960px;
  --container-narrow: 720px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;

  /* Spacing */
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 40px;
  --s-2xl: 64px;
  --s-3xl: 96px;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font-body); color: var(--color-text); background: var(--color-bg); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--color-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-primary-hover); }
main { flex: 1; }

/* ── SVG safety ──
   All inline SVGs inside components get explicit sizing.
   This prevents raw SVGs from blowing up to 100% viewport. */
svg { overflow: visible; }

/* ── Container ── */
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 var(--s-lg); }
.container--narrow { max-width: var(--container-narrow); }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border-light);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 56px; }

.site-logo {
  display: flex; align-items: center; gap: var(--s-sm);
  font-family: var(--font-display); font-weight: 600; font-size: 1.125rem;
  color: var(--color-text); text-decoration: none; letter-spacing: -0.02em;
}
.site-logo:hover { color: var(--color-text); }
.logo-icon {
  width: 30px; height: 30px; min-width: 30px;
  border-radius: 8px; object-fit: cover; display: block;
}

.site-nav { display: flex; align-items: center; gap: var(--s-lg); }
.site-nav a { font-size: 0.875rem; font-weight: 500; color: var(--color-text-secondary); letter-spacing: -0.01em; }
.site-nav a:hover,
.site-nav a.active { color: var(--color-primary); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: var(--s-sm); color: var(--color-text); }
.nav-toggle svg { width: 22px; height: 22px; display: block; }

/* ── Hero ── */
.hero { padding: var(--s-3xl) 0 var(--s-2xl); text-align: center; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--color-primary-light); color: var(--color-primary);
  font-size: 0.8125rem; font-weight: 600;
  padding: 6px 14px; border-radius: 100px; margin-bottom: var(--s-lg);
}
.hero__badge svg { width: 14px; height: 14px; min-width: 14px; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.25rem); font-weight: 700;
  line-height: 1.1; letter-spacing: -0.035em;
  margin-bottom: var(--s-md); max-width: 640px; margin-left: auto; margin-right: auto;
}
.hero__subtitle {
  font-size: clamp(1.0625rem, 2.5vw, 1.25rem);
  color: var(--color-text-secondary); max-width: 480px;
  margin: 0 auto var(--s-xl); line-height: 1.5;
}
.hero__actions { display: flex; gap: var(--s-md); justify-content: center; flex-wrap: wrap; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: var(--r-md);
  font-family: var(--font-body); font-size: 0.9375rem; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.2s; text-decoration: none;
}
.btn svg { width: 18px; height: 18px; min-width: 18px; }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-hover); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(52, 120, 246, 0.3); }
.btn--secondary { background: var(--color-bg-secondary); color: var(--color-text); }
.btn--secondary:hover { background: var(--color-border); color: var(--color-text); transform: translateY(-1px); }

/* Disabled store links — remove when app is published */
.btn--disabled {
  opacity: 0.45; cursor: default; pointer-events: none; position: relative;
}
.btn--disabled-wrap { position: relative; display: inline-flex; flex-direction: column; align-items: center; }
.btn--disabled-wrap::after {
  content: 'Coming soon';
  font-size: 0.6875rem; font-weight: 500; color: var(--color-text-tertiary);
  margin-top: 6px; letter-spacing: 0.01em;
}

/* ── Features ── */
.features { padding: var(--s-2xl) 0 var(--s-3xl); }
.features__label { text-align: center; font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-primary); margin-bottom: var(--s-sm); }
.features__heading { text-align: center; font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.03em; margin-bottom: var(--s-xl); }
.features__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-lg); }

.feature-card {
  background: var(--color-bg-card); border: 1px solid var(--color-border-light);
  border-radius: var(--r-lg); padding: var(--s-xl) var(--s-lg); transition: all 0.3s;
}
.feature-card:hover { border-color: var(--color-border); box-shadow: 0 8px 30px var(--color-shadow-md); transform: translateY(-2px); }
.feature-card__icon {
  width: 44px; height: 44px; border-radius: var(--r-sm);
  background: var(--color-primary-light); display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--s-md); color: var(--color-primary);
}
.feature-card__icon svg { width: 22px; height: 22px; }
.feature-card h3 { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: var(--s-sm); }
.feature-card p { font-size: 0.9375rem; color: var(--color-text-secondary); line-height: 1.55; }

/* ── About ── */
.about { padding: var(--s-2xl) 0; background: var(--color-bg-secondary); }
.about__inner { text-align: center; max-width: 600px; margin: 0 auto; }
.about h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.03em; margin-bottom: var(--s-md); }
.about p { font-size: 1.0625rem; color: var(--color-text-secondary); line-height: 1.65; margin-bottom: var(--s-md); }
.about p:last-child { margin-bottom: 0; }

/* ── CTA ── */
.cta { padding: var(--s-2xl) 0; text-align: center; }
.cta h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: var(--s-sm); }
.cta .hero__subtitle { margin-bottom: var(--s-lg); }

/* ── Page content (legal / support) ── */
.page-header { padding: var(--s-2xl) 0 var(--s-xl); text-align: center; border-bottom: 1px solid var(--color-border-light); }
.page-header h1 { font-family: var(--font-display); font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; letter-spacing: -0.035em; margin-bottom: var(--s-sm); }
.page-header p { color: var(--color-text-secondary); font-size: 1rem; }

.page-content { padding: var(--s-xl) 0 var(--s-3xl); }
.page-content h2 { font-family: var(--font-display); font-size: 1.375rem; font-weight: 650; letter-spacing: -0.02em; margin-top: var(--s-xl); margin-bottom: var(--s-md); }
.page-content h3 { font-size: 1.0625rem; font-weight: 600; margin-top: var(--s-lg); margin-bottom: var(--s-sm); }
.page-content p { font-size: 0.9375rem; color: var(--color-text-secondary); line-height: 1.7; margin-bottom: var(--s-md); }
.page-content ul, .page-content ol { padding-left: var(--s-lg); margin-bottom: var(--s-md); }
.page-content li { font-size: 0.9375rem; color: var(--color-text-secondary); line-height: 1.7; margin-bottom: var(--s-xs); }
.page-content a { text-decoration: underline; text-underline-offset: 2px; }

.legal-notice {
  background: var(--color-primary-light); border-radius: var(--r-md);
  padding: var(--s-md) var(--s-lg); margin-bottom: var(--s-xl);
  font-size: 0.875rem; color: var(--color-primary); font-weight: 500; line-height: 1.6;
}

/* ── Support ── */
.support-contact {
  background: var(--color-bg-secondary); border-radius: var(--r-lg);
  padding: var(--s-xl); margin-bottom: var(--s-xl); text-align: center;
}
.support-contact h2 { margin-top: 0; margin-bottom: var(--s-sm); }
.support-contact p { margin-bottom: var(--s-md); }
.support-email {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--color-bg-card); border: 1px solid var(--color-border);
  border-radius: var(--r-md); padding: 12px 20px;
  font-size: 1rem; font-weight: 600; color: var(--color-primary);
}
.support-email svg { width: 18px; height: 18px; min-width: 18px; }

/* ── FAQ ── */
.faq { margin-top: var(--s-xl); }
.faq h2 { margin-top: 0; margin-bottom: var(--s-lg); }
.faq-item { border: 1px solid var(--color-border-light); border-radius: var(--r-md); margin-bottom: var(--s-md); overflow: hidden; transition: border-color 0.2s; }
.faq-item:hover { border-color: var(--color-border); }
.faq-question {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: var(--s-md) var(--s-lg); background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 0.9375rem; font-weight: 600;
  color: var(--color-text); text-align: left; gap: var(--s-md);
}
.faq-question svg { width: 18px; height: 18px; min-width: 18px; color: var(--color-text-tertiary); transition: transform 0.25s; }
.faq-item.open .faq-question svg { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s; }
.faq-item.open .faq-answer { max-height: 300px; }
.faq-answer__inner { padding: 0 var(--s-lg) var(--s-md); font-size: 0.9375rem; color: var(--color-text-secondary); line-height: 1.65; }
.faq-answer__inner a { color: var(--color-primary); }

/* ── 404 ── */
.error-page { display: flex; align-items: center; justify-content: center; min-height: 60vh; text-align: center; padding: var(--s-2xl) var(--s-lg); }
.error-page__code { font-family: var(--font-display); font-size: clamp(4rem, 10vw, 7rem); font-weight: 800; letter-spacing: -0.04em; color: var(--color-border); line-height: 1; margin-bottom: var(--s-md); }
.error-page h1 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; margin-bottom: var(--s-sm); }
.error-page p { color: var(--color-text-secondary); margin-bottom: var(--s-xl); }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--color-border-light); padding: var(--s-xl) 0; margin-top: auto; }
.site-footer .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-md); }
.footer-copy { font-size: 0.8125rem; color: var(--color-text-tertiary); }
.footer-links { display: flex; gap: var(--s-lg); }
.footer-links a { font-size: 0.8125rem; color: var(--color-text-tertiary); }
.footer-links a:hover { color: var(--color-primary); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed; top: 56px; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    flex-direction: column; padding: var(--s-lg); gap: var(--s-md);
    border-bottom: 1px solid var(--color-border-light);
    transform: translateY(-110%); opacity: 0;
    transition: transform 0.3s, opacity 0.3s; pointer-events: none;
  }
  .site-nav.open { transform: translateY(0); opacity: 1; pointer-events: all; }
  .site-nav a { font-size: 1rem; padding: var(--s-sm) 0; }
  .features__grid { grid-template-columns: 1fr; gap: var(--s-md); }
  .hero { padding: var(--s-2xl) 0 var(--s-xl); }
  .hero__actions { flex-direction: column; align-items: center; }
  .btn { width: 100%; max-width: 280px; justify-content: center; }
  .site-footer .container { flex-direction: column; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; }
  .page-content h2 { font-size: 1.25rem; }
}
@media (max-width: 480px) {
  .container { padding: 0 var(--s-md); }
  .support-contact { padding: var(--s-lg); }
  .support-email { font-size: 0.875rem; }
}

/* ── Animations ── */
@media (prefers-reduced-motion: no-preference) {
  .hero, .feature-card, .about__inner, .support-contact { animation: fadeUp 0.6s ease both; }
  .feature-card:nth-child(2) { animation-delay: 0.1s; }
  .feature-card:nth-child(3) { animation-delay: 0.2s; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
