/* ============================================================
   MAXCELLENCE — design system
   Deep charcoal + champagne gold on warm ivory, with a single
   corporate-red accent reserved for primary CTAs and ticks.
   Fraunces / IBM Plex Sans / Mono.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root{
  --ink:        #2A2723;  /* deep charcoal — text, logo, nav, dark sections */
  --steel:      #443F37;  /* charcoal hover shade */
  --paper:      #FAF6EC;  /* warm ivory background */
  --paper-alt:  #F1E9D6;  /* deeper ivory for alt sections */
  --brass:      #B4933E;  /* champagne gold — dividers, premium highlights */
  --brass-dim:  #97792F;
  --red:        #8C1F1F;  /* corporate red — single accent, primary CTA only */
  --red-dim:    #6E1818;
  --slate:      #5C574E;
  --white:      #FFFFFF;
  --line:       #E3D9C0;
  --line-dark:  rgba(250,246,236,0.18);

  --display: 'Fraunces', serif;
  --body:    'IBM Plex Sans', sans-serif;
  --mono:    'IBM Plex Mono', monospace;

  --max: 1180px;
  --pad: clamp(24px, 5vw, 64px);
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img{ max-width: 100%; display: block; }
a{ color: inherit; }

::selection{ background: var(--brass); color: var(--white); }

