/* ==========================================================================
   Design Tokens
   ========================================================================== */
:root {
  --white: #ffffff;
  --bg-alt: #f8fafc;
  --border: #e2e8f0;

  --text: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;

  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.04);
  --shadow-md: 0 4px 6px -1px rgb(15 23 42 / 0.06), 0 2px 4px -2px rgb(15 23 42 / 0.06);
  --shadow-lg: 0 10px 20px -4px rgb(15 23 42 / 0.08), 0 4px 8px -4px rgb(15 23 42 / 0.06);

  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --container-w: 1080px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-body);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { color: var(--text); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  z-index: 999;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); }

.btn-ghost {
  background: var(--white);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ==========================================================================
   Header / Nav
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.main-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-body);
  transition: color var(--transition);
}
.main-nav a:hover { color: var(--primary); }

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

.nav-cta {
  background: var(--primary);
  color: #fff !important;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
}
.nav-cta:hover { background: var(--primary-hover); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: 6rem 0 5rem;
  background:
    radial-gradient(circle at 15% 20%, var(--primary-light) 0%, transparent 45%),
    var(--white);
}

.hero-inner { max-width: 720px; }

.eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  margin-bottom: 0.75rem;
}

.hero-role {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-body);
  margin-bottom: 1.25rem;
}

.hero-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.hero-video-embed { max-width: 640px; }

.video-wrapper {
  position: relative;
  display: block;
  padding-top: 56.25%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  background: var(--text) center / cover no-repeat;
}
.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.video-mute-btn {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  border: none;
  background: rgb(15 23 42 / 0.55);
  color: #fff;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.video-mute-btn:hover { background: rgb(15 23 42 / 0.75); transform: scale(1.06); }
.video-mute-btn .icon-unmuted { display: none; }
.video-mute-btn.is-unmuted .icon-muted { display: none; }
.video-mute-btn.is-unmuted .icon-unmuted { display: block; }

.hero-video-caption {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition);
}
.hero-video-caption:hover { color: var(--primary); }

/* ==========================================================================
   Sections (shared)
   ========================================================================== */
.section { padding: 5.5rem 0; }
.section-alt { background: var(--bg-alt); }

.section-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: 1.25rem;
}

.section-lead {
  color: var(--text-muted);
  max-width: 680px;
  margin-bottom: 2.5rem;
  font-size: 1.02rem;
}

/* ==========================================================================
   About / Journey
   ========================================================================== */
.journey {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2.5rem 0 3rem;
}

.journey-step {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.journey-step:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.journey-index {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.9rem;
}

.journey-step h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.journey-step p { font-size: 0.92rem; color: var(--text-muted); }

.education-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.education-item h4 { font-size: 0.98rem; margin-bottom: 0.35rem; }
.education-item h4 span { color: var(--text-muted); font-weight: 500; }
.education-item p { font-size: 0.9rem; color: var(--text-muted); }

/* ==========================================================================
   Experience Timeline
   ========================================================================== */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -2.4rem;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.timeline-content {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-sm);
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.35rem;
}

.timeline-head h3 { font-size: 1.05rem; }

.tag-inline {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  margin-left: 0.5rem;
  vertical-align: middle;
}

.timeline-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.timeline-org {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  font-weight: 500;
}

.timeline-content ul { display: flex; flex-direction: column; gap: 0.4rem; }
.timeline-content li {
  font-size: 0.92rem;
  color: var(--text-body);
  padding-left: 1.1rem;
  position: relative;
}
.timeline-content li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* ==========================================================================
   Projects
   ========================================================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.project-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.project-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: #c7d2fe;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.project-tags span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.project-card h3 { font-size: 1.05rem; margin-bottom: 0.6rem; }
.project-card p { font-size: 0.92rem; color: var(--text-muted); }

/* ==========================================================================
   Skills
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem 2.5rem;
  margin-bottom: 3rem;
}

.skill-group h4 {
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.chip {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-body);
  background: var(--white);
  border: 1px solid var(--border);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  transition: border-color var(--transition), color var(--transition);
}
.chip:hover { border-color: var(--primary); color: var(--primary); }

.cert-row {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}
.cert-row h4 { font-size: 0.95rem; margin-bottom: 1rem; }
.cert-row li {
  font-size: 0.92rem;
  color: var(--text-body);
  padding: 0.35rem 0;
}
.cert-row li span { color: var(--text-muted); }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
a.contact-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: #c7d2fe;
}

.contact-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-card strong {
  display: block;
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.contact-card small {
  font-size: 0.82rem;
  color: var(--text-muted);
  word-break: break-word;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-inner a { font-weight: 600; color: var(--text-body); }
.footer-inner a:hover { color: var(--primary); }

/* ==========================================================================
   Scroll reveal
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
  .journey { grid-template-columns: 1fr; }
  .education-row { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .main-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
    box-shadow: var(--shadow-md);
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition), opacity var(--transition);
  }
  .main-nav.open {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }
  .main-nav a { padding: 0.75rem 0; width: 100%; }
  .nav-cta { margin-top: 0.5rem; }
  .nav-toggle { display: flex; }

  .project-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .hero { padding: 4rem 0 3rem; }
  .section { padding: 4rem 0; }
  .timeline { padding-left: 1.5rem; }
  .timeline-marker { left: -1.9rem; }
}
