
:root {

  --bg: #f2f7ff;
  --surface: #ffffff;
  --surface-alt: #e4ecf8;
  --text: #25396f;
  --text-muted: #607080;
  --primary: #435ebe;
  --primary-hover: #3950a2;
  --border: #dee2e6;

  --font: 'Nunito', -apple-system, 'Segoe UI', sans-serif;

  --radius: .375rem;
  --radius-lg: .7rem;
  --shadow: 0 .5rem 1.5rem rgba(37, 57, 111, .12);

  --container: 1100px;
  --section-y: 5rem;
  --transition: .15s ease-in-out;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-muted);
  background: var(--bg);
}
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; color: var(--text); font-weight: 800; }
p { margin: 0; }
a { color: inherit; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--text);
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: 0 0 var(--radius) 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(242, 247, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 .125rem .25rem rgba(37, 57, 111, .06);
}

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

.brand {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}
.brand span { color: var(--primary); }

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

.nav-link {
  background: none;
  border: none;
  font: inherit;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--primary); }

.nav-dropdown { position: relative; }
.nav-dropdown-toggle { display: inline-flex; align-items: center; gap: .35rem; }
.nav-dropdown-caret { width: .8rem; height: .8rem; transition: transform var(--transition); }
.nav-dropdown.open .nav-dropdown-caret { transform: rotate(180deg); }

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + .75rem);
  right: 0;
  min-width: 12rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .4rem;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}
.nav-dropdown.open .nav-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.nav-dropdown-link {
  padding: .55rem .75rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
}
.nav-dropdown-link:hover { background: var(--surface-alt); color: var(--primary); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 1.35rem;
  height: 2px;
  background: var(--text);
  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); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: inherit;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.hero { padding: 4.5rem 0; }

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 3rem;
  align-items: center;
}

.hero-eyebrow {
  color: var(--primary);
  font-weight: 700;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .75rem;
}

.hero-text h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-desc { font-size: 1.05rem; max-width: 30rem; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

.hero-photo { display: flex; justify-content: center; }
.hero-photo-frame {
  width: min(20rem, 70vw);
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hero-photo-frame img { width: 100%; height: 100%; object-fit: cover; }

.section { padding: var(--section-y) 0; }
.section-alt { background: var(--surface-alt); }

.section-title {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 2.5rem;
}

.about-text {
  max-width: 42rem;
  margin: 0 auto;
  text-align: center;
  font-size: 1.05rem;
}

.skill-card,
.timeline-card,
.education-card,
.contact-card,
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
}

.skill-card { padding: 1.5rem; }

.skill-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius);
  background: var(--surface-alt);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.skill-icon svg { width: 1.35rem; height: 1.35rem; }

.skill-card h3 { font-size: 1.05rem; margin-bottom: .85rem; }

.skill-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.skill-tag {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 600;
  padding: .35rem .7rem;
  border-radius: var(--radius);
}

.timeline {
  position: relative;
  max-width: 44rem;
  margin: 0 auto;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}

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

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 4px;
  width: .75rem;
  height: .75rem;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--primary);
}
.timeline-item.current .timeline-dot { background: var(--primary); }

.timeline-card { padding: 1.4rem 1.6rem; }

.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .35rem;
}
.timeline-head h3 { font-size: 1.05rem; }

.timeline-period {
  font-size: .78rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--surface-alt);
  padding: .3rem .75rem;
  border-radius: var(--radius);
  white-space: nowrap;
}

.timeline-company { color: var(--primary); font-weight: 700; font-size: .92rem; margin-bottom: .75rem; }
.timeline-desc { font-size: .95rem; }

.badge-current {
  display: inline-block;
  margin-left: .5rem;
  font-size: .68rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  padding: .15rem .55rem;
  border-radius: var(--radius);
  vertical-align: middle;
  text-transform: uppercase;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.25rem;
  max-width: 56rem;
  margin: 0 auto;
}

.project-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.4rem 1.6rem;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.project-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }

.project-icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius);
  background: var(--surface-alt);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-icon svg { width: 1.35rem; height: 1.35rem; }

.project-body h3 { font-size: 1.05rem; margin-bottom: .5rem; }
.project-body p { font-size: .92rem; color: var(--text-muted); }

.education-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 44rem;
  margin: 0 auto;
}

.education-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.4rem 1.6rem;
}

.education-icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius);
  background: var(--surface-alt);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.education-icon svg { width: 1.35rem; height: 1.35rem; }

.education-card h3 { font-size: 1.05rem; margin-bottom: .25rem; }
.education-period { color: var(--primary); font-weight: 700; font-size: .82rem; margin-bottom: .35rem; }
.education-program { font-size: .92rem; }

.contact-desc {
  max-width: 36rem;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.25rem;
  max-width: 56rem;
  margin: 0 auto;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.contact-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }

.contact-icon {
  flex-shrink: 0;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-icon svg { width: 1.2rem; height: 1.2rem; }

.contact-label { font-size: .78rem; color: var(--text-muted); margin-bottom: .1rem; }
.contact-value { font-weight: 700; font-size: .95rem; color: var(--text); word-break: break-word; }

.site-footer { padding: 2rem 0; text-align: center; border-top: 1px solid var(--border); }
.site-footer p { color: var(--text-muted); font-size: .85rem; }
.footer-tools { margin-bottom: .6rem; }
.footer-tools a { color: var(--text-muted); text-decoration: underline; }
.footer-tools a:hover { color: var(--primary); }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 992px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-photo { order: -1; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
}

@media (max-width: 768px) {
  :root { --section-y: 3.5rem; }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 .5rem 1rem rgba(37, 57, 111, .08);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
  }
  .main-nav.open { max-height: calc(100vh - 4.5rem); overflow-y: auto; }
  .main-nav .nav-link { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
  .nav-toggle { display: flex; }

  .nav-dropdown-toggle { width: 100%; justify-content: space-between; }
  .nav-dropdown-menu {
    position: static;
    border: none;
    box-shadow: none;
    background: var(--surface-alt);
    opacity: 1;
    visibility: visible;
    transform: none;
    max-height: 0;
    padding: 0 1.25rem;
    overflow: hidden;
    transition: max-height var(--transition), padding var(--transition);
  }
  .nav-dropdown.open .nav-dropdown-menu { max-height: 10rem; padding: .5rem 1.25rem; }

  .timeline { padding-left: 1.5rem; }
  .timeline-dot { left: -1.5rem; }
}

@media (max-width: 576px) {
  .container { padding: 0 1rem; }
  .hero-photo-frame { width: min(15rem, 65vw); }
  .timeline-head { flex-direction: column; align-items: flex-start; }
}
