/* Base Styles */
:root {
  --primary-color: #2563eb;
  --secondary-color: #1e40af;
  --accent-color: #3b82f6;
  --dark-color: #1e293b;
  --light-color: #f8fafc;
  --gray-color: #64748b;
  --light-gray-color: #e2e8f0;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

/* Dark Theme Variables */
.dark-theme {
  --primary-color: #3b82f6;
  --secondary-color: #60a5fa;
  --accent-color: #93c5fd;
  --dark-color: #f8fafc;
  --light-color: #0f172a;
  --gray-color: #cbd5e1;
  --light-gray-color: #1e293b;
  --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  color: var(--dark-color);
  background-color: var(--light-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  text-decoration: none;
  color: var(--dark-color);
  transition: var(--transition);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 100px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: var(--dark-color);
}

.underline {
  height: 4px;
  width: 60px;
  background-color: var(--primary-color);
  margin: 0 auto;
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.primary-btn {
  background-color: var(--primary-color);
  color: white;
}

.primary-btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-3px);
  box-shadow: var(--box-shadow);
}

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

.secondary-btn:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-3px);
  box-shadow: var(--box-shadow);
}

.small-btn {
  padding: 8px 20px;
  font-size: 0.9rem;
}

/* Header */
header {
  position: sticky;
  top: 0;
  width: 100%;
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1002;
}

.dark-theme header {
  background-color: rgba(15, 23, 42, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
}

.logo h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
}

nav {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
}

.nav-links li {
  margin-left: 30px;
}

.nav-links a {
  font-weight: 500;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: var(--transition);
}

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

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

.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover::after {
  width: 100%;
}

.theme-switch {
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  margin-left: 18px;
  display: grid;
  place-items: center;
  min-width: 40px;
  min-height: 40px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--dark-color);
  transition: var(--transition);
}

.style-control select { border: 1px solid var(--light-gray-color); border-radius: 9px; padding: 8px 10px; color: var(--dark-color); background: var(--light-color); font: inherit; cursor: pointer; }
.style-control { margin-left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Portfolio-wide visual systems, layered over the shared component structure. */
body[data-portfolio-style="minimal"] { --primary-color: #475569; --secondary-color: #334155; --accent-color: #64748b; }
body[data-portfolio-style="minimal"] .project-card, body[data-portfolio-style="minimal"] .skill-card, body[data-portfolio-style="minimal"] .service-card { border-radius: 12px; box-shadow: 0 8px 28px rgba(15,23,42,.06); }
body[data-portfolio-style="terminal"] { --primary-color: #16834a; --secondary-color: #0f6539; --accent-color: #34d399; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
body[data-portfolio-style="terminal"] .hero, body[data-portfolio-style="terminal"] .about, body[data-portfolio-style="terminal"] .skills, body[data-portfolio-style="terminal"] .projects, body[data-portfolio-style="terminal"] .services { background-color: #f2f8f3; }
body.dark-theme[data-portfolio-style="terminal"] .hero, body.dark-theme[data-portfolio-style="terminal"] .about, body.dark-theme[data-portfolio-style="terminal"] .skills, body.dark-theme[data-portfolio-style="terminal"] .projects, body.dark-theme[data-portfolio-style="terminal"] .services { background-color: #07130d; }
body[data-portfolio-style="terminal"] .section-header h2::before { content: "> "; color: var(--primary-color); }
body[data-portfolio-style="cyber"] { --primary-color: #7c3aed; --secondary-color: #db2777; --accent-color: #22d3ee; }
body[data-portfolio-style="cyber"] .project-card, body[data-portfolio-style="cyber"] .skill-card, body[data-portfolio-style="cyber"] .service-card { border: 1px solid color-mix(in srgb, var(--accent-color) 38%, transparent); box-shadow: 0 0 24px color-mix(in srgb, var(--accent-color) 10%, transparent); }
body[data-portfolio-style="professional"] { --primary-color: #123b63; --secondary-color: #0c2c4c; --accent-color: #b88948; }
body[data-portfolio-style="professional"] .section-header { text-align: left; }
body[data-portfolio-style="professional"] .section-header .underline { margin-left: 0; }
body[data-portfolio-style="professional"] .project-card, body[data-portfolio-style="professional"] .skill-card, body[data-portfolio-style="professional"] .service-card { border-radius: 8px; }
body.dark-theme[data-portfolio-style="professional"] { --primary-color: #7eb5e8; --secondary-color: #4f91cc; --accent-color: #d5ac70; }


.theme-switch:hover {
  color: var(--primary-color);
  transform: rotate(30deg);
}

.burger {
  display: none;
  cursor: pointer;
}

.burger div {
  width: 25px;
  height: 3px;
  background-color: var(--dark-color);
  margin: 5px;
  transition: var(--transition);
}

/* Hero Section */
.hero {
  height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  position: relative;
  background-color: var(--light-color);
  overflow: hidden;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-text {
  flex: 1;
  padding-right: 30px;
}

.hero-text h1 {
  font-size: 3rem;
  margin-bottom: 15px;
  line-height: 1.2;
}

.hero-text h1 span {
  color: var(--primary-color);
}

.hero-text h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--gray-color);
}

.profile-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  margin: 0 0 18px;
  border: 1px solid rgba(37, 99, 235, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

.profile-switch-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: transparent;
  color: var(--gray-color);
  cursor: pointer;
  font: 600 .88rem "Poppins", sans-serif;
  transition: var(--transition);
}

.profile-switch-btn.active,
.profile-switch-btn:hover {
  color: #fff;
  background: var(--primary-color);
}

.profile-switch-btn:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .35);
  outline-offset: 2px;
}

.dark-theme .profile-switch {
  border-color: rgba(147, 197, 253, .2);
  background: rgba(15, 23, 42, .85);
}

[data-skill-profile][hidden],
[data-service-profile][hidden] {
  display: none !important;
}

.hero-text p {
  font-size: 1.1rem;
  margin-bottom: 30px;
  color: var(--gray-color);
}

.hero-btns {
  margin-bottom: 30px;
}

.hero-btns .btn {
  margin-right: 15px;
  margin-bottom: 15px;
}

.social-icons {
  display: flex;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--light-gray-color);
  margin-right: 15px;
  transition: var(--transition);
}

.social-icons a:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-3px);
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image-container {
  position: relative;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--box-shadow);
  border: 5px solid var(--primary-color);
}

.hero-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scroll-down {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
}

.scroll-down a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  transition: var(--transition);
}

.scroll-down a:hover {
  background-color: var(--secondary-color);
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0) translateX(-50%);
  }
  40% {
    transform: translateY(-20px) translateX(-50%);
  }
  60% {
    transform: translateY(-10px) translateX(-50%);
  }
}

