:root {
  --ks-navy: #17324d;
  --ks-navy-light: #234863;
  --ks-teal: #2f7173;
  --ks-teal-dark: #255b5d;
  --ks-cream: #f7f5f0;
  --ks-light: #eef3f3;
  --ks-text: #24313a;
  --ks-muted: #5f6d75;
  --ks-border: #dfe6e7;
  --ks-white: #ffffff;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--ks-text);
  font-size: 1.03rem;
  line-height: 1.7;
}

h1, h2, h3, h4 {
  color: var(--ks-navy);
  font-weight: 700;
}

a {
  color: var(--ks-teal-dark);
}

a:hover {
  color: var(--ks-navy);
}

/* Navigation */

.navbar {
  padding-top: 0.8rem !important;
  padding-bottom: 0.8rem !important;
  background-color: #ffffff !important;
  border-bottom: 1px solid var(--ks-border);
  box-shadow: 0 2px 12px rgba(23, 50, 77, 0.05);
}

.navbar-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-right: 2rem;
  color: var(--ks-navy) !important;
  font-size: 1.34rem;
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.navbar-brand::after {
  display: block;
  margin-top: 0.32rem;
  color: var(--ks-teal-dark);
  font-size: 0.61rem;
  font-weight: 750;
  letter-spacing: 0.17em;
  line-height: 1;
  content: "ACADEMIC RESEARCHER";
}

.navbar-nav {
  gap: 0.15rem;
}

.navbar-nav .nav-link {
  padding: 0.62rem 0.82rem !important;
  color: var(--ks-text) !important;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
}

.navbar-nav .nav-link:hover {
  color: var(--ks-teal-dark) !important;
  background: rgba(47, 113, 115, 0.08);
}

.navbar-nav .nav-link.active {
  color: var(--ks-navy) !important;
  background: rgba(47, 113, 115, 0.13);
}

/* Shared containers */

.home-container {
  width: min(1180px, calc(100% - 3rem));
  margin: 0 auto;
}

.contact-container {
  width: min(960px, calc(100% - 3rem));
  margin: 0 auto;
}

/* Home hero */

