/* ─────────────────────────────────────────────────────────
   BASE.CSS — FrearBros Labs shared styles
   Used by: index.html, racketlog.html, ballgauge.html
───────────────────────────────────────────────────────── */

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

:root {
  --black: #0a0a0a;
  --dark: #111111;
  --surface: #161616;
  --surface-2: #1e1e1e;
  --border: rgba(255,255,255,0.07);
  --border-light: rgba(255,255,255,0.12);
  --white: #ffffff;
  --off-white: #e8e8e8;
  --muted: #888888;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --nav-h: 72px;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden; /* iOS Safari needs this on html, not just body */
}

body {
  font-family: var(--font);
  background: var(--black);
  color: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

/* ─── NAV ─────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 40px;
  background: rgba(10,10,10,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
  overflow: hidden;
}

.nav-inner {
  max-width: var(--max-w, 1200px);
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Home nav */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-logo img { height: 36px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

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

.nav-cta {
  background: var(--gradient);
  color: var(--white) !important;
  padding: 9px 20px;
  border-radius: 8px;
  font-weight: 600 !important;
  transition: opacity 0.2s !important;
}

.nav-cta:hover { opacity: 0.85; color: var(--white) !important; }

/* App page nav */
.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-back:hover { color: var(--white); }
.nav-back svg { transition: transform 0.2s; }
.nav-back:hover svg { transform: translateX(-3px); }

.nav-app-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-icon-nav {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  overflow: hidden;
  flex-shrink: 0;
}

.app-icon-nav img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nav-app-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
}

/* ─── BUTTONS ─────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient);
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 13px 24px;
  border-radius: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover { transform: translateY(-2px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--off-white);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 13px 24px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  transition: background 0.2s, border-color 0.2s;
}

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

/* ─── LAYOUT UTILITIES ────────────────────────────────── */
.container {
  max-width: var(--max-w, 1200px);
  margin: 0 auto;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 16px;
}

.section-label::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--gradient);
  border-radius: 2px;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 520px;
}

/* ─── APP SUPPORT FORM ────────────────────────────────── */
.support-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 80px 40px;
}
.support-inner {
  max-width: 640px;
  margin: 0 auto;
}
.support-inner h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 12px;
}
.support-inner > p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 40px;
}

.support-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.support-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.support-form .form-group:last-of-type { margin-bottom: 24px; }
.support-form label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--off-white);
  letter-spacing: 0.02em;
}
.support-form input,
.support-form textarea,
.support-form select {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--white);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.support-form input::placeholder,
.support-form textarea::placeholder { color: rgba(255,255,255,0.25); }
.support-form input:focus,
.support-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow, rgba(59,130,246,0.08));
}
.support-form textarea { min-height: 140px; resize: vertical; }
.support-form .btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient);
  color: var(--white);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 32px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.support-form .btn-submit:hover { opacity: 0.88; transform: translateY(-2px); }

@media (max-width: 600px) {
  .support-form .form-row { grid-template-columns: 1fr; }
  .support-section { padding: 60px 24px; }
}

/* ─── FOOTER ──────────────────────────────────────────── */
footer {
  background: var(--black);
  border-top: 1px solid var(--border);
  padding: 40px;
  overflow-x: hidden;
}

.footer-inner {
  max-width: var(--max-w, 1200px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-logo { text-decoration: none; }
.footer-logo img { height: 26px; width: auto; }
.footer-copy { font-size: 0.8rem; color: var(--muted); }

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

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

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

/* ─── ANIMATIONS ──────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible { opacity: 1; transform: translateY(0); }
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }

/* ─── APP PAGE SHARED ─────────────────────────────────── */
/* Hero */
.hero {
  min-height: 88vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 60px) 40px 80px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, black, transparent);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-w, 1100px);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero h1 em {
  font-style: normal;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.05rem;
  color: #b8b8b8;
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 460px;
  text-shadow: 0 1px 16px rgba(0,0,0,0.9);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Phone mockup */
.phone-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.phone-mockup {
  width: 260px;
  background: #0f0f0f;
  border-radius: 44px;
  border: 2px solid rgba(255,255,255,0.1);
  padding: 16px;
  box-shadow:
    0 40px 80px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.05),
    inset 0 1px 0 rgba(255,255,255,0.08);
  position: relative;
}

