/* ==========================================================
   10/10 Minimalist Portfolio
   - Mobile-first, accessible, polished
   - Fixed nav bullets & dot alignment (replaced with separators)
   - Research BibTeX copy
   - Project screenshot modal gallery with focus trap
========================================================== */

:root {
  /* Default: Light Theme */
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #0b0d10;
  --muted: #5b6370;
  --border: #e6e8ee;

  --accent: #2563eb;
  --accent-ink: #0b3bb8;
  --tint: rgba(37, 99, 235, 0.08);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.10);

  --radius: 16px;
  --radius-lg: 22px;
  --container: 1120px;
  --section-pad: 64px;

  --focus: 0 0 0 4px rgba(37, 99, 235, 0.22);
  --transition: 240ms cubic-bezier(0.4, 0, 0.2, 1);
  --header-bg: rgba(255, 255, 255, 0.82);
}

[data-theme="dark"] {
  --bg: #0b0d10;
  --surface: #16191d;
  --text: #f0f2f5;
  --muted: #9ba3af;
  --border: #2d323a;

  --accent: #3b82f6;
  --accent-ink: #93c5fd;
  --tint: rgba(59, 130, 246, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);

  --header-bg: #000000;
  --focus: 0 0 0 4px rgba(59, 130, 246, 0.3);
}

body {
  transition: background-color var(--transition), color var(--transition);
}

/* Theme Toggle Button */
.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  font-size: 18px;
  padding: 0;
  color: inherit;
  position: relative;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  background: var(--tint);
}

.theme-toggle:active {
  transform: translateY(0);
}

.theme-toggle .sun-ic {
  display: none;
}

.theme-toggle .moon-ic {
  display: flex;
}

[data-theme="dark"] .theme-toggle .sun-ic {
  display: flex;
}

[data-theme="dark"] .theme-toggle .moon-ic {
  display: none;
}

.theme-toggle i {
  position: absolute;
  font-size: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

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


.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.section {
  padding: var(--section-pad) 0;
}

/* Ensure anchor navigation lands correctly with sticky header */
.section {
  scroll-margin-top: 92px;
}

#top {
  scroll-margin-top: 0;
}


@media (min-width: 900px) {
  :root {
    --section-pad: 88px;
  }
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transform: translateY(-220%);
  transition: transform 160ms ease;
  z-index: 9999;
}

.skip-link:focus {
  transform: translateY(0);
  outline: none;
  box-shadow: var(--focus), var(--shadow-sm);
}

/* Header / Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: inherit;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--tint);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

.brand-text {
  font-size: 14px;
}

.nav-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  height: 42px;
  width: 46px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.nav-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus), var(--shadow-sm);
}

.nav-toggle-lines {
  width: 18px;
  height: 12px;
  position: relative;
}

.nav-toggle-lines::before,
.nav-toggle-lines::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 180ms ease, top 180ms ease, bottom 180ms ease;
}

.nav-toggle-lines::before {
  top: 0;
}

.nav-toggle-lines::after {
  bottom: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines::before {
  top: 5px;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines::after {
  bottom: 5px;
  transform: rotate(-45deg);
}

.nav-menu {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 64px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 14px;
  display: none;
}

.nav-menu[data-state="open"] {
  display: block;
}

/* FIX 1: Remove default bullets and ensure consistent alignment */
.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--text);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.nav-link:hover {
  background: rgba(0, 0, 0, 0.03);
}

.nav-link:active {
  transform: translateY(1px);
}

.nav-link:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.nav-link.active {
  background: var(--tint);
  border-color: rgba(37, 99, 235, 0.2);
  color: var(--accent-ink);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }

  .nav-menu {
    position: static;
    display: flex !important;
    align-items: center;
    gap: 18px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .nav-links {
    display: flex;
    gap: 6px;
  }

  .nav-link {
    padding: 8px 10px;
    border-radius: 999px;
  }

  .nav-cta {
    margin-top: 0;
  }
}

/* Typography */
h1,
h2,
h3 {
  margin: 0 0 10px;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

h2 {
  font-size: 28px;
}

h3 {
  font-size: 18px;
}

@media (min-width: 900px) {
  h2 {
    font-size: 32px;
  }
}

p {
  margin: 0 0 12px;
}

.small {
  font-size: 13px;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 10px;
}

.accent {
  color: var(--accent);
}

/* Buttons & links */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
  box-shadow: var(--shadow-sm);
  font-weight: 650;
  color: inherit;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus), var(--shadow-sm);
}

.btn-primary {
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: rgba(37, 99, 235, 0.16);
}

.btn-ghost {
  background: transparent;
}

.btn-sm {
  padding: 9px 12px;
  font-size: 13px;
}

