/* MuscleReady marketing site
   Brand tokens — locked, do not deviate:
   background #0A0A0A · accent #00E676 · cards #161616 · Ionicons outline only */

:root {
  --bg: #0A0A0A;
  --accent: #00E676;
  --card: #161616;
  --card-border: #2A2A2A;
  --text-primary: #FFFFFF;
  --text-secondary: #888888;
  --text-tertiary: #555555;
  /* Muscle recovery states — from constants/theme.ts */
  --muscle-ready: #00E676;
  --muscle-warning: #FF9500;
  --muscle-sore: #FF3B30;
  --muscle-neglected: #3A3A3A;
  /* Tab bar background — from MainTabNavigator.tsx */
  --tabbar-bg: #0F0F0F;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

section, footer, header { padding: 96px 24px; }

.section-title {
  font-size: clamp(28px, 4.5vw, 40px);
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.02em;
}

.section-sub {
  color: var(--text-secondary);
  text-align: center;
  margin: 12px auto 0;
  max-width: 560px;
  font-size: 17px;
}
/* Green directive under the phone demo — signals it's an actionable prompt */
.section-sub.demo-hint { color: var(--accent); font-weight: 500; }

/* ── Wordmark ─────────────────────────────────────────────── */

.wordmark {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 900;
  letter-spacing: -0.02em;
}
.hero-logo {
  width: min(360px, 70vw);
  height: auto;
  display: block;
  margin: 0 auto;
}
.wordmark-small { font-size: 24px; }
.wordmark-muscle { color: var(--text-primary); }
.wordmark-ready { color: var(--accent); }

/* ── 1. Hero ──────────────────────────────────────────────── */

.hero {
  min-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(0, 230, 118, 0.10), transparent),
    var(--bg);
}

.hero-inner { max-width: 680px; }

.hero-tagline {
  margin-top: 10px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-title {
  margin-top: 28px;
  font-size: clamp(44px, 7.5vw, 76px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero-sub {
  margin: 20px auto 0;
  max-width: 480px;
  color: var(--text-secondary);
  font-size: clamp(16px, 2.2vw, 19px);
}

/* App Store badge placeholder — swapped for the official badge once live */
.appstore-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
  padding: 12px 24px 12px 18px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.appstore-badge:hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(0, 230, 118, 0.25);
  transform: translateY(-1px);
}
.appstore-badge ion-icon { font-size: 32px; }
.badge-text { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.badge-small { font-size: 11px; color: var(--text-secondary); }
.badge-big { font-size: 20px; font-weight: 700; }

/* ── 2. Interactive phone demo ────────────────────────────── */

.demo { background: var(--bg); }

.phone-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  margin-top: 48px;
}

/* iPhone frame — current-gen proportions, Dynamic Island (no notch).
   Screen area is exactly 19.5:9 so a 1290×2796 screenshot drops in 1:1. */
.phone {
  width: min(340px, 82vw);
  padding: 10px;                      /* bezel */
  background: #1C1C1E;                /* titanium-ish frame */
  border-radius: 58px;
  box-shadow:
    0 0 0 2px #333,
    0 0 60px rgba(0, 230, 118, 0.12),
    0 30px 80px rgba(0, 0, 0, 0.8);
  position: relative;
}

/* side buttons */
.phone::before,
.phone::after {
  content: "";
  position: absolute;
  right: -3px;
  width: 3px;
  border-radius: 2px;
  background: #2C2C2E;
}
.phone::before { top: 22%; height: 9%; }   /* power */
.phone::after  { top: 22%; height: 0; }

.phone-screen {
  position: relative;
  aspect-ratio: 9 / 19.5;             /* 1290 × 2796 */
  border-radius: 48px;
  overflow: hidden;
  background: var(--bg);
}

.dynamic-island {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 31%;
  height: 3.6%;
  background: #000;
  border-radius: 999px;
  z-index: 3;
}

/* Screenshot slot — image fills the whole screen; the recreated tab bar
   overlays the bottom, exactly as the native tab bar overlays the app.
   The screen is a *display*, not a control — default cursor makes that clear. */
.screen-media { position: absolute; inset: 0; cursor: default; }

.screen-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.screen-media img.loaded { opacity: 1; }

.screen-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #161616;                /* locked card token */
  text-align: center;
  padding: 24px;
}
.placeholder-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.placeholder-label {
  color: #B0B0B0;
  font-size: 14px;
  font-weight: 500;
  max-width: 200px;
}

/* Tab bar — mirrors navigation/MainTabNavigator.tsx */
.tab-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  display: flex;
  background: var(--tabbar-bg);
  border-top: 0.5px solid var(--card-border);
  padding: 10px 0 22px;               /* bottom inset for home indicator */
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.tab-bar.hidden { transform: translateY(100%); opacity: 0; pointer-events: none; }

/* Accent line along the top edge that signals "this strip is interactive".
   Pulses (.hint) until the first tap; flashes once (.nudge) if the user taps
   the non-interactive screenshot, redirecting them to the real controls. */
.tab-bar::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
}
.tab-bar.hint::before { animation: tabHintLine 2.2s ease-in-out infinite; }
.tab-bar.nudge::before { animation: tabNudgeLine 0.55s ease; }
@keyframes tabHintLine {
  0%, 100% { opacity: 0; }
  50%      { opacity: 0.55; }
}
@keyframes tabNudgeLine {
  0%, 100% { opacity: 0; }
  40%      { opacity: 1; }
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
  isolation: isolate;                 /* contain the hover pill (::before z-index:-1) */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--text-tertiary);
  font-family: inherit;
}
.tab-icon { font-size: 24px; color: var(--text-tertiary); transition: color 0.15s ease; }
.tab-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: var(--text-tertiary);
  transition: color 0.15s ease;
}
.tab-dot {
  position: absolute;
  bottom: -8px;
  width: 4px;
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.tab-item.active .tab-icon,
.tab-item.active .tab-label { color: var(--accent); }
.tab-item.active .tab-label { font-weight: 600; }
.tab-item.active .tab-dot { opacity: 1; }

/* Desktop hover: inactive tabs brighten + a subtle pill so it's obvious
   they're pressable controls, not part of the screenshot. */
@media (hover: hover) {
  .tab-item::before {
    content: "";
    position: absolute;
    inset: -8px 6px -14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: -1;
  }
  .tab-item:hover::before { opacity: 1; }
  .tab-item:hover:not(.active) .tab-icon,
  .tab-item:hover:not(.active) .tab-label { color: var(--text-primary); }
}

/* home indicator */
.phone-screen::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 36%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  z-index: 4;
  pointer-events: none;
}

