/* ============================================================
   CSS Variables
   ============================================================ */
:root {
  --accent:        #38bdf8;
  --accent-hover:  #7dd3fc;
  --bg:            #090911;
  --bg-alt:        #0f0f1a;
  --bg-card:       #12121e;
  --bg-card-hover: #1a1a2e;
  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --border:        rgba(56, 189, 248, 0.12);
  --radius:        10px;
  --nav-h:         68px;
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

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

/* Override Bootstrap dark theme background */
[data-bs-theme="dark"] {
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text-primary);
  --bs-body-font-family: 'Inter', system-ui, sans-serif;
}

::selection {
  background: var(--accent);
  color: #000;
}

section {
  padding: 5rem 0;
  scroll-margin-top: var(--nav-h);
}

a { text-decoration: none; }

/* ============================================================
   Navbar
   ============================================================ */
#main-navbar {
  background-color: rgba(9, 9, 17, 0.8) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  height: var(--nav-h);
  transition: border-color 0.3s, background-color 0.3s;
}

#main-navbar.scrolled {
  border-bottom-color: var(--border);
  background-color: rgba(9, 9, 17, 0.95) !important;
}

.navbar-brand {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent) !important;
  letter-spacing: -0.5px;
}

.brand-dot { color: var(--text-secondary); }

.nav-link {
  color: var(--text-secondary) !important;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem !important;
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0.85rem;
  right: 0.85rem;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform 0.25s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary) !important;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

/* ============================================================
   Hero
   ============================================================ */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
}

/* Grid + glow background */
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56,189,248,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,189,248,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

#hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 55% at 50% -10%,
    rgba(56,189,248,0.10) 0%,
    transparent 60%);
  pointer-events: none;
}

.hero-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.85;
}

.hero-name {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
}

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

.hero-title-line {
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  color: var(--text-secondary);
  font-weight: 400;
  min-height: 2.2rem;
  font-family: 'JetBrains Mono', monospace;
}

#typing-text::after {
  content: '|';
  color: var(--accent);
  animation: blink 0.8s step-end infinite;
  font-weight: 300;
  margin-left: 2px;
}

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

.hero-bio {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 520px;
  line-height: 1.85;
}

/* Buttons */
.btn-accent {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #000 !important;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius);
  border: none;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-accent:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(56,189,248,0.28);
}

.btn-outline-accent {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--accent) !important;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--accent);
  transition: background 0.2s, transform 0.2s;
}

.btn-outline-accent:hover {
  background: rgba(56,189,248,0.08);
  transform: translateY(-2px);
}

.hero-socials a {
  color: var(--text-secondary);
  font-size: 1.35rem;
  transition: color 0.2s, transform 0.2s;
}

.hero-socials a:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

.scroll-down {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-secondary);
  font-size: 1.4rem;
  animation: bounce 2s ease-in-out infinite;
  opacity: 0.5;
}

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

/* ============================================================
   Section Headers
   ============================================================ */
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.85;
  display: block;
  margin-bottom: 0.4rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 0.3rem;
}

.section-title .accent { color: var(--accent); }

.section-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 3rem;
}

.section-divider {
  width: 44px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin-bottom: 0.75rem;
}

.section-divider.mx-auto { margin-left: auto; margin-right: auto; }

/* Alternate section backgrounds */
.bg-alt { background-color: var(--bg-alt); }

/* ============================================================
   About
   ============================================================ */
.about-photo-wrap {
  position: relative;
  display: inline-block;
}

.about-photo {
  width: 270px;
  height: 270px;
  object-fit: cover;
  border-radius: 16px;
  border: 2px solid var(--border);
  box-shadow: 0 0 50px rgba(56,189,248,0.10);
  position: relative;
  z-index: 1;
}

.about-photo-placeholder {
  width: 270px;
  height: 270px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 5rem;
}

/* Decorative corner accent */
.about-photo-wrap::after {
  content: '';
  position: absolute;
  width: 270px;
  height: 270px;
  border: 2px solid var(--accent);
  border-radius: 16px;
  top: 14px;
  left: 14px;
  z-index: 0;
  opacity: 0.25;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
  text-align: center;
  transition: transform 0.25s, border-color 0.25s;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56,189,248,0.3);
}

.stat-number {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  font-family: 'JetBrains Mono', monospace;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================
   Skills
   ============================================================ */
.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  height: 100%;
  transition: border-color 0.25s, transform 0.25s;
}

.skill-group:hover {
  border-color: rgba(56,189,248,0.3);
  transform: translateY(-3px);
}

.skill-group-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.skill-badge {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  margin: 0.2rem 0.15rem;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.skill-badge:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(56,189,248,0.06);
}

/* ============================================================
   Experience Timeline
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 1.75rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent) 0%, transparent 100%);
  border-radius: 2px;
}

.tl-item {
  position: relative;
  padding-bottom: 2.5rem;
}

.tl-item:last-child { padding-bottom: 0; }

.tl-item::before {
  content: '';
  position: absolute;
  left: -1.47rem;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.18);
  flex-shrink: 0;
}

.tl-item.current::before {
  box-shadow: 0 0 0 3px rgba(56,189,248,0.18), 0 0 14px var(--accent);
}

.tl-period {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.2rem;
  opacity: 0.85;
}

.tl-role {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.tl-company {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  margin-top: 0.1rem;
}

.tl-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ============================================================
   Education
   ============================================================ */
.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  height: 100%;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.edu-card:hover {
  border-color: rgba(56,189,248,0.35);
  transform: translateY(-4px);
  box-shadow: 0 10px 35px rgba(56,189,248,0.07);
}

.edu-icon {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: block;
}

.edu-degree {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.edu-school {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.edu-period {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: 0.6rem;
  opacity: 0.85;
}

/* ============================================================
   Contact
   ============================================================ */
.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.contact-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: rgba(56,189,248,0.08);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1rem;
}

.contact-info-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contact-info-value {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.contact-info-value:hover { color: var(--accent); }

/* Form */
.form-control,
.form-select {
  background-color: var(--bg) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius) !important;
  padding: 0.7rem 1rem !important;
  font-size: 0.9rem !important;
  transition: border-color 0.2s !important;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(56,189,248,0.10) !important;
}

.form-control::placeholder { color: var(--text-secondary) !important; opacity: 0.5; }
textarea.form-control { resize: vertical; }

.form-label {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

footer strong { color: var(--text-primary); }

.footer-social {
  color: var(--text-secondary);
  font-size: 1.2rem;
  transition: color 0.2s, transform 0.2s;
  display: inline-block;
}

.footer-social:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

/* ============================================================
   Language Toggle
   ============================================================ */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-secondary) !important;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  text-decoration: none;
}

.lang-toggle:hover {
  color: var(--accent) !important;
  border-color: var(--accent);
  background: rgba(56,189,248,0.06);
}

/* ============================================================
   Scroll Animations
   ============================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

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

.fade-up:nth-child(2) { transition-delay: 0.1s; }
.fade-up:nth-child(3) { transition-delay: 0.2s; }
.fade-up:nth-child(4) { transition-delay: 0.3s; }
.fade-up:nth-child(5) { transition-delay: 0.4s; }
.fade-up:nth-child(6) { transition-delay: 0.5s; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  section { padding: 4rem 0; }

  .about-photo,
  .about-photo-placeholder {
    width: 220px;
    height: 220px;
    margin: 0 auto 2rem;
  }

  .about-photo-wrap::after { display: none; }

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

  .timeline { padding-left: 1.25rem; }
}
