:root {
  --page-bg: #0b1a24;
  --page-bg-soft: #122636;
  --text: #f1ede5;
  --muted: #c6d0d5;
  --accent: #80c6d8;
  --line: rgba(128, 198, 216, 0.55);
  --border: rgba(241, 237, 229, 0.13);
  --max-width: 1500px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
}

body {
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

#quarto-content {
  max-width: none;
  margin: 0;
  padding: 0;
}

#title-block-header { display: none; }

main#quarto-document-content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* =========================================================
   NAVIGATION / DESKTOP
   ========================================================= */

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 118px;
  padding: 0;
  overflow: visible;
  background: rgba(7, 18, 27, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar .container-fluid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 150px 1fr;
  grid-template-rows: 38px 50px;
  align-items: center;
  position: relative;
  overflow: visible;
}

.navbar-brand {
  grid-column: 1;
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 8px 20px 8px 0;
  white-space: nowrap;
  overflow: visible !important;
  flex-shrink: 0;
  color: var(--text) !important;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.navbar-brand .navbar-title,
.navbar-brand span {
  display: none !important;
}

.navbar-brand img {
  height: 100px !important;
  width: auto !important;
  max-height: none !important;
  object-fit: contain;
  transform: translateY(27px);
}

.navbar .container-fluid::before {
  content: "VECCHIONI LAB";
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  padding-left: 0.7rem;
  padding-bottom: 2px;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.navbar-collapse {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  align-self: center;
  padding-right: 4rem;
}

.navbar-nav .nav-link {
  color: var(--text) !important;
  white-space: nowrap;
  padding-left: 0.7rem !important;
  padding-right: 0.7rem !important;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.navbar-nav .nav-link:hover {
  color: var(--accent) !important;
}

.navbar .aa-DetachedSearchButton {
  position: absolute !important;
  right: 1.5rem;
  top: 45px;
  margin: 0 !important;
  z-index: 10;
}

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

.concept-hero {
  position: relative;
  width: 100vw;
  max-width: none;
  min-height: 740px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  overflow: hidden;
  isolation: isolate;
  background: #071722;
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: -3;
  background-image: url("../images/hero3.jpg");
  background-size: cover;
  background-position: 68% center;
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg,
      rgba(4, 18, 28, 0.99) 0%,
      rgba(4, 18, 28, 0.95) 24%,
      rgba(4, 18, 28, 0.72) 42%,
      rgba(4, 18, 28, 0.16) 63%,
      rgba(4, 18, 28, 0.02) 100%),
    linear-gradient(180deg,
      rgba(3, 14, 23, 0.18) 0%,
      rgba(3, 14, 23, 0.02) 65%,
      rgba(3, 14, 23, 0.22) 100%);
}

.concept-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 110px;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    rgba(18, 38, 54, 0) 0%,
    rgba(18, 38, 54, 0.10) 75%,
    rgba(18, 38, 54, 0.28) 100%
  );
}

