:root {
  --ink: #15202b;
  --muted: #5b6470;
  --line: #c8d1da;
  --accent: #1560a0;
  --accent-dark: #184fb3;
  --card: #ffffff;
  --bg1: #f0f4f8;
  --bg2: #d9e2ec;
  --sticky-nav-h: 72px;
  --dark-navy: #15202b;
  --white: #fff;
}

@media (max-width: 860px) {
  :root { --sticky-nav-h: 80px; }
}

* { box-sizing: border-box; }

html {
  height: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--sticky-nav-h);
}

body {
  margin: 0;
  font-family: "Poppins", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: linear-gradient(to right, var(--bg1), var(--bg2));
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

a:hover,
a:focus {
  color: var(--accent-dark);
  border-color: var(--accent-dark);
}

h1 {
  margin: 0 0 6px;
  font-weight: 800;
  letter-spacing: 0.4px;
  font-size: clamp(32px, 5vw, 48px);
  color: #0a2a66;
}

h2 {
  margin: 0 0 16px;
  font-weight: 700;
  font-size: clamp(24px, 3vw, 32px);
}

p {
  margin: 0 0 8px;
  line-height: 1.6;
}

.hidden { display: none !important; }

.view-container {
  scroll-padding-top: var(--sticky-nav-h);
  width: 100%;
  height: auto;
  overflow: visible;
}

.hero h1,
main section > h2,
#home h2,
#portfolio h2,
#experience h2,
#highlights h2,
#contact h2 {
  scroll-margin-top: var(--sticky-nav-h);
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: var(--accent); 
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-brand {
  font-weight: 800;
  font-size: 20px;
  color: #fff;
}

.nav-brand:hover {
  color: var(--dark-navy);
}

.hamburger {
  display: none;
  width: 44px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.hamburger:focus { outline: 3px solid rgba(31,111,235,0.25); }

.hamburger-line {
  width: 22px;
  height: 2px;
  background: var(--ink);
  display: block;
  position: relative;
}

.hamburger-line + .hamburger-line { margin-top: 5px; }

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  transition: transform 0.2s ease;
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  transition: transform 0.2s ease;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-weight: 600;
  border: none !important;
  border-bottom: 1px solid transparent !important;
  color: #fff !important;
}

.nav-link:hover {
  color: var(--dark-navy) !important;
  border-color: transparent !important;
}

.nav-link.active {
  color: var(--dark-navy) !important;
  border-bottom: 2px solid var(--dark-navy) !important;
}

.nav-link.active:hover {
  color: var(--dark-navy) !important;
  border-bottom: 2px solid var(--dark-navy) !important;
}

.social-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.social-github {
  color: var(--white);
}

.social-github:hover,
.social-github:focus {
  color: #000;
  background: var(--white);
}

.social-linkedin {
  color: var(--white);
}

.social-linkedin:hover,
.social-linkedin:focus {
  color: var(--accent);
  background: var(--white);
}

.social-links svg {
  width: 20px;
  height: 20px;
}

.social-links.mobile {
  justify-content: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.mobile-nav {
  position: sticky;
  top: var(--sticky-nav-h);
  z-index: 99;
  width: 100%;
  padding: 12px 20px 20px;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  animation: slideDown 0.15s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mobile-nav-links {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.mobile-nav-link {
  display: block;
  padding: 10px 0;
  font-weight: 700;
  color: var(--ink);
  border-bottom: 1px dashed transparent;
}

.mobile-nav-link:focus { outline: 3px solid rgba(31,111,235,0.25); }

@media (max-width: 860px) {
  .hamburger { display: inline-flex; }
  .nav-right { display: none; }
}

.hero {
  width: 92vw;
  margin: 40px auto 8px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 40px;
  align-items: start;
}

.hero-media { 
  order: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-photo {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: 0;
  height: auto;
  border: 2px solid var(--accent);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-photo:hover {
  transform: scale(1.02);
  box-shadow: 0 15px 35px rgba(0,0,0,0.12);
}

.hero-photo-caption {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  margin: 0;
}

.cursor {
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.hero-copy { 
  order: 2;
  padding-top: 0;
}

.hero-section-title {
  margin: 0 0 12px 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hero-blurb {
  margin: 0 0 20px 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
}

.hero-section {
  margin-bottom: 20px;
}

.hero-section:last-child {
  margin-bottom: 0;
}

.hero-section h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
}

.skill-badge {
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--accent);
  background: rgba(31, 111, 235, 0.1);
  border: 1px solid rgba(31, 111, 235, 0.3);
  border-radius: 20px;
  transition: all 0.3s ease;
}

.skill-badge:hover {
  transform: translateY(-2px);
  background: rgba(31, 111, 235, 0.2);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(31, 111, 235, 0.2);
}

.btn {
  display: inline-block;
  padding: 12px 18px;
  font-weight: 700;
  color: var(--accent);
  background: transparent;
  border-radius: 10px;
  border: 2px solid var(--accent);
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { 
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn.ghost:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 860px) {
  .hero { 
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: center;
  }
  .hero-media { order: 1; }
  .hero-copy  { order: 2; }
  
  .hero-photo {
    max-width: 360px;
    margin: 0 auto;
  }
}

main {
  width: min(1100px, 92vw);
  margin: 12px auto 0;
  padding-bottom: 88px;
}

main section {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

main section:first-of-type { border-top: none; }

.project-grid {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  border-color: var(--accent);
}

.project-video {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 350px;
  background: #000;
  overflow: hidden;
  order: 1;
}

.project-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.project-info {
  padding: 24px;
  order: 2;
}

/* Alternate cards */
.project-card:nth-child(even) .project-video {
  order: 2;
}

.project-card:nth-child(even) .project-info {
  order: 1;
}

/* Responsive on mobile */
@media (max-width: 860px) {
  .project-card {
    grid-template-columns: 1fr;
  }
  
  .project-video {
    min-height: 200px;
  }
  
  .project-card:nth-child(even) .project-video,
  .project-card:nth-child(even) .project-info {
    order: initial;
  }
}

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.project-header > div {
  flex: 1;
}

.project-header h3 {
  margin: 0 0 4px 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}

.project-subtitle {
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 8px 0;
}

.project-description {
  margin-bottom: 16px;
}

.project-description p {
  margin-bottom: 8px;
  line-height: 1.6;
  color: var(--ink);
  font-size: 15px;
}

.project-description p:last-child {
  margin-bottom: 0;
}

.project-description strong {
  color: var(--accent);
  font-weight: 700;
}

.github-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--muted);
  border: none;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
}

.github-link:hover {
  color: var(--accent);
  background: var(--bg1);
}

.github-link svg {
  width: 20px;
  height: 20px;
}

.project-info > p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tags span {
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg1);
  border-radius: 12px;
}

.experience-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.experience-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.experience-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 16px 32px rgba(0,0,0,0.2);
  border-color: var(--accent);
}

.experience-item h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.experience-meta {
  margin: 0 0 12px 0;
  font-size: 14px;
  line-height: 1.4;
}

.experience-org {
  font-weight: 600;
  color: var(--accent);
}

.experience-date {
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.experience-item p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.highlights-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.highlight-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.highlight-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  border-color: var(--accent);
}

.highlight-carousel {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
  background: var(--bg1);
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.4s ease;
}

.carousel-track img {
  min-width: 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  font-size: 24px;
  font-weight: bold;
  color: var(--ink);
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.highlight-card:hover .carousel-btn {
  opacity: 1;
}

.carousel-btn:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
  left: 12px;
}

.carousel-btn.next {
  right: 12px;
}

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background: #fff;
  width: 24px;
  border-radius: 4px;
}

.highlight-content {
  padding: 20px;
}

.highlight-content h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.highlight-award {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.highlight-content p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.5;
}

.highlight-date {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg1);
  border-radius: 12px;
}

.contact-intro {
  margin-bottom: 24px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.contact-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.contact-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  border-bottom: none;
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  border-color: var(--accent);
}

.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  flex-shrink: 0;
}

.contact-icon-email {
  color: #EA4335;
  background: rgba(234, 67, 53, 0.1);
}

.contact-icon-linkedin {
  color: #0077b5;
  background: rgba(0, 119, 181, 0.1);
}

.contact-icon-github {
  color: #000;
  background: rgba(0, 0, 0, 0.05);
}

.contact-icon svg {
  width: 24px;
  height: 24px;
}

.contact-info {
  flex: 1;
}

.contact-info h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.contact-info p {
  margin: 0;
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}

.contact-form {
  max-width: 1100px;
  margin: 24px auto 0;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.form-row label {
  font-weight: 700;
}

.form-row input,
.form-row textarea {
  padding: 12px 12px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31,111,235,0.12);
}

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

.form-status {
  font-size: 14px;
  color: var(--muted);
}

footer {
  position: static;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 12px;
  text-align: center;
  background: var(--accent);
  backdrop-filter: saturate(120%) blur(4px);
  border-top: 1px solid var(--line);
  color: #fff;
}

footer p { margin: 0; }

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}