/* =====================
   ROOT & RESET
   ===================== */
:root {
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --text: #0f172a;
  --text-muted: #475569;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --accent-hover: #1d4ed8;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 4px 10px -3px rgba(0,0,0,0.04);
  --radius: 10px;
  --radius-lg: 18px;
  --nav-h: 64px;
  --max-w: 1100px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

section {
  padding: 88px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 10px;
}

.section-title::after {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  background: var(--accent);
  margin-top: 10px;
  border-radius: 2px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-top: 16px;
  margin-bottom: 48px;
  max-width: 600px;
}

/* =====================
   NAVBAR
   ===================== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: box-shadow 0.25s;
}

#navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.04em;
  font-family: var(--mono);
}

.nav-logo .dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 7px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
  background: var(--accent-light);
}

.nav-links a.active {
  color: var(--accent);
}

.nav-links .nav-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 7px 16px;
  border-radius: 7px;
  font-weight: 600;
}

.nav-links .nav-cta:hover {
  background: var(--accent-hover) !important;
  color: #fff !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}

/* =====================
   HERO
   ===================== */
#hero {
  position: relative;
  padding-top: calc(var(--nav-h) + 80px);
  padding-bottom: 88px;
  background:
    radial-gradient(circle at 75% 20%, rgba(37, 99, 235, 0.07), transparent 45%),
    radial-gradient(circle at 15% 85%, rgba(124, 58, 237, 0.06), transparent 40%),
    #fbfcfe;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(15, 23, 42, 0.10) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 85%);
  pointer-events: none;
}

.hero-container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 56px;
  align-items: center;
}

.hero-content,
.hero-visual {
  min-width: 0;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 22px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  position: relative;
  flex-shrink: 0;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.4);
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.5); opacity: 1; }
  80%, 100% { transform: scale(1.6); opacity: 0; }
}

#hero h1 {
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 18px;
  color: var(--text);
}

.hero-accent {
  color: var(--accent);
}

.hero-role {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 22px;
  font-family: var(--mono);
  letter-spacing: -0.01em;
  min-height: 1.6em;
}

#typewriter {
  color: var(--accent);
  font-weight: 600;
}

.type-cursor {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  background: var(--accent);
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-tagline {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 36px;
  line-height: 1.75;
}

.hero-tagline strong {
  color: var(--text);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.32);
}

.btn-secondary {
  background: #fff;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn-secondary:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
}

.hero-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.dot-sep {
  color: #cbd5e1;
}

/* Hero terminal */
.terminal {
  width: 420px;
  max-width: 100%;
  background: #0f172a;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.15);
  overflow: hidden;
  font-family: var(--mono);
  transform: rotate(0.6deg);
  transition: transform 0.3s ease;
}

.terminal:hover {
  transform: rotate(0deg) translateY(-3px);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  background: #1e293b;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.t-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.t-red { background: #f87171; }
.t-yellow { background: #fbbf24; }
.t-green { background: #34d399; }

.terminal-title {
  margin-left: 8px;
  font-size: 0.72rem;
  color: #64748b;
  letter-spacing: 0.02em;
}

.terminal-body {
  padding: 20px 22px 22px;
  font-size: 0.8rem;
  line-height: 1.7;
}

.terminal-body p {
  color: #e2e8f0;
  margin-bottom: 2px;
  white-space: nowrap;
}

.terminal-body .t-out {
  color: #7dd3fc;
  margin-bottom: 12px;
}

.t-prompt {
  color: #34d399;
  font-weight: 500;
  margin-right: 6px;
}

.t-key {
  color: #94a3b8;
}

.t-blink {
  color: #7dd3fc;
  animation: blink 1s step-end infinite;
}

/* =====================
   ABOUT
   ===================== */
.about-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 52px;
  align-items: start;
  margin-top: 40px;
}

.about-photo {
  flex-shrink: 0;
}

.photo-placeholder {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2);
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 1rem;
  line-height: 1.8;
}

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

.about-text strong {
  color: var(--text);
  font-weight: 600;
}

.about-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.about-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.about-link:hover {
  border-bottom-color: var(--accent);
}

/* =====================
   SKILLS
   ===================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.skill-group {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.skill-group:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.skill-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 5px;
}

.tag-arch { background: #eff6ff; color: #1d4ed8; }
.tag-cloud { background: #f0fdf4; color: #15803d; }
.tag-msg { background: #fff7ed; color: #c2410c; }
.tag-be { background: #fdf4ff; color: #7e22ce; }
.tag-data { background: #fff1f2; color: #be123c; }
.tag-obs { background: #f0fdf4; color: #15803d; }
.tag-fe { background: #eff6ff; color: #1d4ed8; }

/* =====================
   ARCHITECTURE FOCUS
   ===================== */
.arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.arch-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.arch-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #c4b5fd;
}