.hero-content {
  max-width: var(--max-width);
  min-height: 740px;
  margin: 0 auto;
  padding: 3.8rem 4rem 6rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

.hero-eyebrow,
.section-eyebrow {
  margin: 0 0 2rem;
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.concept-hero h1 {
  max-width: 660px;
  margin: 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.5rem, 5.5vw, 6rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero-rule {
  width: 66px;
  height: 1px;
  margin: 2rem 0 1.7rem;
  background: var(--accent);
}

.hero-content > p:not(.hero-eyebrow) {
  max-width: 590px;
  margin: 0;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.75;
}

.hero-button {
  display: inline-block;
  margin-top: 2.2rem;
  padding: 0 0 0.25rem;
  border: none;
  border-bottom: 1px solid rgba(128, 198, 216, 0.65);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.84rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-button:hover {
  color: var(--text);
  background: transparent;
  border-bottom-color: var(--text);
}

/* =========================================================
   HOMEPAGE RESEARCH INTRO
   ========================================================= */

.research-opening {
  padding: 1.2rem 2rem 2rem;
  text-align: center;
  background: linear-gradient(180deg, #112536 0%, #102332 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.research-opening .section-eyebrow {
  margin-bottom: 1rem;
}

.research-opening h2 {
  max-width: 1080px;
  margin: 0 auto;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 4vw, 4rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

/* =========================================================
   RESEARCH PANELS
   ========================================================= */

.research-panel {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 3rem;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 6rem 2rem;
  border-top: 1px solid var(--border);
}

.research-panel-text {
  max-width: 520px;
}

.panel-number {
  margin-bottom: 0.8rem;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.research-panel h2 {
  margin: 0 0 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.4rem;
  font-weight: 400;
}

.research-panel-text p {
  color: var(--muted);
  text-align: justify;
}

.research-panel-image img {
  display: block;
  width: 100%;
  height: auto;
}

.research-panel-image .panel-caption {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.78rem !important;
  font-weight: 400;
  line-height: 1.4 !important;
  text-align: justify;
}

.panel-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(128, 198, 216, 0.4);
}

.research-panel:nth-of-type(even) .research-panel-text {
  order: 2;
}

.research-panel:nth-of-type(even) .research-panel-image {
  order: 1;
}

.research-panel-vision {
  background: rgba(128, 198, 216, 0.035);
}

/* =========================================================
   LEGACY RESEARCH STRIP
   ========================================================= */

.research-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem 5rem;
  background: var(--page-bg-soft);
}

.research-item {
  padding: 2.3rem;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.research-item:first-child {
  border-left: 1px solid var(--border);
}

.research-item h3 {
  margin-top: 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  font-weight: 400;
}

.research-item p { color: var(--muted); }
.research-item a { color: var(--accent); }

/* =========================================================
   PUBLICATIONS / RESEARCH PAGES
   ========================================================= */

.publication {
  margin: 0 0 1.6rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.pub-me {
  color: var(--accent);
  font-weight: 600;
}

.pub-meta {
  display: block;
  margin-top: 0.15rem;
  color: var(--text);
}

.pub-title {
  display: block;
  margin-top: 0.1rem;
  color: var(--muted);
}

.pub-journal {
  color: #8fc9a3;
  font-weight: 600;
}

.pub-meta strong {
  color: var(--text);
  font-weight: 700;
}

.secondary-image {
  width: 50%;
  margin: 3rem auto;
}

/* =========================================================
   FOOTER
   ========================================================= */

.page-footer {
  background: #071722;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* =========================================================
   COLLAPSED / TABLET HEADER
   ========================================================= */

@media (max-width: 1199.98px) {
  .navbar {
    height: 74px;
    min-height: 74px;
    padding: 0;
  }

  .navbar .container-fluid {
    display: block !important;
    position: relative !important;
    width: 100%;
    max-width: none;
    height: 74px;
    min-height: 74px;
    margin: 0;
  }

  .navbar .container-fluid::before {
    content: "VECCHIONI LAB" !important;
    display: block !important;
    position: absolute;
    left: 5.6rem;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    padding: 0;
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.15rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }

  .navbar-brand {
    position: absolute !important;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    display: block !important;
    width: 54px;
    height: 54px;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    overflow: hidden !important;
    background: url("../images/Logos/LogoC_transparent.png") center / contain no-repeat;
  }

  .navbar-brand > *,
  .navbar-brand img {
    display: none !important;
  }

  .navbar-brand::after {
    content: none !important;
    display: none !important;
  }

  .navbar-toggler {
    position: absolute !important;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 !important;
    padding: 0.4rem;
  }

  .aa-DetachedSearchButton {
    display: none !important;
  }

  .navbar-collapse {
    position: absolute !important;
    top: 74px;
    left: 0;
    right: 0;
    width: 100%;
    padding: 1rem 1.5rem 1.5rem;
    background: rgba(7, 18, 27, 0.98);
    z-index: 1000;
  }
}

/* =========================================================
   SMALL SCREEN CONTENT
   ========================================================= */

@media (max-width: 900px) {
  .concept-hero,
  .hero-content {
    min-height: 680px;
  }

  .hero-content {
    padding: 7rem 1.4rem 4rem;
  }

  .hero-image {
    background-position: 72% center;
  }

  .hero-shade {
    background:
      linear-gradient(90deg,
        rgba(4, 18, 28, 0.98) 0%,
        rgba(4, 18, 28, 0.88) 52%,
        rgba(4, 18, 28, 0.32) 100%);
  }

  .concept-hero h1 {
    max-width: 540px;
    font-size: clamp(3rem, 13vw, 4.8rem);
  }

  .research-strip {
    grid-template-columns: 1fr;
    padding: 0 1.2rem 3rem;
  }

  .research-item,
  .research-item:first-child {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  .research-panel {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 4rem 1.4rem;
  }

  .research-panel-text,
  .research-panel-image {
    order: initial !important;
    max-width: none;
  }

  .secondary-image {
    width: 100%;
  }
}

/* =========================================================
   INTERNAL RESEARCH PAGES
   ========================================================= */

.research-page-hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4.5rem 2rem 3rem;
}

.research-page-hero .page-eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.research-page-hero h1 {
  max-width: 900px;
  margin: 0 0 1.5rem;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.2rem, 5vw, 5.5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.035em;
}

.research-page-hero p:not(.page-eyebrow) {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.7;
}

.publications-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

.publication-key {
  margin: 0 0 3rem;
  color: var(--muted);
  font-size: 0.82rem;
}

/* =========================================================
   PEOPLE
   ========================================================= */

.pi-profile {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 4rem;
  align-items: start;

  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 2rem 7rem;
}

.pi-profile-image {
  min-height: 420px;
  border-top: 1px solid var(--border);
}

.pi-profile-text {
  max-width: 650px;
}

.pi-profile-text h2 {
  margin: 0 0 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 400;
}

.pi-profile-text p {
  color: var(--muted);
  text-align: justify;
}

.pi-profile-text a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(128, 198, 216, 0.4);
}

@media (max-width: 900px) {
  .pi-profile {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1rem 1.4rem 5rem;
  }
}

/* =========================================================
   CONTACT
   ========================================================= */

.contact-page {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 5rem;

  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 2rem 7rem;

  border-top: 1px solid var(--border);
}

.contact-block,
.contact-note {
  padding-top: 2.5rem;
}

.contact-page h2 {
  margin: 0 0 1.2rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 400;
}

.contact-page p {
  color: var(--muted);
}

.contact-email {
  display: inline-block;
  margin-top: 1.2rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(128, 198, 216, 0.4);
}

@media (max-width: 900px) {
  .contact-page {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem 1.4rem 5rem;
  }
}

/* =========================================================
   RESOURCES
   ========================================================= */

.resources-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 2rem 7rem;
}

.resources-page > h2 {
  margin: 4rem 0 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);

  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 400;
}

.resource-item {
  padding: 1.8rem 0 2rem;
  border-bottom: 1px solid var(--border);
}

.resource-item h3 {
  margin: 0 0 0.6rem;

  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 400;
}

.resource-item p {
  max-width: 760px;
  margin-bottom: 0.7rem;
  color: var(--muted);
}

.resource-meta {
  display: block;
  margin: 0.4rem 0 0.8rem;

  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.resource-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(128, 198, 216, 0.4);
}

.resource-link:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}

@media (max-width: 900px) {
  .resources-page {
    padding: 1rem 1.4rem 5rem;
  }
}