/* =========================================
   Blue Sky Software
   ========================================= */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--slate-700);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

/* ----- Custom Properties ----- */
:root {
  --blue-50: #f0f9ff;
  --blue-100: #e0f2fe;
  --blue-200: #bae6fd;
  --blue-500: #0ea5e9;
  --blue-600: #0284c7;
  --blue-700: #0369a1;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;
}

/* ----- Typography ----- */
h1, h2, h3, h4 {
  color: var(--slate-900);
  line-height: 1.2;
  font-weight: 700;
}

h1 {
  font-size: 3.5rem;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 2.25rem;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

p {
  line-height: 1.7;
}

/* ----- Layout ----- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 96px 0;
}

/* ----- Button ----- */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--blue-600);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blue-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

/* =========================================
   NAVIGATION
   ========================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--slate-900);
  letter-spacing: -0.01em;
}

.logo span {
  color: var(--blue-600);
}

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

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-500);
  transition: color 0.2s;
}

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

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

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--slate-700);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Mobile Nav Panel */
.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  background: #fff;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 201;
  padding: 80px 32px 32px;
}

.mobile-nav.active {
  transform: translateX(0);
}

.mobile-nav a {
  display: block;
  padding: 16px 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--slate-700);
  border-bottom: 1px solid var(--slate-100);
}

.mobile-nav a:hover {
  color: var(--blue-600);
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 200;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--slate-400);
  font-size: 1.5rem;
  line-height: 1;
}

/* =========================================
   HERO
   ========================================= */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 72px;
  background: linear-gradient(160deg, #ffffff 0%, var(--slate-50) 50%, var(--blue-50) 100%);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero-content {
  animation: fadeInUp 0.8s ease-out;
}

.hero-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-600);
  margin-bottom: 20px;
}

.hero h1 {
  margin-bottom: 24px;
}

.hero p {
  font-size: 1.15rem;
  color: var(--slate-500);
  max-width: 480px;
  margin-bottom: 36px;
}

.hero-image {
  animation: fadeInUp 0.8s ease-out 0.15s both;
}

.hero-image-wrapper {
  position: relative;
}

.hero-image-wrapper::before {
  content: '';
  position: absolute;
  top: -16px;
  right: -16px;
  bottom: -16px;
  left: -16px;
  background: linear-gradient(135deg, var(--blue-100) 0%, var(--blue-50) 100%);
  border-radius: 20px;
  z-index: 0;
}

.hero-image-wrapper img {
  position: relative;
  z-index: 1;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* =========================================
   ABOUT
   ========================================= */
.about {
  background: #fff;
}

.about-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 64px;
  align-items: start;
}

.about-image img {
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.about-text h2 {
  margin-bottom: 24px;
}

.about-text p {
  color: var(--slate-600);
  margin-bottom: 16px;
}

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

/* =========================================
   CODE STRIP
   ========================================= */
.code-strip {
  position: relative;
  padding: 80px 0;
  background: var(--slate-900) url('../images/apex-code.png') left 30%/cover no-repeat;
  overflow: hidden;
}

.code-strip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.87);
}

.code-strip .container {
  position: relative;
  z-index: 1;
  text-align: center;
}

.code-strip blockquote {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.code-strip blockquote span {
  color: var(--blue-500);
}

/* =========================================
   SERVICES
   ========================================= */
.services {
  background: var(--slate-50);
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 64px;
}

.section-header h2 {
  margin-bottom: 16px;
}

.section-header p {
  color: var(--slate-500);
  font-size: 1.05rem;
}

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

.service-card {
  background: #fff;
  padding: 32px;
  border-radius: 12px;
  border: 1px solid var(--slate-200);
  transition: all 0.25s ease;
}

.service-card:hover {
  border-color: var(--blue-200);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  transform: translateY(-3px);
}

.service-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-50);
  color: var(--blue-600);
  margin-bottom: 20px;
}

.service-card h3 {
  margin-bottom: 12px;
}

.service-card p {
  color: var(--slate-500);
  font-size: 0.93rem;
  line-height: 1.7;
}

/* Service card stagger animation */
.services-grid .service-card:nth-child(1) { transition-delay: 0ms; }
.services-grid .service-card:nth-child(2) { transition-delay: 80ms; }
.services-grid .service-card:nth-child(3) { transition-delay: 160ms; }
.services-grid .service-card:nth-child(4) { transition-delay: 240ms; }
.services-grid .service-card:nth-child(5) { transition-delay: 320ms; }
.services-grid .service-card:nth-child(6) { transition-delay: 400ms; }

/* =========================================
   CONTACT
   ========================================= */
.contact {
  background: #fff;
  text-align: center;
}

.contact h2 {
  margin-bottom: 16px;
}

.contact-subtitle {
  color: var(--slate-500);
  font-size: 1.1rem;
  max-width: 500px;
  margin: 0 auto 36px;
}

.email-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--blue-600);
  transition: color 0.2s;
}

.email-link:hover {
  color: var(--blue-700);
}

.email-link svg {
  flex-shrink: 0;
}

/* =========================================
   FOOTER
   ========================================= */
.site-footer {
  background: var(--slate-900);
  color: var(--slate-400);
  padding: 32px 0;
  text-align: center;
  font-size: 0.875rem;
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
  h1 {
    font-size: 2.75rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 48px;
  }

  .hero p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-image {
    max-width: 560px;
    margin: 0 auto;
  }

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

  .about-image {
    max-width: 280px;
    margin: 0 auto;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  section {
    padding: 64px 0;
  }

  .nav-links {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }

  .hero {
    min-height: auto;
    padding-top: 120px;
    padding-bottom: 64px;
  }

  .hero-grid {
    gap: 40px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .code-strip {
    padding: 56px 0;
  }

  .code-strip blockquote {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.875rem;
  }

  .container {
    padding: 0 16px;
  }

  .service-card {
    padding: 24px;
  }
}