*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

:root {
  --accent-rgb: 30, 64, 175;
  --bg:           #f0f4fb;
  --surface:      #ffffff;
  --text:         #1e293b;
  --muted:        #64748b;
  --blue:         #2563eb;
  --accent:       #1e40af;
  --accent-hover: #1e3a8a;
  
  --border:       rgba(var(--accent-rgb), 0.14);
  --tag-bg:       rgba(var(--accent-rgb), 0.07);
  --glow:         rgba(var(--accent-rgb), 0.22);
  --transition:   0.3s ease;

  --shadow-sm:      0 2px 8px rgba(0, 0, 0, 0.02);
  --shadow-md:      0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-glow:    0 4px 20px var(--glow);
  --shadow-glow-hi: 0 6px 25px rgba(var(--accent-rgb), 0.4);
  --shadow-card:    0 10px 20px rgba(var(--accent-rgb), 0.08);
  --shadow-contact: 0 16px 40px rgba(var(--accent-rgb), 0.12);
}

html { 
  scroll-behavior: smooth; 
  scrollbar-width: thin;
  scrollbar-color: var(--muted) #e2e8f0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ── Focus Accessibility ── */
:focus-visible {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
}

/* ── Scrollbar (WebKit) ── */
::-webkit-scrollbar { 
  width: 6px; 
}
::-webkit-scrollbar-track { 
  background: #e2e8f0; 
}
::-webkit-scrollbar-thumb { 
  background: var(--muted); 
  border-radius: 4px; 
  
  &:hover { 
    background: var(--accent); 
  }
}

/* ── Canvas grid background ── */
#canvas-bg {
  position: fixed; inset: 0; z-index: 0;
  opacity: 0.2; pointer-events: none;
}

/* ── Header & Nav ── */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 60px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  background: rgba(240,244,251,0.85);
  transition: padding var(--transition), background var(--transition);

  &.scrolled {
    padding: 15px 60px;
    background: rgba(255,255,255,0.95);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  }
}

.nav-logo {
  text-decoration: none;
  display: flex; align-items: center; justify-content: center;

  &:hover .logo-circle {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--glow);
  }
}

.logo-circle {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px;
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-weight: 800; font-size: 18px;
  color: var(--accent);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.nav-links { 
  display: flex; gap: 36px; align-items: center; 
  
  a {
    color: var(--muted); text-decoration: none;
    font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
    transition: color 0.2s;
    position: relative;

    &::after {
      content: ''; position: absolute; bottom: -4px; left: 0; width: 0%; height: 2px;
      background: var(--accent); transition: width 0.3s ease;
    }

    &:hover, &.active { 
      color: var(--accent); 
      &::after { width: 100%; }
    }
  }
}

.mobile-menu-btn {
  display: none;
  background: none; border: none; cursor: pointer;
  flex-direction: column; gap: 5px; padding: 10px;

  span {
    display: block; width: 24px; height: 2px; background: var(--accent);
    transition: var(--transition);
  }

  &.open span {
    &:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    &:nth-child(2) { opacity: 0; }
    &:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  }
}

/* ── Layout & Main ── */
main { position: relative; z-index: 1; }
section { padding: 120px 60px; }

/* ── Hero ── */
#hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center; align-items: center; 
  padding-top: 80px;
  width: 100%;
}

.hero-inner {
  display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: flex-end;
  text-align: left; gap: 60px; max-width: 1340px; width: 100%; padding: 0 60px;
}

.hero-content {
  flex: 1; min-width: 320px; max-width: 600px; padding-bottom: 20px;
}

.hero-image {
  flex: 1; min-width: 320px; display: flex; justify-content: center; align-items: flex-end;

  img {
    width: 100%; max-width: 640px; height: auto; display: block;
    filter: drop-shadow(0 20px 30px rgba(var(--accent-rgb), 0.15));
  }
}

h1 {
  font-size: clamp(48px, 6vw, 88px); font-weight: 800; line-height: 1; letter-spacing: -3px;
  color: #0f172a; margin-bottom: 12px;
  
  span { color: var(--accent); }
}

.hero-subtitle {
  font-size: 16px; font-weight: 600;
  color: var(--muted); letter-spacing: 2px;
  text-transform: uppercase; margin: 16px 0 32px;
}

.hero-desc {
  color: var(--muted); font-size: 15px; max-width: 540px; line-height: 1.8; margin: 0 0 40px 0;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: nowrap; justify-content: flex-start; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 32px; border-radius: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  text-decoration: none; transition: transform 0.2s, box-shadow 0.2s, background 0.2s; 
  cursor: pointer; border: none; white-space: nowrap;
}

