/* =========================================================
   GLOBAL SETTINGS
   ========================================================= */


:root {
  --site-max-width: 1000px;
  --site-padding: 14px;

  --nav-bg: #1a1c2c;
  --nav-text: #ffffff;
  --nav-hover: #bdc3c7;

  --accent: #3498db;
  --heading: #2c3e50;
}

/* =========================================================
   NAVBAR - FINAL FIX
   ========================================================= */

/* The header background */
#quarto-header {
  background-color: var(--nav-bg) !important;
}

/* The navbar - full width, no constraints */
#quarto-header .navbar {
  background-color: var(--nav-bg) !important;
  padding: 0 !important;
}

/* The container inside navbar - constrain and center */
#quarto-header .navbar > .container-fluid,
#quarto-header .navbar > .container {
  width: 100% !important;
  max-width: var(--site-max-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 8px !important;
  padding-right: 8px !important;

  display: flex !important;
  justify-content: space-between !important;
}

/* Navbar text */
#quarto-header .navbar-brand,
#quarto-header .nav-link {
  color: var(--nav-text) !important;
  font-weight: 500;
}

/* Hover */
#quarto-header .nav-link:hover {
  color: var(--nav-hover) !important;
}

/* Better alignment */
#quarto-header .navbar-nav {
  align-items: center !important;
}

#quarto-header .navbar-nav .nav-link {
  padding-top: 14px !important;
  padding-bottom: 14px !important;
}

/* =========================================================
   BODY WIDTH (MAIN CONTENT)
   ========================================================= */

.quarto-container,
#quarto-content,
main.content {
  max-width: var(--site-max-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--site-padding) !important;
  padding-right: var(--site-padding) !important;
}

/* =========================================================
   TITLE + HEADERS
   ========================================================= */

h1.title {
  color: var(--heading) !important;
  font-weight: 800 !important;
  border-bottom: 2px solid var(--accent) !important;
  padding-bottom: 10px;
  margin-top: 40px;
}

h2, h3 {
  color: #34495e;
  font-weight: 600;
}
.horizontal-links a {
  text-decoration: none;
  margin-right: 15px;
}

h2 {
  margin-top: 40px;
  margin-bottom: 14px;

  font-size: 1.5rem;
  font-weight: 700;
  color: var(--heading);

  padding-left: 12px;
  border-left: 4px solid var(--accent);

  border-bottom: none !important;
}

/* =========================================================
   TEXT JUSTIFICATION (FIX)
   ========================================================= */

/* Default body text */
p {
  text-align: justify;
  text-justify: inter-word;
}

/* Lists */
li {
  text-align: justify;
}

/* Prevent weird justification in titles */
h1, h2, h3, h4, h5, h6 {
  text-align: left;
}


@media (max-width: 991px) {
  .navbar-toggler {
    border: 2px solid white !important;
    border-radius: 12px !important;
    padding: 10px 12px !important;
  }

  .navbar-toggler-icon {
    filter: invert(1) !important;
    width: 2rem !important;
    height: 2rem !important;
  }
}

@media (max-width: 991px) {

  /* make the hamburger area more visible */
  .navbar-toggler {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;

    border: 2px solid white !important;
    border-radius: 12px !important;
    padding: 10px 14px !important;
  }

  /* bigger icon */
  .navbar-toggler-icon {
    filter: invert(1) !important;
    width: 2rem !important;
    height: 2rem !important;
  }

  /* add MENU text */
  .navbar-toggler::after {
    content: "Menu";
    color: white;
    font-weight: 600;
    font-size: 1rem;
  }
}

/* =========================
   Homepage quick navigation
   ========================= */

.home-quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 10px 0;
}

.home-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 10px 14px;
  border-radius: 999px;

  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;

  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.9);
  box-shadow: 0 4px 18px rgba(0,0,0,0.05);

  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.home-nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}

.home-nav-btn:active {
  transform: translateY(0px);
}

@media (max-width: 600px) {
  .home-nav-btn {
    flex: 1 1 calc(50% - 10px);
    text-align: center;
  }
}

/* =========================
   Keyword tags (chips)
   ========================= */

.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.keyword-tags .kw {
  display: inline-flex;
  align-items: center;

  padding: 6px 12px;
  border-radius: 999px;

  font-size: 0.95rem;
  font-weight: 600;

  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.home-quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.horizontal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}



