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

:root {
  --bg: #f0f3f8;
  --bg-alt: #e8ecf4;
  --bg-card: #ffffff;
  --border: #d4dae8;
  --text: #032d60;
  --text-muted: #5a6a85;
  --accent: #0176d3;
  --accent-secondary: #8b5cf6;
  --accent-glow: rgba(1, 118, 211, 0.08);
  --max-w: 1200px;
  --section-pad: 100px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ===== Typography ===== */
h1, h2, h3 { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
p { color: var(--text-muted); max-width: 65ch; }
.mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; }

/* ===== Layout ===== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
section { padding: var(--section-pad) 0; position: relative; }

/* Alternating subtle bg on sections */
section:nth-of-type(even) { background: var(--bg-alt); }

/* ===== Nav ===== */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 16px 0;
  background: transparent;
  transition: background 0.3s, box-shadow 0.3s, padding 0.3s;
}
nav.scrolled {
  background: rgba(240, 243, 248, 0.88);
  backdrop-filter: blur(16px) saturate(1.8);
  box-shadow: 0 1px 3px rgba(3, 45, 96, 0.08);
  padding: 10px 0;
}
nav .container { display: flex; align-items: center; justify-content: space-between; }
.logo {
  text-decoration: none;
  display: flex; align-items: center; gap: 10px;
  transition: opacity 0.2s;
}
.logo:hover { opacity: 0.85; }
.logo-mark { width: 34px; height: 34px; flex-shrink: 0; }
.wordmark {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 800; font-size: 1.35rem; letter-spacing: -0.03em;
  color: var(--text);
}
.wordmark span {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
  color: var(--text-muted); text-decoration: none; font-size: 0.9rem;
  font-weight: 500; position: relative; transition: color 0.2s;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px; border-radius: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.hamburger {
  display: none; background: none; border: none; color: var(--text);
  font-size: 1.5rem; cursor: pointer; padding: 4px;
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  padding-top: 80px; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #e8ecf4 0%, #f0f3f8 40%, #f5f0ff 100%);
}

/* Animated floating orbs */
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.5; pointer-events: none;
  animation: float 20s ease-in-out infinite;
}
.hero::before {
  width: 500px; height: 500px; top: -10%; right: -5%;
  background: radial-gradient(circle, rgba(1, 118, 211, 0.15), transparent 70%);
}
.hero::after {
  width: 400px; height: 400px; bottom: -5%; left: -5%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.12), transparent 70%);
  animation-delay: -10s; animation-duration: 25s;
}

/* Dot grid pattern overlay */
.hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(3, 45, 96, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at 60% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 60% 50%, black 20%, transparent 70%);
}

.hero .container { position: relative; z-index: 1; }
.hero h1 { margin-bottom: 1.25rem; }
.hero h1 .accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { font-size: 1.15rem; margin-bottom: 2rem; max-width: 600px; }

/* CTA with shimmer */
.cta {
  display: inline-block; padding: 14px 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #0b5cab);
  color: #fff; text-decoration: none;
  font-weight: 600; font-size: 0.95rem;
  position: relative; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cta::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 3s ease-in-out infinite;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(1, 118, 211, 0.3); }

/* ===== Problem / Solution ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.two-col .col {
  padding: 40px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--bg-card); box-shadow: 0 2px 8px rgba(3, 45, 96, 0.06);
  position: relative; overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}
.two-col .col:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(3, 45, 96, 0.08); }

/* Gradient top border on cards */
.two-col .col::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  opacity: 0; transition: opacity 0.3s;
}
.two-col .col:hover::before { opacity: 1; }
.two-col .col h3 { color: var(--accent); text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.08em; margin-bottom: 1rem; }
.two-col .col p { color: var(--text-muted); font-size: 1rem; }

/* ===== Cards (Platform) ===== */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; margin-top: 48px; }
.card {
  padding: 36px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 2px 8px rgba(3, 45, 96, 0.06);
  position: relative; overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.4s, transform 0.3s;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s ease;
}
.card:hover::before { transform: scaleX(1); }
.card:hover { border-color: var(--accent); box-shadow: 0 16px 48px rgba(1, 118, 211, 0.12); transform: translateY(-4px); }
.card h3 { color: var(--text); }
.card p { font-size: 0.95rem; }

/* Staggered animation for cards */
.card-grid .card:nth-child(1) { transition-delay: 0s; }
.card-grid .card:nth-child(2) { transition-delay: 0.05s; }
.card-grid .card:nth-child(3) { transition-delay: 0.1s; }
.card-grid .card:nth-child(4) { transition-delay: 0.15s; }

