/* ==========================================================================
   Antigravity Portfolio Design System - Inspired by yohandev.github.io
   Strict Minimalist Engineering Aesthetic
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-subtle: #f9fafb;
  --bg-hover: #f3f4f6;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --border-focus: #111827;
  --accent: #111827;
  --radius: 6px;
  --radius-sm: 4px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, Monaco, monospace;
  --container-max: 1160px; /* Widened to minimize desktop margins */
  --transition: 0.15s ease-in-out;
}

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

html {
  font-size: 18px;
  line-height: 1.6;
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   Layout Container
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 44px 24px 80px 24px;
}

/* --------------------------------------------------------------------------
   Typography & Links
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h1 {
  font-size: 2.15rem;
  margin-bottom: 4px;
}

h2 {
  font-size: 1.3rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

p {
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.65;
  margin-bottom: 12px;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #cbd5e1;
  transition: color var(--transition), text-decoration-color var(--transition);
}

a:hover {
  color: #000000;
  text-decoration-color: var(--text-primary);
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
section {
  margin-bottom: 52px;
}

/* --------------------------------------------------------------------------
   Header / Intro (With Prominent Profile Image Beside Name)
   -------------------------------------------------------------------------- */
.header-intro {
  margin-bottom: 48px;
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
}

.profile-photo {
  width: 145px;
  height: 145px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--border);
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.header-title-text {
  display: flex;
  flex-direction: column;
}

.header-role {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

.header-bio {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  width: 100%;
}

.header-bio p {
  margin-bottom: 12px;
}

.header-bio p:last-child {
  margin-bottom: 0;
}

.header-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 28px;
  font-size: 0.92rem;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.header-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
}

.header-email {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.94rem;
  color: var(--text-primary);
}

.header-email strong {
  font-weight: 600;
  color: var(--text-primary);
  user-select: all;
}

.link-icon {
  width: 1.15em;
  height: 1.15em;
  object-fit: contain;
  vertical-align: -0.15em;
  display: inline-block;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Coursework Carousel Slider
   -------------------------------------------------------------------------- */
.slider-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slider-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background-color var(--transition), border-color var(--transition);
}

.slider-btn:hover {
  background: var(--bg-hover);
  border-color: var(--text-secondary);
}

.slider-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.course-slider-viewport {
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  padding-bottom: 8px;
  margin: 0 -4px;
}

.course-slider-viewport::-webkit-scrollbar {
  height: 4px;
}

.course-slider-viewport::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.course-slider-track {
  display: flex;
  gap: 14px;
  padding: 4px;
}

.course-card {
  flex: 0 0 calc(33.333% - 10px);
  min-width: 260px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--bg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color var(--transition);
}

.course-card:hover {
  border-color: var(--text-primary);
}

.course-card-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.course-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.35;
}

.course-card-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.see-more-action {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
}

.coursework-footer-action {
  margin-top: 14px;
  text-align: right;
}

/* --------------------------------------------------------------------------
   Internships (Single-Column ATS Friendly)
   -------------------------------------------------------------------------- */
.internships-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.internship-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color var(--transition);
  display: flex;
  flex-direction: column;
}

.internship-item:hover {
  border-color: var(--text-primary);
}

.internship-item:hover .see-more-action {
  text-decoration: underline;
}

.internship-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 4px;
}

.internship-role {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text-primary);
}

.internship-date {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.internship-company {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.internship-company a {
  text-decoration: underline;
}

.internship-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.modal-bullets {
  margin: 14px 0 20px 0;
}

.internship-bullets li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding-left: 14px;
  position: relative;
  line-height: 1.55;
}

.internship-bullets li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Projects (Highlights & Other Projects)
   -------------------------------------------------------------------------- */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition);
}

.project-card:hover {
  border-color: var(--text-primary);
}

.project-card-thumb-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #f3f4f6;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.project-card-thumb-container img,
.project-card-thumb-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.project-tag {
  font-size: 0.74rem;
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.project-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.project-card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   Other Projects (Compact Secondary Layout)
   -------------------------------------------------------------------------- */
.other-projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.other-project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition);
}

.other-project-card:hover {
  border-color: var(--text-primary);
}

.other-project-card .project-card-thumb-container {
  aspect-ratio: 16 / 9;
}

.other-project-card .project-card-body {
  padding: 16px;
}

.other-project-card .project-card-title {
  font-size: 0.98rem;
}

.other-project-card .project-card-desc {
  font-size: 0.84rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

/* --------------------------------------------------------------------------
   Certificates & Workshops Section
   -------------------------------------------------------------------------- */
.cert-category-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-top: 20px;
  margin-bottom: 12px;
}