.hero-section {
  margin-top: -1rem;
  padding: 5.5rem 0;
  background:
    radial-gradient(circle at 85% 20%, rgba(47, 113, 115, 0.14), transparent 32%),
    linear-gradient(135deg, var(--ks-cream), #ffffff);
  border-bottom: 1px solid var(--ks-border);
}

.hero-section h1 {
  max-width: 760px;
  margin-top: 0.7rem;
  margin-bottom: 1.4rem;
  font-size: clamp(2.6rem, 5vw, 4.5rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.hero-section p:not(.eyebrow) {
  max-width: 720px;
  color: var(--ks-muted);
  font-size: 1.18rem;
}

.eyebrow {
  margin-bottom: 0;
  color: var(--ks-teal-dark);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.17em;
}

.hero-photo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-photo .quarto-figure {
  margin: 0;
}

.home-profile {
  width: min(330px, 80vw);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 9px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 22px 55px rgba(23, 50, 77, 0.18);
}

/* Buttons */

.btn {
  margin-top: 0.8rem;
  margin-right: 0.6rem;
  padding: 0.75rem 1.3rem;
  border-radius: 999px;
  font-weight: 650;
}

.btn-primary {
  background-color: var(--ks-teal);
  border-color: var(--ks-teal);
}

.btn-primary:hover {
  background-color: var(--ks-teal-dark);
  border-color: var(--ks-teal-dark);
}

.btn-outline-primary {
  color: var(--ks-navy);
  border-color: var(--ks-navy);
}

.btn-outline-primary:hover {
  color: #ffffff;
  background-color: var(--ks-navy);
  border-color: var(--ks-navy);
}

/* Home section headings */

.section-heading {
  margin-top: 5rem;
  margin-bottom: 0.8rem;
  font-size: clamp(2rem, 3vw, 2.7rem);
  letter-spacing: -0.02em;
}

.section-heading::after {
  display: block;
  width: 65px;
  height: 4px;
  margin-top: 0.65rem;
  background: var(--ks-teal);
  border-radius: 4px;
  content: "";
}

.section-intro {
  max-width: 760px;
  margin-bottom: 2rem;
  color: var(--ks-muted);
  font-size: 1.08rem;
}

/* Research Explained */

.explained-feature {
  display: grid;
  grid-template-columns: minmax(420px, 1.12fr) minmax(390px, 0.88fr);
  min-height: 430px;
  margin-top: 2.2rem;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--ks-border);
  border-radius: 26px;
  box-shadow: 0 16px 45px rgba(23, 50, 77, 0.09);
}

.explained-visual {
  position: relative;
  min-height: 430px;
  padding: 2rem;
  overflow: hidden;
  isolation: isolate;
}

.visual-dementia {
  background: linear-gradient(145deg, rgba(23, 50, 77, 0.98), rgba(47, 113, 115, 0.92));
}

.visual-sport {
  background: linear-gradient(145deg, #8c493a, #d18a65);
}

.visual-participation {
  background: linear-gradient(145deg, #425d47, #7e9878);
}

.visual-label {
  position: relative;
  z-index: 3;
  display: inline-block;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.visual-keyword {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  z-index: 3;
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 3.8rem);
  font-weight: 750;
  letter-spacing: -0.04em;
}

.visual-circle {
  position: absolute;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
}

.visual-circle-one {
  top: 70px;
  right: -40px;
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, 0.08);
}

.visual-circle-two {
  top: 130px;
  right: 105px;
  width: 95px;
  height: 95px;
  background: rgba(255, 255, 255, 0.12);
}

.visual-circle-three {
  right: -30px;
  bottom: -40px;
  width: 160px;
  height: 160px;
  background: rgba(255, 255, 255, 0.1);
}

.visual-circle-four {
  top: 55px;
  right: 25px;
  width: 125px;
  height: 125px;
  background: rgba(255, 255, 255, 0.1);
}

.visual-line {
  position: absolute;
  z-index: 2;
  display: block;
  height: 2px;
  background: rgba(255, 255, 255, 0.45);
  transform-origin: left center;
}

.visual-line-one {
  top: 110px;
  left: 70px;
  width: 190px;
  transform: rotate(25deg);
}

.visual-line-two {
  top: 120px;
  left: 30px;
  width: 180px;
  transform: rotate(-25deg);
}

.visual-line-three {
  bottom: 65px;
  left: 50px;
  width: 180px;
  transform: rotate(15deg);
}

.explained-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3.5rem;
}

.audience-tag {
  display: inline-block;
  width: fit-content;
  margin-bottom: 1rem;
  padding: 0.42rem 0.7rem;
  color: var(--ks-teal-dark);
  background: var(--ks-light);
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  line-height: 1.35;
}

.explained-copy h3 {
  max-width: 680px;
  margin: 0 0 1.6rem;
  font-size: clamp(2rem, 3.2vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.explained-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.45rem;
  color: var(--ks-teal-dark);
  font-weight: 700;
  text-decoration: none;
}

.explained-link:hover {
  color: var(--ks-navy);
  text-decoration: none;
}

.explained-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.explained-mini-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.1fr);
  min-height: 285px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--ks-border);
  border-radius: 22px;
  box-shadow: 0 10px 32px rgba(23, 50, 77, 0.07);
}

.explained-mini-card:hover {
  box-shadow: 0 17px 38px rgba(23, 50, 77, 0.12);
  transform: translateY(-5px);
}

.mini-visual {
  position: relative;
  min-height: 285px;
  padding: 1.5rem;
  overflow: hidden;
  isolation: isolate;
}

.mini-keyword {
  position: absolute;
  bottom: 1.4rem;
  left: 1.5rem;
  z-index: 3;
  color: #ffffff;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  font-weight: 750;
  letter-spacing: -0.035em;
}

.mini-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.2rem;
}

.mini-copy h3 {
  margin-top: 0;
  margin-bottom: 1.4rem;
  font-size: 1.55rem;
  line-height: 1.25;
}

.research-more {
  margin-top: 1.7rem;
  text-align: center;
}

/* Blog cards */

#latest-posts {
  margin-top: 1.5rem;
}

#latest-posts .card,
.quarto-listing-container-grid .card {
  height: 100%;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--ks-border);
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(23, 50, 77, 0.06);
}

#latest-posts .card:hover,
.quarto-listing-container-grid .card:hover {
  box-shadow: 0 16px 36px rgba(23, 50, 77, 0.11);
  transform: translateY(-5px);
}

#latest-posts .card-img-top,
.quarto-listing-container-grid .card-img-top {
  height: 220px;
  object-fit: cover;
}

#latest-posts .card-title,
.quarto-listing-container-grid .card-title {
  color: var(--ks-navy);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
}

.blog-more {
  margin-top: 1.5rem;
  text-align: center;
}

/* Collaboration block */

.home-cta {
  margin: 5rem 0 3rem;
  padding: 3.2rem;
  color: #ffffff;
  background: linear-gradient(120deg, rgba(47, 113, 115, 0.96), rgba(23, 50, 77, 0.98));
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(23, 50, 77, 0.18);
}

.home-cta h2 {
  margin-top: 0;
  color: #ffffff;
}

.home-cta p {
  max-width: 820px;
  color: rgba(255, 255, 255, 0.9);
}

