@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ===== DESIGN TOKENS ===== */
:root {
  --primary: #0a0f1e;
  --primary-light: #1e293b;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.25);
  --bg: #f0f4f8;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.65);
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-subtle: rgba(0, 0, 0, 0.06);
  --gradient-hero: linear-gradient(135deg, #0a0f1e 0%, #1a1f3a 50%, #0f1629 100%);
  --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --radius-xl: 1.5rem;
  --radius-lg: 1rem;
  --radius-md: 0.75rem;
  --radius-sm: 0.5rem;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 60px rgba(59,130,246,0.15);
  --transition-fast: 0.2s cubic-bezier(0.4,0,0.2,1);
  --transition-smooth: 0.4s cubic-bezier(0.4,0,0.2,1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  /* Safe area for notched phones */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
img { max-width: 100%; height: auto; display: block; }

/* ===== LOADER ===== */
#global-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s cubic-bezier(0.4,0,0.2,1), visibility 0.6s;
}
.loader-spinner {
  width: 64px;
  height: 64px;
  border: 4px solid rgba(255,255,255,0.1);
  border-left-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
}
.loader-text {
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: pulseGlow 2s infinite;
}
.loader-hidden {
  opacity: 0;
  visibility: hidden;
}

/* ===== KEYFRAMES ===== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
@keyframes pulseGlow { 0%,100%{box-shadow:0 0 20px rgba(59,130,246,0.2)} 50%{box-shadow:0 0 40px rgba(59,130,246,0.4)} }
@keyframes gradientShift { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
@keyframes orbitSpin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }
@keyframes fadeInUp { from{opacity:0;transform:translateY(30px)} to{opacity:1;transform:translateY(0)} }

/* ===== UTILITIES ===== */
.text-accent { color: var(--accent); }
.text-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== GLASSMORPHISM ===== */
.glass {
  background: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
}
.glass-dark {
  background: rgba(10,15,30,0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 0.75rem 1.75rem; border-radius: var(--radius-full);
  font-weight: 600; font-size: 0.9375rem; letter-spacing: 0.01em;
  transition: all var(--transition-fast); cursor: pointer;
  border: none; text-decoration: none; position: relative; overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px; /* Touch target */
}
.btn::after {
  content:''; position:absolute; inset:0;
  background:linear-gradient(rgba(255,255,255,0.15),transparent);
  opacity:0; transition:opacity var(--transition-fast);
}
.btn:hover::after { opacity:1; }
.btn:active { transform: scale(0.97); }

.btn-primary { background:var(--primary); color:white; box-shadow:0 4px 14px rgba(10,15,30,0.25); }
.btn-primary:hover { transform:translateY(-2px); box-shadow:0 8px 25px rgba(10,15,30,0.35); }

.btn-accent { background:var(--gradient-accent); background-size:200% 200%; color:white; box-shadow:0 4px 20px var(--accent-glow); }
.btn-accent:hover { transform:translateY(-2px); box-shadow:0 8px 30px rgba(59,130,246,0.4); }

.btn-outline { background:white; color:var(--text-primary); border:1.5px solid var(--border-subtle); box-shadow:var(--shadow-sm); }
.btn-outline:hover { border-color:var(--accent); color:var(--accent); transform:translateY(-2px); box-shadow:var(--shadow-md); }

.btn-ghost { background:rgba(255,255,255,0.1); color:white; border:1px solid rgba(255,255,255,0.2); backdrop-filter:blur(8px); }
.btn-ghost:hover { background:rgba(255,255,255,0.2); transform:translateY(-2px); }

/* ===== GRIDS ===== */
.bento-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:1.5rem; }

/* ===== PROJECT CARD ===== */
.project-card {
  background:var(--surface); border-radius:var(--radius-xl); overflow:hidden;
  border:1px solid var(--border-subtle); transition:all var(--transition-smooth);
  display:flex; flex-direction:column;
  animation: fadeInUp 0.6s ease both;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  height: 100%;
}
.project-card:hover { transform:translateY(-8px); box-shadow:var(--shadow-lg); border-color:transparent; }
.project-card:hover .card-img { transform:scale(1.08); }
.project-card:hover .card-overlay { opacity:1 !important; }

.card-img { width:100%; height:100%; object-fit:cover; transition:transform 0.6s cubic-bezier(0.4,0,0.2,1); }
.card-badge {
  position:absolute; top:0.75rem; left:0.75rem;
  background:rgba(255,255,255,0.95); backdrop-filter:blur(8px);
  padding:0.25rem 0.75rem; border-radius:var(--radius-full);
  font-size:0.6875rem; font-weight:700; color:var(--accent);
  letter-spacing:0.03em; text-transform:uppercase;
}

/* ===== TOUR CARD ===== */
.tour-card {
  padding:0.75rem 1rem; border:1.5px solid var(--border-subtle);
  border-radius:var(--radius-lg); display:flex; align-items:center; gap:0.75rem;
  transition:all var(--transition-fast); background:var(--surface);
  color:var(--text-primary); position:relative; overflow:hidden;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
.tour-card::before {
  content:''; position:absolute; left:0; top:0; bottom:0; width:3px;
  background:var(--gradient-accent); opacity:0; transition:opacity var(--transition-fast);
}
.tour-card:hover { border-color:var(--accent-light); transform:translateX(6px); box-shadow:0 4px 16px var(--accent-glow); }
.tour-card:hover::before { opacity:1; }

/* ===== BACK BUTTON ===== */
.back-btn {
  position:absolute; top:1rem; left:1rem; z-index:110;
  display:inline-flex; align-items:center; gap:0.5rem;
  color:white; text-decoration:none; background:rgba(0,0,0,0.4);
  backdrop-filter:blur(16px); padding:0.5rem 1rem;
  border-radius:var(--radius-full); font-weight:500; font-size:0.8125rem;
  transition:all var(--transition-fast); border:1px solid rgba(255,255,255,0.1);
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
.back-btn:hover { background:rgba(0,0,0,0.7); transform:translateX(-4px); }

/* ===== SECTION HEADINGS ===== */
.section-label {
  display:inline-flex; align-items:center; gap:0.5rem;
  font-size:0.8125rem; font-weight:700; letter-spacing:0.1em;
  text-transform:uppercase; color:var(--accent); margin-bottom:0.75rem;
}
.section-label::before { content:''; width:2rem; height:2px; background:var(--gradient-accent); border-radius:1px; }

.section-title { font-size:2.5rem; font-weight:800; line-height:1.15; color:var(--text-primary); letter-spacing:-0.02em; }
.section-subtitle { font-size:1.0625rem; color:var(--text-secondary); line-height:1.7; max-width:540px; }

/* ===== LINK ===== */
.link-accent {
  display:inline-flex; align-items:center; gap:0.35rem;
  color:var(--accent); text-decoration:none; font-weight:600; font-size:0.875rem;
  transition:gap var(--transition-fast), color var(--transition-fast);
}
.link-accent:hover { gap:0.6rem; color:var(--accent-light); }

/* ===== STAT ===== */
.stat-card { text-align:center; padding:1.5rem 1rem; }
.stat-number { font-size:2rem; font-weight:800; background:var(--gradient-accent); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; margin-bottom:0.2rem; }
.stat-label { font-size:0.8125rem; color:var(--text-secondary); font-weight:500; }

/* ===== INTERACTIVE HOVER ===== */
.step-card:hover { transform:translateY(-6px); box-shadow:var(--shadow-lg); }
.step-card:hover .step-accent { opacity:1 !important; }
.project-back-link:hover { color:white !important; }
.footer-link:hover { color:rgba(255,255,255,0.9) !important; }
.nav-link { text-decoration:none; color:var(--text-secondary); }
.nav-link:hover { background:rgba(59,130,246,0.08) !important; color:var(--accent) !important; }

/* ===== PANNELLUM OVERRIDES ===== */
.pnlm-container { border-radius: 0 !important; }

/* ===== NAVBAR ===== */
.main-nav {
  position: fixed;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(94%, 1140px);
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: var(--radius-full);
  box-shadow: 0 2px 20px rgba(0,0,0,0.05);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.main-nav.scrolled {
  top: 0.5rem;
  width: min(96%, 1200px);
  padding: 0.6rem 1rem;
  background: rgba(255,255,255,0.88);
  box-shadow: 0 4px 30px rgba(0,0,0,0.1);
}

.nav-brand {
  display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none; color: var(--primary);
  -webkit-tap-highlight-color: transparent;
}
.nav-brand-icon {
  width: 32px; height: 32px; background: var(--gradient-accent);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-brand-text {
  font-size: 1rem; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap;
}

.nav-divider {
  width: 1px; height: 18px; background: var(--border-subtle); margin: 0 0.35rem;
}

/* ===== MOBILE MENU ===== */
.mobile-toggle {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--text-primary); padding: 0.5rem;
  -webkit-tap-highlight-color: transparent;
  min-width: 44px; min-height: 44px;
  align-items: center; justify-content: center;
}
.mobile-menu {
  display: none; position: fixed; top: 4.5rem; left: 0.75rem; right: 0.75rem;
  z-index: 999; background: rgba(255,255,255,0.97); backdrop-filter: blur(20px);
  border-radius: var(--radius-xl); padding: 1.25rem;
  box-shadow: var(--shadow-lg); flex-direction: column; gap: 0.25rem;
}
.mobile-menu.active { display: flex; }
.mobile-menu a {
  text-decoration: none; color: var(--text-primary); font-weight: 600;
  font-size: 1rem; padding: 0.875rem 1rem; border-radius: var(--radius-md);
  min-height: 44px; display: flex; align-items: center;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition-fast);
}
.mobile-menu a:hover, .mobile-menu a:active {
  background: rgba(59,130,246,0.06);
}

/* ============================================================= */
/* RESPONSIVE                                                      */
/* ============================================================= */

/* ---------- TABLET & below (max 768px) ---------- */
@media (max-width: 768px) {
  .section-title { font-size: 1.75rem; }
  .section-subtitle { font-size: 0.9375rem; }
  .bento-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .steps-grid { grid-template-columns: 1fr !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.5rem !important; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 1.5rem !important; }
  .project-content-grid { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
  .desktop-nav { display: none !important; }
  .mobile-toggle { display: flex !important; }
  
  .main-nav {
    top: 0.5rem;
    width: calc(100% - 1rem);
    padding: 0.6rem 1rem;
  }
  
  .hero-content-wrapper {
    grid-template-columns: 1fr !important;
    padding: 5.5rem 1.25rem 2rem !important;
    text-align: center;
    gap: 2rem !important;
  }
  .hero-text { align-items: center; }
  .hero-cta-btns { justify-content: center; }
  .hero-stats { justify-content: center; }

  .stat-number { font-size: 1.5rem; }
  .stat-card { padding: 1rem 0.5rem; }
  .btn { padding: 0.625rem 1.25rem; font-size: 0.875rem; }
  
  /* Project card — disable hover transform on touch */
  .project-card:hover { transform: none; }
  .project-card:active { transform: scale(0.98); }
  
  /* Tour card — disable translateX on touch */
  .tour-card:hover { transform: none; }
  .tour-card:active { transform: scale(0.98); border-color: var(--accent-light); }
  
  /* Step card — disable hover transform on touch */
  .step-card:hover { transform: none; }
  
  .back-btn { top: 0.75rem; left: 0.75rem; padding: 0.4rem 0.75rem; font-size: 0.75rem; }
}

/* ---------- SMALL MOBILE (max 480px) ---------- */
@media (max-width: 480px) {
  .section-title { font-size: 1.5rem; }
  .hero-text h1 { font-size: 1.75rem !important; }
  .hero-text p { font-size: 0.9375rem !important; }
  .hero-cta-btns { flex-direction: column; width: 100%; }
  .hero-cta-btns .btn { width: 100%; justify-content: center; }
  .hero-stats { gap: 1.5rem !important; }
  .footer-grid { grid-template-columns: 1fr !important; gap: 1.25rem !important; }
  
  .main-nav {
    width: calc(100% - 0.75rem);
    left: 50%;
    border-radius: var(--radius-lg);
  }
  
  .mobile-menu {
    top: 4rem;
    left: 0.5rem;
    right: 0.5rem;
  }
}

/* ---------- SMALL DESKTOP (max 1024px) ---------- */
@media (min-width: 769px) and (max-width: 1024px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-content-wrapper { gap: 2rem !important; }
}