.cert-category-title:first-of-type {
  margin-top: 0;
}

.certs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.cert-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color var(--transition);
}

.cert-card:hover {
  border-color: var(--text-primary);
}

.cert-card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}

.cert-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cert-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.cert-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.cert-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   Modals & Detail Views
   -------------------------------------------------------------------------- */
body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(17, 24, 39, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 1120px; /* Widened modal dialog to minimize side whitespace */
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  transform: translateY(12px);
  transition: transform var(--transition);
}

.modal-backdrop.active .modal-dialog {
  transform: translateY(0);
}

.modal-header {
  padding: 16px 26px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-title-wrap {
  flex-grow: 1;
}

.modal-category {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.modal-title {
  font-size: 1.18rem;
  font-weight: 600;
  margin-top: 2px;
}

.modal-close-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--text-secondary);
  transition: background-color var(--transition), color var(--transition);
}

.modal-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 26px;
  overflow-y: auto;
  font-size: 0.96rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.modal-body h3 {
  font-size: 1.08rem;
  color: var(--text-primary);
  margin-top: 26px;
  margin-bottom: 8px;
}

.modal-body h3:first-child {
  margin-top: 0;
}

.modal-body h4 {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-top: 16px;
  margin-bottom: 6px;
}

/* Media inside Modal (Default Standalone Layout) */
.modal-media {
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-subtle);
}

.modal-media img,
.modal-media video {
  width: 100%;
  height: auto;
  display: block;
}

/* Captions (only shown for explicit descriptive text) */
.modal-media-caption {
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* Clickable Images for Fullscreen Preview */
.clickable-img {
  cursor: zoom-in;
  transition: opacity var(--transition);
}

.clickable-img:hover {
  opacity: 0.94;
}

/* --------------------------------------------------------------------------
   Explicit Side by Side Layouts (With Vertical Height Alignment)
   -------------------------------------------------------------------------- */
.media-row {
  display: flex;
  gap: 14px;
  margin: 18px 0;
  align-items: center; /* Aligns shorter media to the vertical center of tallest media */
}

.media-row > * {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.media-row .modal-media {
  margin: 0;
  width: 100%;
}

/* Description beside Media Layout */
.content-beside-row {
  display: flex;
  gap: 18px;
  align-items: center;
  margin: 18px 0;
}

.content-beside-row > .text-col {
  flex: 1;
}

.content-beside-row > .media-col {
  flex: 1;
  min-width: 0;
}

.content-beside-row.reverse {
  flex-direction: row-reverse;
}

/* Portrait video (9:16) container */
.portrait-video-wrapper {
  max-width: 320px;
  margin: 18px auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #000000;
}

.portrait-video-wrapper video {
  width: 100%;
  height: auto;
  display: block;
}

/* Fullscreen Certificate / Image Lightbox Dialog */
.lightbox-dialog {
  background: transparent;
  border: none;
  box-shadow: none;
  width: auto;
  max-width: 92vw;
  max-height: 92vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.lightbox-close-btn {
  position: absolute;
  top: -42px;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  transition: background-color var(--transition);
}

.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

.lightbox-caption {
  color: #ffffff;
  font-size: 0.85rem;
  margin-top: 10px;
  text-align: center;
}

/* Fullscreen Certificate Image Modal */
.cert-modal-dialog {
  max-width: 1120px;
}

.cert-full-view {
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #000000;
}

/* Coursework Full Catalog Layout */
.course-catalog-group {
  margin-bottom: 24px;
}

.course-catalog-title {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.course-catalog-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.course-catalog-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: var(--bg);
}

.course-catalog-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.course-catalog-name {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 4px;
}

.course-catalog-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-contact-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-contact-links a,
.footer-email {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
}

.footer-contact-links a:hover {
  color: var(--text-primary);
}

.footer-email {
  user-select: all;
}

/* --------------------------------------------------------------------------
   Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .course-card {
    flex: 0 0 calc(50% - 7px);
  }
}

@media (max-width: 640px) {
  .container {
    padding: 32px 16px 60px 16px;
  }

  .header-title-row {
    gap: 16px;
  }

  .profile-photo {
    width: 105px;
    height: 105px;
  }

  h1 {
    font-size: 1.7rem;
  }

  .course-card {
    flex: 0 0 calc(85% - 6px);
  }

  .other-projects-grid {
    grid-template-columns: 1fr;
  }

  .certs-grid {
    grid-template-columns: 1fr;
  }

  .media-row {
    flex-direction: column;
    align-items: stretch;
  }

  .content-beside-row,
  .content-beside-row.reverse {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-dialog {
    max-height: 94vh;
  }

  .modal-header {
    padding: 12px 16px;
  }

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