:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.12);
  --accent: #0ea5e9;
  --shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 20px 40px -8px rgba(15, 23, 42, 0.12);
  --contact-bg: #0f172a;
  --contact-text: #ffffff;
  --contact-muted: #94a3b8;
  --radius: 16px;
  --radius-lg: 24px;
}

body.dark {
  --bg: #090d16;
  --surface: #111827;
  --surface-2: #162032;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: #1e293b;
  --primary: #38bdf8;
  --primary-hover: #7dd3fc;
  --primary-glow: rgba(56, 189, 248, 0.15);
  --accent: #38bdf8;
  --shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 20px 40px -8px rgba(0, 0, 0, 0.6);
  --contact-bg: #111827;
  --contact-text: #ffffff;
  --contact-muted: #94a3b8;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.7;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

.container {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

/* Header & Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 250, 252, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

body.dark .header {
  background: rgba(9, 13, 22, 0.85);
}

.nav {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
}

.logo span {
  color: var(--primary);
}

nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

nav a {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  position: relative;
  padding: 6px 0;
}

nav a:hover,
nav a.active {
  color: var(--primary);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--primary);
  transition: width 0.25s ease;
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}


.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-btn, .menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 17px;
  transition: all 0.2s ease;
}

.theme-btn:hover, .menu-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.menu-btn {
  display: none;
}

/* Hero Section */
.hero {
  padding: 100px 0 90px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: 60px;
}

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: inline-block;
}

h1 {
  font-size: clamp(38px, 5.5vw, 68px);
  line-height: 1.08;
  letter-spacing: -2px;
  font-weight: 800;
}

h1 span {
  color: var(--primary);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  max-width: 650px;
  color: var(--muted);
  font-size: 18px;
  margin: 24px 0 32px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  border: 1px solid var(--line);
  transition: all 0.25s ease;
}

.btn:hover {
  transform: translateY(-3px);
}

.btn.primary {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 18px var(--primary-glow);
}

.btn.primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 24px var(--primary-glow);
}

.btn.secondary {
  background: var(--surface);
  color: var(--text);
}

.btn.secondary:hover {
  border-color: var(--primary);
}

.quick-info {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.quick-info span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

/* Hero Photo & Floating Card */
.hero-photo {
  position: relative;
  justify-self: center;
  width: 320px;
  height: 380px;
}

.hero-photo img {
  position: absolute;
  inset: 15px 15px 40px;
  width: calc(100% - 30px);
  height: calc(100% - 55px);
  object-fit: cover;
  border-radius: 38% 38% 28% 28%;
  box-shadow: var(--shadow);
  z-index: 2;
  border: 2px solid var(--line);
  background: var(--surface);
  transition: transform 0.3s ease;
}

.hero-photo:hover img {
  transform: scale(1.02);
}

.photo-ring {
  position: absolute;
  inset: 0 0 25px;
  border: 2px solid var(--primary);
  border-radius: 42% 42% 32% 32%;
  transform: rotate(5deg);
  opacity: 0.5;
  transition: transform 0.4s ease;
}

.hero-photo:hover .photo-ring {
  transform: rotate(10deg) scale(1.03);
}

.floating-card {
  position: absolute;
  z-index: 4;
  right: -20px;
  bottom: 5px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.floating-card strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.floating-card small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Section Common */
.section {
  padding: 95px 0;
}

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

.section-heading {
  margin-bottom: 46px;
}

.section-heading h2 {
  font-size: clamp(30px, 3.8vw, 44px);
  letter-spacing: -1.2px;
  font-weight: 800;
}

/* About Cards */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.about-card {
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.about-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
}

.card-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

.about-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.about-card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.skill-card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.skill-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
}

.skill-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--primary);
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
}

.skill-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
  font-weight: 700;
}

.skill-card p {
  color: var(--muted);
  font-size: 14px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.tags span {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tags span:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  padding: 32px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}

.project-card.featured {
  border-color: var(--primary);
  position: relative;
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.project-number {
  color: var(--primary);
  font-weight: 800;
  font-size: 15px;
  font-family: 'Space Grotesk', sans-serif;
}

.project-type {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.project-card h3 {
  font-size: 22px;
  margin-bottom: 14px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.project-card p {
  color: var(--muted);
  font-size: 15px;
  flex-grow: 1;
  line-height: 1.7;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.project-tags span {
  background: var(--surface-2);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
}

/* Contact Section */
.contact-section {
  padding-top: 40px;
}

.contact-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  padding: 56px;
  background: var(--contact-bg);
  color: var(--contact-text);
  border-radius: 28px;
  box-shadow: var(--shadow-hover);
}

.contact-left h2 {
  font-size: clamp(30px, 3.5vw, 42px);
  margin-bottom: 12px;
  letter-spacing: -1px;
}

.contact-left p:not(.eyebrow) {
  color: var(--contact-muted);
  font-size: 16px;
  max-width: 520px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 260px;
}

.contact-btn {
  padding: 14px 20px;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  display: block;
  transition: all 0.2s ease;
}

.primary-contact {
  background: var(--primary);
  color: #ffffff;
}

.primary-contact:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.contact-sublinks {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.contact-sublinks a {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
}

.contact-sublinks a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Footer */
footer {
  padding: 32px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.footer-inner a {
  color: var(--primary);
}

/* Scroll Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.show {
  opacity: 1;
  transform: none;
}

/* Responsive Media Queries */
@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-photo {
    order: -1;
    width: 270px;
    height: 330px;
  }

  .hero-actions, .quick-info {
    justify-content: center;
  }

  .about-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-box {
    flex-direction: column;
    align-items: flex-start;
    padding: 40px;
  }

  .contact-links {
    width: 100%;
  }

  nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    padding: 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 18px;
    box-shadow: var(--shadow);
  }

  nav.open {
    display: flex;
  }

  .menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 600px) {
  .container {
    width: calc(100% - 32px);
  }

  h1 {
    letter-spacing: -1.5px;
  }

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

  .section {
    padding: 70px 0;
  }

  .contact-box {
    padding: 30px 24px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
