html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  background-color: #f8f9fa;
  color: #212529;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.navbar-brand {
  letter-spacing: 0.02em;
}

.footer a {
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.project-gallery .card-img-top {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  background-color: #f1f5f9;
  cursor: zoom-in;
}

#projectFilters .btn.active {
  color: #fff;
}

/* Expanded image modal styles */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1080;
  padding: 1rem;
}

.image-modal.is-open {
  display: flex;
}

.image-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(30, 30, 30, 0.6);
  backdrop-filter: blur(6px);
  z-index: 1;
}
.image-modal-content {
  position: relative;
  z-index: 2;
  max-width: 96vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.image-modal-content img {
  max-width: 95vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.42);
  background-color: #fff;
}
.image-modal-close {
  position: absolute;
  top: -0.85rem;
  right: -0.85rem;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  font-size: 1.85rem;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  border-radius: 50%;
  width: 2.35rem;
  height: 2.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-headshot {
  width: 160px;
  height: 160px;
  object-fit: cover;
}

.resume-identity {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.experience-logo {
  width: 200px;
  height: 88px;
  object-fit: contain;
}

.resume-detail-heading {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.resume-detail-logo-link {
  display: flex;
  align-items: stretch;
}

.resume-detail-logo {
  width: auto;
  height: 100%;
  max-height: 116px;
  min-height: 88px;
  object-fit: contain;
}

.contact-card {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.resume-section-title {
  margin-bottom: 0.9rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
}

.resume-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding-bottom: 0.15rem;
}

.resume-section-nav a {
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 600;
  color: #334155;
  background-color: #fff;
}

.resume-section-nav a:hover {
  background-color: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.35);
}

.featured-projects {
  padding: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.featured-project-tile {
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 0.7rem;
  padding: 0.95rem;
  background-color: #fff;
}

.projects-transition {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 0.75rem;
}

.featured-project-meta {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
}

.featured-project-subtitle,
.project-card-subtitle {
  font-size: 0.9rem;
  line-height: 1.35;
}

.project-card-inner {
  border-width: 1px;
}

.project-card[data-category="professional"] .project-card-inner {
  border-left: 3px solid rgba(59, 130, 246, 0.55);
}

.project-card[data-category="personal"] .project-card-inner {
  border-left: 3px solid rgba(14, 116, 144, 0.4);
}

.project-card-featured {
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.1);
}

.project-card-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.featured-badge {
  background-color: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.project-featured-note {
  line-height: 1.25;
}

.resume-entry-meta {
  font-size: 0.88rem;
}

.resume-entry-action {
  font-weight: 600;
}

.resume-detail-meta {
  font-size: 0.95rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.25rem;
  margin-bottom: 0.35rem;
  color: #0f172a;
  text-decoration: none;
  border-radius: 0.5rem;
}

.contact-link:hover {
  background-color: rgba(30, 64, 175, 0.08);
  text-decoration: none;
}

.contact-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: 0 0 22px;
}

.github-icon {
  background-color: #ffffff;
  border-radius: 50%;
  padding: 2px;
  box-sizing: content-box;
}

.discord-panel {
  border-left: 4px solid #5865f2;
  background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
}

.discord-widget-wrapper {
  display: flex;
  justify-content: center;
}

.discord-widget-wrapper iframe {
  border: 0;
  border-radius: 0.5rem;
  max-width: 100%;
}

@media (min-width: 992px) {
  .resume-hero-main {
    min-height: 100%;
  }

  .profile-headshot-hero {
    width: auto;
    height: 100%;
    max-height: 290px;
    aspect-ratio: 1 / 1;
  }
}

body.dark-mode {
  background-color: #0f172a;
  color: #e2e8f0;
}

body.dark-mode .navbar {
  background-color: #111827 !important;
  border-bottom-color: #1f2937 !important;
}

body.dark-mode .navbar .navbar-brand,
body.dark-mode .navbar .nav-link {
  color: #e5e7eb !important;
}

body.dark-mode .navbar .nav-link:hover {
  color: #93c5fd !important;
}

body.dark-mode .card,
body.dark-mode .contact-card,
body.dark-mode .discord-panel {
  background: #111827;
  color: #e5e7eb;
  border-color: #1f2937 !important;
}

body.dark-mode .text-muted {
  color: #9ca3af !important;
}

body.dark-mode .footer {
  border-top-color: #1f2937 !important;
}

body.dark-mode .footer a {
  color: #93c5fd;
}

body.dark-mode .contact-link {
  color: #e5e7eb;
}

body.dark-mode .contact-link:hover {
  background-color: rgba(147, 197, 253, 0.15);
}

body.dark-mode .github-icon {
  background-color: #ffffff;
}

body.dark-mode .resume-section-title {
  border-bottom-color: rgba(148, 163, 184, 0.35);
}

body.dark-mode .resume-section-nav a {
  background-color: #0f172a;
  border-color: rgba(148, 163, 184, 0.45);
  color: #dbeafe;
}

body.dark-mode .resume-section-nav a:hover {
  background-color: rgba(37, 99, 235, 0.22);
}

body.dark-mode .featured-projects,
body.dark-mode .featured-project-tile {
  background: #111827;
  border-color: #1e3a8a;
}

body.dark-mode .projects-transition {
  border-top-color: rgba(148, 163, 184, 0.22);
}

body.dark-mode .featured-project-meta {
  color: #94a3b8;
}

body.dark-mode .project-card[data-category="professional"] .project-card-inner {
  border-left-color: rgba(96, 165, 250, 0.75);
}

body.dark-mode .project-card[data-category="personal"] .project-card-inner {
  border-left-color: rgba(125, 211, 252, 0.65);
}

body.dark-mode .project-card-featured {
  box-shadow: 0 8px 16px rgba(30, 64, 175, 0.18);
}

body.dark-mode .project-gallery .card-img-top {
  background-color: #0b1220;
}

body.dark-mode .image-modal-content img {
  background-color: #0f172a;
}

body.dark-mode .project-card-meta .badge.text-bg-light {
  background-color: #1f2937 !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

body.dark-mode .featured-badge {
  background-color: rgba(96, 165, 250, 0.2);
  color: #bfdbfe;
  border-color: rgba(147, 197, 253, 0.45);
}

body.dark-mode #projectFilters .btn {
  border-color: #475569;
  color: #cbd5e1;
}

body.dark-mode #projectFilters .btn.active {
  background-color: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

body.dark-mode code {
  color: #bfdbfe;
}

@media (max-width: 575.98px) {
  .resume-detail-header {
    align-items: flex-start !important;
  }

  .resume-detail-logo {
    height: auto;
    max-height: 72px;
    min-height: 0;
  }

  .resume-section-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.35rem;
  }

  .resume-section-nav a {
    flex: 0 0 auto;
    font-size: 0.78rem;
    padding: 0.24rem 0.56rem;
  }
}

@media print {
  @page {
    size: Letter portrait;
    margin: 0.08in;
  }

  .container,
  .container.py-4 {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body {
    background: #fff !important;
    color: #000;
    font-size: 7.6pt;
    line-height: 1;
    font-family: "Times New Roman", Times, serif;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color: #000 !important;
    zoom: 0.97;
  }

  * {
    color: #000 !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #000 !important;
  }

  .text-muted,
  .text-body-secondary,
  [class*="text-muted"],
  .card-text,
  small,
  .small {
    color: #000 !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #000 !important;
  }

  .navbar,
  .footer,
  #themeToggle,
  .resume-section-nav,
  #projectFilters,
  .featured-projects,
  .discord-panel,
  .btn,
  a.btn {
    display: none !important;
  }

  .profile-headshot {
    display: none !important;
  }

  .card,
  .contact-card,
  .contact-link {
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    margin-bottom: 0.01in !important;
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  .card-body {
    padding: 0 !important;
  }

  .mb-4 {
    margin-bottom: 0.02in !important;
  }

  .mb-3,
  .mb-2,
  .mb-1,
  .mt-3,
  .mt-2,
  .mt-1 {
    margin-bottom: 0.01in !important;
    margin-top: 0.01in !important;
  }

  h2.h4 {
    font-size: 10.4pt !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: #0f3b86 !important;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-top: 0.03in !important;
    margin-bottom: 0.015in !important;
    padding: 0.01in 0.06in;
    border: 0 !important;
  }

  h3.h6 {
    font-size: 8.8pt !important;
    margin-bottom: 0.01in !important;
  }

  p,
  li {
    margin-bottom: 0.006in !important;
  }

  ul {
    margin-bottom: 0.008in !important;
    padding-left: 0.1in !important;
  }

  #projects-section .row.row-cols-1.row-cols-md-2.g-4.mt-1 {
    display: block !important;
    column-count: 2;
    column-gap: 0.12in;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  #projects-section .project-card,
  #projects-section .col {
    display: block !important;
    width: auto !important;
    padding: 0 !important;
    margin: 0 0 0.006in 0 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  #projects-section .card,
  #projects-section .card.h-100 {
    height: auto !important;
    margin: 0 !important;
  }

  #projectFilters,
  #projects-section .btn,
  #experience-section .btn {
    display: none !important;
  }

  #projects-section > p.text-muted {
    display: none !important;
  }

  #projects-section .projects-transition,
  #projects-section .project-featured-note {
    display: none !important;
  }

  #projects-section .card-title {
    font-size: 8pt !important;
    line-height: 1.02 !important;
    margin: 0 !important;
  }

  #projects-section .card-text {
    font-size: 7.3pt !important;
    line-height: 1 !important;
    margin: 0.002in 0 0 0 !important;
  }

  #projects-section .badge {
    font-size: 6.8pt !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: 0 !important;
    display: inline !important;
    color: #000 !important;
  }

  #leadership-section .card:last-child p.mt-3 {
    font-size: 7pt !important;
    line-height: 0.97 !important;
    margin-top: 0.002in !important;
    margin-bottom: 0 !important;
  }

  #leadership-section .card:last-child ul {
    margin-bottom: 0.002in !important;
    line-height: 0.98 !important;
  }

  #leadership-section .card:last-child p.text-muted {
    margin-bottom: 0.002in !important;
  }

  #header-section .small,
  #header-section p.mb-0 {
    display: none !important;
  }

  #leadership-section .row,
  #leadership-section [class*="col-"] {
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  #contact {
    padding: 0 !important;
    margin-top: 0.01in;
  }

  #contact h2,
  .contact-icon {
    display: none !important;
  }

  #contact .contact-link {
    display: inline;
    margin-right: 0.08in;
    padding: 0;
  }

  #contact .contact-link span {
    font-size: 8.3pt;
  }

  a {
    color: #000 !important;
    text-decoration: none !important;
  }

  /* Keep section titles readable on blue bars in print. */
  h2.h4,
  h2.h4 * {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    opacity: 1 !important;
  }
}