:focus-visible{
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

.wrap{
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* ---------- ledger rule — signature divider ----------
   A thin rule with tick marks, standing in for the ruled
   lines of a ledger / docket page. Used wherever the page
   turns from one section of the record to the next. */
.ledger{
  --ticks: 24;
  height: 9px;
  width: 100%;
  background-image: repeating-linear-gradient(
    to right,
    var(--line) 0, var(--line) 1px,
    transparent 1px, transparent calc(100% / var(--ticks))
  );
  background-position: top left;
  background-repeat: no-repeat;
  background-size: 100% 9px;
  border-top: 1px solid var(--line);
  margin: 0;
}
.ledger.on-dark{ border-top-color: var(--line-dark); background-image: repeating-linear-gradient(to right, var(--line-dark) 0, var(--line-dark) 1px, transparent 1px, transparent calc(100% / var(--ticks))); }

/* ---------- eyebrow / index labels ---------- */
.eyebrow{
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass-dim);
}
.eyebrow.on-dark{ color: var(--brass); }

/* ---------- nav ---------- */
.site-nav{
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-nav .wrap{
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.brand{
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.brand .mark{
  font-family: var(--mono);
  font-size: 12px;
  color: var(--brass);
  border: 1px solid var(--brass);
  padding: 2px 6px;
  letter-spacing: 0.05em;
}
.nav-links{
  display: flex;
  gap: clamp(20px, 3vw, 40px);
  list-style: none;
  margin: 0; padding: 0;
  font-size: 14.5px;
}
.nav-links a{
  text-decoration: none;
  color: var(--slate);
  position: relative;
  padding-bottom: 4px;
  transition: color 0.2s ease;
}
.nav-links a:hover{ color: var(--ink); }
.nav-links a.active{ color: var(--ink); }
.nav-links a.active::after{
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--brass);
}

/* ---------- nav dropdown: groups related pages under one tab ---------- */
.has-dropdown{ position: relative; }
.has-dropdown > a::before{
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  margin-left: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.dropdown{
  display: none;
  list-style: none;
  margin: 0;
  padding: 8px 0;
  position: absolute;
  top: 100%;
  left: -18px;
  min-width: 220px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(42,39,35,0.12);
  z-index: 60;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown{ display: block; }
.dropdown a{
  display: block;
  padding: 11px 18px;
  font-size: 14px;
  color: var(--slate);
  text-decoration: none;
  white-space: nowrap;
}
.dropdown a:hover, .dropdown a.active{ background: var(--paper-alt); color: var(--ink); }

.nav-login-btn{
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 8px 14px;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.nav-login-btn:hover{ border-color: var(--red); color: var(--red); }
@media (max-width: 1180px){
  .nav-login-btn{ margin-left: auto; margin-right: 12px; padding: 7px 12px; }
}
.nav-cta{
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 9px 16px;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.nav-cta:hover{ background: var(--ink); color: var(--paper); }

.nav-toggle{
  display: none;
  background: none;
  border: 1px solid var(--line);
  width: 40px; height: 40px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.nav-toggle span{ width: 18px; height: 1.5px; background: var(--ink); }

.nav-panel{ display: contents; }

@media (max-width: 1180px){
  .nav-links, .nav-cta{ display: none; }
  .nav-toggle{ display: flex; }
  .site-nav.open .nav-panel{
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 84px; left: 0; right: 0;
    max-height: calc(100vh - 84px);
    overflow-y: auto;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 24px var(--pad) 28px;
    gap: 22px;
  }
  .site-nav.open .nav-links{
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .site-nav.open .nav-cta{
    display: inline-flex;
    justify-content: center;
  }
  .has-dropdown > a::before{ display: none; }
  .dropdown{
    display: block;
    position: static;
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 10px 0 0 18px;
    min-width: 0;
  }
  .dropdown a{ padding: 8px 0; font-size: 14px; }
}

/* ---------- headings / type scale ---------- */
h1, h2, h3{
  font-family: var(--display);
  font-weight: 500;
  color: var(--ink);
  margin: 0;
  line-height: 1.08;
}
h1{ font-size: clamp(40px, 6vw, 68px); font-weight: 500; letter-spacing: -0.01em; }
h2{ font-size: clamp(28px, 3.6vw, 42px); }
h3{ font-size: clamp(20px, 2vw, 24px); font-weight: 600; }
p{ margin: 0; }
.lede{
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--slate);
  max-width: 62ch;
}

/* ---------- buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: 0.03em;
  text-decoration: none;
  padding: 14px 24px;
  border: 1px solid var(--ink);
  color: var(--ink);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover{ background: var(--ink); color: var(--paper); }
.btn.primary{ background: var(--ink); color: var(--paper); }
.btn.primary:hover{ background: var(--steel); border-color: var(--steel); }
.btn.on-dark{ border-color: var(--line-dark); color: var(--paper); }
.btn.on-dark:hover{ background: var(--paper); color: var(--ink); }
.btn.cta-red{ background: var(--red); border-color: var(--red); color: var(--paper); }
.btn.cta-red:hover{ background: var(--red-dim); border-color: var(--red-dim); }
.btn.outline-on-dark{ border-color: rgba(250,246,236,0.55); color: var(--paper); background: transparent; }
.btn.outline-on-dark:hover{ background: rgba(250,246,236,0.12); border-color: var(--paper); }

/* ---------- sections ---------- */
section{ padding: clamp(56px, 9vw, 108px) 0; }
.section-alt{ background: var(--paper-alt); }
.section-dark{ background: var(--ink); color: var(--paper); }
.section-dark .slate-on-dark{ color: rgba(243,244,240,0.68); }

.section-head{
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

/* ---------- footer ---------- */
.site-footer{
  background: var(--ink);
  color: var(--paper);
  padding: 56px 0 28px;
}
.footer-grid{
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 40px;
}
.footer-grid h4{
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 16px;
}
.footer-grid ul{ list-style: none; margin: 0; padding: 0; }
.footer-grid li{ margin-bottom: 9px; }
.footer-grid a{ text-decoration: none; color: rgba(243,244,240,0.75); font-size: 14.5px; transition: color 0.2s ease; }
.footer-grid a:hover{ color: var(--paper); }
.footer-bottom{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: rgba(243,244,240,0.55);
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 760px){
  .footer-grid{ grid-template-columns: 1fr 1fr; }
}

/* ---------- reveal-on-scroll ---------- */
.reveal{
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in{ opacity: 1; transform: translateY(0); }

/* ---------- utility ---------- */
.grid-2{ display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.grid-3{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); }
.grid-4{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; }
@media (max-width: 1024px){
  .grid-3{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px){
  .grid-2{ grid-template-columns: 1fr; }
  .grid-4{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px){
  .grid-3{ grid-template-columns: 1fr; }
}
@media (max-width: 560px){
  .grid-4{ grid-template-columns: 1fr; }
}

/* ============================================================
   HERO SLIDESHOW — full-width crossfading photos with per-slide
   captions. JS toggles an "active" class every 4s; CSS just
   handles the crossfade transition and control styling.
   ============================================================ */
.hero{
  position: relative;
  height: 94vh;
  min-height: 620px;
  max-height: 960px;
  overflow: hidden;
  color: var(--paper);
}
.hero-slide{
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero-slide.active{ opacity: 1; }

.hero::before{
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16,27,45,0.32) 0%, rgba(16,27,45,0.38) 42%, rgba(16,27,45,0.90) 100%);
  z-index: 1;
}

.hero-caption{ position: absolute; inset: 0; z-index: 2; }
.caption-item{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--pad);
  padding-bottom: 150px;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.caption-item.active{ opacity: 1; }
.caption-item h1{ color: var(--paper); max-width: 17ch; }
.caption-item .lede{ color: rgba(243,244,240,0.86); margin-top: 20px; max-width: 52ch; }

.hero-cta{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  padding: var(--pad);
  padding-top: 0;
  padding-bottom: 96px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* controls row: dots (left) + play/pause (right) */
.hero-controls{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  padding: 0 var(--pad) 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hero-dots{ display: flex; gap: 8px; }
.hero-dots button{
  width: 22px; height: 2px;
  padding: 0;
  border: 0;
  background: rgba(243,244,240,0.35);
  cursor: pointer;
  transition: background 0.2s ease;
}
.hero-dots button.active{ background: var(--brass); }

.hero-toggle{
  width: 40px; height: 40px;
  border: 1px solid rgba(243,244,240,0.5);
  background: rgba(16,27,45,0.35);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.hero-toggle:hover{ background: rgba(16,27,45,0.55); border-color: var(--paper); }
.hero-toggle svg{ width: 13px; height: 13px; fill: var(--paper); }

@media (max-width: 760px){
  .hero{ height: 100vh; min-height: 580px; }
  .caption-item{ padding-bottom: 168px; }
  .hero-cta{ padding-bottom: 108px; }
}

/* ---------- service showcase: alternating photo + copy ---------- */
.service-row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}
.service-row:last-child{ border-bottom: 1px solid var(--line); }
.service-row .service-photo{ position: relative; min-height: 380px; overflow: hidden; }
.service-row .service-photo img{
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute; inset: 0;
}
.service-row .service-text{
  padding: 56px clamp(24px,5vw,64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.service-row.reverse .service-photo{ order: 2; }
.service-row.reverse .service-text{ order: 1; }

@media (max-width: 860px){
  .service-row, .service-row.reverse{ grid-template-columns: 1fr; }
  .service-row .service-photo, .service-row.reverse .service-photo{ order: 1; min-height: 260px; }
  .service-row .service-text, .service-row.reverse .service-text{ order: 2; padding: 40px var(--pad); }
}

/* ---------- method step rows (services page) ---------- */
.method-step{
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 32px;
  padding: 32px 0;
}
@media (max-width: 640px){
  .method-step{ grid-template-columns: 1fr; gap: 8px; padding: 24px 0; }
}
.trust-strip{
  background: var(--ink);
  border-bottom: 1px solid var(--line-dark);
}
.trust-strip .wrap{
  display: flex;
  flex-wrap: wrap;
  gap: 12px 0;
  padding-top: 22px;
  padding-bottom: 22px;
}
.trust-strip span{
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: rgba(250,246,236,0.82);
  padding: 0 22px;
  border-right: 1px solid var(--line-dark);
  white-space: nowrap;
}
.trust-strip span:last-child{ border-right: none; }
.trust-strip span:first-child{ padding-left: 0; }
@media (max-width: 860px){
  .trust-strip span{ padding: 0 14px; border-right: none; }
}

/* ---------- pillar cards (services overview) ---------- */
.pillar-card{
  background: var(--paper-alt);
  border: 1px solid var(--line);
  padding: 0 0 40px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.pillar-card .pillar-photo{
  aspect-ratio: 16/10;
  overflow: hidden;
}
.pillar-card .pillar-photo img{
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.pillar-card .pillar-body{ padding: 28px 36px 0; display: flex; flex-direction: column; flex: 1; }
.pillar-card .pillar-num{
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--brass-dim);
  letter-spacing: 0.1em;
}
.pillar-card ul{ list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.pillar-card li{ padding-left: 18px; position: relative; color: var(--slate); font-size: 14.5px; }
.pillar-card li::before{ content: '—'; position: absolute; left: 0; color: var(--brass); }
.pillar-card .pillar-outcome{
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--slate);
}
.pillar-card .pillar-outcome b{ color: var(--ink); font-weight: 600; }

/* ---------- industry tiles ---------- */
.industry-tile{
  background: var(--paper-alt);
  border: 1px solid var(--line);
  padding: 32px 28px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.industry-tile:hover{ border-color: var(--brass); background: var(--white); }
.industry-tile .tile-num{
  font-family: var(--mono);
  font-size: 12px;
  color: var(--brass-dim);
  letter-spacing: 0.08em;
}

/* ---------- insight / article cards ---------- */
.insight-card{
  border-top: 1px solid var(--line);
  padding: 30px 0;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 24px;
  align-items: baseline;
}
.insight-card:last-child{ border-bottom: 1px solid var(--line); }
.insight-card .insight-tag{
  font-family: var(--mono);
  font-size: 12px;
  color: var(--brass-dim);
  letter-spacing: 0.06em;
}
@media (max-width: 640px){
  .insight-card{ grid-template-columns: 1fr; gap: 8px; }
}