.btn-primary {
  background: var(--accent); color: #ffffff;
  box-shadow: var(--shadow-glow);

  &:hover {
    background: var(--accent-hover); 
    box-shadow: var(--shadow-glow-hi);
    transform: translateY(-3px);
  }
}

.btn-ghost {
  background: transparent; color: var(--text);
  border: 2px solid var(--border);

  &:hover {
    border-color: var(--accent); color: var(--accent);
    transform: translateY(-3px);
    background: var(--tag-bg);
  }
}

.hero-divider {
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 15%, var(--border) 85%, transparent);
}

/* ── Section Headers ── */
.section-header {
  display: flex; align-items: center; gap: 24px; margin-bottom: 40px;
}
.section-num {
  font-size: 12px; font-weight: 700; letter-spacing: 3px; color: var(--accent); text-transform: uppercase;
}
.section-line { flex: 1; height: 1px; background: var(--border); }

h2 {
  font-size: clamp(32px, 4vw, 48px); font-weight: 800; color: #0f172a;
  letter-spacing: -2px; line-height: 1.1; margin-bottom: 60px;
  
  em { color: var(--accent); font-style: normal; }
}

.skill-icon svg,
.contact-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--transition);
}

.skill-icon { margin-bottom: 20px; }

.edu-years span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.edu-years svg {
  width: 16px;
  height: 16px;
  stroke: var(--muted);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Skills ── */
#skills {
  background: linear-gradient(180deg, transparent 0%, rgba(var(--accent-rgb), 0.02) 50%, transparent 100%);
}
.skills-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px;
}
.skill-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; transition: var(--transition); 
  position: relative; overflow: hidden; box-shadow: var(--shadow-sm);

  &::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #1e40af, #3b82f6);
    transform: scaleX(0); transform-origin: left; transition: transform 0.4s ease;
  }

  &:hover { 
    border-color: rgba(var(--accent-rgb), 0.30); 
    transform: translateY(-5px);
    box-shadow: var(--shadow-card);
    
    &::after { transform: scaleX(1); }
  }
}

.skill-cat {
  font-size: 14px; font-weight: 700; color: var(--accent);
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 20px;
}
.skill-items { display: flex; flex-wrap: wrap; gap: 10px; }
.skill-tag {
  padding: 6px 12px; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--text);
}

/* ── Experience ── */
.timeline { 
  position: relative; margin-top: 40px;
  
  &::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
    background: linear-gradient(180deg, var(--accent), var(--blue), transparent);
  }
}

.timeline-item {
  display: grid; grid-template-columns: 280px 1fr; gap: 40px; 
  padding: 0 0 60px 40px; position: relative;

  &::before {
    content: ''; position: absolute; left: -6px; top: 6px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--surface); border: 3px solid var(--accent);
    box-shadow: 0 0 12px var(--glow);
  }
}

.tl-company { font-weight: 800; font-size: 18px; color: #0f172a; margin-bottom: 4px; }
.tl-brand { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.tl-total {
  display: inline-block; background: var(--tag-bg); border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--accent);
}

.tl-stack { 
  margin-top: 20px; 
}

.tl-stack-label { 
  font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; 
}

.tl-stack-list { 
  display: flex; flex-wrap: wrap; gap: 6px; 
}

.tl-stack-tag {
  padding: 4px 10px; border-radius: 4px;
  background: rgba(var(--accent-rgb), 0.06); border: 1px solid rgba(var(--accent-rgb), 0.15);
  font-size: 11px; font-weight: 600; color: #1e40af;
}

.tl-roles { display: flex; flex-direction: column; gap: 24px; }
.tl-role {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; transition: var(--transition);
  box-shadow: var(--shadow-sm);

  &:hover { 
    border-color: rgba(var(--accent-rgb), 0.30); 
    box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.06);
  }
}

.tl-role-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.tl-role-title { font-weight: 800; font-size: 16px; color: var(--accent); }
.tl-date {
  font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.5px;
  background: var(--bg); padding: 4px 12px; border-radius: 6px; white-space: nowrap;
}

.tl-role ul { 
  list-style: none; 
  
  li {
    color: var(--text); font-size: 14px; line-height: 1.8;
    padding-left: 24px; position: relative; margin-bottom: 8px;
    
    &:last-child { margin-bottom: 0; }
    &::before {
      content: '→'; position: absolute; left: 0; top: 0;
      color: var(--accent); font-weight: bold;
    }
  }
}

/* ── Education & Certs ── */
#education { 
  background: linear-gradient(180deg, rgba(238, 242, 249, 0) 0%, rgba(238, 242, 249, 0.5) 50%, rgba(238, 242, 249, 0) 100%); 
}

