/* Site-specific polish for a consistent portfolio and blog presentation. */
body,
.secondary-font,
#secondary-font {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

.primary-font,
#primary-font,
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  letter-spacing: -0.02em;
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* Imported images have different aspect ratios; crop their cards consistently. */
/* A compact, square-forward visual language inspired by editorial portfolio sites. */
:root {
  --portfolio-radius: 0.3rem;
}

#list-page .card {
  overflow: hidden;
  border-radius: var(--portfolio-radius);
}

#list-page .card > .card-header .card-img-top,
footer .card > .card-header .card-img-top {
  display: block;
  object-fit: cover;
  object-position: center;
}

#projects .card-head {
  height: 220px;
}

#projects .card-head .card-img-top {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

#projects .card .card-body {
  display: flex;
  flex-direction: column;
}

#achievements .certification-card {
  display: flex !important;
  flex-direction: column;
  isolation: isolate;
  overflow: hidden;
}

#achievements .card-head {
  background-color: var(--secondary-color);
  flex: 0 0 215px;
  height: 215px;
  min-height: 215px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0.75rem;
  position: relative;
  z-index: 0;
}

#achievements .card-head .card-img-top {
  display: block;
  height: 100% !important;
  max-height: 100% !important;
  max-width: 100% !important;
  min-height: 0;
  width: 100% !important;
  object-fit: contain;
  position: static !important;
}

#achievements .certification-card .card-body {
  background-color: var(--secondary-color) !important;
  display: block;
  flex: 1 0 auto;
  margin: 0 !important;
  padding: 1.25rem;
  position: relative;
  z-index: 1;
}

#achievements .certification-card .card-title,
#achievements .certification-card .card-text {
  background-color: var(--secondary-color) !important;
}

#achievements .credly-profile-wrapper {
  margin: 1.5rem auto 0;
  max-width: 44rem;
}

#achievements .credly-profile-cta {
  align-items: center;
  background-color: color-mix(in srgb, var(--primary-color) 10%, var(--secondary-color)) !important;
  border: 1px solid var(--primary-color);
  border-radius: var(--portfolio-radius);
  color: var(--text-color) !important;
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  text-align: left;
  text-decoration: none;
}

#achievements .credly-profile-cta:hover,
#achievements .credly-profile-cta:focus {
  border-color: var(--text-link-color);
  color: var(--text-color) !important;
}

#achievements .credly-profile-cta img {
  flex: 0 0 48px;
  height: 48px;
  object-fit: contain;
  width: 48px;
}

#achievements .credly-profile-copy {
  display: grid;
  flex: 1;
  gap: 0.15rem;
}

#achievements .credly-profile-copy span {
  color: var(--text-secondary-color);
  font-size: 0.9rem;
}

#achievements .credly-profile-action {
  color: var(--text-link-color);
  font-weight: 700;
  white-space: nowrap;
}

#achievements .achievement-mark-wrap {
  align-items: center;
  background: color-mix(in srgb, var(--primary-color) 10%, transparent);
  display: flex;
  justify-content: center;
}

#achievements .achievement-mark {
  border: 2px solid var(--primary-color);
  border-radius: var(--portfolio-radius);
  color: var(--primary-color);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 1.1rem 1.35rem;
}

#experience .experience-technologies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

#experience .experience-technologies .badge {
  align-items: center;
  background-color: color-mix(in srgb, var(--primary-color) 11%, var(--secondary-color));
  border: 1px solid color-mix(in srgb, var(--primary-color) 22%, transparent);
  display: inline-flex;
  gap: 0.36rem;
  padding: 0.3rem 0.54rem;
  color: var(--text-secondary-color);
  font-size: 0.84rem;
  font-weight: 500;
}

#experience .experience-technologies .badge img {
  display: block;
  height: 1.05rem;
  object-fit: contain;
  width: 1.05rem;
}

#experience .experience-entry {
  display: flex;
  gap: 1.15rem;
}

#experience .experience-list {
  display: grid;
  gap: 1rem;
}

#experience .experience-card {
  background-color: var(--secondary-color) !important;
  border: 0 !important;
  border-radius: var(--portfolio-radius) !important;
  box-shadow: 0 8px 56px rgb(15 80 100 / 16%);
  padding: 1.5rem;
}

#experience .experience-heading {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

#experience .experience-heading h4 {
  margin-bottom: 0.15rem;
}

#experience .experience-company {
  color: var(--text-link-color) !important;
  font-weight: 600;
}

#experience .experience-meta {
  color: var(--text-secondary-color);
  display: grid;
  font-size: 0.875rem;
  gap: 0.2rem;
  text-align: right;
  white-space: nowrap;
}

#experience .experience-description {
  padding: 0.75rem 0;
}

#experience .experience-description p:last-child {
  margin-bottom: 0;
}

#experience .experience-entry-content {
  min-width: 0;
  width: 100%;
}

#experience .company-logo {
  align-items: center;
  display: flex;
  flex: 0 0 88px;
  justify-content: center;
  min-height: 88px;
}

#experience .company-logo::after {
  display: none;
}

#experience .company-logo img {
  display: block;
  max-height: 68px;
  max-width: 88px;
  object-fit: contain;
}

/* Outtask's official wordmark is white, so give it a stable surface in either theme. */
#experience .company-logo img[src$="outtask.svg"] {
  background: #1f2933;
  padding: 0.55rem;
}

/* Keep the full Eiffel Tower composition visible in the About section. */
#about .image img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center;
  border-radius: 50% !important;
}

/* Keep the technology list familiar, while allowing its columns to adapt. */
#about ul {
  display: grid;
  gap: 0 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  max-width: none;
}