/* About Section */
.about-content {
  display: flex;
  align-items: center;
  gap: 50px;
}

.about-image {
  flex: 1;
}

.about-image img {
  border-radius: 10px;
  box-shadow: var(--box-shadow);
}

.about-text {
  flex: 1;
}

.about-text h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: -6px 0 22px;
}

.profile-tags span {
  padding: 7px 12px;
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: 999px;
  background: rgba(37, 99, 235, .07);
  color: var(--primary-color);
  font-size: .82rem;
  font-weight: 600;
}

.dark-theme .profile-tags span {
  border-color: rgba(147, 197, 253, .24);
  background: rgba(59, 130, 246, .12);
}

.about-text p {
  margin-bottom: 20px;
  color: var(--gray-color);
}

.achievement-showcase {
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 88% 0%, rgba(37, 99, 235, .28), transparent 34%), #081426;
  color: #f8fafc;
}

.achievement-showcase::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(147, 197, 253, .5), transparent);
  content: "";
}

.achievement-showcase .container {
  position: relative;
  z-index: 1;
}

.achievement-heading {
  max-width: 720px;
  margin-bottom: 34px;
}

.achievement-eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: #93c5fd;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.achievement-heading h2 {
  margin-bottom: 13px;
  color: #fff;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.08;
}

.achievement-heading p {
  color: #aebdd0;
  font-size: 1.05rem;
}

.achievement-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.achievement-stats > div {
  display: flex;
  min-height: 110px;
  flex-direction: column;
  justify-content: center;
  padding: 20px 24px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 18px;
  background: rgba(255, 255, 255, .045);
  backdrop-filter: blur(10px);
}

.achievement-stats strong {
  color: #fff;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.1;
}

.achievement-stats > div:last-child strong {
  color: #f4c96b;
}

.achievement-stats span {
  margin-top: 7px;
  color: #aebdd0;
  font-size: .9rem;
}

.achievement-feature-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.achievement-feature-card {
  display: flex;
  min-height: 215px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(30, 49, 77, .94), rgba(15, 29, 51, .94));
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.achievement-feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(147, 197, 253, .55);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .24);
}

.achievement-feature-image {
  display: block;
  width: 100%;
  max-height: 180px;
  margin: 14px 0 2px;
  border-radius: 11px;
  background: rgba(226, 232, 240, .1);
  object-fit: contain;
}

.achievement-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #aebdd0;
  font-size: .78rem;
  font-weight: 600;
}

.achievement-result {
  padding: 5px 9px;
  border: 1px solid rgba(244, 201, 107, .3);
  border-radius: 999px;
  background: rgba(244, 201, 107, .1);
  color: #f4c96b;
  white-space: nowrap;
}

.achievement-feature-card h3 {
  margin: 22px 0 8px;
  color: #fff;
  font-size: 1.08rem;
  line-height: 1.35;
}

.achievement-feature-card p {
  margin: 0 0 12px;
  color: #aebdd0;
  font-size: .88rem;
}

.achievement-feature-card a {
  margin-top: auto;
  color: #93c5fd;
  font-size: .84rem;
  font-weight: 600;
}

.achievement-all-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  color: #fff;
  font-weight: 600;
}

.achievement-all-link:hover {
  color: #93c5fd;
}

.achievement-feature-loading,
.achievement-load-error {
  grid-column: 1 / -1;
  color: #aebdd0;
}

.publication-detail-dialog, .wayfinder-dialog { inset: 0; margin: auto; }
.modal.active { display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-content { margin: 0 auto; max-height: calc(100vh - 48px); }

.about-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 30px 0;
}

.detail {
  display: flex;
  align-items: flex-start;
}

.detail i {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-right: 15px;
  margin-top: 5px;
}