.edu-title, .certs-title { 
  font-size: 24px; font-weight: 800; color: #0f172a; margin-bottom: 32px; letter-spacing: -0.5px;
}

.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-bottom: 60px; }
.edu-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; transition: var(--transition);
  
  &:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-card); }
}
.edu-degree { font-size: 12px; font-weight: 700; letter-spacing: 2px; color: var(--accent); text-transform: uppercase; margin-bottom: 12px; }
.edu-school { font-weight: 800; font-size: 18px; color: #0f172a; margin-bottom: 8px; }
.edu-field { color: var(--text); font-size: 14px; margin-bottom: 20px; }

.edu-years {
  font-size: 13px; 
  font-weight: 600; 
  color: var(--muted);
  border-top: 1px solid var(--border); 
  padding-top: 16px;
  display: flex; 
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.certs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.cert-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px; transition: var(--transition);
  display: flex; flex-direction: column; justify-content: center;
  
  &:hover { border-color: rgba(61,130,245,0.5); transform: translateY(-3px); box-shadow: 0 6px 15px rgba(var(--accent-rgb), 0.06); }
}
.cert-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px; line-height: 1.5; }
.cert-issuer { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: 0.5px; }

/* ── Contact ── */
#contact { 
  text-align: center; 
  background: linear-gradient(180deg, transparent 0%, rgba(var(--accent-rgb), 0.03) 100%); 
}
.contact-header { max-width: 700px; margin: 0 auto; }
.contact-desc { color: var(--muted); font-size: 16px; max-width: 500px; margin: 20px auto 0; line-height: 1.6; }

.contact-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px; max-width: 800px; margin: 60px auto 0;
}
.contact-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px 24px;
  text-decoration: none; transition: var(--transition);
  display: flex; flex-direction: column; align-items: center; gap: 16px;

  &:hover {
    border-color: var(--accent); transform: translateY(-6px);
    box-shadow: var(--shadow-contact);
  }
  
  &:hover .contact-icon svg {
    transform: scale(1.1);
  }
}
.contact-label { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.contact-value { font-size: 14px; font-weight: 600; color: var(--text); word-break: break-all; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 60px; background: var(--surface);
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 20px;
  color: var(--muted); font-size: 13px; font-weight: 500;
}

/* ── Reveal Animations ── */
.reveal {
  opacity: 0; 
  transform: translateY(30px);
  will-change: opacity, transform;
  transition: opacity 0.8s cubic-bezier(0.5, 0, 0, 1), transform 0.8s cubic-bezier(0.5, 0, 0, 1);
  
  &.visible { opacity: 1; transform: translateY(0); }
}

/* ── Utilities ── */
.delay-50  { transition-delay: 0.05s; }
.delay-100 { transition-delay: 0.1s; }
.delay-150 { transition-delay: 0.15s; }
.delay-200 { transition-delay: 0.2s; }
.delay-250 { transition-delay: 0.25s; }
.delay-300 { transition-delay: 0.3s; }
.delay-350 { transition-delay: 0.35s; }
.delay-400 { transition-delay: 0.4s; }
.delay-450 { transition-delay: 0.45s; }

/* ── Responsive Design ── */
@media (max-width: 1024px) {
  header, header.scrolled { padding: 15px 30px; }
  
  .nav-links {
    position: fixed; top: 65px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; gap: 0; padding: 20px 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: clip-path 0.4s ease-in-out;

    &.open { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    
    a { 
      padding: 15px 30px; width: 100%; text-align: center; font-size: 14px; 
      
      &::after { display: none; }
    }
  }

  .mobile-menu-btn { display: flex; }
  section { padding: 80px 30px; }
  #hero { padding-top: 100px; }
  .hero-inner { padding: 0 40px; gap: 30px; align-items: flex-end; }
  .hero-content { min-width: 0; padding-bottom: 30px; }
  .hero-desc { margin: 0 0 40px 0; }
  .hero-image { min-width: 0; img { max-width: 100%; } }
  .timeline-item { grid-template-columns: 1fr; gap: 24px; padding: 0 0 48px 32px; }
  footer { padding: 30px; flex-direction: column; text-align: center; }
}

@media (max-width: 768px) {
  .hero-inner { flex-direction: column; text-align: center; padding: 0 24px; gap: 40px; align-items: center; }
  .hero-content { padding-bottom: 0; width: 100%; }
  .hero-desc { margin: 0 auto 40px auto; }
  .hero-actions { justify-content: center; width: 100%; }
  .hero-image { width: 100%; img { max-width: 400px; margin: 0 auto; } }
}

@media (max-width: 600px) {
  h1 { font-size: 40px; }
  .contact-grid { grid-template-columns: 1fr; }
}