.home-cta .btn-light {
  color: var(--ks-navy);
  background: #ffffff;
  border-color: #ffffff;
}

/* Contact page */

.contact-hero {
  margin-top: -1rem;
  padding: 4.5rem 0 4rem;
  background:
    radial-gradient(circle at 85% 15%, rgba(47, 113, 115, 0.18), transparent 30%),
    linear-gradient(135deg, #f7f5f0, #ffffff);
  border-bottom: 1px solid #dfe6e7;
}

.contact-hero h1 {
  margin: 0 0 1rem;
  color: #17324d;
  font-size: clamp(2.6rem, 6vw, 4.7rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.contact-hero-text {
  max-width: 730px;
  margin: 0;
  color: #5f6d75;
  font-size: 1.15rem;
  line-height: 1.7;
}

.contact-form-section {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 4rem 0 1rem;
}

.contact-form-heading {
  margin-bottom: 1.6rem;
  text-align: center;
}

.contact-kicker {
  display: inline-block;
  margin-bottom: 0.7rem;
  color: #255b5d;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.contact-form-heading h2 {
  margin: 0 0 0.7rem;
  color: #17324d;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.15;
}

.contact-form-heading p {
  max-width: 650px;
  margin: 0 auto;
  color: #5f6d75;
}

.contact-form-card {
  padding: 2.5rem;
  background: #ffffff;
  border: 1px solid #dfe6e7;
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(23, 50, 77, 0.11);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.contact-field {
  display: flex;
  flex-direction: column;
}

.contact-field label {
  margin-bottom: 0.45rem;
  color: #17324d;
  font-size: 0.9rem;
  font-weight: 700;
}

.contact-field input,
.contact-field select,
.contact-field textarea {
  width: 100%;
  padding: 0.82rem 0.95rem;
  color: #24313a;
  background: #fbfcfc;
  border: 1px solid #cfd9db;
  border-radius: 10px;
  font: inherit;
  line-height: 1.45;
}

.contact-field textarea {
  min-height: 170px;
  resize: vertical;
}

.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
  outline: none;
  background: #ffffff;
  border-color: #2f7173;
  box-shadow: 0 0 0 4px rgba(47, 113, 115, 0.14);
}

.contact-field-hint {
  margin-top: 0.35rem;
  color: #5f6d75;
  font-size: 0.78rem;
}

.contact-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.contact-submit {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.45rem;
  color: #ffffff;
  background: #2f7173;
  border: 1px solid #2f7173;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.contact-submit:hover {
  background: #255b5d;
  border-color: #255b5d;
}

.contact-privacy {
  margin: 0;
  color: #5f6d75;
  font-size: 0.78rem;
  line-height: 1.55;
}

/* Academic profiles */

.profile-showcase {
  width: min(820px, 100%);
  margin: 3rem auto 1rem;
  padding: 2rem;
  color: #ffffff;
  background: linear-gradient(125deg, #17324d 0%, #24535f 55%, #2f7173 100%);
  border-radius: 20px;
  box-shadow: 0 18px 45px rgba(23, 50, 77, 0.18);
}

.profile-showcase-heading {
  max-width: 620px;
  margin-bottom: 1.4rem;
}

.profile-kicker {
  display: inline-block;
  margin-bottom: 0.55rem;
  color: #bfe1df;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.profile-showcase-heading h2 {
  margin: 0 0 0.55rem;
  color: #ffffff;
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  line-height: 1.1;
}

.profile-showcase-heading p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
}

.profile-link-grid {
  display: grid;
  gap: 0.7rem;
}

.profile-link {
  display: grid;
  grid-template-columns: 46px 1fr 28px;
  min-height: 76px;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1.1rem;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  text-decoration: none !important;
  clip-path: none !important;
}

.profile-link:hover {
  color: #ffffff !important;
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.profile-orcid {
  background: linear-gradient(110deg, #6d9929, #40783d);
}

.profile-scholar {
  background: linear-gradient(110deg, #3f65b8, #354b89);
}

.profile-linkedin {
  background: linear-gradient(110deg, #14679e, #104c79);
}

.profile-index {
  display: flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
}

.profile-link-content {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.profile-platform {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.profile-link-content strong {
  color: #ffffff;
  font-size: 1rem;
  line-height: 1.25;
}

.profile-arrow {
  justify-self: end;
  color: #ffffff;
  font-size: 1.15rem;
}

/* Footer */

.nav-footer {
  margin-top: 5rem;
  padding-top: 1.7rem;
  padding-bottom: 1.7rem;
  color: rgba(255, 255, 255, 0.88);
  background: var(--ks-navy);
  border-top: none;
  font-size: 0.9rem;
}

.nav-footer a {
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}

.nav-footer a:hover {
  color: #c8e1df;
  text-decoration: underline;
}

.nav-footer-center {
  color: rgba(255, 255, 255, 0.72);
}

/* Responsive */

@media (max-width: 1100px) {
  .navbar-brand {
    margin-right: 1rem;
    font-size: 1.16rem;
  }

  .navbar-nav .nav-link {
    padding-right: 0.62rem !important;
    padding-left: 0.62rem !important;
    font-size: 0.94rem;
  }

  .explained-feature {
    grid-template-columns: 1fr;
  }

  .explained-feature .explained-visual {
    min-height: 330px;
  }

  .explained-mini-card {
    grid-template-columns: 1fr;
  }

  .explained-mini-card .mini-visual {
    min-height: 230px;
  }
}

@media (max-width: 900px) {
  .hero-section {
    padding: 4rem 0;
    text-align: center;
  }

  .hero-section h1,
  .hero-section p {
    margin-right: auto;
    margin-left: auto;
  }

  .hero-photo {
    margin-top: 2.8rem;
  }

  .home-profile {
    width: min(280px, 75vw);
  }

  .section-heading,
  .section-intro {
    text-align: center;
  }

  .section-heading::after {
    margin-right: auto;
    margin-left: auto;
  }

  .explained-mini-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .navbar-brand {
    font-size: 1.08rem;
  }

  .navbar-brand::after {
    font-size: 0.52rem;
  }

  .explained-copy {
    padding: 1.8rem;
  }

  .explained-copy h3 {
    font-size: 1.8rem;
  }

  .contact-form-section {
    padding-top: 3rem;
  }

  .contact-form-card {
    padding: 1.35rem;
  }

  .contact-form-row {
    grid-template-columns: 1fr;
  }

  .contact-submit {
    width: 100%;
  }

  .profile-showcase {
    padding: 1.4rem 1rem;
  }

  .profile-link {
    grid-template-columns: 40px 1fr 24px;
    min-height: 70px;
    padding: 0.8rem 0.9rem;
  }

  .nav-footer {
    text-align: center;
  }

  .nav-footer-left,
  .nav-footer-center,
  .nav-footer-right {
    margin-bottom: 0.65rem;
  }
}

@media (max-width: 600px) {
  .home-container,
  .contact-container {
    width: min(100% - 2rem, 1180px);
  }

  .hero-section h1 {
    font-size: 2.45rem;
  }

  .home-cta {
    padding: 2rem;
    text-align: center;
  }

  .btn {
    display: block;
    width: 100%;
    margin-right: 0;
  }

  .explained-feature {
    border-radius: 20px;
  }

  .explained-visual {
    min-height: 230px;
    padding: 1.4rem;
  }

  .visual-keyword {
    bottom: 1.4rem;
    left: 1.4rem;
    font-size: 2.2rem;
  }

  .mini-copy {
    padding: 1.5rem;
  }

  .contact-hero {
    padding: 3.5rem 0 3rem;
  }

  .contact-hero h1 {
    font-size: 2.7rem;
  }
}

/* =========================================================
   AUTOMATIC LATEST RESEARCH EXPLAINED CARDS
   ========================================================= */

.home-research-feature,
.explained-mini-card {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.home-research-visual-link {
  display: block;
  min-width: 0;
  color: inherit;
  text-decoration: none !important;
}

.home-research-image-wrap {
  position: relative;
  isolation: isolate;
}

.home-research-image-wrap::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      180deg,
      rgba(16, 36, 50, 0.12) 0%,
      rgba(16, 36, 50, 0.02) 42%,
      rgba(16, 36, 50, 0.78) 100%
    );
  content: "";
  pointer-events: none;
}

.home-research-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.home-research-visual-link:hover .home-research-image {
  transform: scale(1.035);
}

.home-research-image-wrap .visual-label,
.home-research-image-wrap .visual-keyword,
.home-research-image-wrap .mini-keyword {
  z-index: 2;
}

.home-theme-teal {
  background: linear-gradient(145deg, #17324d, #2f7173);
}

.home-theme-navy {
  background: linear-gradient(145deg, #102a42, #24535f);
}

.home-theme-terracotta {
  background: linear-gradient(145deg, #8c493a, #d18a65);
}

.home-theme-green {
  background: linear-gradient(145deg, #425d47, #7e9878);
}

@media (max-width: 1100px) {
  .home-research-visual-link {
    min-height: 330px;
  }

  .explained-mini-card .home-research-visual-link {
    min-height: 230px;
  }
}

@media (max-width: 600px) {
  .home-research-visual-link {
    min-height: 230px;
  }
}
