/* Ubuntu font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap');

*, *::before, *::after,
body, h1, h2, h3, h4, h5, h6,
p, a, li, td, th, blockquote, pre, code,
input, textarea, button, select, label,
.ubuntu {
  font-family: 'Ubuntu', sans-serif !important;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   PALETTE — Cool Coastal Vibes
   #1C2035  darkest navy → nav bar
   #22263A  deep navy    → body background
   #2E3450  mid navy     → card surfaces
   #6E7D9A  slate        → muted text, borders
   #E8EBF2  off-white    → primary text
   #E82830  vivid red    → accent only
   #C21230  deep crimson → hover/pressed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── Base ───────────────────────────────────────── */
.bg-near-black { background-color: #22263A !important; }
body           { background-color: #22263A; color: #E8EBF2; }

/* ── Nav ────────────────────────────────────────── */
.bg-dark-red {
  background-color: rgba(194, 18, 48, 0.65) !important;
  border-bottom: 1px solid rgba(110, 125, 154, 0.20) !important;
  box-shadow: none !important;
}
.bg-red    { background-color: rgba(194, 18, 48, 0.65) !important; }
.bg-gold   { background-color: rgba(194, 18, 48, 0.65) !important; }
.bg-orange { background-color: rgba(194, 18, 48, 0.65) !important; }
header nav a, header nav a.white-90, header nav a.hover-white {
  color: #E8EBF2 !important;
}
header nav a:hover {
  color: #ffffff !important;
}

/* ── Text ───────────────────────────────────────── */
.near-white, .mid-gray { color: #E8EBF2 !important; }
.dark-gray, .gray      { color: #6E7D9A !important; }
.black, .near-black    { color: #E8EBF2 !important; }
h1, h2, h3, h4, h5    { color: #E8EBF2; }

/* ── Links ──────────────────────────────────────── */
a, .link { color: #E82830 !important; }
a:hover, .link:hover, .dim:hover { color: #C21230 !important; opacity: 1 !important; }

/* ── Card surface ───────────────────────────────── */
.bg-white      { background-color: #2E3450 !important; }
.bg-light-gray { background-color: #2E3450 !important; }
article.bb {
  background: #2E3450 !important;
  border: 1px solid rgba(110, 125, 154, 0.15) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

/* ── Dark text inside white cards ── */
article.bb *,
.tech-stack-section *,
.research-category-content *,
article.page-research *,
article.page-cv *,
article.page-contact *,
article[class^="page-"] *,
.home-projects-tabs .project-card-compact * {
  color: #E8EBF2 !important;
}
article.bb a, article.bb .link,
.tech-stack-section a,
.research-category-content a,
article[class^="page-"] a {
  color: #E82830 !important;
  text-decoration: none;
}
article.bb a:hover,
.tech-stack-section a:hover,
.research-category-content a:hover,
article[class^="page-"] a:hover {
  color: #C21230 !important;
}

/* ── Centered content ───────────────────────────── */
.measure-wide { max-width: 48rem !important; }
.mw7          { max-width: 52rem !important; }
.mw8          { max-width: 60rem !important; }
.w-70-ns      { width: 70% !important; }
main, article.cf { max-width: 60rem; margin-left: auto; margin-right: auto; }
body.is-home main { max-width: 90rem; padding-left: 2.5rem; padding-right: 2.5rem; }

/* ── Home two-column layout ─────────────────────── */
.home-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  row-gap: 3.5rem;
  column-gap: 3.5rem;
  max-width: 84rem;
  margin-left: auto;
  margin-right: auto;
  align-items: start;
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}
.home-left { display: contents; }
.home-left article { display: contents; }
.home-left .profile-section-compact {
  grid-column: 1 / -1;
  grid-row: 1;
  margin-bottom: 0;
}
.home-left .tech-tabs-container {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  overflow: visible;
}
.home-right {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.home-right .home-projects-tabs {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-bottom: 0 !important;
}
.home-right .home-projects-tabs > section { margin-top: auto; }

/* Home profile spans full width */
.home-left .profile-section-compact {
  grid-template-columns: 100px 1fr;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}
.home-left .profile-section-compact img       { width: 100px; height: 100px; max-width: 100px; }
.home-left .profile-section-compact > div p   { font-size: 1.1rem; margin: 0.25em 0; }

/* Align tech stack content with first project card */
.home-left .tech-tabs-container .cv-tab-buttons { margin-bottom: 2rem; }
.home-left .cv-tab-btn                        { font-size: 0.8rem !important; padding: 0.2rem 0.5rem !important; }
.home-left .research-category-content        { padding: 0.75rem 1rem; overflow: visible; }
.home-left .tech-subsection                  { margin-bottom: 1rem; }
.home-left .tech-badges                      { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.home-left .tech-badges img                  { margin: 2px 3px 2px 0; flex-shrink: 0; }

/* Align tech stack content box (Frameworks & Tooling, etc.) with first project card (Audio Dataset Manager) */
.home-projects-tabs .section-heading { margin-bottom: 0.5rem; }
.home-projects-tabs .category-separator.cv-tab-buttons { margin-bottom: 1rem; }
.home-left .tech-tabs-container .cv-tab-panels {
  margin-top: 2.80rem; /* matches "Some projects..." + tab buttons height so tech box aligns with project cards */
}

/* Home projects */
.home-projects-tabs .section-heading { font-size: 1.25rem; margin: 0 0 1rem 0; border-bottom: none; }
.home-projects-tabs .cv-tab-btn { font-size: 0.8rem !important; padding: 0.2rem 0.5rem !important; }
.home-projects-tabs .project-card-compact {
  background: #2E3450;
  border: 1px solid rgba(110, 125, 154, 0.18) !important;
  border-radius: 8px;
  margin-top : 0.0008rem;
  padding-left: 0.75rem;
  margin-bottom: 0.5rem;
  box-shadow: none;
  transition: border-color 0.15s;
}
.home-projects-tabs .project-card-compact:hover {
  border-color: rgba(232, 40, 48, 0.45) !important;
}
.home-projects-tabs .project-card-compact:last-child { border-bottom: none; margin-bottom: 0; }

/* Projects page: AI & Tools disclaimer */
.projects-disclaimer {
  background: rgba(110, 125, 154, 0.15);
  border-left: 3px solid #E82830;
  border-radius: 4px;
  color: #6E7D9A;
}

@media (max-width: 1100px) {
  .home-two-column {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .home-left .profile-section-compact { grid-column: 1; grid-row: 1; }
  .home-left .tech-tabs-container { grid-column: 1; grid-row: 2; }
  .home-right { grid-column: 1; grid-row: 3; }
  .home-left .profile-section-compact img { width: 120px; height: 120px; max-width: 120px; }
  .home-left .tech-tabs-container .cv-tab-panels { margin-top: 0; }
}

/* ── Profile ────────────────────────────────────── */
.profile-section {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  align-items: center;
}
.profile-section img {
  border-radius: 50%;
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center top;
  border: 2px solid #E82830;
  display: block;
  margin: 0;
  padding: 0;
}
.profile-section > div { text-align: justify; margin: 0; padding: 0; min-width: 0; }
.profile-section > div > *:first-child { margin-top: 0 !important; padding-top: 0 !important; }
.profile-section-compact { grid-template-columns: 140px 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.profile-section-compact img { width: 140px; height: 140px; max-width: 140px; flex-shrink: 0; }
.profile-section-compact > div p { margin-top: 0.5em; margin-bottom: 0.5em; }

/* ── Tech stack ─────────────────────────────────── */
.tech-stack-section {
  background: #2E3450;
  border: 1px solid rgba(110, 125, 154, 0.18);
  border-radius: 8px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
}
.tech-stack-section h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(110, 125, 154, 0.18);
  font-weight: 700;
}
.tech-category        { margin-bottom: 2rem; }
.tech-category:last-child { margin-bottom: 0; }
.tech-category h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #E8EBF2;
  margin: 0 0 0.75rem 0;
  padding: 0 0 0.35rem 0;
  border-bottom: 2px solid #E82830;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  display: inline-block;
}
.tech-subgroup {
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: rgba(110, 125, 154, 0.12);
  border-radius: 4px;
  border-left: 2px solid rgba(110, 125, 154, 0.35);
}
.tech-subgroup:last-child { margin-bottom: 0; }
.tech-subgroup-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6E7D9A;
  margin-bottom: 0.4rem;
}
.tech-badges { margin: 0 !important; line-height: 1.8; }
.tech-badges img,
.tech-stack-section p img { display: inline-block; margin: 2px 4px 2px 0; vertical-align: middle; }

/* ── Section headings ───────────────────────────── */
.section-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: #E8EBF2;
  border-left: 3px solid #E82830;
  padding-left: 0.75rem;
  border-bottom: none;
  margin: 2rem 0 1.5rem;
}

/* ── Project card text ───────────────────────────── */
article.bb .db.pv4 { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
.project-description, .project-description p,
article.bb .nested-copy-line-height,
article.bb .nested-copy-line-height p,
.nested-copy-line-height.lh-copy,
.nested-copy-line-height.lh-copy p { text-align: justify !important; }
article.bb .nested-copy-line-height p { margin-top: 0.75em; margin-bottom: 0.75em; }
article.bb .nested-copy-line-height p:first-child { margin-top: 0; }
article.bb .nested-copy-line-height p:last-child  { margin-bottom: 0; }

/* ── Research content ────────────────────────────── */
.research-category-content {
  background: #2E3450 !important;
  padding: 1.5rem 2rem;
  border-radius: 8px;
  border: 1px solid rgba(110, 125, 154, 0.18) !important;
}
.research-category-content h3              { margin-top: 1.5rem; margin-bottom: 0.5rem; color: #E8EBF2; line-height: 1.35; text-align: justify; }
.research-category-content h3:first-of-type { margin-top: 0; }
.research-category-content h3 + p         { white-space: nowrap; text-align: left; margin-top: 0.25rem; margin-bottom: 0.75rem; font-size: clamp(0.6rem, 2.8vw, 0.95rem); }
.research-category-content p               { margin-top: 0.5rem; margin-bottom: 1rem; text-align: justify; }
.research-category-content a               { color: #E82830; }
.research-category-content a:hover         { color: #C21230; }

/* ── Page content cards ──────────────────────────── */
article.page-research,
article.page-cv,
article.page-contact,
article[class^="page-"] {
  background: #2E3450 !important;
  border: 1px solid rgba(110, 125, 154, 0.18) !important;
  border-radius: 8px;
  padding: 2rem !important;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

/* ── Category separators ────────────────────────── */
.category-separator {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 2rem;
  width: 100%;
}
.category-separator::before { background: linear-gradient(to right, transparent, rgba(110,125,154,0.30)); }
.category-separator::after  { background: linear-gradient(to left,  transparent, rgba(110,125,154,0.30)); }
.category-separator::before,
.category-separator::after  { content: ""; flex: 1 1 auto; min-width: 0; height: 1px; }
.category-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #E8EBF2;
  white-space: nowrap;
  padding: 0.25rem 0.85rem;
  border: 1px solid rgba(110, 125, 154, 0.30);
  border-radius: 4px;
  background: #2E3450;
}

/* ── Pagination ─────────────────────────────────── */
.ba.b--moon-gray          { border-color: rgba(110,125,154,0.20) !important; }
.hover-bg-moon-gray:hover { background-color: #2E3450 !important; }
.pagination a,
[class*="pagination"] a {
  background-color: #2E3450 !important;
  color: #E82830 !important;
  border: 1px solid rgba(110,125,154,0.20) !important;
  border-radius: 4px;
}
.pagination a:hover,
[class*="pagination"] a:hover {
  border-color: rgba(232,40,48,0.50) !important;
  color: #C21230 !important;
}
.pagination span,
[class*="pagination"] span { color: #6E7D9A !important; }

/* ── Footer ─────────────────────────────────────── */
footer,
footer.bg-dark-red,
footer.bg-red,
footer.bg-gold,
footer.bg-orange {
  background-color: rgba(194, 18, 48, 0.55) !important;
  color: #E8EBF2 !important;
  border-top: none;
}
footer *,
footer a,
footer .link {
  color: #E8EBF2 !important;
}

/* ── Hero ───────────────────────────────────────── */
.bg-black-60 { background-color: rgba(194, 18, 48, 0.55) !important; }
header[style*="background-image"] > div > div { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
header[style*="background-image"] * { color: #E8EBF2 !important; }
header[style*="background-image"] a { color: #E8EBF2 !important; }
header > div[class*="bg-"]          { padding-bottom: 0 !important; }
header > div[class*="bg-"] *        { color: #E8EBF2 !important; }
header > div[class*="bg-"] a        { color: #E8EBF2 !important; }
.pb6-l   { padding-bottom: 0.75rem !important; }
.white-90 { color: #E8EBF2 !important; opacity: 1 !important; }
.white-80 { color: #E8EBF2 !important; opacity: 1 !important; }
header nav a.f3 { display: none !important; }

/* ── CV tabs ────────────────────────────────────── */
.cv-tabs-container { margin-bottom: 2rem; }
.cv-tabs-container .cv-tab-buttons {
  margin-bottom: 2rem;
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;
}
.cv-tabs-container .cv-tab-buttons::before { background: linear-gradient(to right, transparent, rgba(110,125,154,0.30)); }
.cv-tabs-container .cv-tab-buttons::after  { background: linear-gradient(to left,  transparent, rgba(110,125,154,0.30)); }
.cv-tabs-container .cv-tab-buttons::before,
.cv-tabs-container .cv-tab-buttons::after  { content: ""; flex: 1 1 auto; min-width: 0; height: 1px; }
.cv-tab-btn {
  flex-shrink: 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  color: #6E7D9A;
  padding: 0.2rem 0.6rem 0.3rem;
  transition: color 0.15s, border-color 0.15s;
}
.cv-tab-btn:hover  { color: #E8EBF2; }
.cv-tab-btn.active { color: #E8EBF2; border-bottom-color: #E82830; }
.cv-tab-panel        { display: none; }
.cv-tab-panel.active { display: block; }
.cv-tab-content h3   { margin-top: 1.5rem; margin-bottom: 0.5rem; color: #E8EBF2; }
.cv-tab-content h3:first-child { margin-top: 0; }
.cv-pdf-block {
  border-top: 1px solid rgba(110, 125, 154, 0.18);
  margin-top: 2rem;
  padding-top: 2rem;
}
.cv-pdf-block .link  { color: #E82830 !important; }
.cv-pdf-icon         { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.cv-pdf-block .ml2   { margin-left: 0.5rem; }
.cv-pdf-block-header {
  display: flex; align-items: center;
  justify-content: space-between;
  flex-wrap: wrap; gap: 0.5rem;
}
.cv-pdf-toggle {
  background: transparent;
  border: 1px solid rgba(110, 125, 154, 0.30);
  border-radius: 4px;
  color: #E82830;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s;
}
.cv-pdf-toggle:hover { border-color: #E82830; }
.cv-pdf-toggle .cv-pdf-toggle-arrow { margin-left: 0.25rem; }

/* ── Tech subsections ───────────────────────────── */
.tech-tab-content .tech-subsection-title {
  font-size: 1.1rem; font-weight: 600; color: #E8EBF2;
  margin: 1.5rem 0 0.75rem 0;
}
.tech-tab-content .tech-subsection:first-child .tech-subsection-title { margin-top: 0; }
.tech-subsection            { margin-bottom: 1.25rem; }
.tech-subsection:last-child { margin-bottom: 0; }
.tech-badges { margin: 0.5rem 0 0 !important; line-height: 1.8; }
.tech-badges img { display: inline-block; margin: 2px 4px 2px 0; vertical-align: middle; }

/* ── Tab buttons unified ────────────────────────── */
.cv-tabs-container .cv-tab-btn,
.tech-tabs-container .cv-tab-btn,
.projects-tabs-container .cv-tab-btn,
.research-tabs-container .cv-tab-btn {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.75rem 0.3rem;
  white-space: nowrap;
}
.tech-tabs-container { width: 100%; max-width: 100%; }

/* ── Project gallery ────────────────────────────── */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.project-gallery img {
  width: 100%; height: auto;
  border-radius: 6px;
  border: 1px solid rgba(110, 125, 154, 0.18);
  display: block;
}
.project-gallery-lightmanager:not(.project-gallery-2col) {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 420px;
  align-items: stretch;
}
.project-gallery-lightmanager:not(.project-gallery-2col) img {
  width: 100%; height: 100%; object-fit: cover; background: #2E3450;
}
.project-gallery-lightmanager.project-gallery-2col {
  grid-template-columns: repeat(2, 1fr);
  max-width: 560px;
}
.project-gallery-lightmanager.project-gallery-2col img {
  width: 100%; height: auto; object-fit: contain; background: #2E3450;
}
@media (max-width: 640px) {
  .project-gallery-lightmanager                       { grid-template-columns: 1fr; }
  .project-gallery-lightmanager.project-gallery-2col { grid-template-columns: 1fr; max-width: none; }
}

/* ── Mobile ──────────────────────────────────────── */
@media (max-width: 768px) {
  .profile-section { display: block !important; margin-bottom: 1.5rem !important; }
  .profile-section img {
    display: block !important;
    width: 120px !important; height: 120px !important;
    max-width: 120px !important; max-height: 120px !important;
    margin: 0 auto 1rem auto !important;
    object-fit: cover !important; border-radius: 50% !important;
  }
  .profile-section-compact img {
    width: 120px !important; height: 120px !important;
    max-width: 120px !important; max-height: 120px !important;
    border-radius: 50% !important;
  }
  .profile-section > div { display: block !important; width: 100% !important; text-align: justify !important; -webkit-text-align-last: left; text-align-last: left; }
  .tech-stack-section    { padding: 1rem !important; margin-left: -0.5rem !important; margin-right: -0.5rem !important; border-radius: 6px !important; }
  .tech-stack-section h2 { font-size: 1.1rem !important; }
  .tech-category h3      { font-size: 0.8rem !important; }
  .tech-subgroup         { padding: 0.5rem 0.6rem !important; }
  .tech-subgroup-label   { font-size: 0.75rem !important; }
  .tech-badges img, .tech-stack-section p img { margin: 2px 3px 2px 0 !important; }
  .category-label { white-space: normal !important; font-size: 0.95rem !important; }
  .cv-tabs-container .cv-tab-btn,
  .tech-tabs-container .cv-tab-btn,
  .projects-tabs-container .cv-tab-btn,
  .research-tabs-container .cv-tab-btn {
    font-size: clamp(0.6rem, 2.5vw, 0.85rem) !important;
    padding: 0.2rem 0.4rem !important;
    white-space: nowrap !important;
    letter-spacing: 0.05em !important;
  }
  .category-separator.cv-tab-buttons {
    flex-wrap: nowrap !important; gap: 0.4rem !important;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  }
  .category-separator.cv-tab-buttons::-webkit-scrollbar { height: 4px; }
  .cv-tab-btn { -webkit-tap-highlight-color: rgba(232,40,48,0.18); }
  .category-separator:not(.cv-tab-buttons) { flex-wrap: wrap !important; gap: 0.5rem !important; }
  main article.cf { padding-left: 1rem !important; padding-right: 1rem !important; }
}

@media (max-width: 480px) {
  body.is-home main { padding-left: 1rem !important; padding-right: 1rem !important; }
  .home-two-column  { padding-left: 1rem !important; padding-right: 1rem !important; }
  .cv-tabs-container .cv-tab-btn,
  .tech-tabs-container .cv-tab-btn,
  .projects-tabs-container .cv-tab-btn,
  .research-tabs-container .cv-tab-btn { font-size: 0.65rem !important; padding: 0.18rem 0.35rem !important; }
  article.page-research,
  article.page-cv,
  article.page-contact,
  article[class^="page-"] { padding-left: 1rem !important; padding-right: 1rem !important; }
}
