/* =========================================================
   FONTS
   ========================================================= */

@import url(
  'https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Inter:wght@400;500;600;700&display=swap'
);


/* =========================================================
   GLOBAL VARIABLES
   ========================================================= */

:root {
  --ink: #102c3a;
  --cream: #f7f3eb;
  --paper: #fffdf8;
  --rust: #bd4b35;
  --muted: #5e686c;
  --line: #d9d4ca;
  --max: 1180px;
}


/* =========================================================
   BASE STYLES
   ========================================================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: #17252d;
  font-family: Inter, Arial, sans-serif;
  line-height: 1.55;
}


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

.navbar {
  background: rgba(255, 253, 248, 0.97);
  border-bottom: 1px solid var(--line);
  padding: 0.55rem max(1.25rem, calc((100vw - var(--max)) / 2));
}

.navbar-brand img {
  height: 80px;
  max-height: 80px;
  width: auto;
}

.navbar-nav .nav-link {
  font-size: 0.92rem;
  margin: 0 0.35rem;
  color: #17252d;
}

.navbar-nav .nav-link:hover {
  color: var(--rust);
}


/* =========================================================
   MAIN CONTENT
   ========================================================= */

main.content {
  padding: 0 !important;
  max-width: none !important;
}


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

.hero {
  min-height: 300px;

  background-image:
    linear-gradient(
      90deg,
      rgba(7, 20, 27, 0.9),
      rgba(7, 20, 27, 0.35)
    ),
    url("images/hero-image.jpg");

  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;

  color: white;
}

.hero-shade {
  max-width: var(--max);
  margin: auto;
  min-height: 300px;

  display: grid;
  grid-template-columns: 1.35fr 0.75fr;
  gap: 5rem;
  align-items: center;

  padding: 2rem 1.5rem;
}

.hero h2 {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 1.06;
  margin: 0;
}

.hero-copy > p {
  max-width: 650px;
  font-size: 1rem;
  margin: 1.6rem 0;
}


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

.hero-card {
  background: rgba(9, 35, 46, 0.88);
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.hero-card strong {
  display: block;
  margin-top: 0.65rem;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}


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

.btn {
  display: inline-block;
  text-decoration: none !important;

  padding: 0.78rem 1.15rem;
  margin: 0.25rem 0.55rem 0.25rem 0;

  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;

  border-radius: 4px;
}

.btn-primary {
  background: var(--rust);
  color: white !important;
  border: 1px solid var(--rust);
}

.btn-outline {
  border: 1px solid white;
  color: white !important;
}


/* =========================================================
   SHARED PAGE WIDTH
   ========================================================= */

.three-up,
.feature-grid,
.work-grid,
.closing-band {
  max-width: var(--max);
  margin: auto;

  padding-left: 1.5rem;
  padding-right: 1.5rem;
}


/* =========================================================
   THREE-PILLAR SECTION
   ========================================================= */

.three-up {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;

  padding-top: 2.6rem;
  padding-bottom: 2.6rem;
}

.pillar {
  padding: 0 2rem;
  border-right: 1px solid var(--line);
}

.pillar:first-child {
  padding-left: 0;
}

.pillar:last-child {
  border-right: 0;
}

.pillar h2,
.feature-copy h2,
.section-title,
.closing-band h2 {
  font-family: 'Libre Baskerville', Georgia, serif;
  color: var(--ink);
}

.pillar h2 {
  margin: 0.35rem 0 0.1rem;
}

.pillar strong {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.round-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;

  display: grid;
  place-items: center;

  background: #e8e9e6;
  color: var(--ink);
  font-weight: 700;
}


/* =========================================================
   FEATURED RESEARCH
   ========================================================= */

.feature-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;

  padding-top: 1.5rem;
  padding-bottom: 2.4rem;
}

.feature-image img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.feature-copy {
  background: #f2efe8;
  padding: 2.5rem;
}

.feature-copy h2 {
  font-size: 2.25rem;
  line-height: 1.15;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.caption-rule {
  width: 35px;
  border-top: 2px solid var(--rust);
  margin: 1.5rem 0;
}


/* =========================================================
   SECTION TITLE
   ========================================================= */

.section-title {
  max-width: var(--max);
  margin: 0 auto;

  padding: 1rem 1.5rem;
  font-size: 1.75rem;
}


/* =========================================================
   OUR WORK GRID
   ========================================================= */

.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;

  padding-bottom: 3rem;
}

.work-card h3 {
  font-size: 0.95rem;
  margin: 0.65rem 0 0.05rem;
}

.work-card p {
  font-size: 0.83rem;
  margin: 0;
}

.work-image {
  aspect-ratio: 1.25;
  background-size: cover;
  background-position: center;
}


/* ---------------------------------------------------------
   Work-card image treatments
   --------------------------------------------------------- */

.img-color {
  background:
    linear-gradient(
      135deg,
      #b64a34,
      #e5b84d,
      #153c4a
    );
}

.img-structure {
  background:
    repeating-linear-gradient(
      40deg,
      #bbb 0 3px,
      #eee 3px 8px
    );
}

.img-chem {
  background:
    radial-gradient(
      circle at 40% 45%,
      #9c7048,
      #d8c09d 35%,
      #eee2cc 70%
    );
}

