/* ============================================================
   MacCarley & Sagal Fiduciary Accounting — Design Tokens
   ============================================================ */
:root{
  /* Color: blue-led, editorial trust palette */
  --ink:        #0F1928;   /* Ink Navy — dark section bg */
  --ink-raise:  #1B2740;   /* raised surface on ink */
  --ledger-blue:#2E5D8A;   /* primary accent */
  --sky:        #7FB0DE;   /* light blue accent, for use on dark bg */
  --brass:      #B9873F;   /* secondary accent */
  --sage:       #6F8F6A;   /* tertiary accent */
  --cream:      #F4EFE3;   /* Parchment — light section bg */
  --paper:      #FAF7EF;   /* lightest surface */
  --charcoal:   #1B2130;   /* body text on cream */
  --muted-warm: #6B6354;   /* muted text on cream — tuned for 4.5:1 AA contrast */
  --muted-cool: #93A3BD;   /* muted text on ink */
  --line-warm:  rgba(27,33,48,0.14);
  --line-cool:  rgba(255,255,255,0.16);

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter Tight", -apple-system, Segoe UI, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --container: 1240px;
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

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

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

a{ color: inherit; }

.wrap{
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link{
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ledger-blue);
  color: #fff;
  padding: 12px 20px;
  z-index: 1000;
}
.skip-link:focus{ left: 12px; top: 12px; }

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

/* ============================================================
   Type scale
   ============================================================ */
h1, h2, h3{
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.08;
  margin: 0;
}

.eyebrow{
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ledger-blue);
  margin: 0 0 20px;
}
.eyebrow-light{ color: var(--sky); }
.eyebrow-dot{
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.section-headline{
  font-size: clamp(1.9rem, 3.2vw + 1rem, 3rem);
  max-width: 16ch;
}

.body-copy{
  max-width: 52ch;
  color: var(--charcoal);
  font-size: 1.05rem;
}
.body-copy + .body-copy{ margin-top: 1.1em; }

.lede{
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.6vw + 1rem, 1.9rem);
  font-weight: 400;
  line-height: 1.35;
  max-width: 46ch;
  margin: 0 0 48px;
}
.lede-light{ color: var(--paper); }

/* ============================================================
   Buttons
   ============================================================ */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 15px 26px;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  min-height: 44px;
}
.btn span{ transition: transform 0.25s ease; }
.btn:hover span{ transform: translateX(3px); }
.btn:hover{ transform: translateY(-1px); }

.btn-primary{
  background: var(--ledger-blue);
  color: var(--paper);
}
.btn-primary:hover{ background: #244a6d; }

.btn-outline-light{
  border-color: var(--line-cool);
  color: var(--paper);
  background: transparent;
}
.btn-outline-light:hover{ background: rgba(255,255,255,0.08); border-color: var(--sky); }

.btn-block{ width: 100%; justify-content: center; }

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header{
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(15,25,40,0.88);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line-cool);
}
.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}
.brand{
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  text-decoration: none;
  line-height: 1.4;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4em;
}
.brand-accent{ color: var(--sky); }

.site-nav{
  display: flex;
  align-items: center;
  gap: 32px;
}
.site-nav a{
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted-cool);
  transition: color 0.2s ease;
}
.site-nav a:hover{ color: var(--paper); }
.site-nav a[aria-current="page"]{ color: var(--sky); }
.nav-cta{
  color: var(--paper) !important;
  border: 1px solid var(--line-cool);
  padding: 9px 16px;
}
.nav-cta:hover{ border-color: var(--sky); }

.nav-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--line-cool);
  border-radius: 2px;
  cursor: pointer;
}
.nav-toggle span{
  display: block;
  width: 18px;
  height: 1.5px;
  margin: 0 auto;
  background: var(--paper);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-6.5px) rotate(-45deg); }

/* ============================================================
   Hero
   ============================================================ */