.detail h4 {
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.detail p {
  margin-bottom: 0;
}

/* Skills Section */
.skills {
  background-color: #f1f5f9;
}

.dark-theme .skills {
  background-color: #0f172a;
}

.skills-content {
  text-align: center;
  margin-bottom: 40px;
}

.skills-text h3 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.skills-text p {
  max-width: 700px;
  margin: 0 auto 40px;
  color: var(--gray-color);
}

.skills-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

.skill-card {
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  position: relative;
}

.dark-theme .skill-card {
  background-color: #1e293b;
}

.skill-card:hover {
  transform: translateY(-10px);
}

.skill-icon {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.skill-card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
}

.skill-card p {
  color: var(--gray-color);
  margin-bottom: 20px;
}

.skill-level {
  height: 8px;
  background-color: var(--light-gray-color);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.skill-progress {
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 10px;
}

.skill-percentage {
  font-weight: 600;
  color: var(--primary-color);
}

/* Projects Section */
.projects-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.filter-btn {
  padding: 8px 20px;
  margin: 0 10px 10px;
  border: none;
  background-color: var(--light-gray-color);
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  font-family: "Poppins", sans-serif;
  font-weight: 500;
  color: var(--dark-color);
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--primary-color);
  color: white;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  align-items: stretch;
}
.projects-empty-state, .testimonial-empty-state { display: grid; grid-column: 1 / -1; justify-items: center; gap: 10px; padding: 30px 20px; border: 1px dashed rgba(100,116,139,.3); border-radius: 18px; color: var(--gray-color); text-align: center; }
.projects-empty-state > i, .testimonial-empty-state > i { color: var(--primary-color); font-size: 1.6rem; }
.projects-empty-state strong { color: var(--dark-color); }
.projects-empty-state .btn { min-height: 44px; margin-top: 6px; }
.testimonial-empty-state p { max-width: 560px; margin: 0; }

.project-card {
  background-color: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.dark-theme .project-card {
  background-color: #1e293b;
}

.project-card:hover {
  transform: translateY(-10px);
}

.project-img {
  height: 200px;
  overflow: hidden;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.project-card:hover .project-img img {
  transform: scale(1.1);
}

.project-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-info h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.project-kind-badge {
  align-self: flex-start;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.dark-theme .project-kind-badge {
  background: #123b31;
  color: #9df0d1;
}

.project-category-label {
  margin-bottom: 10px;
  color: var(--primary-color);
  font-size: .82rem;
  font-weight: 600;
}

.project-info p {
  color: var(--gray-color);
  margin-bottom: 15px;
  flex-grow: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 15px;
  flex-shrink: 0;
}

.project-tech span {
  background-color: var(--light-gray-color);
  padding: 5px 10px;
  border-radius: 50px;
  font-size: 0.8rem;
  margin-right: 10px;
  margin-bottom: 10px;
  color: var(--dark-color);
}

.dark-theme .project-tech span {
  color: #f8fafc;
}

.project-links {
  display: flex;
  margin-top: auto;
  flex-shrink: 0;
}

.project-links a {
  margin-right: 10px;
}

.publications-section { padding: 88px 0 96px; background: #f6f8fc; }
.dark-theme .publications-section { background: #0b1220; }
.publications-intro { max-width: 760px; margin: -18px auto 28px; color: var(--gray-color); text-align: center; }
.publications-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin: 0 auto 30px; }
.publication-filter { padding: 9px 16px; border: 1px solid rgba(37,99,235,.14); border-radius: 999px; background: #fff; color: var(--dark-color); cursor: pointer; font: 500 .88rem "Poppins", sans-serif; transition: var(--transition); }
.dark-theme .publication-filter { border-color: #334155; background: #111c2e; color: #e2e8f0; }
.publication-filter:hover, .publication-filter.active { border-color: var(--primary-color); background: var(--primary-color); color: #fff; }
.publications-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: stretch; gap: 22px; }
.publication-card { display: flex; min-width: 0; flex-direction: column; padding: 24px; border: 1px solid rgba(148,163,184,.2); border-radius: 18px; background: #fff; box-shadow: 0 12px 32px rgba(15,23,42,.06); transition: transform .22s ease, box-shadow .22s ease; }
.publication-card:hover { transform: translateY(-4px); box-shadow: 0 18px 38px rgba(15,23,42,.11); }
.dark-theme .publication-card { border-color: #26364c; background: #111c2e; }
.publication-card-featured { border-color: rgba(37,99,235,.42); box-shadow: 0 12px 34px rgba(37,99,235,.11); }
.publication-card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 17px; }
.publication-type, .publication-featured { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; background: rgba(37,99,235,.08); color: var(--primary-color); font-size: .78rem; font-weight: 700; }
.publication-featured { background: rgba(16,185,129,.1); color: #0f8a68; }
.dark-theme .publication-featured { color: #6ee7b7; }
.publication-card h3 { margin: 0 0 12px; color: var(--dark-color); font-size: 1.18rem; line-height: 1.4; }
.publication-description { margin: 0 0 16px; color: var(--gray-color); line-height: 1.65; }
.publication-description-collapsed { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.publication-more-button { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin: -7px 0 17px; padding: 0; border: 0; background: transparent; color: var(--primary-color); cursor: pointer; font: 700 .9rem "Poppins", sans-serif; transition: gap .2s ease; }
.publication-more-button:hover { gap: 12px; }
.publication-more-button:focus-visible, .publication-detail-close:focus-visible { outline: 3px solid rgba(37,99,235,.35); outline-offset: 4px; }
.publication-detail-dialog { width: min(780px, calc(100vw - 28px)); max-width: none; max-height: min(88vh, 900px); padding: 0; overflow: auto; border: 1px solid rgba(148,163,184,.24); border-radius: 26px; background: #fff; color: var(--dark-color); box-shadow: 0 32px 100px rgba(15,23,42,.3); }
.publication-detail-dialog::backdrop { background: rgba(8,15,30,.64); backdrop-filter: blur(6px); }
.dark-theme .publication-detail-dialog { border-color: #26364c; background: #111c2e; color: #f8fafc; }
.publication-detail-shell { position: relative; padding: clamp(26px, 5vw, 48px); }
.publication-detail-close { position: absolute; top: 20px; right: 20px; display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(148,163,184,.24); border-radius: 50%; background: rgba(148,163,184,.1); color: inherit; cursor: pointer; font-size: 1.05rem; transition: background .2s ease, transform .2s ease; }
.publication-detail-close:hover { transform: rotate(90deg); background: rgba(37,99,235,.12); }
.publication-detail-eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 50px 15px 0; color: var(--primary-color); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.publication-detail-dialog h2 { max-width: 620px; margin: 0 40px 20px 0; font-size: clamp(1.45rem, 4vw, 2.1rem); line-height: 1.28; }
.publication-detail-type { display: inline-flex; margin: 0 0 16px; padding: 7px 12px; border-radius: 999px; background: rgba(37,99,235,.1); color: var(--primary-color); font-size: .82rem; font-weight: 700; }
.publication-detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.publication-detail-meta span { padding: 8px 11px; border: 1px solid rgba(148,163,184,.2); border-radius: 11px; background: rgba(148,163,184,.07); color: var(--gray-color); font-size: .83rem; }
.publication-detail-description { margin: 0 0 25px; color: var(--gray-color); font-size: 1rem; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.publication-detail-dialog .publication-actions { padding-top: 18px; border-top: 1px solid rgba(148,163,184,.2); }
.publication-meta { display: grid; gap: 8px; margin: 0 0 20px; color: var(--gray-color); font-size: .85rem; }
.publication-meta span { display: flex; align-items: flex-start; gap: 9px; overflow-wrap: anywhere; }
.publication-meta i { width: 16px; margin-top: 4px; color: var(--primary-color); }
.publication-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: auto; }
.publication-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 0; }
.publications-empty, .publications-load-error { grid-column: 1 / -1; display: grid; justify-items: center; gap: 10px; padding: 34px 18px; color: var(--gray-color); text-align: center; }
.publications-empty i { color: var(--primary-color); font-size: 1.7rem; }
.publications-empty strong { color: var(--dark-color); }
.publications-empty span { font-size: .9rem; }
@media (max-width: 560px) {
  .publications-section { padding: 68px 0 76px; }
  .publications-grid { grid-template-columns: 1fr; }
  .publication-card { padding: 20px; }
}

/* Services Section */
.services {
  background-color: #f1f5f9;
}

.dark-theme .services {
  background-color: #0f172a;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

.service-card {
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  text-align: center;
}

.dark-theme .service-card {
  background-color: #1e293b;
}

.service-card:hover {
  transform: translateY(-10px);
}

.service-icon {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
}

.service-card p {
  color: var(--gray-color);
}

/* Testimonials Section */
.testimonials-container {
  position: relative;
  max-width: 800px;
  margin: 0 auto 30px;
}

.testimonials-slider {
  position: relative;
  overflow: hidden;
  min-height: 250px;
}

.testimonial-card {
  display: none;
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: var(--box-shadow);
  margin-bottom: 30px;
  animation: fadeIn 0.5s ease;
}

.dark-theme .testimonial-card {
  background-color: #1e293b;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.testimonial-card.active {
  display: flex;
  align-items: center;
}

.testimonial-img {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 30px;
  border: 3px solid var(--primary-color);
}

.testimonial-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.testimonial-content p {
  font-style: italic;
  margin-bottom: 20px;
  color: var(--gray-color);
}

.testimonial-info h4 {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.testimonial-info p {
  color: var(--gray-color);
  margin-bottom: 0;
}

.testimonial-rating {
  margin-top: 10px;
  color: #ffc107;
}

.testimonial-date {
  font-size: 0.8rem;
  color: var(--gray-color);
  margin-top: 5px;
}

.testimonial-dots {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--light-gray-color);
  margin: 0 5px;
  cursor: pointer;
  transition: var(--transition);
}

.dot.active {
  background-color: var(--primary-color);
}

.testimonial-controls {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.testimonial-prev,
.testimonial-next {
  background-color: var(--light-gray-color);
  color: var(--dark-color);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0 10px;
  transition: var(--transition);
}

.testimonial-prev:hover,
.testimonial-next:hover {
  background-color: var(--primary-color);
  color: white;
}

/* New styles for the inline testimonial form */
.testimonial-form-wrapper {
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: var(--box-shadow);
  max-width: 600px;
  margin: 60px auto 0; /* Add margin-top to separate from slider */
}

.dark-theme .testimonial-form-wrapper {
  background-color: #1e293b;
}

.testimonial-form-wrapper h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--primary-color);
  text-align: center;
}

/* Rating System */
.rating {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.rating input {
  display: none; /* This hides the radio buttons */
}

.rating label {
  cursor: pointer;
  font-size: 1.5rem;
  color: #ffc10750; /* Light yellow for unselected stars */
  padding: 0 5px;
  transition: var(--transition);
}

.rating label:hover,
.rating label:hover ~ label,
.rating input:checked ~ label {
  color: #ffc107; /* Vibrant yellow for hovered/checked stars */
}

/* Contact Section */
.contact-content {
  display: flex;
  gap: 50px;
}

.contact-info,
.contact-form {
  flex: 1;
}

.contact-info h3,
.contact-form h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--primary-color);
}

/* Builder Page */
.builder-hero {
  padding: 70px 0 80px;
  background-color: #f1f5f9;
}

.dark-theme .builder-hero {
  background-color: #0f172a;
}

.builder-hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
}

.builder-hero .hero-text {
  max-width: 600px;
}

.builder-hero .hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.builder-form-card .form-group {
  display: grid;
  gap: 15px;
}

.builder-form-card .form-group .checkbox-group {
  flex-wrap: wrap;
}

.builder-image {
  width: 360px;
  height: 360px;
  border-radius: 30px;
  border: 3px solid var(--primary-color);
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: white;
  color: var(--primary-color);
  font-size: 5rem;
}

.dark-theme .builder-image {
  background-color: #1e293b;
}

.builder-section {
  padding: 80px 0;
}

.builder-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
}

.builder-form-card,
.builder-summary-card {
  background-color: white;
  border-radius: 25px;
  padding: 35px;
  box-shadow: var(--box-shadow);
}

.dark-theme .builder-form-card,
.dark-theme .builder-summary-card {
  background-color: #1e293b;
}

.builder-section-title {
  margin: 30px 0 15px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dark-color);
}

.builder-form-card .form-group {
  display: grid;
  gap: 12px;
}

.checkbox-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 18px;
  margin-bottom: 0;
  border: 1px solid var(--light-gray-color);
  border-radius: 14px;
  background-color: #f8fafc;
  transition: border-color 0.3s ease, background-color 0.3s ease;
  cursor: pointer;
  color: var(--dark-color);
  min-height: 50px;
}

.dark-theme .checkbox-group {
  background-color: #1e293b;
  border-color: #334155;
  color: var(--light-color);
}

.checkbox-group:hover {
  border-color: var(--primary-color);
  background-color: rgba(59, 130, 246, 0.08);
}

.dark-theme .checkbox-group:hover {
  background-color: rgba(59, 130, 246, 0.15);
}

.checkbox-group input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.builder-summary h2 {
  font-size: 2rem;
  margin-bottom: 25px;
  color: var(--primary-color);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  font-weight: 600;
  color: var(--dark-color);
}

.summary-row.total {
  font-size: 1.4rem;
  margin-top: 20px;
}

.summary-note {
  margin-top: 20px;
  color: var(--gray-color);
  line-height: 1.7;
}

.builder-summary .btn {
  width: 100%;
  margin-top: 30px;
}

.builder-price-option {
  width: 100%;
  padding: 15px;
  border: 1px solid var(--light-gray-color);
  border-radius: 8px;
  background-color: white;
  color: var(--dark-color);
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.dark-theme .builder-price-option {
  background-color: #1e293b;
  color: var(--light-color);
  border-color: #334155;
}

.builder-price-option:focus {
  outline: none;
  border-color: var(--primary-color);
}

.builder-summary-card {
  position: sticky;
  top: 100px;
}

@media screen and (max-width: 1024px) {
  .builder-grid {
    grid-template-columns: 1fr;
  }

  .builder-summary-card {
    position: static;
  }

  .builder-hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .builder-hero .hero-image {
    order: -1;
  }
}

@media screen and (max-width: 768px) {
  .builder-hero {
    padding-top: 55px;
  }

  .builder-hero .hero-image {
    margin-top: 40px;
  }

  .builder-image {
    width: 260px;
    height: 260px;
    font-size: 4rem;
  }

  .builder-section {
    padding: 60px 0;
  }

  .builder-form-card,
  .builder-summary-card {
    padding: 25px;
    border-radius: 20px;
  }

  .builder-summary h2 {
    font-size: 1.6rem;
  }

  .summary-row.total {
    font-size: 1.2rem;
  }

  .builder-section-title {
    font-size: 1rem;
  }
}

@media screen and (max-width: 480px) {
  .builder-hero {
    padding-top: 45px;
    padding-bottom: 60px;
  }

  .builder-hero h1 {
    font-size: 2rem;
  }

  .builder-hero p {
    font-size: 0.95rem;
  }

  .builder-image {
    width: 200px;
    height: 200px;
    font-size: 3rem;
  }

  .builder-form-card,
  .builder-summary-card {
    padding: 20px;
    border-radius: 15px;
  }

  .checkbox-group {
    padding: 12px 15px;
    font-size: 0.9rem;
  }

  .checkbox-group input {
    width: 18px;
    height: 18px;
  }

  .builder-price-option {
    padding: 12px;
    font-size: 0.9rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 12px;
    font-size: 0.9rem;
  }
}


.contact-info p {
  margin-bottom: 30px;
  color: var(--gray-color);
}

.contact-details {
  margin-bottom: 30px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
}

.contact-item i {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-right: 15px;
  margin-top: 5px;
}

.contact-item h4 {
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.contact-item p {
  margin-bottom: 0;
}

.social-links {
  display: flex;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--light-gray-color);
  margin-right: 15px;
  transition: var(--transition);
}

.social-links a:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-3px);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid var(--light-gray-color);
  border-radius: 5px;
  font-family: "Poppins", sans-serif;
  transition: var(--transition);
  background-color: white;
  color: var(--dark-color);
}

.dark-theme .form-group input,
.dark-theme .form-group textarea {
  background-color: #1e293b;
  color: var(--light-color);
  border-color: #334155;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-group textarea {
  height: 150px;
  resize: vertical;
}

.form-status {
  margin-top: 20px;
  padding: 10px;
  border-radius: 5px;
  display: none;
}

.form-status.success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  border: 1px solid var(--success-color);
  display: block;
}

.form-status.error {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
  display: block;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: white;
  color: var(--dark-color);
  padding: 15px;
  border-radius: 5px;
  box-shadow: var(--box-shadow);
  display: flex;
  flex-direction: column;
  min-width: 300px;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.5s ease;
  z-index: 1000;
}

.dark-theme .toast {
  background-color: #1e293b;
  color: var(--light-color);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-content {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.toast-icon {
  font-size: 1.5rem;
  color: var(--success-color);
  margin-right: 15px;
}

.toast-message {
  font-weight: 500;
}

.toast-progress {
  height: 3px;
  background-color: var(--success-color);
  width: 100%;
  animation: progress 3s linear forwards;
}

@keyframes progress {
  0% {
    width: 100%;
  }
  100% {
    width: 0%;
  }
}

/* PWA Install Prompt */
.pwa-install-prompt {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: white;
  box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 999;
}

.dark-theme .pwa-install-prompt {
  background-color: #1e293b;
}

.pwa-install-prompt.show {
  transform: translateY(0);
}

.prompt-content {
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.prompt-icon {
  font-size: 2rem;
  color: var(--primary-color);
  margin-right: 20px;
}

.prompt-text {
  flex: 1;
}

.prompt-text h3 {
  font-size: 1.3rem;
  margin-bottom: 5px;
}

.prompt-text p {
  color: var(--gray-color);
  margin-bottom: 0;
}

.prompt-buttons {
  display: flex;
}

.prompt-buttons button {
  margin-left: 10px;
}

/* Footer */
footer {
  background-color: var(--dark-color);
  color: white;
  padding: 60px 0 20px;
}

.dark-theme footer {
  background-color: #0f172a;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.footer-logo,
.footer-links,
.footer-social {
  margin-bottom: 30px;
}

.footer-logo h2 {
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.footer-links h3,
.footer-social h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: white;
}

.footer-links ul li {
  margin-bottom: 10px;
}

.footer-links ul li a {
  color: #cbd5e1;
  transition: var(--transition);
}

.footer-links ul li a:hover {
  color: var(--primary-color);
  padding-left: 5px;
}

.footer-social .social-links a {
  background-color: #334155;
  color: white;
}

.footer-social .social-links a:hover {
  background-color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #334155;
}

.footer-bottom p {
  color: #cbd5e1;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  box-shadow: var(--box-shadow);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--secondary-color);
  transform: translateY(-3px);
}

/* Responsive Styles */
/* ========================================================================== */
/* Media queries for various screen sizes */
/* ========================================================================== */

@media screen and (max-width: 1024px) {
  section {
    padding: 80px 0; /* Slightly reduce section padding */
  }

  .hero-text h1 {
    font-size: 2.5rem;
  }

  .hero-text h2 {
    font-size: 1.5rem;
  }

  .hero-image-container {
    width: 350px;
    height: 350px;
  }

  .about-content,
  .contact-content {
    flex-direction: column;
    gap: 30px; /* Adjust gap for column layout */
  }

  .about-image,
  .about-text,
  .contact-info,
  .contact-form {
    width: 100%;
    padding: 0 10px; /* Add some horizontal padding */
  }

  .skills-cards,
  .projects-grid,
  .services-grid {
    grid-template-columns: repeat(
      auto-fill,
      minmax(280px, 1fr)
    ); /* Adjust min width for cards */
    gap: 25px; /* Slightly reduce gap */
  }

  .project-card .project-info,
  .service-card,
  .skill-card {
    padding: 25px; /* Adjust internal padding of cards */
  }

  .testimonial-form-wrapper {
    padding: 25px; /* Adjust form padding */
  }
}

@media screen and (max-width: 768px) {
  header .container {
    padding: 15px 20px; /* Smaller header padding */
  }

  .logo h1 {
    font-size: 1.8rem; /* Smaller logo on mobile */
  }

  .nav-links {
    position: fixed; /* Changed to fixed for better mobile menu */
    right: 0;
    top: 65px; /* Adjusted top to be below header */
    background-color: white;
    height: calc(100vh - 65px);
    width: 75%; /* Slightly wider mobile menu */
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    padding: 50px 0;
    transform: translateX(100%);
    transition: var(--transition);
    box-shadow: -5px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
  }

  .dark-theme .nav-links {
    background-color: #0f172a;
  }

  .nav-links.active {
    transform: translateX(0);
  }

  .nav-links li {
    margin: 0;
  }

  .burger {
    display: block;
  }

  section {
    padding: 60px 0; /* Further reduce section padding */
  }

  .section-header {
    margin-bottom: 40px; /* Reduce margin below section header */
  }

  .section-header h2 {
    font-size: 2rem; /* Smaller section titles */
  }

  .hero-content {
    flex-direction: column-reverse;
    text-align: center;
    padding-top: 50px; /* Add padding to hero content */
  }

  .hero-text {
    padding-right: 0;
    margin-top: 40px; /* Adjust margin for hero text */
  }

  .hero-text h1 {
    font-size: 2.2rem; /* Further reduce hero title */
  }

  .hero-text h2 {
    font-size: 1.3rem; /* Further reduce hero subtitle */
  }

  .hero-text p {
    font-size: 1rem; /* Adjust hero paragraph font size */
  }

  .hero-btns {
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    align-items: center;
    margin-bottom: 20px;
  }

  .hero-btns .btn {
    margin-right: 0;
    margin-bottom: 15px; /* Space between stacked buttons */
    width: 80%; /* Make buttons wider */
    max-width: 250px;
  }

  .social-icons {
    justify-content: center;
    margin-top: 20px;
  }

  .hero-image-container {
    width: 300px;
    height: 300px;
    border-width: 3px; /* Thinner border */
  }

  .about-details {
    grid-template-columns: 1fr; /* Single column for about details */
    gap: 15px;
  }

  .detail {
    flex-direction: column; /* Stack icon and text */
    align-items: center;
    text-align: center;
  }

  .detail i {
    margin-right: 0;
    margin-bottom: 10px; /* Space between icon and text */
  }

  .skills-text p {
    font-size: 0.95rem; /* Adjust skills text font size */
  }

  .skill-card,
  .service-card,
  .project-card {
    padding: 20px; /* Reduce card padding */
  }

  .skill-card h3,
  .service-card h3 {
    font-size: 1.3rem; /* Adjust card title font size */
  }

  .project-info h3 {
    font-size: 1.2rem; /* Adjust project title font size */
  }

  .project-tech span {
    font-size: 0.75rem; /* Smaller tech tags */
    padding: 4px 8px;
  }

  .testimonial-card.active {
    flex-direction: column;
    text-align: center;
    padding: 25px; /* Adjust testimonial card padding */
  }

  .testimonial-img {
    margin-right: 0;
    margin-bottom: 20px;
    width: 80px; /* Smaller testimonial image */
    height: 80px;
  }

  .testimonial-content p {
    font-size: 0.95rem; /* Adjust testimonial text font size */
  }

  .testimonial-info h4 {
    font-size: 1.1rem; /* Adjust testimonial name font size */
  }

  .testimonial-form-wrapper {
    width: 90%;
    margin: 40px auto 0; /* Adjust margin for form */
    padding: 20px;
  }

  .testimonial-form-wrapper h3 {
    font-size: 1.5rem; /* Adjust form title font size */
  }

  .rating label {
    font-size: 1.2rem; /* Smaller stars */
  }

  .contact-info h3,
  .contact-form h3 {
    font-size: 1.5rem; /* Adjust contact section titles */
  }

  .contact-info p {
    font-size: 0.95rem; /* Adjust contact info text */
  }

  .contact-item {
    flex-direction: column; /* Stack contact item icon and text */
    align-items: center;
    text-align: center;
  }

  .contact-item i {
    margin-right: 0;
    margin-bottom: 10px;
  }

  .social-links,
  .footer-social .social-links {
    justify-content: center;
  }

  .form-group input,
  .form-group textarea {
    padding: 12px; /* Smaller form input padding */
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 20px; /* Adjust gap for footer sections */
  }

  .footer-logo h2 {
    font-size: 1.8rem;
  }

  .footer-links h3,
  .footer-social h3 {
    font-size: 1.2rem;
  }

  .footer-links ul li a:hover {
    padding-left: 0;
  }

  .pwa-install-prompt .prompt-content {
    flex-direction: column;
    text-align: center;
  }

  .pwa-install-prompt .prompt-icon {
    margin-right: 0;
    margin-bottom: 10px;
  }

  .pwa-install-prompt .prompt-buttons {
    flex-direction: column;
    margin-top: 15px;
  }

  .pwa-install-prompt .prompt-buttons button {
    margin-left: 0;
    margin-top: 10px;
    width: 100%; /* Make buttons full width */
  }

  .toast {
    bottom: 20px;
    right: 20px;
    min-width: 250px; /* Smaller toast width */
    padding: 12px;
  }

  .toast-icon {
    font-size: 1.2rem;
    margin-right: 10px;
  }

  .toast-message {
    font-size: 0.9rem;
  }
}

@media screen and (max-width: 768px) {
  .hero {
    height: calc(100vh - 65px);
    min-height: 640px;
  }
}

@media screen and (max-width: 480px) {
  .container {
    padding: 0 15px; /* Smaller container padding on very small screens */
  }

  .hero {
    min-height: 620px;
  }

  section {
    padding: 40px 0; /* Even smaller section padding */
  }

  .section-header {
    margin-bottom: 30px;
  }

  .section-header h2 {
    font-size: 1.8rem;
  }

  .hero-text h1 {
    font-size: 1.8rem;
  }

  .hero-text h2 {
    font-size: 1.1rem;
  }

  .hero-text p {
    font-size: 0.9rem;
  }

  .hero-image-container {
    width: 250px;
    height: 250px;
  }

  .skills-cards,
  .projects-grid,
  .services-grid {
    grid-template-columns: 1fr; /* Single column layout for all cards */
    gap: 20px;
  }

  .skill-card,
  .service-card,
  .project-card {
    padding: 15px; /* Further reduce card padding */
  }

  .skill-card h3,
  .service-card h3 {
    font-size: 1.2rem;
  }

  .project-info h3 {
    font-size: 1.1rem;
  }

  .testimonial-card.active {
    padding: 20px;
  }

  .testimonial-img {
    width: 70px;
    height: 70px;
  }

  .testimonial-content p {
    font-size: 0.85rem;
  }

  .testimonial-info h4 {
    font-size: 1rem;
  }

  .testimonial-form-wrapper {
    margin: 30px auto 0;
    padding: 15px;
  }

  .testimonial-form-wrapper h3 {
    font-size: 1.3rem;
  }

  .contact-info h3,
  .contact-form h3 {
    font-size: 1.3rem;
  }

  .contact-item h4 {
    font-size: 1rem;
  }

  .contact-item p {
    font-size: 0.9rem;
  }

  .footer-logo h2 {
    font-size: 1.6rem;
  }

  .footer-links h3,
  .footer-social h3 {
    font-size: 1.1rem;
  }

  .back-to-top {
    width: 40px;
    height: 40px;
    bottom: 20px;
    right: 20px;
  }
}

/* Keep the shared navigation usable before the full desktop links get cramped. */
@media screen and (max-width: 1200px) {
  header .container {
    padding: 15px 20px;
  }

  .nav-links {
    position: fixed;
    top: 68px;
    right: 0;
    display: flex;
    width: min(380px, 85vw);
    height: min(calc(100vh - 68px), 92vh);
    height: min(calc(100dvh - 68px), 92dvh);
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    gap: 6px;
    padding: 15px 0;
    background: var(--light-color);
    box-shadow: -5px 0 16px rgba(15, 23, 42, 0.12);
    transform: translateX(105%);
    transition: var(--transition);
    z-index: 1001;
  }

  .nav-links li {
    margin: 0;
  }

  .nav-links a {
    line-height: 1.48;
  }

  .burger {
    display: block;
  }
}

@media (max-width: 560px) {
  header .container { padding: 10px 14px; }
  .theme-switch { margin-left: 8px; }
  .style-control { margin-left: 4px; }
  .style-control select { max-width: 88px; padding: 6px 4px; font-size: .75rem; }
}

.hero-image {
  flex-direction: column;
  gap: 14px;
}

.hero-image-container.hero-award-photo {
  width: min(34vw, 420px);
  height: auto;
  aspect-ratio: 3 / 4;
  border: 4px solid #fff;
  border-radius: 30px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, .22), 0 0 0 1px rgba(37, 99, 235, .16);
}

.hero-award-photo img {
  object-position: center 30%;
}

.hero-photo-caption {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--gray-color);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .16em;
}

.hero-photo-caption span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 5px rgba(16, 185, 129, .14);
}

.builder-photo {
  position: relative;
  width: min(100%, 360px);
  height: auto;
  aspect-ratio: 4 / 5;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 26px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
}

.builder-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
}

.builder-photo-label {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 14px;
  background: rgba(15, 23, 42, .72);
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
  text-align: center;
  backdrop-filter: blur(12px);
}

@media screen and (max-width: 768px) {
  .hero {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 42px 0 76px;
  }

  .hero-image-container.hero-award-photo {
    width: min(70vw, 310px);
  }

  .builder-photo {
    width: min(70vw, 280px);
  }
}

@media screen and (max-width: 480px) {
  .hero-image-container.hero-award-photo {
    width: min(68vw, 260px);
  }

  .builder-photo {
    width: min(68vw, 245px);
  }
}

@media screen and (max-width: 1050px) {
  .achievement-feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media screen and (max-width: 680px) {
  .achievement-stats {
    grid-template-columns: 1fr;
  }

  .achievement-stats > div {
    min-height: 88px;
  }

  .achievement-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 440px) {
  .achievement-feature-grid {
    grid-template-columns: 1fr;
  }
}

/* Unified, stable site header: same height and scroll behavior on every page. */
:root { --portfolio-header-height: 76px; }
header { position: sticky !important; top: 0; z-index: 1100; width: 100%; min-height: var(--portfolio-header-height); }
header .container { width: min(1440px, 100%); min-height: var(--portfolio-header-height); padding: 8px clamp(12px, 2vw, 28px); }
header nav { min-width: 0; gap: 6px; }
header .nav-links { align-items: center; gap: 0; }
header .nav-links li { margin-left: clamp(8px, .9vw, 16px); }
header .nav-links a { white-space: nowrap; font-size: clamp(.76rem, .82vw, .92rem); }
header .burger { border: 0; padding: 8px; background: transparent; }
header .burger div { border-radius: 2px; }
section[id] { scroll-margin-top: calc(var(--portfolio-header-height) + 12px); }
@media (max-width: 1200px) {
  header .container { min-height: var(--portfolio-header-height); padding: 8px 18px; }
  header .nav-links { position: fixed; top: var(--portfolio-header-height); right: 0; width: min(380px, 88vw); height: calc(100vh - var(--portfolio-header-height)); height: calc(100dvh - var(--portfolio-header-height)); overflow-y: auto; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 6px; padding: 16px; background: var(--light-color); box-shadow: -5px 8px 22px rgba(15,23,42,.16); transform: translateX(105%); transition: transform .22s ease; z-index: 1099; }
  header .nav-links li { margin: 0; }
  header .nav-links a { display: flex; min-height: 44px; align-items: center; padding: 8px 12px; white-space: normal; font-size: .95rem; }
  header .nav-links.active { transform: translateX(0); }
  header .burger { display: block; cursor: pointer; }
}
@media (max-width: 560px) { header .container { padding: 8px 12px; } header .logo h1 { font-size: 1.55rem; } }

.contact-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.contact-message-body { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 768px) { .scroll-down { display: none; } }

@media (max-width: 768px) {
  .hero-content { padding-top: 20px; }
  .hero-text { margin-top: 20px; }
  .hero-image-container.hero-award-photo { width: min(58vw, 250px); }
}
@media (max-width: 480px) {
  .hero-image-container.hero-award-photo { width: min(62vw, 228px); }
}

/* Mobile layout guardrails for narrow phones and safe areas. */
@media (max-width: 768px) {
  html, body { max-width: 100%; overflow-x: clip; }
  header { position: sticky; top: 0; z-index: 1100; }
  header .container { min-height: 60px; padding: 7px max(12px, env(safe-area-inset-right)) 7px max(12px, env(safe-area-inset-left)); }
  header nav { gap: 5px; }
  header .nav-links { top: 60px; height: calc(100vh - 60px); height: calc(100dvh - 60px); padding: 12px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  header .nav-links a { min-height: 46px; }
  .hero { height: auto; min-height: calc(100svh - 60px); padding-bottom: 36px; }
  .hero-content { gap: 16px; padding: 24px 0 0; }
  .hero-text { width: 100%; margin-top: 12px; }
  .hero-text h1 { font-size: clamp(1.7rem, 7vw, 2.25rem); line-height: 1.2; overflow-wrap: anywhere; }
  .hero-text h1 span { overflow-wrap: anywhere; }
  .profile-switch { flex-wrap: wrap; justify-content: center; gap: 8px; }
  .profile-switch-btn { min-height: 44px; }
  .hero-btns { flex-wrap: wrap; gap: 10px; }
  .hero-btns .btn { min-height: 46px; }
  .section-header { padding-right: 8px; padding-left: 8px; }
  .projects-filter, .publications-filters { width: 100%; max-width: 100%; gap: 8px; }
  .projects-filter .filter-btn { min-height: 44px; margin: 0; padding: 10px 14px; }
  .publications-filters .publication-filter { min-height: 44px; padding: 10px 13px; }
  .project-card, .service-card, .skill-card, .publication-card { min-width: 0; }
  .contact-content { flex-direction: column; gap: 24px; }
  .contact-form { min-width: 0; }
  .back-to-top { right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); width: 46px; height: 46px; }
}

@media (max-width: 420px) {
  header .style-control select { max-width: 86px; padding-right: 20px; font-size: .75rem; }
  .profile-switch-btn { flex: 1 1 145px; padding: 10px 12px; font-size: .82rem; }
  .hero-image-container { max-width: 74vw; }
  .hero-btns .btn { width: 100%; }
  .section-header h2 { font-size: clamp(1.55rem, 7vw, 1.9rem); }
}