#about ul li {
  background: none;
  border: 0;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
  margin-bottom: 10px;
  padding: 0 0 0 20px;
}

#about ul li::before {
  content: "▹";
}

/* Keep the scroll-up header above content and offset in-page navigation beneath it. */
#profileHeader,
#profileHeader.showHeaderOnTop {
  background-color: var(--background-color) !important;
  isolation: isolate;
  z-index: 1050;
}

#profileHeader .navbar {
  background-color: var(--background-color) !important;
}

/* On mobile, keep the expanded navigation in one stable sticky header. */
@media (max-width: 991.98px) {
  #profileHeader,
  #profileHeader.showHeaderOnTop {
    position: sticky;
    top: 0;
  }

  #profileHeader .navbar-collapse {
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
  }
}

section[id] {
  scroll-margin-top: 5.75rem;
}

/* Keep cards, controls, and the hero portrait deliberately restrained. */
#hero .image img,
#projects .card,
#achievements .card,
#education .card,
#experience .experience-card,
footer .card,
.btn,
.dropdown-menu,
.form-control,
.form-select {
  border-radius: var(--portfolio-radius) !important;
}

#projects .card-head,
#projects .card-head .card-img-top,
#achievements .card-head,
#achievements .card-head .card-img-top,
#list-page .card > .card-header,
#list-page .card > .card-header .card-img-top,
footer .card > .card-header,
footer .card > .card-header .card-img-top {
  border-radius: var(--portfolio-radius) var(--portfolio-radius) 0 0 !important;
}

#experience .experience-technologies .badge {
  border-radius: 0.2rem;
}

#education .education-entry {
  align-items: flex-start;
  display: flex;
  gap: 1.5rem;
}

/* The theme rounds the inner card body independently, which can expose a light seam. */
#education .card {
  background-color: var(--secondary-color) !important;
  border: 0 !important;
  box-shadow: 0 8px 56px rgb(15 80 100 / 16%);
  overflow: hidden;
}

#education .card .card-body {
  background-color: var(--secondary-color) !important;
  border-radius: 0 !important;
}

#education .education-card:hover {
  border: 0 !important;
}

#education .education-logo {
  align-items: center;
  display: flex;
  flex: 0 0 96px;
  justify-content: center;
  min-height: 96px;
}

#education .education-logo::after {
  display: none;
}

#education .education-logo img {
  display: block;
  max-height: 82px;
  max-width: 96px;
  object-fit: contain;
}

#education .education-entry-content {
  min-width: 0;
  width: 100%;
}

#education .education-date {
  float: right;
  margin-left: 1rem;
}

#education .school-link {
  color: var(--text-link-color) !important;
  display: inline-block;
  font-weight: 600;
  text-decoration: none;
}

#education .school-link h6 {
  color: inherit !important;
  margin-bottom: 0.35rem;
}

#education .school-link::after {
  background-color: var(--primary-color);
  content: "";
  display: block;
  height: 2px;
  opacity: 0.5;
  transition: width 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
  width: 0;
}

#education .school-link:hover::after,
#education .school-link:focus::after {
  width: 100%;
}

.footer-extra-social-links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.footer-extra-social-links a {
  align-items: center;
  color: var(--text-link-color) !important;
  display: inline-flex;
  font-size: 1.55rem;
  height: 2.4rem;
  justify-content: center;
  text-decoration: none;
  width: 2.4rem;
}

.footer-extra-social-links a:hover,
.footer-extra-social-links a:focus {
  color: var(--primary-color) !important;
}

.footer-extra-social-links a[aria-label="YouTube"] {
  color: #ff0000 !important;
}

#hero {
  position: relative;
}

.hero-scroll-cue {
  align-items: center;
  animation: hero-scroll-bounce 1.8s ease-in-out infinite;
  color: var(--primary-color) !important;
  display: flex;
  font-size: 2rem;
  height: 2.5rem;
  justify-content: center;
  left: calc(50% - 1.25rem);
  opacity: 0;
  pointer-events: none;
  position: absolute;
  text-decoration: none;
  top: calc(100vh - 4rem);
  transition: opacity 0.25s ease;
  width: 2.5rem;
}

.hero-scroll-cue.is-visible {
  opacity: 1;
  pointer-events: auto;
}

@keyframes hero-scroll-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(0.45rem); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-scroll-cue { animation: none; }
}

/* Keep the primary hero action and its icon actions aligned on one shared control size. */
#hero .image img {
  aspect-ratio: 1;
  border-radius: 50% !important;
  object-fit: cover;
}

#hero a.btn,
#hero a.btn.social-icon {
  align-items: center;
  box-sizing: border-box;
  display: inline-flex;
  height: 44px;
  margin-top: 50px;
}

#hero a.btn:not(.social-icon) {
  padding: 0 1rem;
}

#hero a.btn.social-icon {
  justify-content: center;
  padding: 0;
  width: 44px;
}

#list-page .card > .card-header .card-img-top,
footer .card > .card-header .card-img-top {
  height: 250px !important;
  object-fit: cover !important;
}

@media (max-width: 575.98px) {
  #experience .experience-entry,
  #education .education-entry {
    flex-direction: column;
    gap: 0.75rem;
  }

  #experience .experience-card {
    padding: 1.1rem;
  }

  #experience .experience-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
  }

  #experience .experience-meta {
    text-align: left;
    white-space: normal;
  }

  #achievements .credly-profile-cta {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  #achievements .credly-profile-action {
    margin-left: 64px;
  }

  #experience .company-logo,
  #education .education-logo {
    flex-basis: auto;
    justify-content: flex-start;
    min-height: auto;
  }

  #education .education-date {
    float: none;
    margin-left: 0;
  }
}