/* extra-screen chips */
.extra-screens {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.extra-screens-label {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.chip ion-icon { font-size: 15px; }
.chip:hover { color: var(--text-primary); }
.chip.active { color: var(--accent); border-color: var(--accent); }

/* ── 3. Features ──────────────────────────────────────────── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  max-width: 1060px;
  margin: 48px auto 0;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 28px;
}
.feature-icon { font-size: 28px; color: var(--accent); }
.feature-card h3 { margin-top: 14px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.feature-card p { margin-top: 8px; color: var(--text-secondary); font-size: 15px; }

/* recovery-state tokens inside feature copy */
.tok { font-weight: 600; }
.tok-ready { color: var(--muscle-ready); }
.tok-warning { color: var(--muscle-warning); }
.tok-sore { color: var(--muscle-sore); }
.tok-neglected { color: #7A7A7A; }   /* lightened for legibility on dark bg */

/* ── 4. Screenshot gallery (Higgsfield scrape target) ─────── */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  max-width: 1100px;
  margin: 48px auto 0;
}

.gallery-item { display: flex; flex-direction: column; gap: 10px; }

.gallery-shot {
  position: relative;
  aspect-ratio: 9 / 19.5;             /* 1290 × 2796 */
  border-radius: 24px;
  overflow: hidden;
  background: #161616;
}
.gallery-shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.gallery-shot img.loaded { opacity: 1; }
.gallery-shot .screen-placeholder { border-radius: 24px; }

.gallery-caption {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

/* ── 5. Closing CTA ───────────────────────────────────────── */

.closing {
  text-align: center;
  border-top: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.closing-tagline { margin-top: 8px; color: var(--text-secondary); font-size: 15px; }
.closing-fineprint { margin-top: 40px; color: var(--text-tertiary); font-size: 12px; }

@media (max-width: 640px) {
  section, footer, header { padding: 64px 20px; }
}

/* ============================================================
   SUPPORT  (App Store Connect Support URL target — /#support)
   ============================================================ */
.support { background: var(--bg); }

.support-intro {
  max-width: 560px;
  margin: 16px auto 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 16px;
}

.support-email {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  margin: 28px auto 0;
  padding: 14px 24px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card);
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.support-email:hover { border-color: var(--accent); transform: translateY(-1px); }
.support-email ion-icon { font-size: 20px; }

.faq {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 48px auto 0;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 22px;
}

.faq-q {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.faq-a {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Footer contact line */
.closing-contact {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}
.closing-contact a { color: var(--text-secondary); text-decoration: none; }
.closing-contact a:hover { color: var(--accent); }
.closing-contact .dot { color: var(--text-tertiary); }

.closing-legal {
  margin-top: 10px;
  color: var(--text-tertiary);
  font-size: 12px;
}

/* ============================================================
   STORE BADGES — App Store live, Google Play inert placeholder
   ============================================================ */
.badge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.appstore-badge.badge-disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
  filter: grayscale(1);
}

/* ============================================================
   RESEARCH — sourcing / evidence section
   ============================================================ */
.research { background: var(--bg); }

.research-intro {
  max-width: 660px;
  margin: 16px auto 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  max-width: 1040px;
  margin: 48px auto 0;
}

.research-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.research-finding {
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-primary);
}
.research-finding strong { color: var(--accent); font-weight: 700; }

.research-use {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  padding-left: 12px;
  border-left: 2px solid var(--accent);
}

.research-cite {
  margin-top: auto;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-tertiary);
}
.research-cite em { font-style: italic; }

.research-org {
  display: block;
  margin-top: 6px;
  color: var(--text-secondary);
  font-weight: 600;
}

.research-caveat {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 860px;
  margin: 36px auto 0;
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.research-caveat ion-icon {
  flex-shrink: 0;
  font-size: 20px;
  color: var(--muscle-warning);
  margin-top: 2px;
}
.research-caveat strong { color: var(--text-primary); }

/* ============================================================
   PRIVACY POLICY  (App Store Connect Privacy Policy URL target)
   ============================================================ */
.privacy { background: var(--bg); }

.privacy-updated {
  text-align: center;
  margin-top: 12px;
  color: var(--text-tertiary);
  font-size: 13px;
}

.privacy-body {
  max-width: 720px;
  margin: 32px auto 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.privacy-body strong { color: var(--text-primary); }
.privacy-body a { color: var(--accent); text-decoration: none; }
.privacy-body a:hover { text-decoration: underline; }