/* ===== Tech Stack ===== */
.tech-lead { font-size: 1.1rem; color: var(--text-muted); max-width: 720px; margin-bottom: 40px; }
.gcp-highlight {
  padding: 36px; border-radius: 16px; margin-bottom: 32px;
  border: 1px solid transparent; text-align: center;
  background:
    linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    linear-gradient(135deg, var(--accent), var(--accent-secondary)) border-box;
  position: relative; overflow: hidden;
}
/* Subtle animated shimmer on GCP card */
.gcp-highlight::after {
  content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(1, 118, 211, 0.04), transparent);
  animation: shimmer 4s ease-in-out infinite;
}
.gcp-highlight h3 {
  font-size: 1.4rem; margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gcp-highlight p { margin: 0 auto; color: var(--text-muted); }
.pill-grid { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.pill {
  padding: 10px 20px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-muted);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.pill:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(3, 45, 96, 0.08); }
.pill.accent {
  border-color: var(--accent); color: var(--accent);
  background: linear-gradient(135deg, rgba(1, 118, 211, 0.06), rgba(139, 92, 246, 0.04));
  font-size: 0.95rem;
}
.pill.accent:hover { box-shadow: 0 4px 16px rgba(1, 118, 211, 0.15); }

/* ===== Portfolio ===== */
.wave-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 48px; }
.wave-card {
  padding: 36px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--bg-card); box-shadow: 0 2px 8px rgba(3, 45, 96, 0.06);
  position: relative; overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}
.wave-card:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(3, 45, 96, 0.08); }
.wave-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  opacity: 0; transition: opacity 0.3s;
}
.wave-card:hover::before { opacity: 1; }
.wave-card .label {
  display: inline-block; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 4px 12px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(1, 118, 211, 0.08), rgba(139, 92, 246, 0.06));
  color: var(--accent); margin-bottom: 1rem;
}
.wave-card ul { list-style: none; padding: 0; }
.wave-card li {
  color: var(--text-muted); padding: 8px 0; padding-left: 24px; position: relative;
  transition: color 0.2s, transform 0.2s;
}
.wave-card li:hover { color: var(--text); transform: translateX(4px); }
.wave-card li::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  opacity: 0.6; transition: opacity 0.2s;
}
.wave-card li:hover::before { opacity: 1; }
.portfolio-note { text-align: center; margin-top: 32px; color: var(--text-muted); font-size: 0.9rem; max-width: 600px; margin-left: auto; margin-right: auto; }

/* ===== Section Header ===== */
.section-header { text-align: center; margin-bottom: 16px; }
.section-header p { margin: 0 auto; }
.section-header h2 { position: relative; display: inline-block; }
.section-header h2::after {
  content: ''; display: block; width: 48px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  margin: 12px auto 0;
}

/* ===== Footer ===== */
footer {
  padding: 80px 0 40px; border-top: 1px solid var(--border);
  background: var(--bg);
}
.footer-content { display: grid; grid-template-columns: 2fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-about p { margin-bottom: 1.5rem; }
.footer-contact h3 { margin-bottom: 1rem; }
.footer-contact a {
  color: var(--accent); text-decoration: none;
  position: relative; transition: color 0.2s;
}
.footer-contact a::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1px; background: var(--accent);
  transition: width 0.3s ease;
}
.footer-contact a:hover::after { width: 100%; }
.footer-bottom {
  text-align: center; padding-top: 32px; border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.85rem;
}

/* ===== Animations ===== */
.fade-up {
  opacity: 0; transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* Staggered children */
.fade-up.visible .card:nth-child(1),
.fade-up.visible .col:nth-child(1),
.fade-up.visible .wave-card:nth-child(1) { animation: fadeSlideUp 0.5s 0.1s both; }
.fade-up.visible .card:nth-child(2),
.fade-up.visible .col:nth-child(2),
.fade-up.visible .wave-card:nth-child(2) { animation: fadeSlideUp 0.5s 0.2s both; }
.fade-up.visible .card:nth-child(3) { animation: fadeSlideUp 0.5s 0.3s both; }
.fade-up.visible .card:nth-child(4) { animation: fadeSlideUp 0.5s 0.4s both; }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(30px, -20px) scale(1.05); }
  66%      { transform: translate(-20px, 15px) scale(0.95); }
}

@keyframes shimmer {
  0%   { left: -100%; }
  100% { left: 200%; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .fade-up { opacity: 1; transform: none; }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  :root { --section-pad: 64px; }
  .two-col, .card-grid, .wave-grid, .footer-content { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; gap: 16px;
    position: absolute; top: 60px; right: 24px;
    background: rgba(240, 243, 248, 0.98); padding: 24px; border-radius: 16px;
    border: 1px solid var(--border); backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(3, 45, 96, 0.1);
  }
  .hamburger { display: block; }
  .hero { min-height: auto; padding: 120px 0 80px; }
  .hero::before, .hero::after { display: none; }
}