/* Inline links (FIX 2: dot alignment replaced with separator line) */
.inline-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-links .sep {
  width: 1px;
  height: 14px;
  background: var(--border);
  display: inline-block;
  transform: translateY(1px);
}

.inline-links-compact {
  gap: 8px;
}

.inline-links-compact .sep {
  height: 12px;
}

.link {
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
  padding: 2px 6px;
  border-radius: 8px;
  display: inline-block;
}

.link:hover {
  border-color: rgba(11, 59, 184, 0.4);
  background: var(--tint);
  transform: translateY(-1px);
}

.link:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

/* Hero */
.hero {
  padding-top: 40px;
}

.hero-grid {
  display: grid;
  gap: 26px;
}

.hero-title {
  font-size: 40px;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--muted);
  max-width: 66ch;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 12px;
}

.kpi {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.012);
  padding: 12px 12px;
  box-shadow: var(--shadow-sm);
}

.kpi-num {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 18px;
}

.kpi-label {
  font-size: 12px;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-size: 13px;
  color: var(--muted);
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.015);
}

.hero-card {
  display: grid;
  gap: 12px;
}

.profile-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
}

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 8%;
  overflow: hidden;

  margin: auto 14px auto;
  /* center horizontally */

  background: #ffffff;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.08),
    inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  /* slightly higher crop for faces */
  display: block;
}

@media (min-width: 768px) {
  .avatar {
    width: 140px;
    height: 140px;
    margin-bottom: 14px;
  }
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}





.profile-name {
  font-size: 18px;
  margin-bottom: 2px;
}

.profile-role {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.profile-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.hero-card-footer {
  padding: 0 6px;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.25fr 0.85fr;
    align-items: start;
    gap: 38px;
  }

  .hero-title {
    font-size: 54px;
  }

  .hero-subtitle {
    font-size: 18px;
  }
}

/* Section head */
.section-head {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
  max-width: 72ch;
}

/* Cards, lists */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.list li {
  margin: 8px 0;
}

.list strong {
  color: var(--text);
}

/* About points */
.about-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 1.4fr 0.9fr;
    gap: 20px;
  }
}

.about-points {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.about-point {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  align-items: start;
}

.about-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.55);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

/* Skills */
.skills-grid {
  display: grid;
  gap: 14px;
}

.skill-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.skill-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.skill-cat {
  font-weight: 800;
}

.skill-level {
  font-size: 13px;
  color: var(--muted);
}

.skill-list {
  display: grid;
  gap: 12px;
}

.skill-item {
  display: grid;
  gap: 6px;
}

.skill-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.skill-top strong {
  color: var(--text);
  font-weight: 650;
}

.progress {
  height: 10px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress>span {
  display: block;
  height: 100%;
  width: 0%;
  background: rgba(37, 99, 235, 0.55);
  border-right: 1px solid rgba(37, 99, 235, 0.25);
  transition: width 700ms ease;
}

@media (min-width: 900px) {
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

/* Certifications */
.certs-grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 900px) {
  .certs-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

.cert-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.cert-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.2);
}

.cert-title {
  font-size: 16px;
  font-weight: 850;
  margin-bottom: 4px;
}

.cert-issuer {
  font-weight: 650;
}

/* Research */
.research-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.01);
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.filter:hover {
  transform: translateY(-1px);
}

.filter:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.filter[aria-pressed="true"] {
  background: var(--tint);
  border-color: rgba(37, 99, 235, 0.22);
  color: var(--accent-ink);
}

.input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font: inherit;
}

.input:focus-visible {
  outline: none;
  box-shadow: var(--focus), var(--shadow-sm);
}

.research-list {
  display: grid;
  gap: 14px;
}

.paper {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.paper-top {
  display: grid;
  gap: 6px;
}

.paper-title {
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.02em;
  margin: 0;
}

.paper-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.012);
  font-size: 12px;
  color: var(--muted);
}

.badge-accent {
  background: var(--tint);
  border-color: rgba(37, 99, 235, 0.22);
  color: var(--accent-ink);
}

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

.tag {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.01);
  color: var(--muted);
}

.paper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

/* BibTeX drawer */
.bibtex {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.01);
  padding: 12px;
  display: none;
}

.bibtex.is-open {
  display: block;
}

.bibtex pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: var(--text);
}

/* Projects */
.grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

.project {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  display: grid;
  gap: 12px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.project:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.project:focus-within {
  box-shadow: var(--focus), var(--shadow-md);
}

.project-media {
  height: 150px;
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.20), rgba(0, 0, 0, 0.03));
  position: relative;
}

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

.project-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 12px;
  backdrop-filter: blur(8px);
}

.project-title {
  font-size: 16px;
  margin: 0;
  font-weight: 850;
}

.project-desc {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.project-links .btn {
  box-shadow: none;
}

/* Contact */
.contact-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .contact-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 20px;
  }
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