.hero{
  position: relative;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  padding-top: 96px;
}
.hero-bg{
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
}
.topo{ width: 100%; height: 100%; }
.topo path{
  fill: none;
  stroke: var(--sky);
  stroke-width: 1;
  opacity: 0.35;
}
.topo circle{ fill: var(--brass); opacity: 0.7; }

.hero-grid{
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding-top: 64px;
  padding-bottom: 40px;
}
.hero-headline{
  font-size: clamp(2.4rem, 6vw + 1rem, 4.6rem);
  color: var(--paper);
}
.hero-aside{
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 38ch;
}
.hero-aside p{ color: var(--muted-cool); font-size: 1.05rem; margin: 0; }

.swatch-row{
  position: relative;
  z-index: 1;
  display: flex;
  gap: 6px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line-cool);
}
.swatch{ width: 40px; height: 8px; }
.swatch-blue{ background: var(--ledger-blue); }
.swatch-sage{ background: var(--sage); }
.swatch-brass{ background: var(--brass); }

/* ============================================================
   Sections (generic)
   ============================================================ */
.section{ padding: 88px 0; }
.section-ink{ background: var(--ink); color: var(--paper); }
#services{ padding-top: 56px; }
.section-cream{ background: var(--cream); }

/* ============================================================
   Services list
   ============================================================ */
.service-list{
  list-style: none;
  margin: 40px auto 0;
  padding: 0;
  border-top: 1px solid var(--line-cool);
}
.service-row{
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line-cool);
  transition: padding-left 0.3s ease, background-color 0.3s ease;
}
.service-row:hover{
  padding-left: 12px;
  background: rgba(255,255,255,0.03);
}
.service-num{
  font-family: var(--font-mono);
  color: var(--brass);
  font-size: 0.95rem;
  width: 2ch;
  flex: none;
}
.service-name{
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.4vw + 0.8rem, 1.6rem);
  font-weight: 400;
}

/* ============================================================
   About split
   ============================================================ */
.about{
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  align-items: center;
}
.about-head{ grid-column: 1 / -1; margin-bottom: 8px; }
.about-headline{ max-width: none; font-size: clamp(1.85rem, 4.6vw - 0.3rem, 2.9rem); }
.about-visual{ padding: 0 24px; }
.ledger-art{ width: 100%; height: auto; }
.ledger-bg{ fill: var(--paper); }
.ledger-lines line{ stroke: var(--line-warm); stroke-width: 1; }
.ledger-mark circle{ fill: var(--brass); }
.ledger-mark path{ stroke: var(--ledger-blue); stroke-width: 1.5; }

.about-copy{ padding: 0 24px; max-width: 640px; }
.about-copy > * + *{ margin-top: 20px; }

.fact-row{
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line-warm);
}
.fact{ display: flex; align-items: baseline; gap: 16px; }
.fact-num{
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  color: var(--ledger-blue);
  flex: none;
  width: 1.4em;
}
.fact:nth-child(2) .fact-num{ color: var(--sage); }
.fact:nth-child(3) .fact-num{ color: var(--brass); }
.fact-label{
  font-size: 0.92rem;
  color: var(--muted-warm);
  max-width: 34ch;
}

.team{
  grid-column: 1 / -1;
  padding: 48px 24px 0;
  margin-top: 16px;
  border-top: 1px solid var(--line-warm);
}
.team-head{ max-width: 640px; }
.team-title{
  font-size: clamp(1.2rem, 1vw + 1rem, 1.5rem);
  margin-top: 12px;
  max-width: 32ch;
}
.team-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-top: 40px;
}
.team-member:nth-child(1) .team-avatar{ background: var(--ledger-blue); }
.team-member:nth-child(2) .team-avatar{ background: var(--brass); }
.team-avatar{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--paper);
  margin-bottom: 18px;
}
.team-name{ font-size: 1.2rem; margin: 0 0 2px; }
.team-role{
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ledger-blue);
  margin: 0 0 12px;
}
.team-member:nth-child(2) .team-role{ color: var(--brass); }
.team-bio{
  margin: 0;
  color: var(--muted-warm);
  font-size: 0.95rem;
  max-width: 42ch;
}

