/* ========================================
   FGS — Flatirons Geomagnetic Services
   Modern Static Site — Style System
   ======================================== */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  /* Brand Palette */
  --primary: #4A9FD9;
  --primary-light: #6CB8E6;
  --primary-dark: #2B7CB8;
  --accent: #38D9A9;
  --accent-glow: rgba(56, 217, 169, 0.3);

  /* Dark Theme */
  --bg-deep: #0A0E1A;
  --bg-dark: #0F1524;
  --bg-card: #141B2D;
  --bg-card-hover: #1A2340;
  --bg-glass: rgba(20, 27, 45, 0.85);

  /* Text */
  --text-primary: #E8EDF5;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  /* Borders & Glow */
  --border-subtle: rgba(74, 159, 217, 0.15);
  --border-hover: rgba(74, 159, 217, 0.35);
  --glow-primary: 0 0 30px rgba(74, 159, 217, 0.15);
  --glow-accent: 0 0 30px rgba(56, 217, 169, 0.15);

  /* Spacing */
  --section-padding: 100px 0;
  --container-max: 1200px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.4s ease;
  --transition-slow: 0.6s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
}

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

/* ---------- Navigation ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 18px 0;
  transition: all var(--transition-medium);
}

.navbar.scrolled {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.nav-logo span {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all var(--transition-fast);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: rgba(74, 159, 217, 0.1);
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: transparent;
  border: none;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url('../images/hero-aurora.jpg') center/cover no-repeat;
  filter: brightness(0.45) saturate(1.2);
  transform: scale(1.05);
  animation: heroZoom 20s ease-in-out infinite alternate;
}

@keyframes heroZoom {
  0% { transform: scale(1.05); }
  100% { transform: scale(1.12); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 14, 26, 0.3) 0%,
    rgba(10, 14, 26, 0.5) 50%,
    rgba(10, 14, 26, 0.95) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 0 24px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(74, 159, 217, 0.12);
  border: 1px solid rgba(74, 159, 217, 0.25);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 14px 32px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-medium);
  box-shadow: 0 4px 20px rgba(74, 159, 217, 0.3);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(74, 159, 217, 0.4);
  color: white;
}

.hero-cta svg {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.hero-cta:hover svg {
  transform: translateX(4px);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: float 3s ease-in-out infinite;
}

.scroll-indicator .mouse {
  width: 22px;
  height: 34px;
  border: 2px solid var(--text-muted);
  border-radius: 12px;
  position: relative;
}

.scroll-indicator .mouse::after {
  content: '';
  width: 3px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollDown 2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

@keyframes scrollDown {
  0% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

/* ---------- Section Common Styles ---------- */
.section {
  padding: var(--section-padding);
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-light);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Divider line */
.section-divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  margin: 0 auto 20px;
}

/* ---------- Services Section ---------- */
#services {
  background: var(--bg-dark);
}

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

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 36px 28px;
  transition: all var(--transition-medium);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity var(--transition-medium);
}

.service-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: var(--glow-primary);
}

.service-card:hover::before {
  opacity: 1;
}

.service-icon {
  width: 56px;
  height: 56px;
  background: rgba(74, 159, 217, 0.1);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: all var(--transition-medium);
}

.service-card:hover .service-icon {
  background: rgba(74, 159, 217, 0.18);
  box-shadow: 0 0 20px rgba(74, 159, 217, 0.15);
}

.service-icon img {
  width: 30px;
  height: 30px;
}

.service-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.service-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ---------- About / Founder Section ---------- */
#about {
  background: var(--bg-deep);
}

.about-content {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 60px;
  align-items: center;
}

.about-image {
  position: relative;
}

.about-image img {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-subtle);
  box-shadow: 0 0 40px rgba(74, 159, 217, 0.1);
  display: block;
  margin: 0 auto;
}

.about-image .orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 320px;
  height: 320px;
  border: 1px dashed rgba(74, 159, 217, 0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: spin 30s linear infinite;
}

.about-image .orbit-dot {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--primary);
}

@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.about-text h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.about-role {
  color: var(--primary-light);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 20px;
}

.about-text p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 14px;
}

.about-text p:last-of-type {
  margin-bottom: 0;
}

/* ---------- Highlight Banner ---------- */
.highlight-banner {
  background: linear-gradient(135deg, var(--primary-dark), var(--bg-card));
  padding: 60px 0;
  position: relative;
  overflow: hidden;
}

.highlight-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/earth.jpg') center/cover no-repeat;
  opacity: 0.15;
  filter: blur(2px);
}

.highlight-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.highlight-inner h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.highlight-inner p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 28px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--primary);
  color: var(--primary-light);
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-medium);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 20px rgba(74, 159, 217, 0.3);
}

/* ---------- Publications Section ---------- */
#publications {
  background: var(--bg-dark);
}

.publications-list {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pub-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 22px 28px;
  transition: all var(--transition-fast);
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.pub-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.pub-year {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(74, 159, 217, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.pub-text {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.65;
}

.pub-text a {
  color: var(--accent);
  font-weight: 500;
}

.pub-text a:hover {
  text-decoration: underline;
}

/* ---------- Contact Section ---------- */
#contact {
  background: var(--bg-deep);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 800px;
  margin: 0 auto;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 32px 24px;
  text-align: center;
  transition: all var(--transition-medium);
}

.contact-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--glow-primary);
}

.contact-icon {
  width: 48px;
  height: 48px;
  background: rgba(74, 159, 217, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.contact-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--primary-light);
}

.contact-card h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.contact-card p,
.contact-card a {
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-dark);
  border-top: 1px solid var(--border-subtle);
  padding: 32px 0;
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo img {
  height: 28px;
}

.footer-logo span {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .services-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }

  .about-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .footer .container {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 70px 0;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-dark);
    flex-direction: column;
    padding: 100px 32px 32px;
    gap: 4px;
    transition: right var(--transition-medium);
    border-left: 1px solid var(--border-subtle);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links a {
    font-size: 1rem;
    padding: 12px 16px;
  }

  .nav-toggle {
    display: flex;
  }

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

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .scroll-indicator {
    display: none;
  }
}