.phone-notch {
  width: 90px;
  height: 28px;
  background: #0f0f0f;
  border-radius: 0 0 18px 18px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-notch-pill {
  width: 60px;
  height: 10px;
  background: #1a1a1a;
  border-radius: 10px;
}

.phone-screen {
  background: #0d1117;
  border-radius: 32px;
  overflow: hidden;
  min-height: 480px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.phone-header { font-size: 0.7rem; font-weight: 800; color: var(--white); margin-bottom: 4px; }
.phone-sub { font-size: 0.6rem; color: var(--muted); margin-bottom: 8px; }

.phone-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: -1;
}

/* Feature blocks */
section { padding: var(--section-pad, 100px) 40px; overflow-x: hidden; }

.features-intro {
  background: var(--dark);
  text-align: center;
  padding: 80px 40px;
  overflow-x: hidden;
}

.features-intro .section-label { justify-content: center; }
.features-intro .section-desc { margin: 0 auto; }

.feature-block { padding: 80px 40px; overflow-x: hidden; }
.feature-block:nth-child(odd) { background: var(--black); }
.feature-block:nth-child(even) { background: var(--dark); }

.feature-block-inner {
  max-width: var(--max-w, 1100px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}

.feature-block-inner.reverse { direction: rtl; }
.feature-block-inner.reverse > * { direction: ltr; }

.feature-visual {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 300px;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.feature-visual::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--gradient);
  opacity: 0.6;
}

.feature-visual-icon { font-size: 2.5rem; margin-bottom: 8px; }

.feature-text h2 {
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.feature-text p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 28px;
}

.feature-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--off-white);
  line-height: 1.5;
}

.feature-list li .check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 0.65rem;
  color: var(--accent-bright);
  font-weight: 700;
}

/* Shared mock UI */
.mock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
}

.mock-row-left { display: flex; flex-direction: column; gap: 3px; }
.mock-row-title { font-size: 0.78rem; font-weight: 600; color: var(--white); }
.mock-row-sub { font-size: 0.65rem; color: var(--muted); }
.mock-row-right { font-size: 0.72rem; font-weight: 700; color: var(--accent-bright); }

.mock-tag {
  display: inline-flex;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}

.mock-gauge-block {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border);
}

.mock-gauge-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mock-gauge-bar-bg {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 6px;
}

.mock-gauge-bar-fill { height: 100%; border-radius: 10px; }

.mock-gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.55rem;
  color: var(--muted);
}

/* All features grid */
.all-features { background: var(--surface); padding: var(--section-pad, 100px) 40px; overflow-x: hidden; }

.all-features-header { text-align: center; margin-bottom: 64px; }
.all-features-header .section-label { justify-content: center; }

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.feat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  transition: border-color 0.3s, transform 0.3s;
}

.feat-card:hover { transform: translateY(-3px); }
.feat-card-icon { font-size: 1.6rem; margin-bottom: 14px; display: block; }
.feat-card h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; color: var(--white); }
.feat-card p { font-size: 0.82rem; color: var(--muted); line-height: 1.6; }

/* CTA section */
.cta-section {
  background: var(--black);
  padding: var(--section-pad, 100px) 40px;
  text-align: center;
  position: relative;
  overflow: hidden; /* catches glow + horizontal */
}

.cta-glow {
  position: absolute;
  width: 600px;
  height: 400px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.cta-inner { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; }

.cta-inner h2 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
}

.cta-inner p { color: var(--muted); font-size: 1rem; line-height: 1.7; margin-bottom: 36px; }

.appstore-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  color: var(--black);
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 40px rgba(255,255,255,0.1);
}

.appstore-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 40px rgba(255,255,255,0.15); }
.appstore-btn svg { width: 20px; height: 20px; }

/* ─── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .phone-wrap { display: none; }
  .feature-block-inner { grid-template-columns: 1fr; gap: 40px; }
  .feature-block-inner.reverse { direction: ltr; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  nav { padding: 0 20px; }
  section { padding: 60px 20px; }
  .feature-block { padding: 60px 20px; }
  .all-features { padding: 60px 20px; }
  .cta-section { padding: 60px 20px; }
  footer { padding: 32px 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }

  /* App page nav — tighten up on tablet/mobile */
  .nav-back-label { display: none; } /* hide "FrearBros Labs" text, keep arrow */
  .nav-app-name { display: none; }   /* hide app name text, keep icon only */

  /* App page hero — less top breathing room on mobile */
  .hero { padding-top: calc(var(--nav-h) + 32px); padding-bottom: 48px; }
}

@media (max-width: 480px) {
  /* App page nav — Download button shrink */
  .nav-inner .btn-primary { font-size: 0.75rem; padding: 8px 14px; }
}

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