.arch-icon {
  font-size: 1.8rem;
  margin-bottom: 14px;
  display: block;
}

.arch-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.arch-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* =====================
   TIMELINE (EXPERIENCE)
   ===================== */
.timeline {
  position: relative;
  padding-left: 36px;
  margin-top: 48px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -30px;
  top: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-content {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.timeline-role {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
  letter-spacing: -0.01em;
}

.timeline-company {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 600;
}

.timeline-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  background: var(--bg-alt);
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.timeline-bullets {
  list-style: none;
  margin-bottom: 18px;
}

.timeline-bullets li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 9px;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.timeline-bullets li::before {
  content: '→';
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--accent);
  font-size: 0.78rem;
}

.timeline-bullets strong {
  color: var(--text);
  font-weight: 600;
}

.timeline-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 18px;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-sm {
  font-size: 0.73rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 5px;
  background: var(--bg-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* =====================
   PROJECTS
   ===================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.project-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 15px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #60a5fa);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-head {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.project-company {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
}

.project-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.project-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
}

.project-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.highlight {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent);
}

.highlight::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.project-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.project-link:hover {
  border-bottom-color: var(--accent);
}

.project-link .arrow {
  transition: transform 0.2s ease;
}

.project-link:hover .arrow {
  transform: translateX(4px);
}

/* =====================
   CONTACT
   ===================== */
.contact-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 16px;
  margin-top: 48px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.contact-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
}

.contact-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.contact-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

/* =====================
   FOOTER
   ===================== */
footer {
  background: var(--text);
  color: #94a3b8;
  text-align: center;
  padding: 32px 24px;
  font-size: 0.85rem;
}

/* =====================
   ANIMATIONS
   ===================== */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 900px) {
  .hero-container {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    display: flex;
    justify-content: center;
  }

  .terminal {
    transform: none;
    width: 100%;
    max-width: 480px;
  }

  .terminal-body {
    overflow-x: auto;
  }
}

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

  #hero {
    padding-top: calc(var(--nav-h) + 48px);
    padding-bottom: 64px;
  }

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

  .about-photo {
    display: flex;
    justify-content: center;
  }

  .about-links {
    justify-content: center;
  }

  /* Mobile nav */
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 16px 16px;
    gap: 2px;
    box-shadow: var(--shadow-md);
  }

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

  .nav-links a {
    padding: 10px 14px;
    border-radius: 7px;
    font-size: 0.9rem;
  }

  .nav-toggle {
    display: flex;
  }

  .timeline {
    padding-left: 28px;
  }

  .timeline-marker {
    left: -22px;
  }

  .timeline-header {
    flex-direction: column;
    gap: 8px;
  }

  .timeline-date {
    align-self: flex-start;
  }

  .projects-grid,
  .arch-grid {
    grid-template-columns: 1fr;
  }

  .contact-links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
  }

  .btn {
    text-align: center;
  }

  .hero-meta {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .dot-sep {
    display: none;
  }
}