label {
  font-weight: 750;
  font-size: 13px;
}

.textarea {
  resize: vertical;
}

.error {
  margin: 0;
  color: #b42318;
  font-size: 12px;
  min-height: 16px;
}

.form-actions {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.form-status {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* Socials upgrade */
.social-head {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
}

.social-grid {
  display: grid;
  gap: 10px;
}

.social-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.01);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.social-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.social-card:focus-visible {
  outline: none;
  box-shadow: var(--focus), var(--shadow-sm);
}

.social-ic {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--tint);
  border: 1px solid rgba(37, 99, 235, 0.20);
  color: var(--accent-ink);
  flex: 0 0 auto;
}

.social-meta {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.social-title {
  font-weight: 850;
  letter-spacing: -0.02em;
}

.social-sub {
  font-size: 13px;
}

.social-arrow {
  color: var(--muted);
}

.address-wrap {
  display: grid;
  gap: 12px;
}

.address-title {
  font-weight: 850;
  margin-bottom: 6px;
}

.map {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: rgba(0, 0, 0, 0.01);
}

.map iframe {
  display: block;
  width: 100%;
  height: 220px;
  border: 0;
}

@media (min-width: 900px) {
  .map iframe {
    height: 240px;
  }
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

#galleryImage {
  max-width: 100%;
  max-height: 80vh;
  /* limits height to viewport */
  width: auto;
  height: auto;

  object-fit: contain;
}

/* Research Pillars */
.research-pillars {
  display: grid;
  gap: 16px;
  margin-bottom: 32px;
}

@media (min-width: 768px) {
  .research-pillars {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.pillar-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.pillar-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pillar-ic {
  font-size: 24px;
  flex: 0 0 auto;
  color: var(--accent);
}

.pillar-title {
  font-size: 15px;
  font-weight: 850;
  margin: 0 0 2px;
}

.pillar-subtitle {
  display: block;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 4px;
}

.pillar-body p {
  margin: 0;
  line-height: 1.4;
}



@media (min-width: 1024px) {
  #galleryImage {
    max-height: 80vh;
  }
}

.modal-body {
  padding: 8px 20px 16px;
}

/* Modal gallery */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}

.modal[aria-hidden="false"] {
  display: block;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 13, 16, 0.55);
  backdrop-filter: blur(3px);
}

.modal-panel {
  position: relative;
  width: min(980px, calc(100% - 32px));
  margin: 60px auto;
  background: var(--surface);
  border: 1px solid rgba(230, 232, 238, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.modal-panel {
  width: min(96vw, 1400px);
  max-height: 94vh;

  background: #ffffff;
  border-radius: 14px;

  display: flex;
  flex-direction: column;

  outline: none;
}

/* Make modal fit the viewport */
.modal-panel {
  max-height: 94vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Modal body scrolls if needed (never the image overflowing the page) */
.modal-body {
  overflow: auto;
}

/* Hard cap the image height so it never exceeds the viewport */
#galleryImage {
  max-width: 100%;
  max-height: 65vh;
  /* adjust: 65–80vh based on preference */
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}


.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.modal-desc {
  margin: 0;
}

.icon-btn {
  height: 40px;
  width: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.01);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.icon-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus), var(--shadow-sm);
}

.modal-body {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.gallery {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;

  padding: 12px 0;
}

.gallery-nav {
  height: 44px;
  width: 44px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.01);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  font-size: 22px;
  line-height: 1;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.gallery-nav:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.gallery-nav:focus-visible {
  outline: none;
  box-shadow: var(--focus), var(--shadow-sm);
}

.gallery-figure {
  margin: 0;
  border-radius: 18px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.02);
  box-shadow: var(--shadow-sm);
}

.gallery-figure img {
  width: 100%;
  height: min(56vh, 520px);
  object-fit: contain;
  background: #fff;
}

.gallery-figure figcaption {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

.thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.thumb {
  width: 90px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.02);
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.thumb:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.thumb[aria-current="true"] {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--focus), var(--shadow-sm);
}

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

@media (max-width: 520px) {
  .gallery {
    grid-template-columns: 40px 1fr 40px;
  }

  .thumb {
    width: 78px;
    height: 50px;
  }

  .modal-panel {
    margin: 36px auto;
  }
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Screen-reader only */
.sr-only {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .reveal,
  .progress>span,
  .project,
  .social-card,
  .filter,
  .gallery-nav,
  .thumb,
  .icon-btn,
  .nav-link {
    transition: none !important;
  }

  .btn:hover,
  .project:hover,
  .filter:hover,
  .social-card:hover,
  .gallery-nav:hover,
  .thumb:hover,
  .icon-btn:hover {
    transform: none !important;
  }
}