/* =============================================
   BreathFly — main.css
   Shared variables, reset, header, footer
   ============================================= */

/* --- Custom Properties --- */
:root {
  /* Brand */
  --primary: #4A90A4;
  --primary-dark: #3A7A8E;
  --primary-light: #5BA8BE;
  --secondary: #7B68EE;
  --accent: #20B2AA;
  --success: #34C759;
  --energy: #F4A460;

  /* Dark theme surfaces */
  --bg-void: #0A1628;
  --bg-deep: #0F1F35;
  --bg-surface: #182A42;
  --bg-elevated: #1F3350;
  --bg-card: #162640;

  /* Text */
  --text-primary: #E2EEF6;
  --text-secondary: #7E9BB0;
  --text-muted: #4A6578;

  /* Borders */
  --border: rgba(74, 144, 164, 0.08);
  --border-hover: rgba(74, 144, 164, 0.25);
  --border-active: rgba(74, 144, 164, 0.45);

  /* Glows */
  --glow-sm: 0 0 20px rgba(74, 144, 164, 0.2);
  --glow-md: 0 0 40px rgba(74, 144, 164, 0.3);
  --glow-lg: 0 0 80px rgba(74, 144, 164, 0.35);
  --glow-primary: rgba(74, 144, 164, 0.12);

  /* Layout */
  --max-width: 1120px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --transition: 0.3s var(--ease-out);
  --transition-slow: 0.5s var(--ease-out);
}

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

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

body {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-void);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 14px;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--primary);
  color: var(--bg-void);
}

img {
  max-width: 100%;
  display: block;
}

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

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

/* --- Ambient background --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(74, 144, 164, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 90%, rgba(123, 104, 238, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Section shared --- */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: var(--glow-primary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  color: var(--primary);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 480px;
  margin: 0 auto;
}

/* --- Gradient text --- */
.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 40%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Header --- */
.site-header {
  padding: 1rem 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 22, 40, 0.75);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), box-shadow var(--transition);
}

.site-header.scrolled {
  background: rgba(10, 22, 40, 0.92);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  transition: color var(--transition);
  white-space: nowrap;
}

.header-brand-text {
  display: inline;
}

.brand-fly {
  color: #00FFFF;
}

.header-brand:hover {
  color: var(--primary);
}

.header-brand-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(74, 144, 164, 0.4));
  transition: filter var(--transition);
}

.header-brand:hover .header-brand-logo {
  filter: drop-shadow(0 0 14px rgba(74, 144, 164, 0.6));
}

.header-nav {
  display: flex;
  gap: 1.75rem;
}

.header-nav a {
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color var(--transition);
  position: relative;
}

.header-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--primary);
  transition: width var(--transition);
}

.header-nav a:hover {
  color: var(--primary);
}

.header-nav a:hover::after {
  width: 100%;
}

/* --- Footer --- */
.site-footer {
  padding: 3rem 24px 2.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
}

.footer-brand {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.footer-copyright {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color var(--transition);
}

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

/* --- App Store badge --- */
.app-store-badge {
  display: inline-block;
  transition: transform var(--transition), filter var(--transition);
}

.app-store-badge img {
  height: 52px;
  width: auto;
  border-radius: var(--radius);
}

.app-store-badge:hover {
  transform: translateY(-3px);
  filter: brightness(1.1);
}

/* --- Reveal animations --- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

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

/* Staggered children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.15s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.2s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.25s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.3s; }

/* --- Mobile nav --- */
.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.mobile-menu-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* --- Responsive shared --- */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(10, 22, 40, 0.97);
    backdrop-filter: blur(24px);
    padding: 1rem 24px;
    border-bottom: 1px solid var(--border);
    gap: 0;
  }

  .header-nav.open {
    display: flex;
  }

  .header-nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .header-nav a::after {
    display: none;
  }
}