.img-mech {
  background:
    linear-gradient(
      120deg,
      #d5a72c 0 48%,
      #162f3a 49% 55%,
      #efe1bb 56%
    );
}


/* =========================================================
   CLOSING BAND
   ========================================================= */

.closing-band {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;

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

  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.closing-mark {
  border-left: 2px solid var(--ink);
  padding-left: 2rem;

  letter-spacing: 0.13em;
  color: var(--ink);
}


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

.page-footer {
  background: var(--ink) !important;
  color: white !important;

  padding:
    1.5rem
    max(1.25rem, calc((100vw - var(--max)) / 2)) !important;
}


/* =========================================================
   QUARTO TITLE BLOCK
   ========================================================= */

.quarto-title-block,
.title-block-header {
  max-width: var(--max);
  margin: 2rem auto;
  padding: 0 1.5rem;
}


/* =========================================================
   NON-HOMEPAGE CONTENT
   ========================================================= */

body:not(.home) #quarto-content > main {
  max-width: var(--max) !important;
  margin: auto !important;
  padding: 2rem 1.5rem !important;
}


/* =========================================================
   MOBILE / SMALL SCREENS
   ========================================================= */

@media (max-width: 800px) {

  .hero-shade,
  .feature-grid,
  .closing-band {
    grid-template-columns: 1fr;
  }

  .hero-shade {
    gap: 2rem;
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .three-up,
  .work-grid {
    grid-template-columns: 1fr;
  }

  .pillar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 1.25rem 0;
  }

  .work-grid { 
    gap: 1.75rem;
  }

  .hero h2 {
    font-size: 2.7rem;
  }
}

/* Remove homepage space above the hero */
body.home #quarto-content {
  padding-top: 0 !important;
}

body.home main.content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

body.home .hero {
  margin-top: 0 !important;
}

body.home #title-block-header {
  display: none !important;
}



@media (min-width: 801px) {
  body.home .hero,
  body.home .hero-shade {
    min-height: 300px;
  }

  body.home .hero-shade {
    padding: 1.5rem;
    gap: 2rem;
    grid-template-columns: 1.5fr 1fr;
  }

  body.home .hero h2 {
    font-size: 2.8rem;
    line-height: 1.1;
    margin: 0;
    padding: 0;
    border: 0;
  }

  body.home .hero-card {
    padding: 1.25rem;
  }
}

/* =========================================================
   PRELIMINARY HOMEPAGE — body sections only.
   Existing navbar and hero rules above remain unchanged.
   Optional images fall back to text/number graphics.
   ========================================================= */
.home-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  scroll-margin-top: 120px;
}
.home-section h2 {
  font-family: 'Libre Baskerville', Georgia, serif;
  color: var(--ink);
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  margin-top: .5rem;
  border: 0;
  padding-bottom: 0;
}
.home-section h3 { color: var(--ink); font-size: 1.1rem; }
.home-section p { max-width: 100%; }
.intro-section { padding-bottom: 0; }
.research-section, .foundation-section {
  background: #f2efe8;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.research-layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 2rem;
  align-items: center;
  margin: 1.5rem 0;
}
.measurement-art {
  aspect-ratio: 3 / 2;
  background: var(--paper) url('images/cbrl-measurements.png') center / contain no-repeat;
  border: 1px solid var(--line);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.measurement-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--ink);
}
.measurement-fallback strong {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  color: var(--rust);
}
.measurement-fallback span { font-size: .75rem; letter-spacing: .06em; }
.measurement-fallback small { color: var(--muted); }
/* When adding cbrl-measurements.png, hide the fallback with:
   .measurement-fallback { display: none; }
*/
.domain-strip { padding: 1rem 0; border-top: 1px solid var(--line); font-size: .88rem; }
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.service-card { padding: 1.4rem; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.service-card h3 { margin: .8rem 0 .2rem; font-size: 1rem; }
.service-card > p { font-size: .9rem; margin: .45rem 0 0; }
.service-card > p > strong { color: var(--rust); font-size: .85rem; }
.service-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background-color: #e8e9e6;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  font-weight: 700;
}
.icon-basic { background-image: url('images/icon-basic.png'); }
.icon-lab { background-image: url('images/icon-lab.png'); }
.icon-monitor { background-image: url('images/icon-monitor.png'); }
.icon-collections { background-image: url('images/icon-collections.png'); }
.icon-preservation { background-image: url('images/icon-preservation.png'); }
.icon-research { background-image: url('images/icon-research.png'); }
/* Optional icons: hide a number only after adding its corresponding image,
   e.g. .icon-basic span { display: none; }
*/
.audience-note { font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 1rem; }
.metrics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.metric { padding: 1.2rem; background: var(--paper); border: 1px solid var(--line); }
.metric p { margin: 0; font-size: .88rem; }
.metric strong { display: block; color: var(--rust); font-size: 2rem; margin-bottom: .35rem; }
.founder-section { padding-bottom: 3rem; }
@media (max-width: 800px) {
  .research-layout { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-section { padding: 2rem 1.5rem; }
  .intro-section { padding-bottom: 0; }
}
@media (max-width: 540px) {
  .service-grid, .metrics-grid { grid-template-columns: 1fr; }
}