/* =========================
   HERO SECTION (Homepage)
   ========================= */

.hero-section {
  padding: 40px 30px;
  border-radius: 18px;

  background: linear-gradient(
    135deg,
    rgba(52, 152, 219, 0.08),
    rgba(155, 89, 182, 0.06)
  );

  margin-top: 20px;
  margin-bottom: 30px;
}

/* Improve spacing inside hero */
.hero-section h2 {
  margin-top: 0;
}

/* Slightly larger intro text */
.hero-section p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #2c3e50;
  max-width: 60ch;
}

.hero-section strong {
  font-weight: 700;
  color: var(--heading);
}

.hero-section h2 {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.25;
}

/* =========================
   SECTION BACKGROUNDS
   ========================= */

.section-soft {
  background: rgba(0, 0, 0, 0.025);
  padding: 30px 25px;
  border-radius: 16px;
  margin: 30px 0;
}

/* =========================
   PROJECT CARDS
   ========================= */

.project-card {
  background: #ffffff;
  padding: 18px 18px;
  border-radius: 14px;

  /* NEW: subtle border */
  border: 1px solid rgba(0,0,0,0.06);

  /* improved shadow */
  box-shadow: 0 8px 22px rgba(0,0,0,0.06);

  transition: transform 0.15s ease, box-shadow 0.15s ease;

  height: 100%;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

/* =========================
   PROJECT GRID (FIX ALIGNMENT)
   ========================= */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

/* Make cards consistent height */
.project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}


/* =========================
   TYPOGRAPHY IMPROVEMENTS
   ========================= */

/* Better paragraph readability */
p {
  line-height: 1.75;
  font-size: 1.03rem;
}

/* Limit line width for readability */
.main-container {
  max-width: var(--site-max-width);
}

/* Headings spacing */
h2 {
  margin-top: 40px;
  margin-bottom: 10px;
}

h3 {
  margin-bottom: 8px;
}

/* Slightly stronger section titles */
.section-soft h2 {
  font-weight: 700;
}

.project-card a {
  font-weight: 600;
  text-decoration: none;
}

.project-card a:hover {
  text-decoration: underline;
}

/* =========================
   HERO BUTTONS
   ========================= */

.hero-buttons {
  margin-top: 15px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

.btn-secondary {
  background: white;
  color: var(--accent);
  border: 1px solid rgba(0,0,0,0.15);
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary:hover {
  background: rgba(0,0,0,0.03);
}

/* ===== SAFE FIX: MOBILE READABILITY ===== */

/* remove ugly justification everywhere */
p {
  text-align: left;
}

/* improve spacing + readability */
@media (max-width: 768px) {

  .main-container {
    padding-left: 12px;
    padding-right: 12px;
  }

  p {
    font-size: 1rem;
    line-height: 1.6;
  }

  h2 {
    font-size: 1.4rem;
  }

}

/* =========================
   HERO SPECIALIZATION
   ========================= */

.hero-section .hero-specialization {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent) !important;
  margin: 8px 0 14px 0;
}

/* ===== FORCE PROJECT GRID ALWAYS 2 COLUMNS ===== */

.section-soft .projects-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 16px;
}

/* prevent parent layout from interfering */
.section-soft {
  display: block !important;
}

.projects-grid > * {
  min-width: 0;
}

@media (max-width: 768px) {
  h2 {
    font-size: 1.35rem;
    padding-left: 10px;
    border-left-width: 3px;
  }
}

/* ===== FIX NAVBAR ALIGNMENT ===== */

#quarto-header .navbar .container-fluid {
  max-width: 960px !important;
  margin-left: auto !important;
  margin-right: auto !important;

  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ===== TRUE NAV ALIGNMENT FIX ===== */

#quarto-header .navbar-nav {
  margin-left: calc((100% - 960px) / 2 + 14px) !important;
}

#quarto-header .navbar .quarto-navbar-tools {
  margin-right: calc((100% - 960px) / 2 + 14px) !important;
}

/* ===== FINAL NAV ALIGN (SIMPLE FIX) ===== */

#quarto-header .navbar .container-fluid {
  max-width: 960px !important;
  margin: 0 auto !important;
  padding-left: 14px !important;
  padding-right: 14px !important;
}