/* ============================================================
   Process (timeline)
   ============================================================ */
.process-head{ margin-bottom: 56px; }
.process-head .section-headline{ max-width: none; }
.process-intro{ margin-top: 18px; }

.timeline{
  position: relative;
  list-style: none;
  margin: 0 auto;
  padding: 0;
}
.timeline::before{
  content: "";
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 22px;
  width: 1px;
  background: var(--line-warm);
}
.timeline-item{
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 24px;
  padding-bottom: 44px;
}
.timeline-item:last-child{ padding-bottom: 0; }
.timeline-node{
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--cream);
  border: 1.5px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  flex: none;
  transition: transform 0.3s ease;
}
.timeline-blue .timeline-node{ color: var(--ledger-blue); }
.timeline-sage .timeline-node{ color: var(--sage); }
.timeline-brass .timeline-node{ color: var(--brass); }
.timeline-item:hover .timeline-node{ transform: scale(1.08); }
.timeline-title{
  font-size: 1.25rem;
  margin: 4px 0 8px;
}
.timeline-desc{
  margin: 0;
  color: var(--muted-warm);
  font-size: 0.98rem;
  max-width: 56ch;
}

/* ============================================================
   Contact
   ============================================================ */
.contact-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}
.contact-copy .section-headline{ margin: 0 0 20px; }
.contact-panel{
  background: var(--paper);
  color: var(--charcoal);
  padding: 40px 28px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 40px 70px -35px rgba(4,9,20,0.55);
}
.contact-form{
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.field{ display: flex; flex-direction: column; gap: 8px; }
.field label{
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-warm);
}
.field input, .field textarea{
  background: var(--cream);
  border: 1px solid var(--line-warm);
  border-radius: 2px;
  padding: 12px 14px;
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 1rem;
  resize: vertical;
}
.field input:focus, .field textarea:focus{
  outline: 2px solid var(--ledger-blue);
  outline-offset: 1px;
  border-color: var(--ledger-blue);
}
.form-note{
  margin: 0;
  min-height: 1.2em;
  font-size: 0.9rem;
  color: var(--ledger-blue);
}
.form-note--error{ color: #b3413a; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer{
  position: relative;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
}
.footer-bg{ position: absolute; inset: 0; opacity: 0.4; z-index: 0; }
.footer-bg .topo path{ stroke: var(--sky); }
.footer-bg .topo circle{ fill: var(--brass); opacity: 0.7; }

.footer-grid{
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
}
.footer-left{
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: 56px 24px 40px;
}
.footer-headline{
  font-size: clamp(2.6rem, 6vw + 1rem, 4.6rem);
  color: var(--brass);
  line-height: 1.02;
}
.footer-brand{
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
}
.footer-brand .brand-accent{ color: var(--sky); }

.footer-box{
  background: var(--paper);
  color: var(--charcoal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  padding: 8px 0 0;
}
.footer-box-nav{ display: flex; flex-direction: column; }
.footer-box-nav a{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  text-decoration: none;
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 1.05rem;
  border-bottom: 1px solid var(--line-warm);
  transition: background-color 0.25s ease, padding-left 0.25s ease;
}
.footer-box-nav a:first-child{ border-top: 1px solid var(--line-warm); }
.footer-box-nav a:hover{ background: var(--cream); padding-left: 34px; }
.footer-box-nav .row-arrow{
  color: var(--brass);
  transition: transform 0.25s ease;
}
.footer-box-nav a:hover .row-arrow{ transform: translateX(3px); }
.footer-box-meta{
  padding: 24px 28px 28px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted-warm);
}
.footer-box-meta p{ margin: 0 0 4px; }

/* ============================================================
   FAQ
   ============================================================ */
