@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg: #050a0e;
  --bg-elevated: #0a1118;
  --bg-card: #0f1923;
  --surface: #152231;
  --border: rgba(148, 163, 184, 0.12);
  --border-hover: rgba(148, 163, 184, 0.28);
  --text: #e2e8f0;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --accent: #22d3ee;
  --accent-glow: rgba(34, 211, 238, 0.15);
  --accent-strong: rgba(34, 211, 238, 0.3);
  --accent-warm: #f59e0b;
  --success: #34d399;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ========== NAV ========== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 24px;
  transition: background 0.4s, backdrop-filter 0.4s;
}

.nav.scrolled {
  background: rgba(5, 10, 14, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(5, 10, 14, 0.96);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px 20px;
    gap: 2px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 14px;
    font-size: 1rem;
  }

  .nav-mobile-toggle {
    display: block;
  }
}

/* ========== HERO ========== */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 40%, transparent 0%, var(--bg) 100%);
  z-index: 1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 0 24px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--accent-glow);
  border: 1px solid var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--accent) 0%, #818cf8 50%, var(--accent-warm) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 36px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(129, 140, 248, 0.1));
  border: 1px solid var(--accent-strong);
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), box-shadow 0.3s;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(34, 211, 238, 0.2);
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: float 3s ease-in-out infinite;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ========== SECTIONS COMMON ========== */

.section {
  padding: 100px 24px;
  max-width: 1120px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .section {
    padding: 64px 20px;
  }
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 12px;
  font-family: var(--font-mono);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 20px;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.7;
}

/* ========== ABOUT ========== */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  margin-top: 40px;
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.about-left {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.about-photo {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.about-photo img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  border: 2px solid var(--border);
  object-fit: cover;
  filter: grayscale(0.15) contrast(1.05);
  transition: filter 0.4s, border-color 0.4s;
}

.about-photo::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent-glow), rgba(129, 140, 248, 0.08));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s;
}

.about-photo:hover img {
  filter: grayscale(0) contrast(1.08);
  border-color: var(--accent-strong);
}

.about-photo:hover::after {
  opacity: 1;
}

.about-text p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 16px;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ========== EXPERTISE ========== */

.expertise-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 40px;
}

@media (max-width: 640px) {
  .expertise-grid {
    grid-template-columns: 1fr;
  }
}

.expertise-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s var(--ease-out), box-shadow 0.3s;
}

.expertise-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.expertise-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.expertise-card:hover::before {
  opacity: 1;
}

.expertise-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-glow);
  border: 1px solid var(--accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.expertise-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.expertise-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.expertise-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.expertise-tag {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ========== PROJECT ========== */

.project-section {
  position: relative;
}

.project-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(34, 211, 238, 0.04) 100%);
  border: 1px solid var(--accent-strong);
  border-radius: 24px;
  padding: 48px 40px;
  margin-top: 40px;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 40% 60% at 0% 0%, rgba(34, 211, 238, 0.08), transparent),
    radial-gradient(ellipse 30% 40% at 100% 100%, rgba(129, 140, 248, 0.06), transparent);
  pointer-events: none;
}

@media (max-width: 640px) {
  .project-card {
    padding: 32px 24px;
  }
}

.project-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-warm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.project-card h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.project-card .project-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 640px;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

.project-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.project-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.project-feature-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.project-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  color: #050a0e;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: transform 0.2s var(--ease-out), box-shadow 0.3s;
  letter-spacing: -0.01em;
}

.project-cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 40px rgba(34, 211, 238, 0.3);
}

/* ========== EDUCATION ========== */

.timeline {
  position: relative;
  margin-top: 40px;
  padding-left: 32px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-bottom: 36px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -28px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-item:not(:first-child) .timeline-dot {
  background: var(--bg-card);
  box-shadow: 0 0 0 2px var(--border-hover);
}

.timeline-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ========== CONTACT / FOOTER ========== */

.footer {
  border-top: 1px solid var(--border);
  padding: 64px 24px;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}

@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    gap: 32px;
  }
}

.footer-left h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.footer-left p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 400px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--accent);
}

.footer-bottom {
  max-width: 1120px;
  margin: 40px auto 0;
  padding: 24px 24px 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-langs {
  display: flex;
  gap: 12px;
}

.footer-lang {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ========== LANG SWITCHER ========== */

.lang-switcher {
  display: inline-flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  margin-left: 8px;
}

.lang-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  color: var(--accent);
  background: var(--accent-glow);
}

@media (max-width: 640px) {
  .lang-switcher {
    margin: 8px 0 0;
    align-self: flex-start;
  }
}

/* ========== SCROLL PROGRESS & SCROLL-TO-TOP ========== */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 200;
  background: rgba(148, 163, 184, 0.12);
}

.scroll-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #818cf8);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.4);
  transition: width 120ms linear;
}

.scroll-top-btn {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  right: calc(24px + env(safe-area-inset-right, 0px));
  z-index: 150;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.2s var(--ease-out), border-color 0.2s, box-shadow 0.2s;
}

.scroll-top-btn svg {
  width: 24px;
  height: 24px;
}

.scroll-top-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-top-btn:hover {
  border-color: var(--accent-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

@media (max-width: 640px) {
  .scroll-top-btn {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right: calc(20px + env(safe-area-inset-right, 0px));
    width: 44px;
    height: 44px;
  }
  .scroll-top-btn svg {
    width: 20px;
    height: 20px;
  }
}

/* Very small screens (e.g. narrow phones) */
@media (max-width: 380px) {
  .section {
    padding: 48px 16px;
  }
  .hero-content {
    padding: 0 16px;
  }
  .nav-inner {
    padding-left: 16px;
    padding-right: 16px;
  }
  .scroll-top-btn {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
  }
}

/* ========== ANIMATION HELPERS (reveal via .is-visible) ========== */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.55s var(--ease-out), transform 0.65s var(--ease-out);
}

.reveal-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.55s var(--ease-out), transform 0.65s var(--ease-out);
}

.reveal-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.6s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger when parent grid/section triggers reveal */
.expertise-grid .expertise-card:nth-child(1) { transition-delay: 0ms; }
.expertise-grid .expertise-card:nth-child(2) { transition-delay: 80ms; }
.expertise-grid .expertise-card:nth-child(3) { transition-delay: 160ms; }
.expertise-grid .expertise-card:nth-child(4) { transition-delay: 240ms; }

.timeline .timeline-item:nth-child(1) { transition-delay: 0ms; }
.timeline .timeline-item:nth-child(2) { transition-delay: 100ms; }
.timeline .timeline-item:nth-child(3) { transition-delay: 200ms; }
.timeline .timeline-item:nth-child(4) { transition-delay: 300ms; }

/* ========== UTILITY ========== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