.faq-hero{ padding-bottom: 64px; }
.faq-hero .lede-light{ margin: 0; }
.faq-hero .section-headline{ margin: 16px 0; max-width: none; }

.faq-list{
  max-width: 820px;
  border-top: 1px solid var(--line-warm);
}
.faq-item{ border-bottom: 1px solid var(--line-warm); }
.faq-question{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 4px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 0.4vw + 1rem, 1.3rem);
  color: var(--charcoal);
  transition: color 0.2s ease;
}
.faq-question::-webkit-details-marker{ display: none; }
.faq-question:hover{ color: var(--ledger-blue); }
.faq-icon{
  font-family: var(--font-mono);
  color: var(--ledger-blue);
  font-size: 1.2rem;
  flex: none;
  transition: transform 0.3s ease;
}
.faq-item[open] .faq-icon{ transform: rotate(45deg); }
.faq-answer{
  margin: -8px 4px 28px;
  color: var(--muted-warm);
  max-width: 66ch;
  font-size: 1rem;
}
.faq-answer-lead{
  margin: -8px 4px 14px;
  color: var(--muted-warm);
  max-width: 66ch;
  font-size: 1rem;
}
.faq-checklist{
  list-style: none;
  margin: 0 4px 18px;
  padding: 0;
  max-width: 66ch;
}
.faq-checklist li{
  position: relative;
  padding-left: 20px;
  color: var(--charcoal);
  font-size: 1rem;
}
.faq-checklist li + li{ margin-top: 8px; }
.faq-checklist li::before{
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ledger-blue);
}
.faq-answer-note{
  margin: 0 4px 28px;
  color: var(--muted-warm);
  max-width: 66ch;
  font-size: 1rem;
}

.faq-cta{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--line-warm);
}
.faq-cta p{ margin: 0; }

/* ============================================================
   Scroll reveal
   ============================================================ */
[data-reveal], [data-reveal-stagger] > *{
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
[data-reveal].is-visible, [data-reveal-stagger].is-visible > *{
  opacity: 1;
  transform: translateY(0);
}
/* Per-item transition-delay is set inline by script.js so any
   number of staggered children (5 services, 10 timeline steps, etc.)
   fan out evenly without hardcoded nth-child rules. */
@media (prefers-reduced-motion: reduce){
  [data-reveal], [data-reveal-stagger] > *{ opacity: 1; transform: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (min-width: 640px){
  .about-visual, .about-copy{ padding: 0 40px; }
  .team{ padding-left: 40px; padding-right: 40px; }
}

@media (min-width: 768px){
  .wrap{ padding: 0 40px; }
  .hero-grid{
    grid-template-columns: 1.4fr 1fr;
    align-items: end;
    padding-top: 96px;
    padding-bottom: 96px;
  }
  .about{ grid-template-columns: 1fr 1fr; }
  .team-grid{ grid-template-columns: 1fr 1fr; gap: 56px; }
  .timeline{ max-width: 780px; }
  .timeline-item{ grid-template-columns: 52px 1fr; column-gap: 32px; padding-bottom: 52px; }
  .timeline-node{ width: 52px; height: 52px; font-size: 0.85rem; }
  .timeline::before{ left: 26px; }
  .contact-grid{ grid-template-columns: 1.1fr 0.9fr; }
  .contact-panel{ padding: 48px 44px; }
  .footer-grid{ grid-template-columns: 1fr 420px; align-items: stretch; min-height: 540px; }
  .footer-left{ padding-left: 40px; }
  .faq-cta{ flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (min-width: 1024px){
  .section{ padding: 120px 0; }
}

@media (max-width: 767px){
  .footer-contact{ text-align: left; }
  .site-nav{
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ink);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-bottom: 1px solid var(--line-cool);
  }
  .site-nav.is-open{ max-height: 260px; }
  .site-nav a{
    padding: 16px 24px;
    border-top: 1px solid var(--line-cool);
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .nav-cta{ border: none; }
  .nav-toggle{ display: flex; }
}
